|
| 1 | +--- |
| 2 | +apiVersion: v1 |
| 3 | +kind: Namespace |
| 4 | +metadata: |
| 5 | + name: gpustack-system |
| 6 | + labels: |
| 7 | + "app.kubernetes.io/part-of": "gpustack" |
| 8 | +--- |
| 9 | +apiVersion: rbac.authorization.k8s.io/v1 |
| 10 | +kind: ClusterRole |
| 11 | +metadata: |
| 12 | + namespace: gpustack-system |
| 13 | + name: gpustack-runtime-deployer |
| 14 | + labels: |
| 15 | + "app.kubernetes.io/part-of": "gpustack" |
| 16 | + "app.kubernetes.io/component": "gpustack-runtime" |
| 17 | +rules: |
| 18 | + - apiGroups: |
| 19 | + - "" |
| 20 | + resources: |
| 21 | + - "pods" |
| 22 | + - "configmaps" |
| 23 | + - "services" |
| 24 | + - "pods/log" |
| 25 | + - "pods/exec" |
| 26 | + verbs: |
| 27 | + - "*" |
| 28 | +--- |
| 29 | +apiVersion: rbac.authorization.k8s.io/v1 |
| 30 | +kind: RoleBinding |
| 31 | +metadata: |
| 32 | + namespace: gpustack-system |
| 33 | + name: gpustack-runtime-deployer |
| 34 | + labels: |
| 35 | + "app.kubernetes.io/part-of": "gpustack" |
| 36 | + "app.kubernetes.io/component": "gpustack-runtime" |
| 37 | +subjects: |
| 38 | + - kind: ServiceAccount |
| 39 | + name: gpustack-runtime |
| 40 | +roleRef: |
| 41 | + apiGroup: rbac.authorization.k8s.io |
| 42 | + kind: ClusterRole |
| 43 | + name: gpustack-runtime-deployer |
| 44 | +--- |
| 45 | +apiVersion: v1 |
| 46 | +kind: ServiceAccount |
| 47 | +metadata: |
| 48 | + namespace: gpustack-system |
| 49 | + name: gpustack-runtime |
| 50 | + labels: |
| 51 | + "app.kubernetes.io/part-of": "gpustack" |
| 52 | + "app.kubernetes.io/component": "gpustack-runtime" |
| 53 | +--- |
| 54 | +apiVersion: apps/v1 |
| 55 | +kind: DaemonSet |
| 56 | +metadata: |
| 57 | + namespace: gpustack-system |
| 58 | + name: gpustack-runtime |
| 59 | + labels: |
| 60 | + "app.kubernetes.io/part-of": "gpustack" |
| 61 | + "app.kubernetes.io/component": "gpustack-runtime" |
| 62 | + "app.kubernetes.io/name": "gpustack-runtime" |
| 63 | +spec: |
| 64 | + selector: |
| 65 | + matchLabels: |
| 66 | + "app.kubernetes.io/part-of": "gpustack" |
| 67 | + "app.kubernetes.io/component": "gpustack-runtime" |
| 68 | + "app.kubernetes.io/name": "gpustack-runtime" |
| 69 | + updateStrategy: |
| 70 | + type: OnDelete |
| 71 | + template: |
| 72 | + metadata: |
| 73 | + labels: |
| 74 | + "app.kubernetes.io/part-of": "gpustack" |
| 75 | + "app.kubernetes.io/component": "gpustack-runtime" |
| 76 | + "app.kubernetes.io/name": "gpustack-runtime" |
| 77 | + spec: |
| 78 | + # Provide GPU resource request for gpustack-runtime if not using default runtime. |
| 79 | + # |
| 80 | + # runtimeClassName: nvidia |
| 81 | + |
| 82 | + restartPolicy: Always |
| 83 | + containers: |
| 84 | + - name: default |
| 85 | + image: gpustack/runtime:main |
| 86 | + imagePullPolicy: Always |
| 87 | + tty: true |
| 88 | + command: |
| 89 | + - gpustack-runtime |
| 90 | + - --profile |
| 91 | + - --watch=60 |
| 92 | + |
| 93 | + # Provide privileged is used for detect devices. |
| 94 | + # |
| 95 | + securityContext: |
| 96 | + privileged: true |
| 97 | + |
| 98 | + # Specify environment for enabling mirrored deployment, |
| 99 | + # |
| 100 | + env: |
| 101 | + - name: GPUSTACK_RUNTIME_DEPLOY |
| 102 | + value: "Kubernetes" |
| 103 | + - name: GPUSTACK_RUNTIME_DEPLOY_MIRRORED_DEPLOYMENT |
| 104 | + value: "true" |
| 105 | + - name: GPUSTACK_RUNTIME_DEPLOY_MIRRORED_NAME |
| 106 | + valueFrom: |
| 107 | + fieldRef: |
| 108 | + fieldPath: metadata.name |
| 109 | + - name: GPUSTACK_RUNTIME_KUBERNETES_NAMESPACE |
| 110 | + valueFrom: |
| 111 | + fieldRef: |
| 112 | + fieldPath: metadata.namespace |
| 113 | + - name: GPUSTACK_RUNTIME_KUBERNETES_NODE_NAME |
| 114 | + valueFrom: |
| 115 | + fieldRef: |
| 116 | + fieldPath: spec.nodeName |
| 117 | + |
| 118 | + # Mount necessary volume for gpustack-runtime to work properly. |
| 119 | + # - Mount gpustack data volume for persistent data storage. |
| 120 | + # - Mount other source if needed, please refer to pack/Dockerfile. |
| 121 | + # |
| 122 | + volumeMounts: |
| 123 | + - name: gpustack-runtime-data |
| 124 | + mountPath: /var/lib/gpustack |
| 125 | + # - name: toolkit |
| 126 | + # mountPath: /opt/... |
| 127 | + volumes: |
| 128 | + - name: gpustack-runtime-data |
| 129 | + emptyDir: { } |
| 130 | + # - name: toolkit |
| 131 | + # hostPath: |
| 132 | + # name: /opt/... |
| 133 | + |
| 134 | + # Inject service account to the Pod for accessing Kubernetes API. |
| 135 | + # |
| 136 | + serviceAccountName: gpustack-runtime |
| 137 | + |
| 138 | + # It may be desirable to set a high priority class to ensure that a DaemonSet Pod |
| 139 | + # preempts running Pods. |
| 140 | + # |
| 141 | + # priorityClassName: important |
| 142 | + |
| 143 | + # These tolerations are to have the DaemonSet runnable on control plane nodes |
| 144 | + # remove them if your control plane nodes should not run Pods. |
| 145 | + # |
| 146 | + tolerations: |
| 147 | + - key: node-role.kubernetes.io/control-plane |
| 148 | + operator: Exists |
| 149 | + effect: NoSchedule |
| 150 | + - key: node-role.kubernetes.io/master |
| 151 | + operator: Exists |
| 152 | + effect: NoSchedule |
0 commit comments