From b902bc26ad22b2f9b951ad5f205b4c52506b09de Mon Sep 17 00:00:00 2001 From: yandongxiao Date: Tue, 19 Dec 2023 13:57:00 +0800 Subject: [PATCH] [BugFix] Remove annotations from search service (#370) Signed-off-by: yandongxiao --- pkg/k8sutils/templates/service/spec.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/k8sutils/templates/service/spec.go b/pkg/k8sutils/templates/service/spec.go index eb423801..77ac8271 100644 --- a/pkg/k8sutils/templates/service/spec.go +++ b/pkg/k8sutils/templates/service/spec.go @@ -15,13 +15,17 @@ package service import ( - "github.com/StarRocks/starrocks-kubernetes-operator/pkg/apis/starrocks/v1" corev1 "k8s.io/api/core/v1" + + "github.com/StarRocks/starrocks-kubernetes-operator/pkg/apis/starrocks/v1" ) func MakeSearchService(serviceName string, externalService *corev1.Service, ports []corev1.ServicePort) *corev1.Service { searchSvc := &corev1.Service{} externalService.ObjectMeta.DeepCopyInto(&searchSvc.ObjectMeta) + // some service annotations can only be used when `type` is 'LoadBalancer', e.g. service.beta.kubernetes.io/load-balancer-source-ranges + // we do not need to annotations for search service + searchSvc.Annotations = nil searchSvc.Name = serviceName searchSvc.Spec = corev1.ServiceSpec{ ClusterIP: "None",