Skip to content

Commit

Permalink
Add volumes and volume mounts to jupyter and worker configs (#102)
Browse files Browse the repository at this point in the history
* adding volumes and volume mounts to jupyter and worker configs

* autogenerating readme per docs

* fix(README.md) updated wrong readme... duh

* adding readme

* updated readme

Co-authored-by: ClimaBot <[email protected]>
  • Loading branch information
lbrindze and ClimaBot authored Sep 14, 2020
1 parent 106c126 commit 14a5adf
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dask/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ The following table lists the configurable parameters of the Dask chart and thei
| `worker.default_resources.memory` | Default memory (deprecated use `resources`). | `"4GiB"` |
| `worker.env` | Environment variables. see `values.yaml` for example values. | `null` |
| `worker.resources` | Worker pod resources. see `values.yaml` for example values. | `{}` |
| `worker.mounts` | Worker pod volumes and volume mounts, mounts.volumes follows kuberentes api v1 volumes spec. mounts.volumemounts follows kubernetesapi v1 volumemount spec | `{}` |
| `worker.tolerations` | Tolerations. | `[]` |
| `worker.affinity` | Container affinity. | `{}` |
| `worker.nodeSelector` | Node selector. | `{}` |
Expand All @@ -108,6 +109,7 @@ The following table lists the configurable parameters of the Dask chart and thei
| `jupyter.args` | Container arguments. | `null` |
| `jupyter.extraConfig` | | `"# Extra Jupyter config goes here\n# E.g\n# c.NotebookApp.port = 8888"` |
| `jupyter.resources` | Jupyter pod resources. see `values.yaml` for example values. | `{}` |
| `jupyter.mounts` | Worker pod volumes and volume mounts, mounts.volumes follows kuberentes api v1 volumes spec. mounts.volumemounts follows kubernetesapi v1 volumemount spec | `{}` |
| `jupyter.tolerations` | Tolerations. | `[]` |
| `jupyter.affinity` | Container affinity. | `{}` |
| `jupyter.nodeSelector` | Node selector. | `{}` |
Expand Down
6 changes: 6 additions & 0 deletions dask/templates/dask-jupyter-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,19 @@ spec:
volumeMounts:
- name: config-volume
mountPath: /usr/local/etc/jupyter
{{- if .Values.worker.mounts.volumeMounts }}
{{- toYaml .Values.worker.mounts.volumeMounts | nindent 12 }}
{{- end }}
env:
- name: DASK_SCHEDULER_ADDRESS
value: {{ template "dask.fullname" . }}-scheduler:{{ .Values.scheduler.servicePort }}
{{- if .Values.jupyter.env }}
{{- toYaml .Values.jupyter.env | nindent 12 }}
{{- end }}
volumes:
{{- if .Values.jupyter.mounts.volumes }}
{{- toYaml .Values.worker.mounts.volumes | nindent 8}}
{{- end }}
- name: config-volume
configMap:
name: {{ template "dask.fullname" . }}-jupyter-config
Expand Down
9 changes: 9 additions & 0 deletions dask/templates/dask-worker-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ spec:
spec:
imagePullSecrets:
{{- toYaml .Values.worker.image.pullSecrets | nindent 8 }}
{{- if .Values.worker.mounts.volumes }}
volumes:
{{- toYaml .Values.worker.mounts.volumes | nindent 8}}
{{- end }}
containers:
- name: {{ template "dask.fullname" . }}-worker
image: "{{ .Values.worker.image.repository }}:{{ .Values.worker.image.tag }}"
Expand All @@ -50,6 +54,11 @@ spec:
{{- toYaml .Values.worker.resources | nindent 12 }}
env:
{{- toYaml .Values.worker.env | nindent 12 }}

{{- if .Values.worker.mounts.volumeMounts }}
volumeMounts:
{{- toYaml .Values.worker.mounts.volumeMounts | nindent 12 }}
{{- end }}
{{- with .Values.worker.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand Down
15 changes: 15 additions & 0 deletions dask/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ worker:
# cpu: 1
# memory: 3G
# nvidia.com/gpu: 1
mounts: {} # Worker Pod volumes and volume mounts, mounts.volumes follows kuberentes api v1 Volumes spec. mounts.volumeMounts follows kubernetesapi v1 VolumeMount spec
# volumes:
# - name: data
# emptyDir: {}
# volumeMounts:
# - name: data
# mountPath: /data
tolerations: [] # Tolerations.
affinity: {} # Container affinity.
nodeSelector: {} # Node Selector.
Expand All @@ -89,6 +96,7 @@ jupyter:
pullPolicy: IfNotPresent # Container image pull policy.
pullSecrets: # Container image [pull secrets](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/).
# - name: regcred
#
replicas: 1 # Number of notebook servers.
serviceType: "ClusterIP" # Scheduler service type. Set to `LoadBalancer` to expose outside of your cluster.
# serviceType: "NodePort"
Expand Down Expand Up @@ -117,6 +125,13 @@ jupyter:
# requests:
# cpu: 2
# memory: 6G
mounts: {} # Worker Pod volumes and volume mounts, mounts.volumes follows kuberentes api v1 Volumes spec. mounts.volumeMounts follows kubernetesapi v1 VolumeMount spec
# volumes:
# - name: data
# emptyDir: {}
# volumeMounts:
# - name: data
# mountPath: /data
tolerations: [] # Tolerations.
affinity: {} # Container affinity.
nodeSelector: {} # Node Selector.
Expand Down

0 comments on commit 14a5adf

Please sign in to comment.