Skip to content

Commit

Permalink
HUNTING: Added Ingess for Flower
Browse files Browse the repository at this point in the history
  • Loading branch information
deshetti committed Jun 19, 2023
1 parent 4afd836 commit 1dbf9c2
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/hunting/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.4.7
version: 0.4.8

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
63 changes: 63 additions & 0 deletions charts/hunting/templates/ingress-flower.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{{- if .Values.flower.enabled }}
{{- if .Values.flower.ingress.enabled -}}
{{- $fullName := include "hunting.fullname" . -}}
{{- $svcPort := .Values.flower.service.port -}}
{{- if and .Values.flower.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
{{- if not (hasKey .Values.flower.ingress.annotations "kubernetes.io/ingress.class") }}
{{- $_ := set .Values.flower.ingress.annotations "kubernetes.io/ingress.class" .Values.flower.ingress.className}}
{{- end }}
{{- end }}
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
metadata:
name: {{ $fullName }}-flower
labels:
{{- include "hunting.labels" . | nindent 4 }}
{{- with .Values.flower.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if and .Values.flower.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
ingressClassName: {{ .Values.flower.ingress.className }}
{{- end }}
{{- if .Values.flower.ingress.tls }}
tls:
{{- range .Values.flower.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.flower.ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ .path }}
{{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
pathType: {{ .pathType }}
{{- end }}
backend:
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
service:
name: {{ $fullName }}-flower
port:
name: http
{{- else }}
serviceName: {{ $fullName }}-flower
servicePort: {{ $svcPort }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
19 changes: 18 additions & 1 deletion charts/hunting/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,24 @@ flower:
memory: 2Gi
requests:
cpu: 25m
memory: 100Mi
memory: 100Mi

ingress:
enabled: false
className: ""
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: chart-example.local
paths:
- path: /
pathType: ImplementationSpecific
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local


mongodb:
enabled: false
Expand Down

0 comments on commit 1dbf9c2

Please sign in to comment.