diff --git a/charts/kf-notebooks/Chart.yaml b/charts/kf-notebooks/Chart.yaml index eeef864..e2751bf 100644 --- a/charts/kf-notebooks/Chart.yaml +++ b/charts/kf-notebooks/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.0 +version: 0.1.1 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/kf-notebooks/templates/_helpers.tpl b/charts/kf-notebooks/templates/_helpers.tpl index c790894..8ed025a 100644 --- a/charts/kf-notebooks/templates/_helpers.tpl +++ b/charts/kf-notebooks/templates/_helpers.tpl @@ -23,6 +23,26 @@ If release name contains chart name it will be used as a full name. {{- end }} {{- end }} +{{/* +Create a default name for notebook pvc. +*/}} + +{{- define "kf-notebooks.notebooks.jupyter.pvc.name.base" -}} +{{- printf "%s-%s" (include "kf-notebooks.fullname" .) .Values.notebooks.jupyter.name | trunc 53 | trimSuffix "-" -}} +{{- end }} + +{{- define "kf-notebooks.notebooks.vscode.pvc.name.base" -}} +{{- printf "%s-%s" (include "kf-notebooks.fullname" .) .Values.notebooks.vscode.name | trunc 53 | trimSuffix "-" -}} +{{- end }} + +{{- define "kf-notebooks.notebooks.jupyter.pvc.name" -}} +{{- printf "%s-%s" (include "kf-notebooks.notebooks.jupyter.pvc.name.base" .) "workspace" -}} +{{- end }} + +{{- define "kf-notebooks.notebooks.vscode.pvc.name" -}} +{{- printf "%s-%s" (include "kf-notebooks.notebooks.vscode.pvc.name.base" .) "workspace" -}} +{{- end }} + {{/* Create chart name and version as used by the chart label. */}} diff --git a/charts/kf-notebooks/templates/pvc.yaml b/charts/kf-notebooks/templates/pvc.yaml index 842633b..b50df13 100644 --- a/charts/kf-notebooks/templates/pvc.yaml +++ b/charts/kf-notebooks/templates/pvc.yaml @@ -4,7 +4,7 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: {{ include "kf-notebooks.fullname" $ }}-{{ $notebook.name }}-workspace + name: {{ printf "%s-%s" (include "kf-notebooks.fullname" $) $notebook.name | trunc 53 | trimSuffix "-" }}-workspace labels: {{- include "kf-notebooks.labels" $ | nindent 4 }} app: {{ $notebook.name }} diff --git a/charts/kf-notebooks/templates/pytorch-cuda.yaml b/charts/kf-notebooks/templates/pytorch-cuda.yaml index be424b1..9ee19b0 100644 --- a/charts/kf-notebooks/templates/pytorch-cuda.yaml +++ b/charts/kf-notebooks/templates/pytorch-cuda.yaml @@ -3,7 +3,7 @@ apiVersion: kubeflow.org/v1 kind: Notebook metadata: - name: {{ include "kf-notebooks.fullname" . }}-{{ .Values.notebooks.jupyter.name }} + name: {{ printf "%s-%s" (include "kf-notebooks.fullname" .) .Values.notebooks.jupyter.name | trunc 41 | trimSuffix "-" }} labels: {{- include "kf-notebooks.labels" . | nindent 4 }} app: {{ .Values.notebooks.jupyter.name }} @@ -27,5 +27,5 @@ spec: name: dshm - name: workspace persistentVolumeClaim: - claimName: {{ include "kf-notebooks.fullname" . }}-{{ .Values.notebooks.jupyter.name }}-workspace + claimName: {{ include "kf-notebooks.notebooks.jupyter.pvc.name" . }} {{- end }} diff --git a/charts/kf-notebooks/templates/service.yaml b/charts/kf-notebooks/templates/service.yaml index 272a4b5..75d9113 100644 --- a/charts/kf-notebooks/templates/service.yaml +++ b/charts/kf-notebooks/templates/service.yaml @@ -5,7 +5,7 @@ apiVersion: v1 kind: Service metadata: - name: {{ include "kf-notebooks.fullname" $ }}-{{ $notebook.name }} + name: {{ printf "%s-%s" (include "kf-notebooks.fullname" $) $notebook.name | trunc 41 | trimSuffix "-" }} labels: {{- include "kf-notebooks.labels" $ | nindent 4 }} app: {{ $notebook.name }} diff --git a/charts/kf-notebooks/templates/vscode.yaml b/charts/kf-notebooks/templates/vscode.yaml index 9030f07..cd10ded 100644 --- a/charts/kf-notebooks/templates/vscode.yaml +++ b/charts/kf-notebooks/templates/vscode.yaml @@ -3,7 +3,7 @@ apiVersion: kubeflow.org/v1 kind: Notebook metadata: - name: {{ include "kf-notebooks.fullname" . }}-{{ .Values.notebooks.vscode.name }} + name: {{ printf "%s-%s" (include "kf-notebooks.fullname" .) .Values.notebooks.vscode.name | trunc 41 | trimSuffix "-" }} labels: {{- include "kf-notebooks.labels" . | nindent 4 }} app: {{ .Values.notebooks.vscode.name }} @@ -27,5 +27,5 @@ spec: name: dshm - name: workspace persistentVolumeClaim: - claimName: {{ include "kf-notebooks.fullname" . }}-{{ .Values.notebooks.vscode.name }}-workspace + claimName: {{ include "kf-notebooks.notebooks.vscode.pvc.name" . }} {{- end }} diff --git a/charts/kf-notebooks/values.yaml b/charts/kf-notebooks/values.yaml index 61a5b84..0c8ef99 100644 --- a/charts/kf-notebooks/values.yaml +++ b/charts/kf-notebooks/values.yaml @@ -18,7 +18,7 @@ service: notebooks: jupyter: enabled: false - name: jupyter-pytorch-cuda + name: jupyter image: repository: kubeflownotebookswg/jupyter-pytorch-cuda-full tag: "" @@ -36,7 +36,7 @@ notebooks: vscode: enabled: false - name: codeserver-python + name: vscode image: repository: kubeflownotebookswg/codeserver-python tag: ""