From 405955cbd06c5661b4e6f6050d1f1adc9a93c312 Mon Sep 17 00:00:00 2001 From: ychangkim Date: Thu, 10 Jul 2025 16:37:04 +0900 Subject: [PATCH] nim --- charts/nim/CUSTOM-README.md | 7 ++++++- charts/nim/custom-values.yaml | 14 ++++++++++++++ charts/nim/templates/nimservice.yaml | 8 +++++++- charts/nim/values.yaml | 10 +++++++++- 4 files changed, 36 insertions(+), 3 deletions(-) diff --git a/charts/nim/CUSTOM-README.md b/charts/nim/CUSTOM-README.md index cbc6342..1eb0c61 100644 --- a/charts/nim/CUSTOM-README.md +++ b/charts/nim/CUSTOM-README.md @@ -29,9 +29,14 @@ | ---------------------- | ------------------------------------------------------------ | ------ | | `nimService.name` | nim service 이름. | `meta-llama3-8b-instruct` | | `nimService.existingAuthSecret` | nim service auth secret명. | | +| `nimService.existingPVC` | 기존 PVC 이름. 설정 시 기존 PVC를 사용하고, 비어있으면 새 PVC 생성 | `""` | | `image.repository` | nim service model registry. | `nvcr.io/nim/meta/llama-3.2-3b-instruct` | | `image.tag` | nim service model tag. | `1.8.3` | | `imagePullSecrets.name` | nim service model secret 명. | `nvcrimagepullsecret` | | `imagePullSecrets.registry` | nim model resistory. | `nvcr.io` | | `imagePullSecrets.username` | nim model resistory username. | `$oauthtoken` | -| `imagePullSecrets.password` | nim model resistory password. | | \ No newline at end of file +| `imagePullSecrets.password` | nim model resistory password. | | +| `nimService.storage.pvc.storageClass` | 새 PVC 생성 시 사용할 스토리지 클래스 (existingPVC가 비어있을 때 사용) | `longhorn` | +| `nimService.storage.pvc.size` | 새 PVC 생성 시 크기 (existingPVC가 비어있을 때 사용) | `30Gi` | +| `nimService.storage.pvc.volumeAccessMode` | 새 PVC 생성 시 접근 모드 (existingPVC가 비어있을 때 사용) | `ReadWriteMany` | +| `nimService.storage.readOnly` | PVC 읽기 전용 마운트 여부 (기존 PVC 사용 시 `true` 권장) | `false` | \ No newline at end of file diff --git a/charts/nim/custom-values.yaml b/charts/nim/custom-values.yaml index de2bdfb..0e41b01 100644 --- a/charts/nim/custom-values.yaml +++ b/charts/nim/custom-values.yaml @@ -1,6 +1,20 @@ nimService: name: "$nimService.name" existingAuthSecret: "$INFISICAL_SECRET" + + # Example 1: Create a new PVC (leave existingPVC empty) + existingPVC: "" + # storage: + # pvc: + # storageClass: longhorn + # size: 30Gi + # volumeAccessMode: ReadWriteMany + # readOnly: false + + # Example 2: Use an existing PVC (specify existingPVC) + # existingPVC: "existing-pvc-name" + # storage: + # readOnly: true image: repository: "$image.repository" diff --git a/charts/nim/templates/nimservice.yaml b/charts/nim/templates/nimservice.yaml index 00c1b1f..31758f6 100644 --- a/charts/nim/templates/nimservice.yaml +++ b/charts/nim/templates/nimservice.yaml @@ -18,11 +18,17 @@ spec: authSecret: {{ if ne .Values.nimService.existingAuthSecret "" }}{{ .Values.nimService.existingAuthSecret }}{{ else }}{{ .Values.nimService.authSecret }}{{ end }} replicas: {{ .Values.nimService.replicas }} storage: + {{- if ne .Values.nimService.existingPVC "" }} pvc: - create: {{ .Values.nimService.storage.pvc.create }} + name: {{ .Values.nimService.existingPVC }} + readOnly: {{ .Values.nimService.storage.readOnly }} + {{- else }} + pvc: + create: true storageClass: {{ .Values.nimService.storage.pvc.storageClass }} size: {{ .Values.nimService.storage.pvc.size }} volumeAccessMode: {{ .Values.nimService.storage.pvc.volumeAccessMode }} + {{- end }} runtimeClassName: {{ .Values.nimService.runtimeClassName }} resources: {{- toYaml .Values.nimService.resources | nindent 4 }} diff --git a/charts/nim/values.yaml b/charts/nim/values.yaml index 0217526..6ace0f2 100644 --- a/charts/nim/values.yaml +++ b/charts/nim/values.yaml @@ -17,6 +17,10 @@ nimService: existingAuthSecret: "" authSecret: ngc-api + # If existingPVC is set, the PVC with this name will be used + # If empty, a new PVC will be created with the configuration in storage.pvc + existingPVC: "" + # NGC API Key for authentication ngcAPIKey: "" @@ -28,11 +32,15 @@ nimService: # Storage configuration storage: + # PVC configuration for creating a new PVC + # These settings are used when existingPVC is empty pvc: - create: true storageClass: longhorn size: 30Gi volumeAccessMode: ReadWriteMany + # Set to true when using an existing PVC that should be mounted as read-only + # This is recommended when existingPVC is set + readOnly: true # Resource requirements resources: