Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions internal/controller/bindata/vsp/intel-ipu/01.vsp_p4_pv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: vsp-p4-pv
namespace: {{.Namespace}}
spec:
selector:
app: vsp-p4
capacity:
storage: 3Gi
accessModes:
- ReadWriteMany
persistentVolumeReclaimPolicy: Retain
local:
path: /opt/p4/
storageClassName: local-storage
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- {{.HostName}}
13 changes: 13 additions & 0 deletions internal/controller/bindata/vsp/intel-ipu/02.vsp_p4_pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: vsp-p4-pvc
namespace: {{.Namespace}}
spec:
accessModes:
- ReadWriteMany
provisioner: kubernetes.io/no-provisioner
resources:
requests:
storage: 3Gi
storageClassName: local-storage
5 changes: 5 additions & 0 deletions internal/controller/bindata/vsp/intel-ipu/03.vsp_p4_sa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: vsp-p4-sa
namespace: {{.Namespace}}
25 changes: 25 additions & 0 deletions internal/controller/bindata/vsp/intel-ipu/04.vsp_p4_role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: vsp-p4-role
namespace: {{.Namespace}}
rules:
- apiGroups:
- security.openshift.io
resourceNames:
- privileged
resources:
- securitycontextconstraints
verbs:
- use
- apiGroups:
- apps
resources:
- daemonsets
verbs:
- get
- list
- watch
- create
- update
- delete
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: vsp-p4-role-binding
namespace: {{.Namespace}}
subjects:
- kind: ServiceAccount
name: vsp-p4-sa
roleRef:
kind: Role
name: vsp-p4-role
apiGroup: rbac.authorization.k8s.io
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the commit takes the files from vendor/github.com/intel/ipu-opi-plugins/ipu-plugin/pkg/infrapod/bindata/vsp-p4-pvc.

For one, the commit message should explain where exactly those files come from. Also, it is not clear why this is done, why it is necessary or why it is a good idea.

Also, the commit renames the files. I understand you try to renumber them, but is that really necessary? Even if you end up with two files starting with 01., does it actually hurt? As the files are literally identical as from the vendored directory, can we keep the filenames unchanged?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thom311 just getting back on this PR. This PR is a follow-up to #569 where @bn222 refactored the dpu-operator to handle vsp-plugin cleanup sequence as desired (vsp-p4 to wait for vsp-plugin to finish pod cleanup procedure where it explicitly deletes the P4 rules).

lexical (or numeric) ordering of P4 yaml failnames are required to maintain the bring-up and delete sequence of pods.


12 changes: 12 additions & 0 deletions internal/controller/bindata/vsp/intel-ipu/06.vsp_p4_service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: vsp-p4-service
namespace: {{.Namespace}}
spec:
selector:
app: vsp-p4
ports:
- protocol: TCP
port: 9559
targetPort: 9559
67 changes: 67 additions & 0 deletions internal/controller/bindata/vsp/intel-ipu/07.vsp_p4.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: vsp-p4
namespace: {{.Namespace}}
spec:
selector:
matchLabels:
app: vsp-p4
template:
metadata:
labels:
app: vsp-p4
spec:
nodeSelector:
dpu: "true"
serviceAccountName: vsp-p4-sa
containers:
- name: p4-container
image: {{.IntelVspP4Image}}
securityContext:
privileged: true
ports:
- containerPort: 9559
hostPort: 9559
resources:
requests:
cpu: 500m
memory: 4Gi
hugepages-2Mi: 256Mi
limits:
cpu: 1
memory: 4Gi
hugepages-2Mi: 256Mi
volumeMounts:
- name: lib-modules
mountPath: /lib/modules/
- name: var-run
mountPath: /opt/p4/p4-cp-nws/var/run
- name: sys
mountPath: /sys
- name: dev
mountPath: /dev
- name: hugepages
mountPath: /dev/hugepages
- name: opt-p4
mountPath: /opt/p4
dnsPolicy: ClusterFirstWithHostNet
volumes:
- name: lib-modules
hostPath:
path: /lib/modules/
- name: var-run
hostPath:
path: /opt/p4/p4-cp-nws/var/run
- name: sys
hostPath:
path: /sys
- name: dev
hostPath:
path: /dev
- name: hugepages
hostPath:
path: /dev/hugepages
- name: opt-p4
persistentVolumeClaim:
claimName: vsp-p4-pvc
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider mount directly from the host, we can assume that the user puts it in a certain path.

1 change: 1 addition & 0 deletions internal/controller/dataprocessingunit_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ func (r *DataProcessingUnitReconciler) ensureVSPResources(ctx context.Context, d
"VspName": r.getVSPName(dpu),
"DpuName": dpu.Name,
"NodeName": dpu.Spec.NodeName,
"HostName": dpu.Spec.NodeName,
"VendorSpecificPluginImage": vspImage,
"ImagePullPolicy": r.imagePullPolicy,
"Command": "[]",
Expand Down