From 3355cfc038e6d12ae8b48ea1b7ad5dbeeadff9ec Mon Sep 17 00:00:00 2001 From: George MacRorie Date: Mon, 13 Nov 2023 19:17:16 +0000 Subject: [PATCH 1/4] feat(ssh): add field for configuring ssh known hosts --- charts/flipt/templates/configmap_ssh.yaml | 12 ++++++++++++ charts/flipt/templates/deployment.yaml | 14 ++++++++++++++ charts/flipt/values.yaml | 6 ++++++ 3 files changed, 32 insertions(+) create mode 100644 charts/flipt/templates/configmap_ssh.yaml diff --git a/charts/flipt/templates/configmap_ssh.yaml b/charts/flipt/templates/configmap_ssh.yaml new file mode 100644 index 0000000..b51d58c --- /dev/null +++ b/charts/flipt/templates/configmap_ssh.yaml @@ -0,0 +1,12 @@ +{{- if (.Values.ssh).knownHosts }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "flipt.fullname" . }}-ssh-known-hosts + labels: + {{- include "flipt.labels" . | nindent 4 }} +data: + ssh_known_hosts: | + {{- .Values.ssh.knownHosts | nindent 4 }} +{{- end }} diff --git a/charts/flipt/templates/deployment.yaml b/charts/flipt/templates/deployment.yaml index 71838ca..70336e9 100644 --- a/charts/flipt/templates/deployment.yaml +++ b/charts/flipt/templates/deployment.yaml @@ -43,6 +43,10 @@ spec: {{- if .Values.flipt.extraEnvVars }} {{- include "common.tplvalues.render" (dict "value" .Values.flipt.extraEnvVars "context" $) | nindent 12 }} {{- end }} + {{- if (.Values.ssh).knownHosts }} + - name: SSH_KNOWN_HOSTS + value: /etc/flipt/known_hosts + {{- end }} volumeMounts: - name: flipt-local-state mountPath: /home/flipt/.config/flipt @@ -58,6 +62,11 @@ spec: {{ if .Values.extraVolumeMounts }} {{- toYaml .Values.extraVolumeMounts | nindent 12 }} {{- end }} + {{- if (.Values.ssh).knownHosts }} + - name: flipt-ssh-known-hosts + mountPath: /etc/flipt/ssh_known_hosts + readOnly: true + {{- end }} livenessProbe: httpGet: path: /health @@ -86,6 +95,11 @@ spec: {{- if .Values.extraVolumes }} {{- toYaml .Values.extraVolumes | nindent 8 }} {{- end }} + {{- if (.Values.ssh).knownHosts }} + - name: flipt-ssh-known-hosts + configMap: + name: {{ include "flipt.fullname" . }}-ssh-known-hosts + {{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} diff --git a/charts/flipt/values.yaml b/charts/flipt/values.yaml index a081fef..7e3afc9 100644 --- a/charts/flipt/values.yaml +++ b/charts/flipt/values.yaml @@ -201,3 +201,9 @@ extraVolumeMounts: [] # secret: # secretName: flit-git-ssh-key-secret extraVolumes: [] + +# ssh contains some SSH specific configuration parameters +ssh: + # knownHosts is the contents of a custom known hosts file + # for use with SSH authentication and the Git backend for Flipt + knownHosts: "" From 325b4f11839283debb9e70552867fee8bb406867 Mon Sep 17 00:00:00 2001 From: George MacRorie Date: Mon, 13 Nov 2023 19:30:22 +0000 Subject: [PATCH 2/4] fix(chart): add subPath to volumeMount --- charts/flipt/templates/deployment.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/charts/flipt/templates/deployment.yaml b/charts/flipt/templates/deployment.yaml index 70336e9..d571e79 100644 --- a/charts/flipt/templates/deployment.yaml +++ b/charts/flipt/templates/deployment.yaml @@ -66,6 +66,7 @@ spec: - name: flipt-ssh-known-hosts mountPath: /etc/flipt/ssh_known_hosts readOnly: true + subPath: ssh_known_hosts {{- end }} livenessProbe: httpGet: From c22a3e1227258a11cad195eb02a7ae65645a94d2 Mon Sep 17 00:00:00 2001 From: George MacRorie Date: Mon, 13 Nov 2023 19:30:36 +0000 Subject: [PATCH 3/4] chore: bump chart version 0.45.0 --- charts/flipt/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/flipt/Chart.yaml b/charts/flipt/Chart.yaml index 483b968..6117195 100644 --- a/charts/flipt/Chart.yaml +++ b/charts/flipt/Chart.yaml @@ -3,7 +3,7 @@ name: flipt home: https://flipt.io description: Flipt is an open-source, self-hosted feature flag solution. type: application -version: 0.44.2 +version: 0.45.0 appVersion: v1.30.1 maintainers: - name: Flipt From 91567d31e16035f3bdeac767690fadde59bb2003 Mon Sep 17 00:00:00 2001 From: George MacRorie Date: Tue, 14 Nov 2023 10:03:37 +0000 Subject: [PATCH 4/4] chore(charts): reorder volume and volumeMounts on deployment --- charts/flipt/templates/deployment.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/charts/flipt/templates/deployment.yaml b/charts/flipt/templates/deployment.yaml index d571e79..abec54c 100644 --- a/charts/flipt/templates/deployment.yaml +++ b/charts/flipt/templates/deployment.yaml @@ -59,15 +59,15 @@ spec: {{- if .Values.persistence.subPath }} subPath: {{ .Values.persistence.subPath }} {{- end }} - {{ if .Values.extraVolumeMounts }} - {{- toYaml .Values.extraVolumeMounts | nindent 12 }} - {{- end }} {{- if (.Values.ssh).knownHosts }} - name: flipt-ssh-known-hosts mountPath: /etc/flipt/ssh_known_hosts readOnly: true subPath: ssh_known_hosts {{- end }} + {{- if .Values.extraVolumeMounts }} + {{- toYaml .Values.extraVolumeMounts | nindent 12 }} + {{- end }} livenessProbe: httpGet: path: /health @@ -93,14 +93,14 @@ spec: {{- else }} emptyDir: {} {{- end }} - {{- if .Values.extraVolumes }} - {{- toYaml .Values.extraVolumes | nindent 8 }} - {{- end }} {{- if (.Values.ssh).knownHosts }} - name: flipt-ssh-known-hosts configMap: name: {{ include "flipt.fullname" . }}-ssh-known-hosts {{- end }} + {{- if .Values.extraVolumes }} + {{- toYaml .Values.extraVolumes | nindent 8 }} + {{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }}