diff --git a/templates/custom-scripts.yaml b/templates/custom-scripts.yaml new file mode 100644 index 0000000..befd59b --- /dev/null +++ b/templates/custom-scripts.yaml @@ -0,0 +1,10 @@ +{{- if .Values.sftpConfig.customScripts }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "sftp-server.fullname" . }}-custom-scripts +data: + {{- range $k, $v := .Values.sftpConfig.customScripts }} + {{ $k }}: {{ $v | toYaml | indent 2 }} + {{- end }} +{{- end }} diff --git a/templates/deployment.yaml b/templates/deployment.yaml index bf44fd4..5fefd78 100644 --- a/templates/deployment.yaml +++ b/templates/deployment.yaml @@ -87,6 +87,10 @@ spec: subPath: {{ . }} {{- end }} {{- end }} + {{- if .Values.sftpConfig.customScripts }} + - name: custom-scripts + mountPath: /etc/sftp.d + {{- end }} livenessProbe: tcpSocket: port: 22 @@ -120,6 +124,12 @@ spec: secretName: {{ .Values.sftpConfig.hostKeys.secret }} defaultMode: 384 {{- end }} + {{- if .Values.sftpConfig.customScripts }} + - name: custom-scripts + configMap: + name: {{ include "sftp-server.fullname" . }}-custom-scripts + defaultMode: 0755 + {{- end }} {{- if .Values.persistentVolume.enabled }} - name: data persistentVolumeClaim: diff --git a/values.yaml b/values.yaml index da4fc60..e623363 100644 --- a/values.yaml +++ b/values.yaml @@ -27,6 +27,7 @@ sftpConfig: #- ssh_host_rsa_key #- ssh_host_ed25519_key authorizedKeys: {} + #customScripts: {} debug: enabled: false