-
Notifications
You must be signed in to change notification settings - Fork 83
Support direct editing of the intelRdt config #215
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
base: main
Are you sure you want to change the base?
Changes from all commits
f11dfb3
a0a9b2b
9ce5904
3c7483a
36de883
1c3cb8a
2414758
d9d155a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| apiVersion: apps/v1 | ||
| kind: DaemonSet | ||
| metadata: | ||
| name: nri-plugin-rdt | ||
| spec: | ||
| template: | ||
| spec: | ||
| containers: | ||
| - name: plugin | ||
| image: plugin:latest | ||
| args: | ||
| - "-idx" | ||
| - "10" | ||
| resources: | ||
| requests: | ||
| cpu: "2m" | ||
| memory: "5Mi" | ||
| securityContext: | ||
| allowPrivilegeEscalation: false | ||
| capabilities: | ||
| drop: | ||
| - ALL | ||
| volumeMounts: | ||
| - name: nri-socket | ||
| mountPath: /var/run/nri/nri.sock | ||
| volumes: | ||
| - name: nri-socket | ||
| hostPath: | ||
| path: /var/run/nri/nri.sock | ||
| type: Socket |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| apiVersion: kustomize.config.k8s.io/v1beta1 | ||
| kind: Kustomization | ||
| namespace: kube-system | ||
| resources: | ||
| - daemonset.yaml | ||
| images: | ||
| - name: plugin | ||
| newName: ghcr.io/containerd/nri/plugins/rdt | ||
| labels: | ||
| - includeSelectors: true | ||
| pairs: | ||
| app.kubernetes.io/name: nri-plugin-rdt |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| apiVersion: kustomize.config.k8s.io/v1beta1 | ||
| kind: Kustomization | ||
| resources: | ||
| - base/ | ||
| components: | ||
| - ../components/image-stable |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| apiVersion: kustomize.config.k8s.io/v1beta1 | ||
| kind: Kustomization | ||
| resources: | ||
| - ../base/ | ||
| components: | ||
| - ../../components/image-unstable |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -279,6 +279,30 @@ func (a *ContainerAdjustment) SetLinuxRDTClass(value string) { | |
| a.Linux.Resources.RdtClass = String(value) | ||
| } | ||
|
|
||
| // SetLinuxRDTClosID records setting the RDT CLOS id for a container. | ||
| func (a *ContainerAdjustment) SetLinuxRDTClosID(value string) { | ||
| a.initLinuxRdt() | ||
| a.Linux.Rdt.ClosId = String(value) | ||
| } | ||
|
|
||
| // SetLinuxRDTSchemata records setting the RDT schemata for a container. | ||
| func (a *ContainerAdjustment) SetLinuxRDTSchemata(value []string) { | ||
| a.initLinuxRdt() | ||
| a.Linux.Rdt.Schemata = RepeatedString(value) | ||
| } | ||
|
|
||
| // SetLinuxRDTEnableMonitoring records enabling RDT monitoring for a container. | ||
| func (a *ContainerAdjustment) SetLinuxRDTEnableMonitoring(value bool) { | ||
| a.initLinuxRdt() | ||
| a.Linux.Rdt.EnableMonitoring = Bool(value) | ||
| } | ||
|
|
||
| // RemoveLinuxRdt records the removal of the RDT configuration. | ||
| func (a *ContainerAdjustment) RemoveLinuxRDT() { | ||
| a.initLinuxRdt() | ||
| a.Linux.Rdt.Remove = true | ||
| } | ||
|
|
||
| // AddLinuxUnified sets a cgroupv2 unified resource. | ||
| func (a *ContainerAdjustment) AddLinuxUnified(key, value string) { | ||
| a.initLinuxResourcesUnified() | ||
|
|
@@ -378,3 +402,9 @@ func (a *ContainerAdjustment) initLinuxResourcesUnified() { | |
| a.Linux.Resources.Unified = make(map[string]string) | ||
| } | ||
| } | ||
| func (a *ContainerAdjustment) initLinuxRdt() { | ||
|
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. Just a note: #118 has a bunch of queued similar changes, updating the result-handling code so that there is no need to always a priory create a fully constructed but empty adjustment. It would be nice to get that finally in, so I'll rebase it that on the latest main/HEAD then update with any missing init*() bits necessary. 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. 👍 I'll review when that's updated. And then rebase when that's merged |
||
| a.initLinux() | ||
| if a.Linux.Rdt == nil { | ||
| a.Linux.Rdt = &LinuxRdt{} | ||
| } | ||
| } | ||
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.
@marquiz Do we know what is the expected timeframe for cutting the first such runtime-spec release which would put 383cadbf08c0 commit behind a tag ?
I am asking because we have been reluctant lately to pull in untagged versions of the runtime spec, because that would cause extra hassle/work if we wanted to or were forced to cut a new release and bump containerd and cri-o to pull in that new version. For instance #157 and #166 are current drafts exactly for this reason: the runtime-spec they require is not available yet in a tagged release.
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.
Yeah, sure. I don't think we need to hurry with this.
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.
@marquiz @mikebrow @chrishenzie In principle there is one way how we could get this partially in already now, to avoid having to keep rebasing this with a guaranteed conflict whenever we add something to LinuxContainer or LinuxContainerAdjustment.
It would be to split this up to 2 stacked PRs:
Then we could merge #PR1 (and rebase PR#2 when that happens), and keep the OCI Spec-dependent bits pending until the necessary bits get tagged. We could apply the same to #157 and #166...
Maybe not worth the effort though, and we can just mark this a draft until we get a tagged OCI Spec.