Skip to content

Commit

Permalink
Fix etcd operator to work with k8s 1.21
Browse files Browse the repository at this point in the history
Annotation `service.alpha.kubernetes.io/tolerate-unready-endpoints` stopped working in k8s 1.21
It has been deprecated for a long time, see:
https://github.com/kubernetes/kubernetes/blob/v1.21.5/pkg/controller/endpoint/endpoints_controller.go#L80
Now using the new way
  • Loading branch information
jedrivisser authored and nberlee committed Apr 2, 2022
1 parent c5807b3 commit e73da47
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 28 deletions.
19 changes: 0 additions & 19 deletions doc/alpha-features.md

This file was deleted.

13 changes: 4 additions & 9 deletions pkg/util/k8sutil/k8sutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"net"
"net/url"
"os"
"strconv"
"strings"
"time"

Expand Down Expand Up @@ -75,7 +74,6 @@ const (
defaultDNSTimeout = int64(0)
)

const TolerateUnreadyEndpointsAnnotation = "service.alpha.kubernetes.io/tolerate-unready-endpoints"

func GetEtcdVersion(pod *v1.Pod) string {
return pod.Annotations[etcdVersionAnnotationKey]
Expand Down Expand Up @@ -254,15 +252,12 @@ func newEtcdServiceManifest(svcName, clusterName, clusterIP string, ports []v1.S
ObjectMeta: metav1.ObjectMeta{
Name: svcName,
Labels: labels,
Annotations: map[string]string{
TolerateUnreadyEndpointsAnnotation: strconv.FormatBool(publishNotReadyAddresses),
},
},
Spec: v1.ServiceSpec{
Ports: ports,
Selector: labels,
ClusterIP: clusterIP,
// PublishNotReadyAddresses: publishNotReadyAddresses, // TODO(ckoehn): Activate once TolerateUnreadyEndpointsAnnotation is deprecated.
Ports: ports,
Selector: labels,
ClusterIP: clusterIP,
PublishNotReadyAddresses: publishNotReadyAddresses,
},
}
return svc
Expand Down

0 comments on commit e73da47

Please sign in to comment.