Skip to content
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

Merged
merged 2 commits into from
Aug 10, 2017

Conversation

kow3ns
Copy link
Member

@kow3ns kow3ns commented Jul 17, 2017

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

The v1.Service.PublishNotReadyAddresses field is added to notify DNS addons to publish the notReadyAddresses of Enpdoints. The "service.alpha.kubernetes.io/tolerate-unready-endpoints" annotation has been deprecated and will be removed when clients have sufficient time to consume the field.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 17, 2017
@k8s-github-robot k8s-github-robot added kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Jul 17, 2017
@yujuhong
Copy link
Contributor

@kubernetes/sig-network-pr-reviews

@k8s-ci-robot k8s-ci-robot added the sig/network Categorizes an issue or PR as relevant to SIG Network. label Jul 17, 2017
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
Copy link
Contributor

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.

Copy link
Member Author

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?

Copy link
Contributor

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.

Copy link
Member Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you!

@kow3ns kow3ns force-pushed the promote-service-tue branch 2 times, most recently from a95c847 to 1a6a989 Compare July 17, 2017 23:39
@caseydavenport
Copy link
Member

caseydavenport commented Jul 18, 2017

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.

@kow3ns
Copy link
Member Author

kow3ns commented Jul 18, 2017

@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.

@caseydavenport
Copy link
Member

@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:

Object Versioning: API version name contains beta (e.g. v2beta3)

Which isn't true for Services. Does that mean we just go straight to GA?

@kow3ns
Copy link
Member Author

kow3ns commented Jul 18, 2017

@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.

@kow3ns kow3ns force-pushed the promote-service-tue branch from 1a6a989 to b1150a8 Compare July 18, 2017 05:15
@kow3ns
Copy link
Member Author

kow3ns commented Jul 18, 2017

/test pull-kubernetes-federation-e2e-gce

@kow3ns
Copy link
Member Author

kow3ns commented Jul 18, 2017

@kow3ns
Copy link
Member Author

kow3ns commented Jul 18, 2017

/test pull-kubernetes-federation-e2e-gce

1 similar comment
@kow3ns
Copy link
Member Author

kow3ns commented Jul 18, 2017

/test pull-kubernetes-federation-e2e-gce

@deads2k
Copy link
Contributor

deads2k commented Jul 18, 2017

@kubernetes/sig-api-machinery-misc @lavalamp field promotion

@k8s-ci-robot k8s-ci-robot added the sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. label Jul 18, 2017
@enisoc
Copy link
Member

enisoc commented Jul 18, 2017

@kow3ns wrote:

The annotation is considered to be deprecated but will remain available for a full deprecation cycle.

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?

@liggitt
Copy link
Member

liggitt commented Jul 18, 2017

The annotation is considered to be deprecated but will remain available for a full deprecation cycle.

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.

@kow3ns
Copy link
Member Author

kow3ns commented Jul 18, 2017

@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.

@liggitt
Copy link
Member

liggitt commented Jul 18, 2017

@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.

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?

@liggitt
Copy link
Member

liggitt commented Jul 18, 2017

If you use the annotation, the field is ignored.

That also seems backwards... an alpha-level annotation should not win over a supported field.

@kow3ns
Copy link
Member Author

kow3ns commented Jul 18, 2017

@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.
When I say enabled it by default, I mean there does not appear to have ever been a configurable feature gate to disable this annotation in any environment.

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.

@liggitt
Copy link
Member

liggitt commented Jul 18, 2017

@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 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 release-note-action-required, and note the alpha annotation is no longer honored.

@kow3ns
Copy link
Member Author

kow3ns commented Jul 18, 2017

That also seems backwards... an alpha-level annotation should not win over a supported field.

@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.

  1. The field value defaults to false and the annotation, if present and set to true, overrides the default value allowing the user to maintain the desired behavior across upgrade and rollback scenarios.
  2. When users are confident in the 1.8 cluster, they can modify their services to remove the annotation and set the field to true. They may optionally leave the annotation in place in case they should decide to roll back at some later point.
  3. During this time helm charts, examples, tutorials will work with either the annotation or the field.
  4. During an upgrade to 1.9, we do as you suggest and add the release-note-action-required and a final deprecation notice.

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.

@kow3ns
Copy link
Member Author

kow3ns commented Jul 19, 2017

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,

  1. promote the annotation in 1.8 concurrently with updating kube-dns to the desired behavior.
  2. in 1.9 modify the endpoint controller to the correct behavior, and default to the updated version of kube-dns.

@lavalamp lavalamp removed the sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. label Jul 20, 2017
@bgrant0607
Copy link
Member

@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.

@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 25, 2017
@@ -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 {
Copy link
Contributor

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?

Copy link
Contributor

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

@kow3ns kow3ns force-pushed the promote-service-tue branch from b1150a8 to 30f5ad0 Compare August 4, 2017 16:59
@k8s-github-robot k8s-github-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 4, 2017
@kow3ns
Copy link
Member Author

kow3ns commented Aug 4, 2017

@bgrant0607 as per #49239

@kow3ns kow3ns force-pushed the promote-service-tue branch 2 times, most recently from 38430b3 to 72bd280 Compare August 7, 2017 22:06
@kow3ns
Copy link
Member Author

kow3ns commented Aug 7, 2017

/retest

@bgrant0607
Copy link
Member

/approve

@k8s-github-robot k8s-github-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 8, 2017
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 8, 2017
Kenneth Owens added 2 commits August 9, 2017 15:17
@kow3ns kow3ns force-pushed the promote-service-tue branch from 72bd280 to 8fb609b Compare August 9, 2017 22:20
@k8s-github-robot k8s-github-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 9, 2017
@crimsonfaith91
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 9, 2017
@k8s-github-robot
Copy link

[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 /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@kow3ns
Copy link
Member Author

kow3ns commented Aug 9, 2017

/retest

@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 50418, 49830, 49206, 49061, 49912)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/network Categorizes an issue or PR as relevant to SIG Network. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make TolerateUnreadyEndpointsAnnotation beta