From f4a282ef2690ab223012faa1ccbbe0420a9d821b Mon Sep 17 00:00:00 2001 From: a601287411 <601287411@qq.com> Date: Wed, 19 Apr 2023 21:14:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=A0=BC=E5=BC=8F=E5=8C=96yaml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/deployment.yaml | 10 ++++++++-- values.yaml | 8 ++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/templates/deployment.yaml b/templates/deployment.yaml index 1105e7d..6db7a5e 100644 --- a/templates/deployment.yaml +++ b/templates/deployment.yaml @@ -18,6 +18,8 @@ spec: labels: {{- include "ailab-demo.selectorLabels" . | nindent 8 }} spec: + affinity: + {{- include "ailab-demo.GPUNodeAffinity" . | nindent 8 }} {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} @@ -35,12 +37,18 @@ spec: - name: http containerPort: {{ .Values.service.port }} protocol: TCP + {{- if .Values.livenessProbe }} livenessProbe: {{- toYaml .Values.livenessProbe | nindent 12 }} + {{ end }} + {{- if .Values.readinessProbe }} readinessProbe: {{- toYaml .Values.readinessProbe | nindent 12 }} + {{ end}} + {{- if .Values.resources }} resources: {{- toYaml .Values.resources | nindent 12 }} + {{- end }} volumeMounts: - mountPath: /mnt/atpdata/huggingface name: huggingface @@ -52,8 +60,6 @@ spec: nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} - affinity: - {{- include "ailab-demo.GPUNodeAffinity" . | nindent 8 }} {{- with .Values.tolerations }} tolerations: {{- toYaml . | nindent 8 }} diff --git a/values.yaml b/values.yaml index 889fbbe..8a037b4 100644 --- a/values.yaml +++ b/values.yaml @@ -60,9 +60,11 @@ resources: {} # limits: # cpu: 100m # memory: 128Mi + # nvidia.com/gpu: 1 # requests: # cpu: 100m # memory: 128Mi + # nvidia.com/gpu: 1 # GPU resource configuration gpuResource: @@ -91,8 +93,7 @@ huggingface: # These are disabled by default, as they are not required for the demo # application to function. If you want to enable them, you can uncomment # the following lines and adjust them as necessary. -livenessProbe: - {} +livenessProbe: {} # failureThreshold: 3 # httpGet: # path: / @@ -101,8 +102,7 @@ livenessProbe: # periodSeconds: 10 # successThreshold: 1 # timeoutSeconds: 1 -readinessProbe: - {} +readinessProbe: {} # failureThreshold: 3 # httpGet: # path: /