From 509af53cbd707467f184467b4579e3dc7feacbbe Mon Sep 17 00:00:00 2001 From: Kenneth Owens Date: Wed, 9 Aug 2017 15:17:56 -0700 Subject: [PATCH] Adds v1.Service.PublishUnreadyAddresses and deprecates service.alpha.kubernetes.io/tolerate-unready-endpoints --- pkg/api/types.go | 12 ++++++++++++ pkg/controller/endpoint/endpoints_controller.go | 2 ++ staging/src/k8s.io/api/core/v1/types.go | 12 ++++++++++++ 3 files changed, 26 insertions(+) diff --git a/pkg/api/types.go b/pkg/api/types.go index 7d6e767f3f2..e6d637f0c82 100644 --- a/pkg/api/types.go +++ b/pkg/api/types.go @@ -2722,6 +2722,18 @@ type ServiceSpec struct { // and ExternalTrafficPolicy is set to Local. // +optional HealthCheckNodePort int32 + + // publishNotReadyAddresses, when set to true, indicates that DNS implementations + // must publish the notReadyAddresses of subsets for the Endpoints associated with + // the Service. The default value is false. + // The primary use case for setting this field is to use a StatefulSet's Headless Service + // to propagate SRV records for its Pods without respect to their readiness for purpose + // of peer discovery. + // This field will replace the service.alpha.kubernetes.io/tolerate-unready-endpoints + // when that annotation is deprecated and all clients have been converted to use this + // field. + // +optional + PublishNotReadyAddresses bool } type ServicePort struct { diff --git a/pkg/controller/endpoint/endpoints_controller.go b/pkg/controller/endpoint/endpoints_controller.go index f1cea8b39b0..78bdf615d3f 100644 --- a/pkg/controller/endpoint/endpoints_controller.go +++ b/pkg/controller/endpoint/endpoints_controller.go @@ -63,6 +63,8 @@ const ( // receiving traffic for the Service from the moment the kubelet starts all // containers in the pod and marks it "Running", till the kubelet stops all // containers and deletes the pod from the apiserver. + // This field is deprecated. v1.Service.PublishNotReadyAddresses will replace it + // subsequent releases. TolerateUnreadyEndpointsAnnotation = "service.alpha.kubernetes.io/tolerate-unready-endpoints" ) diff --git a/staging/src/k8s.io/api/core/v1/types.go b/staging/src/k8s.io/api/core/v1/types.go index 287710e04e8..6b79e441e9d 100644 --- a/staging/src/k8s.io/api/core/v1/types.go +++ b/staging/src/k8s.io/api/core/v1/types.go @@ -3070,6 +3070,18 @@ type ServiceSpec struct { // and ExternalTrafficPolicy is set to Local. // +optional HealthCheckNodePort int32 `json:"healthCheckNodePort,omitempty" protobuf:"bytes,12,opt,name=healthCheckNodePort"` + + // publishNotReadyAddresses, when set to true, indicates that DNS implementations + // must publish the notReadyAddresses of subsets for the Endpoints associated with + // the Service. The default value is false. + // The primary use case for setting this field is to use a StatefulSet's Headless Service + // to propagate SRV records for its Pods without respect to their readiness for purpose + // of peer discovery. + // This field will replace the service.alpha.kubernetes.io/tolerate-unready-endpoints + // when that annotation is deprecated and all clients have been converted to use this + // field. + // +optional + PublishNotReadyAddresses bool `json:"publishNotReadyAddresses,omitempty" protobuf:"varint,13,opt,name=publishNotReadyAddresses"` } // ServicePort contains information on service's port.