mirror of
https://github.com/k8snetworkplumbingwg/multus-cni.git
synced 2025-08-17 15:52:37 +00:00
[stub] stubbing in daemonset and yaml resources, updates driver name for now to try it
This commit is contained in:
parent
8f8bdd8772
commit
062b5f82ea
@ -29,7 +29,7 @@ const (
|
||||
cdiVendor = "k8s." + DriverName
|
||||
cdiClass = "gpu"
|
||||
cdiKind = cdiVendor + "/" + cdiClass
|
||||
DriverName = "gpu.example.com"
|
||||
DriverName = "gpu.multus-cni.io"
|
||||
cdiCommonDeviceName = "common"
|
||||
)
|
||||
|
||||
|
101
deployments/dra.yml
Normal file
101
deployments/dra.yml
Normal file
@ -0,0 +1,101 @@
|
||||
---
|
||||
apiVersion: resource.k8s.io/v1beta1
|
||||
kind: DeviceClass
|
||||
metadata:
|
||||
name: gpu.multus-cni.io
|
||||
spec:
|
||||
selectors:
|
||||
- cel:
|
||||
expression: "device.driver == 'gpu.multus-cni.io'"
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: dra-multus-driver
|
||||
namespace: default
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: dra-multus-driver-role
|
||||
rules:
|
||||
- apiGroups: ["resource.k8s.io"]
|
||||
resources: ["resourceclaims"]
|
||||
verbs: ["get"]
|
||||
- apiGroups: [""]
|
||||
resources: ["nodes"]
|
||||
verbs: ["get"]
|
||||
- apiGroups: ["resource.k8s.io"]
|
||||
resources: ["resourceslices"]
|
||||
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: dra-multus-driver-role-binding
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: dra-multus-driver
|
||||
namespace: default
|
||||
roleRef:
|
||||
kind: ClusterRole
|
||||
name: dra-multus-driver-role
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: DaemonSet
|
||||
metadata:
|
||||
name: dra-multus-driver
|
||||
namespace: default
|
||||
labels:
|
||||
app: dra-multus-driver
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: dra-multus-driver
|
||||
updateStrategy:
|
||||
type: RollingUpdate
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: dra-multus-driver
|
||||
spec:
|
||||
priorityClassName: system-node-critical
|
||||
serviceAccountName: dra-multus-driver
|
||||
containers:
|
||||
- name: plugin
|
||||
image: dougbtv/dra-multus-driver:dev
|
||||
imagePullPolicy: IfNotPresent
|
||||
command: ["/dra-example-driver"]
|
||||
securityContext:
|
||||
privileged: true
|
||||
env:
|
||||
- name: CDI_ROOT
|
||||
value: /var/run/cdi
|
||||
- name: NODE_NAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: spec.nodeName
|
||||
- name: NAMESPACE
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.namespace
|
||||
- name: NUM_DEVICES
|
||||
value: "8"
|
||||
volumeMounts:
|
||||
- name: plugins-registry
|
||||
mountPath: /var/lib/kubelet/plugins_registry
|
||||
- name: plugins
|
||||
mountPath: /var/lib/kubelet/plugins
|
||||
- name: cdi
|
||||
mountPath: /var/run/cdi
|
||||
volumes:
|
||||
- name: plugins-registry
|
||||
hostPath:
|
||||
path: /var/lib/kubelet/plugins_registry
|
||||
- name: plugins
|
||||
hostPath:
|
||||
path: /var/lib/kubelet/plugins
|
||||
- name: cdi
|
||||
hostPath:
|
||||
path: /var/run/cdi
|
@ -80,3 +80,5 @@ echo "Building kubeconfig_generator"
|
||||
go build -o "${DEST_DIR}"/kubeconfig_generator ${BUILD_ARGS} -ldflags "${LDFLAGS}" ./cmd/kubeconfig_generator
|
||||
echo "Building cert-approver"
|
||||
go build -o "${DEST_DIR}"/cert-approver ${BUILD_ARGS} -ldflags "${LDFLAGS}" ./cmd/cert-approver
|
||||
echo "Building dra-multus-driver"
|
||||
go build -o "${DEST_DIR}"/dra-multus-driver ${BUILD_ARGS} -ldflags "${LDFLAGS}" ./cmd/dra-multus-driver
|
||||
|
@ -12,6 +12,7 @@ LABEL org.opencontainers.image.source=https://github.com/k8snetworkplumbingwg/mu
|
||||
COPY --from=build /usr/src/multus-cni/bin /usr/src/multus-cni/bin
|
||||
COPY --from=build /usr/src/multus-cni/LICENSE /usr/src/multus-cni/LICENSE
|
||||
COPY --from=build /usr/src/multus-cni/bin/cert-approver /
|
||||
COPY --from=build /usr/src/multus-cni/bin/dra-multus-driver /
|
||||
WORKDIR /
|
||||
|
||||
ENTRYPOINT [ "/usr/src/multus-cni/bin/multus-daemon" ]
|
||||
|
@ -26,7 +26,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
GroupName = "gpu.resource.example.com"
|
||||
GroupName = "gpu.resource.multus-cni.io"
|
||||
Version = "v1alpha1"
|
||||
|
||||
GpuConfigKind = "GpuConfig"
|
||||
|
@ -15,6 +15,6 @@
|
||||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package
|
||||
// +groupName=gpu.resource.example.com
|
||||
// +groupName=gpu.resource.multus-cni.io
|
||||
|
||||
package v1alpha1
|
||||
|
Loading…
Reference in New Issue
Block a user