| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240 |
- {{- if .Values.worker.enabled }}
- apiVersion: apps/v1
- kind: DaemonSet
- metadata:
- labels:
- app: {{ .Release.Name }}-worker
- {{ include "chart_labels" . | indent 4 }}
- name: {{ .Release.Name }}-worker
- namespace: {{ .Release.Namespace }}
- spec:
- revisionHistoryLimit: 10
- selector:
- matchLabels:
- app: {{ .Release.Name }}-worker
- template:
- metadata:
- labels:
- app: {{ .Release.Name }}-worker
- spec:
- containers:
- - env:
- - name: GPUSTACK_SERVER_URL
- value: http://{{ .Release.Name }}-server.{{ .Release.Namespace }}.svc:{{ .Values.server.apiPort }}
- - name: GPUSTACK_WORKER_NAME
- valueFrom:
- fieldRef:
- fieldPath: spec.nodeName
- - name: GPUSTACK_RUNTIME_DEPLOY
- value: "Kubernetes"
- - name: GPUSTACK_RUNTIME_DEPLOY_MIRRORED_DEPLOYMENT
- value: "true"
- - name: GPUSTACK_RUNTIME_DEPLOY_MIRRORED_NAME
- valueFrom:
- fieldRef:
- fieldPath: metadata.name
- - name: GPUSTACK_RUNTIME_KUBERNETES_NAMESPACE
- valueFrom:
- fieldRef:
- fieldPath: metadata.namespace
- - name: GPUSTACK_RUNTIME_KUBERNETES_NODE_NAME
- valueFrom:
- fieldRef:
- fieldPath: spec.nodeName
- - name: GPUSTACK_WORKER_IP
- valueFrom:
- fieldRef:
- fieldPath: status.hostIP
- {{- if eq .Values.worker.gpuVendor "hygon" }}
- - name: ROCM_PATH
- value: /opt/dtk
- - name: ROCM_SMI_LIB_PATH
- value: /opt/hyhal/lib
- {{- end }}
- envFrom:
- - secretRef:
- name: registration-token
- optional: false
- - configMapRef:
- name: worker-config
- optional: true
- image: {{ include "gpustack.image" . }}:{{ include "gpustack.imageTag" . }}
- imagePullPolicy: {{ .Values.image.pullPolicy }}
- name: {{ .Release.Name }}-worker
- resources: {}
- securityContext:
- allowPrivilegeEscalation: true
- capabilities: {}
- privileged: true
- readOnlyRootFilesystem: false
- runAsNonRoot: false
- terminationMessagePath: /dev/termination-log
- terminationMessagePolicy: File
- volumeMounts:
- - name: gpustack-data-dir
- mountPath: /var/lib/gpustack
- - name: cdi
- mountPath: /var/run/cdi
- - name: kubelet-device-plugins
- mountPath: /var/lib/kubelet/device-plugins
- {{- if eq .Values.worker.gpuVendor "amd" }}
- - name: gpustack-amd-driver
- mountPath: /opt/rocm
- readOnly: true
- {{- end }}
- {{- if eq .Values.worker.gpuVendor "ascend" }}
- - name: gpustack-ascend-driver
- mountPath: /usr/local/Ascend/driver
- readOnly: true
- - name: gpustack-ascend-toolkit
- mountPath: /usr/local/Ascend/ascend-toolkit
- readOnly: true
- {{- end }}
- {{- if eq .Values.worker.gpuVendor "hygon" }}
- - name: gpustack-hygon-driver
- mountPath: /opt/hyhal
- readOnly: true
- - name: gpustack-hygon-toolkit
- mountPath: /opt/dtk
- readOnly: true
- {{- end }}
- {{- if eq .Values.worker.gpuVendor "metax" }}
- - name: gpustack-metax-driver
- mountPath: /opt/mxdriver
- readOnly: true
- - name: gpustack-metax-toolkit
- mountPath: /opt/maca
- readOnly: true
- {{- end }}
- {{- if eq .Values.worker.gpuVendor "iluvatar" }}
- - name: gpustack-iluvatar-toolkit
- mountPath: /usr/local/corex
- readOnly: true
- {{- end }}
- {{- if eq .Values.worker.gpuVendor "cambricon" }}
- - name: gpustack-cambricon-bin
- mountPath: /usr/bin/cnmon
- - name: gpustack-cambricon-toolkit
- mountPath: /usr/local/neuware
- readOnly: true
- {{- end }}
- {{- if eq .Values.worker.gpuVendor "thead" }}
- - name: gpustack-thead-toolkit
- mountPath: /usr/local/PPU_SDK
- readOnly: true
- {{- end }}
- {{- with .Values.worker.extraVolumeMounts }}
- {{- toYaml . | nindent 12 }}
- {{- end }}
- ports:
- - name: api
- containerPort: {{ .Values.worker.port }}
- protocol: TCP
- - name: metrics
- containerPort: {{ .Values.worker.metricsPort }}
- protocol: TCP
- readinessProbe:
- httpGet:
- path: /readyz
- port: api
- initialDelaySeconds: 5
- periodSeconds: 10
- timeoutSeconds: 2
- failureThreshold: 3
- successThreshold: 1
- livenessProbe:
- httpGet:
- path: /healthz
- port: api
- initialDelaySeconds: 10
- periodSeconds: 10
- timeoutSeconds: 2
- failureThreshold: 5
- successThreshold: 1
- volumes:
- - name: gpustack-data-dir
- hostPath:
- path: {{ .Values.worker.dataDir }}
- type: DirectoryOrCreate
- - name: cdi
- hostPath:
- path: /var/run/cdi
- type: DirectoryOrCreate
- - name: kubelet-device-plugins
- hostPath:
- path: /var/lib/kubelet/device-plugins
- type: DirectoryOrCreate
- {{- if eq .Values.worker.gpuVendor "amd" }}
- - name: gpustack-amd-driver
- hostPath:
- path: /opt/rocm
- type: DirectoryOrCreate
- {{- end }}
- {{- if eq .Values.worker.gpuVendor "ascend" }}
- - name: gpustack-ascend-driver
- hostPath:
- path: /usr/local/Ascend/driver
- type: DirectoryOrCreate
- - name: gpustack-ascend-toolkit
- hostPath:
- path: /usr/local/Ascend/ascend-toolkit
- type: DirectoryOrCreate
- {{- end }}
- {{- if eq .Values.worker.gpuVendor "hygon" }}
- - name: gpustack-hygon-driver
- hostPath:
- path: /opt/hyhal
- type: DirectoryOrCreate
- - name: gpustack-hygon-toolkit
- hostPath:
- path: /opt/dtk
- type: DirectoryOrCreate
- {{- end }}
- {{- if eq .Values.worker.gpuVendor "metax" }}
- - name: gpustack-metax-driver
- hostPath:
- path: /opt/mxdriver
- type: DirectoryOrCreate
- - name: gpustack-metax-toolkit
- hostPath:
- path: /opt/maca
- type: DirectoryOrCreate
- {{- end }}
- {{- if eq .Values.worker.gpuVendor "iluvatar" }}
- - name: gpustack-iluvatar-toolkit
- hostPath:
- path: /usr/local/corex
- type: DirectoryOrCreate
- {{- end }}
- {{- if eq .Values.worker.gpuVendor "cambricon" }}
- - name: gpustack-cambricon-bin
- hostPath:
- path: /usr/bin/cnmon
- type: FileOrCreate
- - name: gpustack-cambricon-toolkit
- hostPath:
- path: /usr/local/neuware
- type: DirectoryOrCreate
- {{- end }}
- {{- if eq .Values.worker.gpuVendor "thead" }}
- - name: gpustack-thead-toolkit
- hostPath:
- path: /usr/local/PPU_SDK
- type: DirectoryOrCreate
- {{- end }}
- {{- with .Values.worker.extraVolumes }}
- {{- toYaml . | nindent 8 }}
- {{- end }}
- hostNetwork: true
- hostIPC: true
- serviceAccountName: {{ .Release.Name }}-worker
- dnsPolicy: ClusterFirstWithHostNet
- {{- if or (eq .Values.worker.gpuVendor "nvidia") (eq .Values.worker.gpuVendor "mthreads") }}
- runtimeClassName: {{ .Values.worker.gpuVendor }}
- {{- end }}
- updateStrategy:
- rollingUpdate:
- maxSurge: 0
- maxUnavailable: 1
- type: RollingUpdate
- {{- end }}
|