Skip to content

Allow set extra labels/annotations - #2791

Open
andriishestakov wants to merge 1 commit into
nebius:mainfrom
andriishestakov:add-labels
Open

Allow set extra labels/annotations#2791
andriishestakov wants to merge 1 commit into
nebius:mainfrom
andriishestakov:add-labels

Conversation

@andriishestakov

Copy link
Copy Markdown
Contributor

Problem

Solution

Testing

Release Notes

@Uburro Uburro added feature helm Functional changes in Helm charts labels Jul 27, 2026
nodeFilter = slurmv1.K8sNodeFilter{}
}
labels := maps.Clone(matchLabels)
maps.Copy(labels, clusterValues.SlurmExporter.Labels)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

User labels can hijack selector labels and permanently wedge the StatefulSet. Every render does maps.Copy(labels, X.Labels) after building the operator's labels, so user keys win - but the selector is built separately from matchLabels, which is not updated. Setting extraLabels: {app.kubernetes.io/component: foo} (or name/instance, or slurm.nebius.ai/nodeset) makes the pod template diverge from the immutable selector.

// +kubebuilder:validation:Required
SlurmNodes SlurmNodes `json:"slurmNodes"`

// ExtraLabels are custom K8s labels added to every Pod and the spool PVC of this cluster.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The spool PVC doc comment doesn't match the behavior. Both CRD fields say "added to every Pod and the spool PVC of this cluster", but nothing in the operator labels a PVC: common/volume.go:46-60 (the VolumeClaimTemplates, including the worker spool) is untouched. The only PVC labeling is chart-side in pvc.yaml, which iterates .Values.volumeSources with createPVC — jail and friends, not spool, and driven by chart values rather than the CR field. If the use case is billing attribution, unlabeled operator-created PVCs are probably the most valuable remaining gap; either way the comment should be corrected.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ActiveCheck can use spool PVC. It needs to be rewritten.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature helm Functional changes in Helm charts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants