Skip to content
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

WIP: DNM: per-nodegroup SCC toggle #1124

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
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
9 changes: 9 additions & 0 deletions api/numaresourcesoperator/v1/numaresourcesoperator_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ type NodeGroupConfig struct {
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
}

const (
NodeGroupMaxAnnotations = 8
)

// NodeGroup defines group of nodes that will run resource topology exporter daemon set
// You can choose the group of node by MachineConfigPoolSelector or by PoolName
type NodeGroup struct {
Expand All @@ -123,6 +127,11 @@ type NodeGroup struct {
// PoolName defines the pool name to which the nodes belong that the config of this node group will be applied to
// +optional
PoolName *string `json:"poolName,omitempty"`
// Annotations is the per-nodegroup equivalent of the per-object annotations.
// Unlike the regular annotations, there is a hard limit of supported annotations, dependent on the operator version.
// In general, prefer to use per-object standard annotations.
// +optional
Annotations map[string]string `json:"annotations,omitempty"`
}

// NodeGroupStatus reports the status of a NodeGroup once matches an actual set of nodes and it is correctly processed
Expand Down
7 changes: 7 additions & 0 deletions api/numaresourcesoperator/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ spec:
NodeGroup defines group of nodes that will run resource topology exporter daemon set
You can choose the group of node by MachineConfigPoolSelector or by PoolName
properties:
annotations:
additionalProperties:
type: string
description: |-
Annotations is the per-nodegroup equivalent of the per-object annotations.
Unlike the regular annotations, there is a hard limit of supported annotations, dependent on the operator version.
In general, prefer to use per-object standard annotations.
type: object
config:
description: Config defines the RTE behavior for this NodeGroup
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ spec:
NodeGroup defines group of nodes that will run resource topology exporter daemon set
You can choose the group of node by MachineConfigPoolSelector or by PoolName
properties:
annotations:
additionalProperties:
type: string
description: |-
Annotations is the per-nodegroup equivalent of the per-object annotations.
Unlike the regular annotations, there is a hard limit of supported annotations, dependent on the operator version.
In general, prefer to use per-object standard annotations.
type: object
config:
description: Config defines the RTE behavior for this NodeGroup
properties:
Expand Down
4 changes: 3 additions & 1 deletion controllers/numaresourcesoperator_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,9 @@ func (r *NUMAResourcesOperatorReconciler) syncNUMAResourcesOperatorResources(ctx
}
rteupdate.DaemonSetHashAnnotation(r.RTEManifests.Core.DaemonSet, cmHash)
}
rteupdate.SecurityContextConstraint(r.RTEManifests.Core.SecurityContextConstraint, annotations.IsCustomPolicyEnabled(instance.Annotations))

rteupdate.SecurityContextConstraint(r.RTEManifests.Core.SecurityContextConstraint, true) // force to legacy context
// SCC v2 needs no updates

existing = existing.WithManifestsUpdater(func(poolName string, gdm *rtestate.GeneratedDesiredManifest) error {
err := daemonsetUpdater(poolName, gdm)
Expand Down
Loading
Loading