Skip to content

Commit

Permalink
K8SPXC-876 use PublishNotReadyAddresses instead of annotation
Browse files Browse the repository at this point in the history
https://jira.percona.com/browse/K8SPXC-876
"service.alpha.kubernetes.io/tolerate-unready-endpoints" annotation has been
deprecated since Kuberneets 1.8 and the spec.publishNotReadyAddresses
parameter replacing it has been correctly implemented in Kubernetes 1.11
(see kubernetes/kubernetes#63742)
  • Loading branch information
delgod committed Sep 14, 2021
1 parent 5731222 commit c100480
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/pxc/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@ func NewServicePXCUnready(cr *api.PerconaXtraDBCluster) *corev1.Service {
)
}

if cr.CompareVersionWith("1.10.0") >= 0 {
obj.Spec.PublishNotReadyAddresses = true
delete(obj.ObjectMeta.Annotations, "service.alpha.kubernetes.io/tolerate-unready-endpoints")
}

return obj
}

Expand Down Expand Up @@ -173,6 +178,11 @@ func NewServiceProxySQLUnready(cr *api.PerconaXtraDBCluster) *corev1.Service {
obj.ObjectMeta.Labels["app.kubernetes.io/part-of"] = "percona-xtradb-cluster"
}

if cr.CompareVersionWith("1.10.0") >= 0 {
obj.Spec.PublishNotReadyAddresses = true
delete(obj.ObjectMeta.Annotations, "service.alpha.kubernetes.io/tolerate-unready-endpoints")
}

return obj
}

Expand Down

0 comments on commit c100480

Please sign in to comment.