-
Notifications
You must be signed in to change notification settings - Fork 40k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Promotes TolerateUnreadyEndpoints annotation to a field (beta) #49061
Promotes TolerateUnreadyEndpoints annotation to a field (beta) #49061
Conversation
@kubernetes/sig-network-pr-reviews |
pkg/api/types.go
Outdated
// headless Service to be DNS resolvable without respect to their readiness checks. | ||
// Endpoints of these Services retain their DNS records and continue | ||
// receiving traffic for the Service from the moment the kubelet starts all | ||
// containers in the Pod and marks it "Running", until the kubelet stops all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally, we want the service to be resolvable also for pod phase "pending" + condition "initializing". Basically, we want the service to be resolvable in the init container.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xiang90 I took the comment from the original documentation. In reality it causes the endpoints controller to completely ignore readiness. Do you think that the comment should be updated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In reality it causes the endpoints controller to completely ignore readiness.
Implementation is what you just described. It completely ignores pod readiness. So no matter what state pod is in, service is not affected. I hope we can change the documentation as well, since I believe the init container case is a valid one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will update the comment to more accurately reflect the behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you!
a95c847
to
1a6a989
Compare
Do we have a way of denoting a field as beta when it's not an annotation? By putting this in the v1.Service definition aren't we implying that it's a GA feature? Not saying we shouldn't, just curious if we can actually claim that this is beta. |
@caseydavenport I'm using beta based on these criteria. If no one objects to the field's naming, and given the length of time we've been carrying the annotation with no modifications to the semantics, I'd like to suggest we move it to a field. It is probably stable in reality, but not reserving the right to change the semantics in a backward compatible way over the next release doesn't really buy anything. Also, as users have been using the field in production for some time now, I don't think its endanger of breaking anyone's cluster. |
@kow3ns I wasn't claiming it was anything but stable :) Moving to a field sounds good to me, I was more just curious about this point from the doc you linked:
Which isn't true for Services. Does that mean we just go straight to GA? |
@caseydavenport There is precedence for moving beta features to fields in v1 objects if we have a high confidence in the API (e.g. PodAffinity/PodAntiAffinity). I don't think the presence of a field automatically promotes it GA in all perspectives, but it means that we will support the field in a backward compatible way and it meets the beta criteria of stability. I will of course deffer to SIG API machinery and the API reviewers on this. |
1a6a989
to
b1150a8
Compare
/test pull-kubernetes-federation-e2e-gce |
/test pull-kubernetes-federation-e2e-gce |
1 similar comment
/test pull-kubernetes-federation-e2e-gce |
@kubernetes/sig-api-machinery-misc @lavalamp field promotion |
@kow3ns wrote:
The documented deprecation cycle for an alpha annotation is 0 releases. Since we intend to support it longer than that, we should explicitly say when that is. Is the plan to remove it in 1.9? |
What do you mean by "remain available"? Trying to represent the same data as both an annotation and as a field is extremely problematic. This has been tried before and wreaks havoc with edit, patch, apply, etc. |
@enisoc @liggitt We told users that they could use it even though it's alpha, and we enabled it by default. We have to at least treat it as beta (Beta: 3 months or 1 release (whichever is longer)), and we can't reasonably deprecate it until we release a stable version. We can't just remove it and break them. We need to support it for at least one release cycle and give them time to update their running services, stable helm charts, and examples. I understand the pain we have had in the past with this, and this PR doesn't attempt to keep the field consistent. Its an either or. If you use the annotation, the field is ignored. If you remove annotation, the value of the field will be used. In 1.8, we will give users a full release cycle to update the field on their running services, update the stable helm charts, and modify their manifests, tutorials, and examples. |
That seems like an untenable approach... agree on what alpha means, ship something under that definition, enable it in one deployment, then force the open source project to maintain beta-level support for it? |
That also seems backwards... an alpha-level annotation should not win over a supported field. |
@liggitt by we I mean we the kubernetes developers, told the open source community (e.g. helm maintainers) and other users that it was usable. It's the community, in particular all of the people who are using it that I'm not aware of, that I'm worried about breaking. |
It was usable as an alpha feature, with alpha guarantees around compatibility. It is a mistake to act like alpha features require support in future versions. That sets a bad precedent, makes people expect and depend on alpha features being supported, and destroys the point of having an alpha level feature in the first place. If the field is being added, I think we should add |
@liggitt my thought about the annotation being present and overriding the field is that during an upgrade from 1.7 to 1.8 the following would occur.
I remember the confusion around storage-class annotations, init-container annotations, and pod-affinity/pod-anti-affinity annotations and have been bitten by it as well. That is why I'm suggesting the above. While it may not set the best precedent, I think it will keep our users from being surprised during an upgrade. |
So I still want to move forward with the API change but will remove the annotation based on feedback from @liggitt, @lavalamp, and @bgrant0607. The argument makes sense, and if SIG API concurs that we should stick to our guns wrt to our policy, I'm good with it. However, wrt to #49239. I'd like to fix this in a separate PR as it will require coordination with SIG Network. We need to decide on, and deliver, a compatible DNS implementation prior modifying the endpoints controllers behavior wrt to unreadiness. I propose,
|
@kow3ns Changing the Endpoints controller behavior in step (2) would a significant change in behavior. I don't think we can do that separately from breaking the alpha API. |
@@ -354,7 +354,7 @@ func (e *EndpointController) syncService(key string) error { | |||
return err | |||
} | |||
|
|||
var tolerateUnreadyEndpoints bool | |||
tolerateUnreadyEndpoints := service.Spec.TolerateUnreadyEndpoints | |||
if v, ok := service.Annotations[TolerateUnreadyEndpointsAnnotation]; ok { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Continue to use Annotations field in code logic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this is for backward compatibility? @kow3ns
b1150a8
to
30f5ad0
Compare
@bgrant0607 as per #49239 |
38430b3
to
72bd280
Compare
/retest |
/approve |
…kubernetes.io/tolerate-unready-endpoints
72bd280
to
8fb609b
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bgrant0607, crimsonfaith91, kow3ns Associated issue: 47880 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
/retest |
Automatic merge from submit-queue (batch tested with PRs 50418, 49830, 49206, 49061, 49912) |
This PR promotes add the v1.Service.PublishNotReadyAddresses field and adds a deprecation notice for The "service.alpha.kubernetes.io/tolerate-unready-endpoints".
fixes #47880,#25283