use PublishNotReadyAddresses instead of annotation
"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)
@@ -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
}
@@ -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
}
