Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement support for init containers and extra volumes/mounts for ssh #75

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
14 changes: 14 additions & 0 deletions helm-chart/jupyterhub-ssh/schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions helm-chart/jupyterhub-ssh/templates/ssh/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand All @@ -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
Expand Down
4 changes: 4 additions & 0 deletions helm-chart/jupyterhub-ssh/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ ssh:
affinity: {}
networkPolicy: {}

initContainers: []
extraVolumes: []
extraVolumeMounts: []

sftp:
enabled: true
replicaCount: 1
Expand Down