[topology] Add optional default for topologyConstraint LabelSelector#597
Conversation
Replicate the defaulting behaviour used in cluster-level default constraints https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/#cluster-level-default-constraints
|
@olliewalsh tested and works as expected (no regressions in the previous code that we tested). If you can take a look at openstack-k8s-operators/glance-operator#670 (comment) I was wondering if similarly to what we did for // GetGlanceAPILabelSelector - Returns a metav1.LabelSelector for a given GlanceAPI
func GetGlanceAPILabelSelector(instance *glancev1.GlanceAPI) metav1.LabelSelector {
return metav1.LabelSelector{
MatchExpressions: []metav1.LabelSelectorRequirement{
{
Key: glance.GlanceAPIName,
Operator: metav1.LabelSelectorOpIn,
Values: []string{
fmt.Sprintf("%s-%s-%s", glance.ServiceName, instance.APIName(), instance.Spec.APIType),
},
},
},
}
}a generic one, that can be called from this module. as input for that function. Do you want to push an update for this before we land it? [1] https://github.com/openstack-k8s-operators/glance-operator/blob/main/pkg/glanceapi/statefulset.go#L296 |
Replicate the defaulting behaviour used in cluster-level default constraints https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/#cluster-level-default-constraints