| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244 |
- ---
- # DaemonSet
- apiVersion: apps/v1
- kind: DaemonSet
- metadata:
- labels:
- app: gpustack-worker
- name: gpustack-worker
- namespace: {{ config.namespace }}
- spec:
- revisionHistoryLimit: 10
- selector:
- matchLabels:
- app: gpustack-worker
- template:
- metadata:
- labels:
- app: gpustack-worker
- spec:
- containers:
- - env:
- - name: GPUSTACK_SERVER_URL
- value: {{ config.server_url }}
- - name: GPUSTACK_WORKER_NAME
- valueFrom:
- fieldRef:
- fieldPath: spec.nodeName
- - name: GPUSTACK_WORKER_IP
- valueFrom:
- fieldRef:
- apiVersion: v1
- fieldPath: status.hostIP
- - 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
- {%- if config.runtime == 'hygon' %}
- - name: ROCM_PATH
- value: /opt/dtk
- - name: ROCM_SMI_LIB_PATH
- value: /opt/hyhal/lib
- {%- endif %}
- envFrom:
- - secretRef:
- name: registration-token
- optional: false
- {%- if config.args and config.args|length > 0 %}
- args:
- {%- for arg in config.args %}
- - {{ arg }}
- {%- endfor %}
- {%- endif %}
- image: {{ config.image }}
- imagePullPolicy: IfNotPresent
- name: gpustack-worker
- resources: {}
- securityContext:
- allowPrivilegeEscalation: true
- capabilities: {}
- privileged: true
- readOnlyRootFilesystem: false
- runAsNonRoot: false
- terminationMessagePath: /dev/termination-log
- terminationMessagePolicy: File
- volumeMounts:
- - name: cdi
- mountPath: /var/run/cdi
- - name: kubelet-device-plugins
- mountPath: /var/lib/kubelet/device-plugins
- {%- if config.runtime == 'amd' %}
- - name: gpustack-amd-driver
- mountPath: /opt/rocm
- readOnly: true
- {%- endif %}
- {%- if config.runtime == 'ascend' %}
- - name: gpustack-ascend-driver
- mountPath: /usr/local/Ascend/driver
- readOnly: true
- - name: gpustack-ascend-toolkit
- mountPath: /usr/local/Ascend/ascend-toolkit
- readOnly: true
- {%- endif %}
- {%- if config.runtime == 'hygon' %}
- - name: gpustack-hygon-driver
- mountPath: /opt/hyhal
- readOnly: true
- - name: gpustack-hygon-toolkit
- mountPath: /opt/dtk
- readOnly: true
- {%- endif %}
- {%- if config.runtime == 'metax' %}
- - name: gpustack-metax-driver
- mountPath: /opt/mxdriver
- readOnly: true
- - name: gpustack-metax-toolkit
- mountPath: /opt/maca
- readOnly: true
- {%- endif %}
- {%- if config.runtime == 'iluvatar' %}
- - name: gpustack-iluvatar-toolkit
- mountPath: /usr/local/corex
- readOnly: true
- {%- endif %}
- {%- if config.runtime == 'cambricon' %}
- - name: gpustack-cambricon-bin
- mountPath: /usr/bin/cnmon
- - name: gpustack-cambricon-toolkit
- mountPath: /usr/local/neuware
- readOnly: true
- {%- endif %}
- {%- if config.runtime == 'thead' %}
- - name: gpustack-thead-toolkit
- mountPath: /usr/local/PPU_SDK
- readOnly: true
- {%- endif %}
- {%- if config.k8s_volume_mounts %}
- {%- for vm in config.k8s_volume_mounts %}
- - name: {{ vm.name | to_yaml }}
- mountPath: {{ vm.mount_path | to_yaml }}
- readOnly: {{ vm.read_only | lower }}
- {%- endfor %}
- {%- endif %}
- ports:
- - name: api
- containerPort: 10150
- protocol: TCP
- - name: metrics
- containerPort: 10151
- 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: cdi
- hostPath:
- path: /var/run/cdi
- type: DirectoryOrCreate
- - name: kubelet-device-plugins
- hostPath:
- path: /var/lib/kubelet/device-plugins
- type: DirectoryOrCreate
- {%- if config.runtime == '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
- {%- endif %}
- {%- if config.runtime == 'amd' %}
- - name: gpustack-amd-driver
- hostPath:
- path: /opt/rocm
- type: DirectoryOrCreate
- {%- endif %}
- {%- if config.runtime == 'hygon' %}
- - name: gpustack-hygon-driver
- hostPath:
- path: /opt/hyhal
- type: DirectoryOrCreate
- - name: gpustack-hygon-toolkit
- hostPath:
- path: /opt/dtk
- type: DirectoryOrCreate
- {%- endif %}
- {%- if config.runtime == 'metax' %}
- - name: gpustack-metax-driver
- hostPath:
- path: /opt/mxdriver
- type: DirectoryOrCreate
- - name: gpustack-metax-toolkit
- hostPath:
- path: /opt/maca
- type: DirectoryOrCreate
- {%- endif %}
- {%- if config.runtime == 'iluvatar' %}
- - name: gpustack-iluvatar-toolkit
- hostPath:
- path: /usr/local/corex
- type: DirectoryOrCreate
- {%- endif %}
- {%- if config.runtime == 'cambricon' %}
- - name: gpustack-cambricon-bin
- hostPath:
- path: /usr/bin/cnmon
- type: FileOrCreate
- - name: gpustack-cambricon-toolkit
- hostPath:
- path: /usr/local/neuware
- type: DirectoryOrCreate
- {%- endif %}
- {%- if config.runtime == 'thead' %}
- - name: gpustack-thead-toolkit
- hostPath:
- path: /usr/local/PPU_SDK
- type: DirectoryOrCreate
- {%- endif %}
- {%- if config.k8s_volume_mounts %}
- {%- for vm in config.k8s_volume_mounts %}
- - name: {{ vm.name | to_yaml }}
- {{ vm.volume_source | to_yaml | indent(10) }}
- {%- endfor %}
- {%- endif %}
- hostNetwork: true
- hostIPC: true
- dnsPolicy: ClusterFirstWithHostNet
- serviceAccountName: gpustack-worker
- {%- if config.runtime in ['nvidia', 'mthreads'] %}
- runtimeClassName: {{ config.runtime }}
- {%- endif %}
- updateStrategy:
- rollingUpdate:
- maxSurge: 0
- maxUnavailable: 1
- type: RollingUpdate
|