Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1544 from weaveworks/chart-ssh
Browse files Browse the repository at this point in the history
Helm chart: Make SSH know hosts volume optional
  • Loading branch information
stefanprodan committed Nov 23, 2018
2 parents 661792b + 020a3f0 commit e032939
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions chart/flux/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ spec:
- name: kubedir
configMap:
name: {{ template "flux.fullname" . }}-kube-config
{{- if .Values.ssh.known_hosts }}
- name: sshdir
configMap:
name: {{ template "flux.fullname" . }}-ssh-config
defaultMode: 0600
{{- end }}
- name: git-key
secret:
{{- if .Values.git.secretName }}
Expand All @@ -56,9 +58,11 @@ spec:
volumeMounts:
- name: kubedir
mountPath: /root/.kubectl
{{- if .Values.ssh.known_hosts }}
- name: sshdir
mountPath: /root/.ssh
readOnly: true
{{- end }}
- name: git-key
mountPath: /etc/fluxd/ssh
readOnly: true
Expand Down
4 changes: 4 additions & 0 deletions chart/flux/templates/helm-operator-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ spec:
serviceAccountName: {{ template "flux.serviceAccountName" . }}
{{- end }}
volumes:
{{- if .Values.ssh.known_hosts }}
- name: sshdir
configMap:
name: {{ template "flux.fullname" . }}-ssh-config
defaultMode: 0600
{{- end }}
- name: git-key
secret:
{{- if .Values.helmOperator.git.secretName }}
Expand Down Expand Up @@ -61,10 +63,12 @@ spec:
image: "{{ .Values.helmOperator.repository }}:{{ .Values.helmOperator.tag }}"
imagePullPolicy: {{ .Values.helmOperator.pullPolicy }}
volumeMounts:
{{- if .Values.ssh.known_hosts }}
- name: sshdir
mountPath: /root/.ssh/known_hosts
subPath: known_hosts
readOnly: true
{{- end }}
- name: git-key
mountPath: /etc/fluxd/ssh
readOnly: true
Expand Down
2 changes: 2 additions & 0 deletions chart/flux/templates/ssh.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.ssh.known_hosts -}}
apiVersion: v1
kind: ConfigMap
metadata:
Expand All @@ -13,3 +14,4 @@ data:
{{ .Values.ssh.known_hosts }}
{{- end }}
{{- end }}
{{- end -}}

0 comments on commit e032939

Please sign in to comment.