Allow set extra labels/annotations - #2791
Conversation
55f7ecd to
e3d86f5
Compare
| nodeFilter = slurmv1.K8sNodeFilter{} | ||
| } | ||
| labels := maps.Clone(matchLabels) | ||
| maps.Copy(labels, clusterValues.SlurmExporter.Labels) |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
ActiveCheck can use spool PVC. It needs to be rewritten.
Problem
Solution
Testing
Release Notes