diff --git a/pkg/cluster/service/service.go b/pkg/cluster/service/service.go index 479a341..85c17ed 100644 --- a/pkg/cluster/service/service.go +++ b/pkg/cluster/service/service.go @@ -112,19 +112,23 @@ func buildService( }) } + labels := map[string]string{ + "dice/component": dicesvcname, + "dice/koperator": "true", + "dice/cluster-name": clus.Name, + } + selectorLabels := labels + return &corev1.Service{ ObjectMeta: metav1.ObjectMeta{ Name: convertServiceName(dicesvcname), Namespace: clus.Namespace, OwnerReferences: ownerRefs, + Labels: labels, }, Spec: corev1.ServiceSpec{ - Selector: map[string]string{ - "dice/component": dicesvcname, - "dice/koperator": "true", - "dice/cluster-name": clus.Name, - }, - Ports: ports, + Selector: selectorLabels, + Ports: ports, }, } }