File tree Expand file tree Collapse file tree 14 files changed +31
-140
lines changed
Expand file tree Collapse file tree 14 files changed +31
-140
lines changed Original file line number Diff line number Diff line change @@ -80,7 +80,8 @@ kind: Pod
8080metadata :
8181 name : my-hyperlight-app
8282spec :
83- runtimeClassName : hyperlight-kvm # or hyperlight-mshv
83+ nodeSelector :
84+ hyperlight.dev/hypervisor : kvm # or mshv
8485 automountServiceAccountToken : false
8586 securityContext :
8687 runAsNonRoot : true
Original file line number Diff line number Diff line change @@ -157,7 +157,6 @@ create_kvm_nodepool() {
157157 --min-count " ${KVM_NODE_MIN_COUNT} " \
158158 --max-count " ${KVM_NODE_MAX_COUNT} " \
159159 --labels " hyperlight.dev/hypervisor=kvm" " hyperlight.dev/enabled=true" \
160- --node-taints " hyperlight.dev/hypervisor=kvm:NoSchedule" \
161160 --mode User \
162161 --ssh-access disabled \
163162 -o none
@@ -184,7 +183,6 @@ create_mshv_nodepool() {
184183 --min-count " ${MSHV_NODE_MIN_COUNT} " \
185184 --max-count " ${MSHV_NODE_MAX_COUNT} " \
186185 --labels " hyperlight.dev/hypervisor=mshv" " hyperlight.dev/enabled=true" \
187- --node-taints " hyperlight.dev/hypervisor=mshv:NoSchedule" \
188186 --mode User \
189187 --ssh-access disabled \
190188 -o none
Original file line number Diff line number Diff line change @@ -24,44 +24,6 @@ metadata:
2424 app.kubernetes.io/name : hyperlight-system
2525 app.kubernetes.io/part-of : hyperlight
2626
27- ---
28- # RuntimeClass for KVM-based Hyperlight workloads
29- apiVersion : node.k8s.io/v1
30- kind : RuntimeClass
31- metadata :
32- name : hyperlight-kvm
33- labels :
34- app.kubernetes.io/name : hyperlight-kvm
35- app.kubernetes.io/part-of : hyperlight
36- handler : runc
37- scheduling :
38- nodeSelector :
39- hyperlight.dev/hypervisor : kvm
40- tolerations :
41- - key : " hyperlight.dev/hypervisor"
42- operator : " Equal"
43- value : " kvm"
44- effect : " NoSchedule"
45-
46- ---
47- # RuntimeClass for MSHV-based Hyperlight workloads
48- apiVersion : node.k8s.io/v1
49- kind : RuntimeClass
50- metadata :
51- name : hyperlight-mshv
52- labels :
53- app.kubernetes.io/name : hyperlight-mshv
54- app.kubernetes.io/part-of : hyperlight
55- handler : runc
56- scheduling :
57- nodeSelector :
58- hyperlight.dev/hypervisor : mshv
59- tolerations :
60- - key : " hyperlight.dev/hypervisor"
61- operator : " Equal"
62- value : " mshv"
63- effect : " NoSchedule"
64-
6527---
6628# ServiceAccount for device plugin
6729apiVersion : v1
9961 # Only run on nodes with hyperlight enabled
10062 nodeSelector :
10163 hyperlight.dev/enabled : " true"
102- # Tolerate hypervisor taints
103- tolerations :
104- - key : " hyperlight.dev/hypervisor"
105- operator : " Exists"
106- effect : " NoSchedule"
10764 priorityClassName : system-node-critical
10865 containers :
10966 - name : device-plugin
Original file line number Diff line number Diff line change 9898}
9999
100100setup_node_labels () {
101- log_info " Setting up node labels and taints ..."
101+ log_info " Setting up node labels..."
102102
103103 # The labels are set in kind-config.yaml, but let's ensure they exist
104104 local node
@@ -107,9 +107,6 @@ setup_node_labels() {
107107 kubectl label node " ${node} " hyperlight.dev/enabled=true --overwrite
108108 kubectl label node " ${node} " hyperlight.dev/hypervisor=kvm --overwrite
109109
110- # Add taint (optional for local dev, but matches production)
111- kubectl taint node " ${node} " hyperlight.dev/hypervisor=kvm:NoSchedule --overwrite 2> /dev/null || true
112-
113110 log_success " Node configured"
114111}
115112
Original file line number Diff line number Diff line change @@ -8,44 +8,6 @@ metadata:
88 app.kubernetes.io/name : hyperlight-system
99 app.kubernetes.io/part-of : hyperlight
1010
11- ---
12- # RuntimeClass for KVM-based Hyperlight workloads
13- apiVersion : node.k8s.io/v1
14- kind : RuntimeClass
15- metadata :
16- name : hyperlight-kvm
17- labels :
18- app.kubernetes.io/name : hyperlight-kvm
19- app.kubernetes.io/part-of : hyperlight
20- handler : runc
21- scheduling :
22- nodeSelector :
23- hyperlight.dev/hypervisor : kvm
24- tolerations :
25- - key : " hyperlight.dev/hypervisor"
26- operator : " Equal"
27- value : " kvm"
28- effect : " NoSchedule"
29-
30- ---
31- # RuntimeClass for MSHV-based Hyperlight workloads
32- apiVersion : node.k8s.io/v1
33- kind : RuntimeClass
34- metadata :
35- name : hyperlight-mshv
36- labels :
37- app.kubernetes.io/name : hyperlight-mshv
38- app.kubernetes.io/part-of : hyperlight
39- handler : runc
40- scheduling :
41- nodeSelector :
42- hyperlight.dev/hypervisor : mshv
43- tolerations :
44- - key : " hyperlight.dev/hypervisor"
45- operator : " Equal"
46- value : " mshv"
47- effect : " NoSchedule"
48-
4911---
5012# ServiceAccount for device plugin
5113apiVersion : v1
8345 # Only run on nodes with hyperlight enabled
8446 nodeSelector :
8547 hyperlight.dev/enabled : " true"
86- # Tolerate hypervisor taints
87- tolerations :
88- - key : " hyperlight.dev/hypervisor"
89- operator : " Exists"
90- effect : " NoSchedule"
9148 priorityClassName : system-node-critical
9249 containers :
9350 - name : device-plugin
Original file line number Diff line number Diff line change 2121 app.kubernetes.io/name : hyperlight-app
2222 hyperlight.dev/hypervisor : kvm
2323 spec :
24- runtimeClassName : hyperlight-kvm
25- # Disable K8s API access - most apps don't need it
24+ nodeSelector :
25+ hyperlight.dev/hypervisor : kvm
26+ # Disable K8s API access
2627 automountServiceAccountToken : false
2728 # Explicitly disable host namespaces
2829 hostNetwork : false
Original file line number Diff line number Diff line change 2121 app.kubernetes.io/name : hyperlight-app
2222 hyperlight.dev/hypervisor : mshv
2323 spec :
24- runtimeClassName : hyperlight-mshv
25- # Disable K8s API access - most apps don't need it
24+ nodeSelector :
25+ hyperlight.dev/hypervisor : mshv
26+ # Disable K8s API access
2627 automountServiceAccountToken : false
2728 # Explicitly disable host namespaces
2829 hostNetwork : false
Original file line number Diff line number Diff line change @@ -9,7 +9,8 @@ metadata:
99 app.kubernetes.io/name : hyperlight-test
1010 hyperlight.dev/hypervisor : kvm
1111spec :
12- runtimeClassName : hyperlight-kvm
12+ nodeSelector :
13+ hyperlight.dev/hypervisor : kvm
1314 containers :
1415 - name : test
1516 image : alpine:3.19
Original file line number Diff line number Diff line change @@ -9,7 +9,8 @@ metadata:
99 app.kubernetes.io/name : hyperlight-test
1010 hyperlight.dev/hypervisor : mshv
1111spec :
12- runtimeClassName : hyperlight-mshv
12+ nodeSelector :
13+ hyperlight.dev/hypervisor : mshv
1314 containers :
1415 - name : test
1516 image : alpine:3.19
Original file line number Diff line number Diff line change @@ -17,8 +17,7 @@ RUN apk --no-cache add ca-certificates
1717
1818COPY --from=builder /app/hyperlight-device-plugin /usr/local/bin/
1919
20- # Run as non-root
21- RUN adduser -D -u 1000 hyperlight
22- USER hyperlight
20+ # Note: Runs as root (runAsUser: 0) in Kubernetes - required for
21+ # write access to /var/lib/kubelet/device-plugins and /var/run/cdi
2322
2423ENTRYPOINT ["hyperlight-device-plugin" ]
You can’t perform that action at this time.
0 commit comments