diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4c1b03b..88e8002 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,27 +11,27 @@ repos: # Autoformat: Python code - repo: https://github.com/psf/black - rev: 21.7b0 + rev: 22.8.0 hooks: - id: black args: [--target-version=py39] # Autoformat: Python code - repo: https://github.com/asottile/reorder_python_imports - rev: v2.5.0 + rev: v3.8.3 hooks: - id: reorder-python-imports # Autoformat: markdown, yaml (but not Helm templates) - repo: https://github.com/pre-commit/mirrors-prettier - rev: v2.3.2 + rev: v3.0.0-alpha.0 hooks: - id: prettier exclude: helm-chart/jupyterhub-ssh/templates # Misc... - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.0.1 + rev: v4.3.0 # ref: https://github.com/pre-commit/pre-commit-hooks#hooks-available hooks: # Autoformat: Makes sure files end in a newline and only a newline. diff --git a/helm-chart/jupyterhub-ssh/schema.yaml b/helm-chart/jupyterhub-ssh/schema.yaml index 82bb128..1ef496a 100644 --- a/helm-chart/jupyterhub-ssh/schema.yaml +++ b/helm-chart/jupyterhub-ssh/schema.yaml @@ -69,6 +69,20 @@ properties: debug: true ``` + initContainers: + type: array + description: | + Init containers definition as defined in the [k8s docuementation]( + https://kubernetes.io/docs/concepts/workloads/pods/init-containers/). + extraVolumes: + type: array + description: | + Additional volume(s) that will be made available for the containers to + consume. + extraVolumeMounts: + type: array + description: | + Additional volume mount(s) that will be added to all the containers. sftp: type: object description: TODO diff --git a/helm-chart/jupyterhub-ssh/templates/ssh/deployment.yaml b/helm-chart/jupyterhub-ssh/templates/ssh/deployment.yaml index d60ba89..2c26a3f 100644 --- a/helm-chart/jupyterhub-ssh/templates/ssh/deployment.yaml +++ b/helm-chart/jupyterhub-ssh/templates/ssh/deployment.yaml @@ -29,6 +29,14 @@ spec: - name: config secret: secretName: {{ include "jupyterhub-ssh.fullname" . }} + {{- with .Values.ssh.extraVolumes }} + {{- . | toYaml | nindent 8 }} + {{- end }} + + {{- with .Values.ssh.initContainers }} + initContainers: + {{- . | toYaml | nindent 8 }} + {{- end }} containers: - name: server image: "{{ .Values.ssh.image.repository }}:{{ .Values.ssh.image.tag | default .Chart.AppVersion }}" @@ -40,6 +48,9 @@ spec: - name: config mountPath: /etc/jupyterhub-ssh/config readOnly: true + {{- with .Values.ssh.extraVolumeMounts }} + {{- . | toYaml | nindent 12 }} + {{- end }} ports: - name: ssh containerPort: 8022 diff --git a/helm-chart/jupyterhub-ssh/values.yaml b/helm-chart/jupyterhub-ssh/values.yaml index 841aaa2..e5ef795 100644 --- a/helm-chart/jupyterhub-ssh/values.yaml +++ b/helm-chart/jupyterhub-ssh/values.yaml @@ -54,6 +54,10 @@ ssh: affinity: {} networkPolicy: {} + initContainers: [] + extraVolumes: [] + extraVolumeMounts: [] + sftp: enabled: true replicaCount: 1