diff --git a/charts/k8s-ssh-bastion/Chart.yaml b/charts/k8s-ssh-bastion/Chart.yaml index 56e61ab..ad529d0 100644 --- a/charts/k8s-ssh-bastion/Chart.yaml +++ b/charts/k8s-ssh-bastion/Chart.yaml @@ -2,4 +2,4 @@ apiVersion: v1 appVersion: 0.3.0 description: A Helm chart for k8s bastion name: k8s-ssh-bastion -version: 0.3.5 +version: 0.3.6 diff --git a/charts/k8s-ssh-bastion/templates/deployment.yaml b/charts/k8s-ssh-bastion/templates/deployment.yaml index a00a206..ff7546d 100644 --- a/charts/k8s-ssh-bastion/templates/deployment.yaml +++ b/charts/k8s-ssh-bastion/templates/deployment.yaml @@ -48,6 +48,12 @@ spec: mkdir -p /run/sshd + {{- with .Values.initscripts }} + {{- range $key, $value := . }} + {{ $key }} + {{- end }} + {{- end }} + /usr/sbin/sshd -D -e -E /proc/1/fd/1 lifecycle: {{ .Values.lifecycle | toJson }} ports: @@ -61,6 +67,8 @@ spec: mountPath: /etc/ssh - name: sshd-configs-origin mountPath: /etc/ssh_origin + - name: usr-share-initscripts + mountPath: /usr/share/initscripts resources: {{ toYaml .Values.resources | indent 12 }} hostNetwork: {{ .Values.hostNetwork }} @@ -84,6 +92,10 @@ spec: - name: sshd-configs-origin configMap: name: {{ .Release.Name }}-etc-ssh-origin + - name: usr-share-startup + configMap: + name: {{ .Release.Name }}-usr-share-initscripts + defaultMode: 0755 --- apiVersion: v1 kind: ConfigMap @@ -100,6 +112,15 @@ metadata: data: {{ tpl (toYaml .Values.ssh) $ | indent 2 }} +--- +# Additional startup commands +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Release.Name }}-usr-share-initscripts +data: +{{ tpl (toYaml .Values.initscripts) $ | indent 2 }} + --- # Used to store ssh host keys & other stuff apiVersion: v1 diff --git a/charts/k8s-ssh-bastion/values.yaml b/charts/k8s-ssh-bastion/values.yaml index cd15e6a..00d0648 100644 --- a/charts/k8s-ssh-bastion/values.yaml +++ b/charts/k8s-ssh-bastion/values.yaml @@ -56,6 +56,11 @@ topologySpreadConstraints: storageClass: "efs" +initscripts: {} + # install-tools.sh: | + # #!/bin/bash + # echo do something + # Override files under /etc/ssh ssh: banner: |