diff --git a/README.md b/README.md index e97a9ce..727b679 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,7 @@ metadata: name: kind-test namespace: kubesphere-system annotations: - tower.kubesphere.io/external-lb-service-annoations: '{"eip.porter.kubesphere.io/v1alpha2":"porter-bgp-eip","lb.kubesphere.io/v1alpha1":"porter","protocol.porter.kubesphere.io/v1alpha1":"bgp"}' + tower.kubesphere.io/external-lb-service-annotations: '{"eip.porter.kubesphere.io/v1alpha2":"porter-bgp-eip","lb.kubesphere.io/v1alpha1":"porter","protocol.porter.kubesphere.io/v1alpha1":"bgp"}' spec: connection: type: proxy @@ -98,4 +98,4 @@ spec: externalKubeAPIEnabled: true ``` -With `externalKubeAPIEnabled=true` and `connection.type=proxy` tower will create the serivce with `LoadBlancer` type, content in annotation with key `tower.kubesphere.io/external-lb-service-annoations` will be applied to the service anntations as k-v, so that your can control how the `ccm` process the service. \ No newline at end of file +With `externalKubeAPIEnabled=true` and `connection.type=proxy` tower will create the serivce with `LoadBlancer` type, content in annotation with key `tower.kubesphere.io/external-lb-service-annotations` will be applied to the service anntations as k-v, so that your can control how the `ccm` process the service. \ No newline at end of file diff --git a/pkg/proxy/proxy.go b/pkg/proxy/proxy.go index 61fb2c5..ee4158c 100644 --- a/pkg/proxy/proxy.go +++ b/pkg/proxy/proxy.go @@ -583,7 +583,10 @@ func (s *Proxy) addCluster(cluster *v1alpha1.Cluster) error { func updateServiceByExternalKubeAPI(cluster *v1alpha1.Cluster, service *corev1.Service) { // get lb annotations from cluster annotations - externalLBAnnotations, ok := cluster.Annotations["tower.kubesphere.io/external-lb-service-annoations"] + externalLBAnnotations, ok := cluster.Annotations["tower.kubesphere.io/external-lb-service-annotations"] + if !ok { + externalLBAnnotations, ok = cluster.Annotations["tower.kubesphere.io/external-lb-service-annoations"] + } if ok { var annotation map[string]string if err := json.Unmarshal([]byte(externalLBAnnotations), &annotation); err != nil { @@ -717,7 +720,7 @@ func (s *Proxy) allocatePort() (uint16, error) { for _, item := range clusters.Items { if item.Spec.Connection.Type == v1alpha1.ConnectionTypeProxy && item.Spec.Connection.KubernetesAPIServerPort != 0 && - item.Spec.Connection.KubeSphereAPIServerPort == port { + item.Spec.Connection.KubernetesAPIServerPort == port { collision = true break }