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.
This commit is contained in:
ychangkim
2026-03-31 12:29:23 +09:00
parent b4213e4872
commit 9be83c6f3a
6 changed files with 55 additions and 12 deletions
@@ -34,7 +34,7 @@ jupyterlab/
| `jupyterlab.homeDir` | `/home/jovyan` | `homeVolume.mountPath` 또는 기본값 | | `jupyterlab.homeDir` | `/home/jovyan` | `homeVolume.mountPath` 또는 기본값 |
| `jupyterlab.dataDir` | `/home/jovyan/data` | `<homeDir>/<dataVolume.mountPath>` | | `jupyterlab.dataDir` | `/home/jovyan/data` | `<homeDir>/<dataVolume.mountPath>` |
| `jupyterlab.labels` | (라벨 맵) | 공통 라벨 세트 | | `jupyterlab.labels` | (라벨 맵) | 공통 라벨 세트 |
| `jupyterlab.image` | `quay.io/jupyter/scipy-notebook:latest` | 전체 이미지 참조 | | `jupyterlab.image` | `quay.io/jupyter/scipy-notebook:latest` | 전체 이미지 참조. `repository``:`가 있으면 `tag` 무시 |
| `jupyterlab.command` | (bash 커맨드 배열) | JupyterLab 시작 커맨드 | | `jupyterlab.command` | (bash 커맨드 배열) | JupyterLab 시작 커맨드 |
### `deployment.yaml` ### `deployment.yaml`
@@ -42,7 +42,8 @@ jupyterlab/
- `replicas`: `values.replicas` - `replicas`: `values.replicas`
- 보안 컨텍스트: Pod 레벨 `runAsUser: 1000 / fsGroup: 100`, Container 레벨 `runAsUser: 0` - 보안 컨텍스트: Pod 레벨 `runAsUser: 1000 / fsGroup: 100`, Container 레벨 `runAsUser: 0`
- readinessProbe: `tcpSocket:8888`, 초기 30초 대기, 10초 주기, 27회 실패 허용 (총 ~5분) - 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` ### `configmap.yaml`
@@ -25,10 +25,24 @@ custom-values.yaml (override)
```yaml ```yaml
image: image:
registry: "quay.io" # 레지스트리 주소. 비워두면 Docker Hub 사용 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` 적용 > `image.pullPolicy`는 custom-values에 없으므로 `values.yaml` 기본값 `IfNotPresent` 적용
### resources ### resources
@@ -144,6 +158,7 @@ helm diff upgrade my-jupyter ./manifests/helm/jupyterlab \
```yaml ```yaml
image: image:
repository: "jupyter/scipy-notebook"
tag: "latest" tag: "latest"
resources: resources:
@@ -173,7 +188,11 @@ ingress:
```yaml ```yaml
image: image:
tag: "2024-01-15" # 버전 고정 # repository에 태그 포함 방식 (권장 - 버전 고정)
repository: "jupyter/scipy-notebook:2024-01-15"
# 또는 분리 방식:
# repository: "jupyter/scipy-notebook"
# tag: "2024-01-15"
resources: resources:
limits: limits:
+3 -3
View File
@@ -68,9 +68,9 @@ helm uninstall my-jupyter -n jupyter
| Key | Type | Default | Description | | Key | Type | Default | Description |
|-----|------|---------|-------------| |-----|------|---------|-------------|
| `image.registry` | string | `quay.io` | 이미지 레지스트리 | | `image.registry` | string | `quay.io` | 이미지 레지스트리. 비워두면 Docker Hub 사용 |
| `image.repository` | string | `jupyter/scipy-notebook` | 이미지 리포지토리 | | `image.repository` | string | `jupyter/scipy-notebook` | 이미지 리포지토리. 태그 포함 가능 (예: `repo:tag`) |
| `image.tag` | string | `latest` | 이미지 태그 | | `image.tag` | string | `latest` | 이미지 태그. `repository`에 태그가 포함된 경우 무시됨 |
| `image.pullPolicy` | string | `IfNotPresent` | 이미지 풀 정책 | | `image.pullPolicy` | string | `IfNotPresent` | 이미지 풀 정책 |
| `replicas` | int | `1` | Pod 복제본 수 (1=실행, 0=중지) | | `replicas` | int | `1` | Pod 복제본 수 (1=실행, 0=중지) |
| `resources.limits.cpu` | string | `2000m` | CPU 제한 | | `resources.limits.cpu` | string | `2000m` | CPU 제한 |
@@ -1,5 +1,11 @@
image: image:
registry: "quay.io" 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" repository: "jupyter/scipy-notebook"
tag: "latest" tag: "latest"
@@ -54,13 +54,29 @@ helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }}
{{- end }} {{- 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" -}} {{- define "jupyterlab.image" -}}
{{- $repo := .Values.image.repository }}
{{- $tag := .Values.image.tag }}
{{- $hasTag := contains ":" $repo }}
{{- if .Values.image.registry }} {{- 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 }} {{- 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 }}
{{- end }} {{- end }}
+2 -1
View File
@@ -2,8 +2,9 @@
# Deploys JupyterLab using pure Kubernetes resources without an Operator. # Deploys JupyterLab using pure Kubernetes resources without an Operator.
# JupyterLab Docker image # JupyterLab Docker image
# Full image ref: <registry>/<repository>:<tag> # Full image ref: [registry/]repository[:tag]
# Leave registry empty to use Docker Hub (default). # Leave registry empty to use Docker Hub (default).
# tag is optional if repository already contains a tag (e.g. "repo:tag").
image: image:
registry: "quay.io" registry: "quay.io"
repository: "jupyter/scipy-notebook" repository: "jupyter/scipy-notebook"