-
Notifications
You must be signed in to change notification settings - Fork 32
Move Intel vsp-p4 plugin yaml context one level above #591
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
arunvelayutham
wants to merge
1
commit into
openshift:main
Choose a base branch
from
arunvelayutham:move-p4-yaml-to-dpu-operator-bindata
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
internal/controller/bindata/vsp/intel-ipu/01.vsp_p4_pv.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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
13
internal/controller/bindata/vsp/intel-ipu/02.vsp_p4_pvc.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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
25
internal/controller/bindata/vsp/intel-ipu/04.vsp_p4_role.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
13 changes: 13 additions & 0 deletions
13
internal/controller/bindata/vsp/intel-ipu/05.vsp_p4_role_binding.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
|
|
||
12 changes: 12 additions & 0 deletions
12
internal/controller/bindata/vsp/intel-ipu/06.vsp_p4_service.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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?There was a problem hiding this comment.
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.