diff --git a/charts/hunting/Chart.yaml b/charts/hunting/Chart.yaml index 010571c..570cd7a 100644 --- a/charts/hunting/Chart.yaml +++ b/charts/hunting/Chart.yaml @@ -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 diff --git a/charts/hunting/templates/ingress-flower.yaml b/charts/hunting/templates/ingress-flower.yaml new file mode 100644 index 0000000..62daa78 --- /dev/null +++ b/charts/hunting/templates/ingress-flower.yaml @@ -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 }} diff --git a/charts/hunting/values.yaml b/charts/hunting/values.yaml index 6a03aa7..ac19b3f 100644 --- a/charts/hunting/values.yaml +++ b/charts/hunting/values.yaml @@ -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