From 6362e856ee3fda77017e5a4fbb63015762b5b211 Mon Sep 17 00:00:00 2001 From: Anthony Vickers Date: Mon, 17 Oct 2022 11:08:44 +0100 Subject: [PATCH 01/10] Add support for more features in helm chart * add init container support * add sidecar container support * add emptyDir volume support --- charts/kminion/templates/deployment.yaml | 13 ++++++++++++- charts/kminion/values.yaml | 7 +++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/charts/kminion/templates/deployment.yaml b/charts/kminion/templates/deployment.yaml index d652960..1b4379d 100644 --- a/charts/kminion/templates/deployment.yaml +++ b/charts/kminion/templates/deployment.yaml @@ -24,7 +24,7 @@ spec: {{- end}} labels: {{- include "kminion.selectorLabels" . | nindent 8}} - {{- if .Values.customLabels}} + {{- if .Values.customLabels -}} {{toYaml .Values.customLabels | nindent 8}} {{- end}} spec: @@ -44,6 +44,14 @@ spec: secret: secretName: {{.secretName}} {{- end}} + {{- range .Values.deployment.volumes.emptyDir}} + - name: {{.name}} + emptydir: {} + {{- end}} + initContainers: + {{- with .Values.deployment.initContainers }} + {{- toYaml . | nindent 8 }} + {{- end }} containers: - name: {{.Chart.Name}} securityContext: @@ -89,6 +97,9 @@ spec: path: /ready port: {{.Values.service.port}} initialDelaySeconds: 10 + {{- with .Values.deployment.extraContainers }} + {{- toYaml . | nindent 8 }} + {{- end }} {{- with .Values.nodeSelector}} nodeSelector: {{- toYaml . | nindent 8}} diff --git a/charts/kminion/values.yaml b/charts/kminion/values.yaml index fe1fa30..04f903f 100644 --- a/charts/kminion/values.yaml +++ b/charts/kminion/values.yaml @@ -116,6 +116,8 @@ deployment: secrets: [] # - secretName: vault-tls # mountPath: /vault/tls + emptyDir: [] + # - name: example # If you want to provide specifc config settings like sensitive Kafka credentials via environment variables you can # do so by making them available here. See the kminion reference config to figure out the expected variable names. @@ -137,6 +139,11 @@ deployment: # secretName: kafka-credentials-team-xy # secretKey: password + # Add additional containers, e. g. for oauth2-proxy + extraContainers: {} + # Add additional init containers, e. g. for oauth2-proxy + initContainers: {} + kminion: # KMinion can be configured using environment variables and/or a YAML config. The yaml contents under config will # end up in a YAML file which will be mounted into the kminion container. From cb9763e193894a9d294ab9990f0ba23db8b23259 Mon Sep 17 00:00:00 2001 From: Anthony Vickers Date: Mon, 17 Oct 2022 11:12:50 +0100 Subject: [PATCH 02/10] Bump helm chart release version --- charts/kminion/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/kminion/Chart.yaml b/charts/kminion/Chart.yaml index e0cce3a..4167d5c 100644 --- a/charts/kminion/Chart.yaml +++ b/charts/kminion/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.9.0 +version: 0.10.0 # 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 From 845f8fa60ca7268fa47a81da320db3611f716c54 Mon Sep 17 00:00:00 2001 From: Anthony Vickers Date: Mon, 17 Oct 2022 11:31:31 +0100 Subject: [PATCH 03/10] Fix emptyDir volume --- charts/kminion/templates/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/kminion/templates/deployment.yaml b/charts/kminion/templates/deployment.yaml index 1b4379d..e635aa4 100644 --- a/charts/kminion/templates/deployment.yaml +++ b/charts/kminion/templates/deployment.yaml @@ -46,7 +46,7 @@ spec: {{- end}} {{- range .Values.deployment.volumes.emptyDir}} - name: {{.name}} - emptydir: {} + emptyDir: {} {{- end}} initContainers: {{- with .Values.deployment.initContainers }} From f1ea127c0de873e426db07b061344bfe394f4dee Mon Sep 17 00:00:00 2001 From: Anthony Vickers Date: Mon, 17 Oct 2022 11:43:01 +0100 Subject: [PATCH 04/10] Add support for any extra volume type not just emptyDir --- charts/kminion/templates/deployment.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/charts/kminion/templates/deployment.yaml b/charts/kminion/templates/deployment.yaml index e635aa4..d5a6245 100644 --- a/charts/kminion/templates/deployment.yaml +++ b/charts/kminion/templates/deployment.yaml @@ -44,10 +44,9 @@ spec: secret: secretName: {{.secretName}} {{- end}} - {{- range .Values.deployment.volumes.emptyDir}} - - name: {{.name}} - emptyDir: {} - {{- end}} + {{- with .Values.deployment.volumes.extra }} + {{- toYaml . | nindent 8 }} + {{- end }} initContainers: {{- with .Values.deployment.initContainers }} {{- toYaml . | nindent 8 }} From a2f14019dd37a7b1d2ed73a91f4197b09012179e Mon Sep 17 00:00:00 2001 From: Anthony Vickers Date: Mon, 17 Oct 2022 11:46:28 +0100 Subject: [PATCH 05/10] Update example values.yaml --- charts/kminion/values.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/charts/kminion/values.yaml b/charts/kminion/values.yaml index 04f903f..7555609 100644 --- a/charts/kminion/values.yaml +++ b/charts/kminion/values.yaml @@ -116,8 +116,9 @@ deployment: secrets: [] # - secretName: vault-tls # mountPath: /vault/tls - emptyDir: [] + extra: [] # - name: example + # emptyDir: {} # If you want to provide specifc config settings like sensitive Kafka credentials via environment variables you can # do so by making them available here. See the kminion reference config to figure out the expected variable names. From 37424c1a4169c59bfbb199e0dc6d940c7a81c81d Mon Sep 17 00:00:00 2001 From: Anthony Vickers Date: Tue, 18 Oct 2022 10:50:34 +0100 Subject: [PATCH 06/10] Add deployment labels --- charts/kminion/templates/deployment.yaml | 7 +++++-- charts/kminion/values.yaml | 6 +++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/charts/kminion/templates/deployment.yaml b/charts/kminion/templates/deployment.yaml index d5a6245..25e9771 100644 --- a/charts/kminion/templates/deployment.yaml +++ b/charts/kminion/templates/deployment.yaml @@ -5,6 +5,9 @@ metadata: namespace: {{ .Release.Namespace | quote }} labels: {{- include "kminion.labels" . | nindent 4}} + {{- with .Values.deployment.labels}} + {{- toYaml . | nindent 4}} + {{- end}} {{- with .Values.deployment.annotations}} annotations: {{- toYaml . | nindent 4}} @@ -24,8 +27,8 @@ spec: {{- end}} labels: {{- include "kminion.selectorLabels" . | nindent 8}} - {{- if .Values.customLabels -}} - {{toYaml .Values.customLabels | nindent 8}} + {{- if .Values.podLabels -}} + {{toYaml .Values.podLabels | nindent 8}} {{- end}} spec: {{- with .Values.imagePullSecrets}} diff --git a/charts/kminion/values.yaml b/charts/kminion/values.yaml index 7555609..d2b8108 100644 --- a/charts/kminion/values.yaml +++ b/charts/kminion/values.yaml @@ -27,6 +27,9 @@ podAnnotations: {} # prometheus.io/scrape: "true" # prometheus.io/port: "8080" # prometheus.io/path: "/metrics" + +podLabels: {} + podSecurityContext: runAsUser: 99 fsGroup: 99 @@ -88,7 +91,7 @@ tolerations: [] affinity: {} -customLabels: {} + serviceMonitor: create: false @@ -109,6 +112,7 @@ daemonset: enabled: false deployment: + labels: {} # Annotations to add to the Deployment resource annotations: {} volumes: From 9918d411842ccb7448e09940ee1da7dbcdc8d3da Mon Sep 17 00:00:00 2001 From: Anthony Vickers Date: Tue, 18 Oct 2022 13:41:17 +0100 Subject: [PATCH 07/10] Revert customlabels variable --- charts/kminion/templates/deployment.yaml | 6 +++--- charts/kminion/values.yaml | 4 +--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/charts/kminion/templates/deployment.yaml b/charts/kminion/templates/deployment.yaml index 25e9771..df3c883 100644 --- a/charts/kminion/templates/deployment.yaml +++ b/charts/kminion/templates/deployment.yaml @@ -8,8 +8,8 @@ metadata: {{- with .Values.deployment.labels}} {{- toYaml . | nindent 4}} {{- end}} - {{- with .Values.deployment.annotations}} annotations: + {{- with .Values.deployment.annotations}} {{- toYaml . | nindent 4}} {{- end}} spec: @@ -27,8 +27,8 @@ spec: {{- end}} labels: {{- include "kminion.selectorLabels" . | nindent 8}} - {{- if .Values.podLabels -}} - {{toYaml .Values.podLabels | nindent 8}} + {{- if .Values.customLabels -}} + {{toYaml .Values.customLabels | nindent 8}} {{- end}} spec: {{- with .Values.imagePullSecrets}} diff --git a/charts/kminion/values.yaml b/charts/kminion/values.yaml index d2b8108..894fdfd 100644 --- a/charts/kminion/values.yaml +++ b/charts/kminion/values.yaml @@ -28,8 +28,6 @@ podAnnotations: {} # prometheus.io/port: "8080" # prometheus.io/path: "/metrics" -podLabels: {} - podSecurityContext: runAsUser: 99 fsGroup: 99 @@ -91,7 +89,7 @@ tolerations: [] affinity: {} - +customLabels: {} serviceMonitor: create: false From 58684d4ad41154aae065fc0b89d5d57bb740d3d7 Mon Sep 17 00:00:00 2001 From: Anthony Vickers Date: Tue, 18 Oct 2022 13:42:12 +0100 Subject: [PATCH 08/10] Revert deployment annotations change --- charts/kminion/templates/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/kminion/templates/deployment.yaml b/charts/kminion/templates/deployment.yaml index df3c883..e5b35c1 100644 --- a/charts/kminion/templates/deployment.yaml +++ b/charts/kminion/templates/deployment.yaml @@ -8,8 +8,8 @@ metadata: {{- with .Values.deployment.labels}} {{- toYaml . | nindent 4}} {{- end}} - annotations: {{- with .Values.deployment.annotations}} + annotations: {{- toYaml . | nindent 4}} {{- end}} spec: From 71b0ac23008f0fb448c9aa78454f73f6b80dc716 Mon Sep 17 00:00:00 2001 From: Anthony Vickers Date: Wed, 2 Nov 2022 16:52:14 +0000 Subject: [PATCH 09/10] Revert move empty line in custom labels --- charts/kminion/templates/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/kminion/templates/deployment.yaml b/charts/kminion/templates/deployment.yaml index e5b35c1..3276032 100644 --- a/charts/kminion/templates/deployment.yaml +++ b/charts/kminion/templates/deployment.yaml @@ -27,7 +27,7 @@ spec: {{- end}} labels: {{- include "kminion.selectorLabels" . | nindent 8}} - {{- if .Values.customLabels -}} + {{- if .Values.customLabels}} {{toYaml .Values.customLabels | nindent 8}} {{- end}} spec: From ebf004b1c28cfb87b01b1dfc3fc862ae91bdad24 Mon Sep 17 00:00:00 2001 From: Anthony Vickers Date: Wed, 2 Nov 2022 16:52:51 +0000 Subject: [PATCH 10/10] Optional readiness probe Support previous versions of kminion in the most recent helm chart. This chart deploys v2.2.0 of kminion but previous versions ~2.0.0 don't support the readiness probe --- charts/kminion/templates/deployment.yaml | 2 ++ charts/kminion/values.yaml | 3 +++ 2 files changed, 5 insertions(+) diff --git a/charts/kminion/templates/deployment.yaml b/charts/kminion/templates/deployment.yaml index 3276032..e99c702 100644 --- a/charts/kminion/templates/deployment.yaml +++ b/charts/kminion/templates/deployment.yaml @@ -94,11 +94,13 @@ spec: {{- end}} resources: {{- toYaml .Values.resources | nindent 12}} + {{- if .Values.deployment.readinessProbe.enabled }} readinessProbe: httpGet: path: /ready port: {{.Values.service.port}} initialDelaySeconds: 10 + {{- end }} {{- with .Values.deployment.extraContainers }} {{- toYaml . | nindent 8 }} {{- end }} diff --git a/charts/kminion/values.yaml b/charts/kminion/values.yaml index 894fdfd..4e1b97f 100644 --- a/charts/kminion/values.yaml +++ b/charts/kminion/values.yaml @@ -110,6 +110,9 @@ daemonset: enabled: false deployment: + readinessProbe: + enabled: true + labels: {} # Annotations to add to the Deployment resource annotations: {}