From 82192c20d3928db9c1465ab98f961affb44c1eeb Mon Sep 17 00:00:00 2001 From: "Paulo E. Castro" Date: Thu, 10 Nov 2022 22:08:51 +0000 Subject: [PATCH] Add Ingress resource to fluentd for Deployment/StatefulSet options. Signed-off-by: Paulo E. Castro --- charts/fluentd/Chart.yaml | 2 +- charts/fluentd/templates/ingress.yaml | 44 +++++++++++++++++++++++++++ charts/fluentd/values.yaml | 15 +++++++++ 3 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 charts/fluentd/templates/ingress.yaml diff --git a/charts/fluentd/Chart.yaml b/charts/fluentd/Chart.yaml index e3a6fa6a..f19fa1a5 100644 --- a/charts/fluentd/Chart.yaml +++ b/charts/fluentd/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: fluentd description: A Helm chart for Kubernetes # type: application -version: 0.4.3 +version: 0.4.4 appVersion: v1.15.2 icon: https://www.fluentd.org/images/miscellany/fluentd-logo_2x.png home: https://www.fluentd.org/ diff --git a/charts/fluentd/templates/ingress.yaml b/charts/fluentd/templates/ingress.yaml new file mode 100644 index 00000000..6628cc7d --- /dev/null +++ b/charts/fluentd/templates/ingress.yaml @@ -0,0 +1,44 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "fluentd.fullname" . -}} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ include "fluentd.fullname" . }} + labels: + {{- include "fluentd.labels" . | nindent 4 }} + {{- with .Values.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + {{- with .secretName }} + secretName: {{ . }} + {{- end }} + {{- end }} + {{- end }} + rules: + {{- range concat .Values.ingress.hosts .Values.ingress.extraHosts }} + - host: {{ .host | quote }} + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: {{ $fullName }} + port: + {{- if .port }} + number: {{ .port }} + {{- end }} + {{- end }} +{{- end }} diff --git a/charts/fluentd/values.yaml b/charts/fluentd/values.yaml index b9ac8d98..bbebc000 100644 --- a/charts/fluentd/values.yaml +++ b/charts/fluentd/values.yaml @@ -375,3 +375,18 @@ fileConfigs: password changeme + +ingress: + enabled: false + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: [] + # - host: fluentd.example.tld + # port: 9880 + + tls: [] + # - secretName: fluentd-tls + # hosts: + # - fluentd.example.tld