From 9be83c6f3a20224ac2c50a763aaa4c18563ba8df Mon Sep 17 00:00:00 2001 From: ychangkim Date: Tue, 31 Mar 2026 12:29:23 +0900 Subject: [PATCH] feat: support inline tag in image.repository for jupyterlab chart Allow repository field to include a tag (e.g. "repo:tag"), in which case the tag field is ignored. Update docs and custom-values to reflect the new behavior and add dshm volume notes. --- .../helm/jupyterlab/1.0.0/BUILD-README.md | 5 ++-- .../helm/jupyterlab/1.0.0/CUSTOM-README.md | 25 ++++++++++++++++--- manifests/helm/jupyterlab/1.0.0/README.md | 6 ++--- .../helm/jupyterlab/1.0.0/custom-values.yaml | 6 +++++ .../jupyterlab/1.0.0/templates/_helpers.tpl | 22 +++++++++++++--- manifests/helm/jupyterlab/1.0.0/values.yaml | 3 ++- 6 files changed, 55 insertions(+), 12 deletions(-) diff --git a/manifests/helm/jupyterlab/1.0.0/BUILD-README.md b/manifests/helm/jupyterlab/1.0.0/BUILD-README.md index 4161a86..77f0461 100644 --- a/manifests/helm/jupyterlab/1.0.0/BUILD-README.md +++ b/manifests/helm/jupyterlab/1.0.0/BUILD-README.md @@ -34,7 +34,7 @@ jupyterlab/ | `jupyterlab.homeDir` | `/home/jovyan` | `homeVolume.mountPath` 또는 기본값 | | `jupyterlab.dataDir` | `/home/jovyan/data` | `/` | | `jupyterlab.labels` | (라벨 맵) | 공통 라벨 세트 | -| `jupyterlab.image` | `quay.io/jupyter/scipy-notebook:latest` | 전체 이미지 참조 | +| `jupyterlab.image` | `quay.io/jupyter/scipy-notebook:latest` | 전체 이미지 참조. `repository`에 `:`가 있으면 `tag` 무시 | | `jupyterlab.command` | (bash 커맨드 배열) | JupyterLab 시작 커맨드 | ### `deployment.yaml` @@ -42,7 +42,8 @@ jupyterlab/ - `replicas`: `values.replicas` - 보안 컨텍스트: Pod 레벨 `runAsUser: 1000 / fsGroup: 100`, Container 레벨 `runAsUser: 0` - readinessProbe: `tcpSocket:8888`, 초기 30초 대기, 10초 주기, 27회 실패 허용 (총 ~5분) -- 볼륨: `localtime`, `startup-script` (항상), `home-volume`, `data-volume`, `groupVolumes` (조건부) +- 볼륨: `localtime`, `startup-script`, `dshm` (항상), `home-volume`, `data-volume`, `groupVolumes` (조건부) +- `dshm`: RAM 기반 tmpfs를 `/dev/shm`에 마운트. PyTorch/NumPy 멀티프로세싱 시 기본 64MB 제한 해제 ### `configmap.yaml` diff --git a/manifests/helm/jupyterlab/1.0.0/CUSTOM-README.md b/manifests/helm/jupyterlab/1.0.0/CUSTOM-README.md index 9fff8c4..83a4cc2 100644 --- a/manifests/helm/jupyterlab/1.0.0/CUSTOM-README.md +++ b/manifests/helm/jupyterlab/1.0.0/CUSTOM-README.md @@ -25,10 +25,24 @@ custom-values.yaml (override) ```yaml image: registry: "quay.io" # 레지스트리 주소. 비워두면 Docker Hub 사용 - repository: "jupyter/scipy-notebook" - tag: "latest" # 특정 버전 고정 권장 (예: "2024-01-15") + + # tag는 생략 가능. repository에 태그를 포함하면 tag 필드는 무시됨. + # 방법1: repository에 태그 포함 (tag 불필요) + repository: "jupyter/scipy-notebook:ubuntu-22.04" + + # 방법2: repository + tag 분리 + # repository: "jupyter/scipy-notebook" + # tag: "latest" + + tag: "latest" # repository에 ":"가 있으면 이 값은 무시됨 ``` +| 입력 | 결과 이미지 | +|------|------------| +| `repository: "repo:ubuntu-22.04"`, `tag: "latest"` | `quay.io/repo:ubuntu-22.04` (tag 무시) | +| `repository: "repo"`, `tag: "latest"` | `quay.io/repo:latest` | +| `repository: "repo"`, `tag: ""` | `quay.io/repo` | + > `image.pullPolicy`는 custom-values에 없으므로 `values.yaml` 기본값 `IfNotPresent` 적용 ### resources @@ -144,6 +158,7 @@ helm diff upgrade my-jupyter ./manifests/helm/jupyterlab \ ```yaml image: + repository: "jupyter/scipy-notebook" tag: "latest" resources: @@ -173,7 +188,11 @@ ingress: ```yaml image: - tag: "2024-01-15" # 버전 고정 + # repository에 태그 포함 방식 (권장 - 버전 고정) + repository: "jupyter/scipy-notebook:2024-01-15" + # 또는 분리 방식: + # repository: "jupyter/scipy-notebook" + # tag: "2024-01-15" resources: limits: diff --git a/manifests/helm/jupyterlab/1.0.0/README.md b/manifests/helm/jupyterlab/1.0.0/README.md index 763d76f..2bb517a 100644 --- a/manifests/helm/jupyterlab/1.0.0/README.md +++ b/manifests/helm/jupyterlab/1.0.0/README.md @@ -68,9 +68,9 @@ helm uninstall my-jupyter -n jupyter | Key | Type | Default | Description | |-----|------|---------|-------------| -| `image.registry` | string | `quay.io` | 이미지 레지스트리 | -| `image.repository` | string | `jupyter/scipy-notebook` | 이미지 리포지토리 | -| `image.tag` | string | `latest` | 이미지 태그 | +| `image.registry` | string | `quay.io` | 이미지 레지스트리. 비워두면 Docker Hub 사용 | +| `image.repository` | string | `jupyter/scipy-notebook` | 이미지 리포지토리. 태그 포함 가능 (예: `repo:tag`) | +| `image.tag` | string | `latest` | 이미지 태그. `repository`에 태그가 포함된 경우 무시됨 | | `image.pullPolicy` | string | `IfNotPresent` | 이미지 풀 정책 | | `replicas` | int | `1` | Pod 복제본 수 (1=실행, 0=중지) | | `resources.limits.cpu` | string | `2000m` | CPU 제한 | diff --git a/manifests/helm/jupyterlab/1.0.0/custom-values.yaml b/manifests/helm/jupyterlab/1.0.0/custom-values.yaml index ce321ed..ab4fcd7 100644 --- a/manifests/helm/jupyterlab/1.0.0/custom-values.yaml +++ b/manifests/helm/jupyterlab/1.0.0/custom-values.yaml @@ -1,5 +1,11 @@ image: registry: "quay.io" + # tag는 생략 가능. repository에 태그 포함 시 tag 필드 무시됨. + # 예시1: repository만으로 태그 지정 + # repository: "jupyter/scipy-notebook:ubuntu-22.04" + # 예시2: repository + tag 분리 + # repository: "jupyter/scipy-notebook" + # tag: "latest" repository: "jupyter/scipy-notebook" tag: "latest" diff --git a/manifests/helm/jupyterlab/1.0.0/templates/_helpers.tpl b/manifests/helm/jupyterlab/1.0.0/templates/_helpers.tpl index e488c55..2e6cfc2 100644 --- a/manifests/helm/jupyterlab/1.0.0/templates/_helpers.tpl +++ b/manifests/helm/jupyterlab/1.0.0/templates/_helpers.tpl @@ -54,13 +54,29 @@ helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} {{- end }} {{/* -Full image reference: [registry/]repository:tag +Full image reference: [registry/]repository[:tag] +If repository already contains a tag (e.g. "repo:tag"), tag field is ignored. */}} {{- define "jupyterlab.image" -}} +{{- $repo := .Values.image.repository }} +{{- $tag := .Values.image.tag }} +{{- $hasTag := contains ":" $repo }} {{- if .Values.image.registry }} -{{- printf "%s/%s:%s" .Values.image.registry .Values.image.repository .Values.image.tag }} +{{- if $hasTag }} +{{- printf "%s/%s" .Values.image.registry $repo }} +{{- else if $tag }} +{{- printf "%s/%s:%s" .Values.image.registry $repo $tag }} {{- else }} -{{- printf "%s:%s" .Values.image.repository .Values.image.tag }} +{{- printf "%s/%s" .Values.image.registry $repo }} +{{- end }} +{{- else }} +{{- if $hasTag }} +{{- $repo }} +{{- else if $tag }} +{{- printf "%s:%s" $repo $tag }} +{{- else }} +{{- $repo }} +{{- end }} {{- end }} {{- end }} diff --git a/manifests/helm/jupyterlab/1.0.0/values.yaml b/manifests/helm/jupyterlab/1.0.0/values.yaml index 2ea8b4a..f366082 100644 --- a/manifests/helm/jupyterlab/1.0.0/values.yaml +++ b/manifests/helm/jupyterlab/1.0.0/values.yaml @@ -2,8 +2,9 @@ # Deploys JupyterLab using pure Kubernetes resources without an Operator. # JupyterLab Docker image -# Full image ref: /: +# Full image ref: [registry/]repository[:tag] # Leave registry empty to use Docker Hub (default). +# tag is optional if repository already contains a tag (e.g. "repo:tag"). image: registry: "quay.io" repository: "jupyter/scipy-notebook"