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

Bug 1900989: Move idle check from endpoints to service #225

Merged
merged 1 commit into from
Jan 28, 2021

Conversation

frobware
Copy link
Contributor

@frobware frobware commented Nov 27, 2020

As we have moved to endpointslices we now check the service for the
idled annotation. oc idle has been updated to annotate the service.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1900989

@frobware frobware changed the title Ensure idled services work with endpointslices Bug 1900989: Ensure idled services work with endpointslices Nov 27, 2020
@openshift-ci-robot openshift-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. labels Nov 27, 2020
@frobware
Copy link
Contributor Author

/hold

@openshift-ci-robot
Copy link
Contributor

@frobware: This pull request references Bugzilla bug 1900989, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.7.0) matches configured target release for branch (4.7.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1900989: Ensure idled services work with endpointslices

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot added bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Nov 27, 2020
@frobware frobware changed the title Bug 1900989: Ensure idled services work with endpointslices [WIP] Bug 1900989: Ensure idled services work with endpointslices Nov 30, 2020
@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 30, 2020
@frobware
Copy link
Contributor Author

Installing from initial release registry.build02.ci.openshift.org/ci-op-t951pb9z/release@sha256:b0b724e3b077f637528f0ea67b196214e5f661148a7873bbdd2173730a3dc41a
level=info msg=Credentials loaded from environment variable "GOOGLE_CLOUD_KEYFILE_JSON", file "/etc/openshift-installer/gce.json"
level=warning msg=Found override for release image. Please be warned, this is not advised
level=info msg=Consuming Install Config from target directory
level=fatal msg=failed to fetch Cluster: failed to fetch dependency of "Cluster": failed to generate asset "Platform Provisioning Check": baseDomain: Internal error: failed to list DNS Zones: googleapi: Error 429: Resource has been exhausted (e.g. check quota)., rateLimitExceeded

/test e2e-upgrade

@frobware
Copy link
Contributor Author

/test images

@openshift-merge-robot
Copy link
Contributor

@frobware: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/e2e-agnostic 25378d0 link /test e2e-agnostic

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 5, 2020
@frobware
Copy link
Contributor Author

frobware commented Jan 4, 2021

/retest

@sgreene570
Copy link

An oc idle <service> will annotate the endpoint with an 'idle time'
annotation. We don't or can't add this annotation to endpointslices in
openshift/oc (idle) because the underlying endpointslices are managed
by the kube-controller-manager and that doesn't propagate annotations
as part of the mirroring service.

Is it at all possible to have oc idle pick up the endpointslice for a service and annotate that directly?

@frobware
Copy link
Contributor Author

frobware commented Jan 6, 2021

Is it at all possible to have oc idle pick up the endpointslice for a service and annotate that directly?

This was my first thought too. And this is how I initially implemented it. But it turns out that the endpointslice is managed by the endpoints/endpointslice mirroring service so although you can annotate the endpointslice and, with good luck/timing you do see that delivered, it is soon overwritten by the mirroring service. I got caught out when testing this because the first few times it worked (as in I received and endpointslice with the expected annotation) but sometimes I was stepping through the behaviour in the debugger and I noticed that sometimes the annotation had disappeared.

@frobware
Copy link
Contributor Author

We may be better off carrying kubernetes/kubernetes#98116

@frobware
Copy link
Contributor Author

frobware commented Jan 19, 2021

This is the fix: openshift/openshift-controller-manager#159

@frobware
Copy link
Contributor Author

/hold

@aojea
Copy link

aojea commented Jan 19, 2021

/cc

@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 19, 2021
@openshift-ci-robot
Copy link
Contributor

@frobware: This pull request references Bugzilla bug 1900989, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.7.0) matches configured target release for branch (4.7.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

[WIP] Bug 1900989: Ensure idled services work with endpointslices

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@frobware frobware changed the title [WIP] Bug 1900989: Ensure idled services work with endpointslices Bug 1900989: Move idle check from endpoints to service Jan 27, 2021
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 27, 2021
@frobware
Copy link
Contributor Author

/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 27, 2021
@frobware
Copy link
Contributor Author

Is it at all possible to have oc idle pick up the endpointslice for a service and annotate that directly?

We're now annotating the service; see openshift/oc#720

svcSubset := kapi.EndpointSubset{
Addresses: []kapi.EndpointAddress{
{
IP: service.Spec.ClusterIP,
Copy link

Choose a reason for hiding this comment

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

just FYI, with dual stack this will be an slice service.Spec.ClusterIPs

Choose a reason for hiding this comment

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

Spoke with @frobware, we can address this in a follow-up

Comment on lines +259 to +260
for i := range subsets {
if len(subsets[i].Addresses) > 0 {

Choose a reason for hiding this comment

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

Suggested change
for i := range subsets {
if len(subsets[i].Addresses) > 0 {
for _, subset := range subsets {
if len(subset.Addresses) > 0 {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why bother with the copy? It's not zero cost vis-a-vis accessing via the index.

Choose a reason for hiding this comment

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

Consistency, I guess. But you do bring up a point about the copy, so I don't feel strongly enough to contend.

pkg/router/template/plugin.go Show resolved Hide resolved
As we have moved to endpointslices we now check the service for the
idled annotation. `oc idle` has been updated to annotate the service.
@sgreene570
Copy link

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 27, 2021
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: frobware, sgreene570

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [frobware,sgreene570]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit 30e2fb5 into openshift:master Jan 28, 2021
@openshift-ci-robot
Copy link
Contributor

@frobware: Some pull requests linked via external trackers have merged:

The following pull requests linked via external trackers have not merged:

These pull request must merge or be unlinked from the Bugzilla bug in order for it to move to the next state. Once unlinked, request a bug refresh with /bugzilla refresh.

Bugzilla bug 1900989 has not been moved to the MODIFIED state.

In response to this:

Bug 1900989: Move idle check from endpoints to service

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

frobware pushed a commit to frobware/openshift-controller-manager that referenced this pull request Jan 28, 2021
The router (in 4.7) has moved to using endpointslices. Rather than
annotating both endpoints and endpointslices oc/idle will now annotate
the service associated with the endpoints. Similarly unidling now
needs to remove those idle annotations from the service.

- openshift/oc#720
- openshift/router#225
frobware added a commit to frobware/openshift-apiserver that referenced this pull request Jan 29, 2021
oc/idle is now updating the service in addition to the endpoints when
idling.

Related PRs:

- openshift/openshift-controller-manager#165
- openshift/oc#720
- openshift/router#225
- openshift/sdn#252
frobware added a commit to frobware/origin that referenced this pull request Jan 29, 2021
oc/idle will now additionally annotate the service. The test
explicitly deletes it so removing that call so that we can verify the
following PRs, all related to annotating the service when idling.

- openshift/oc#720
- openshift/router#225
- openshift/sdn#252
- openshift/openshift-apiserver#180
- openshift/openshift-controller-manager#165
openshift-cherrypick-robot pushed a commit to openshift-cherrypick-robot/openshift-apiserver that referenced this pull request Feb 3, 2021
oc/idle is now updating the service in addition to the endpoints when
idling.

Related PRs:

- openshift/openshift-controller-manager#165
- openshift/oc#720
- openshift/router#225
- openshift/sdn#252
openshift-cherrypick-robot pushed a commit to openshift-cherrypick-robot/openshift-controller-manager that referenced this pull request Feb 3, 2021
The router (in 4.7) has moved to using endpointslices. Rather than
annotating both endpoints and endpointslices oc/idle will now annotate
the service associated with the endpoints. Similarly unidling now
needs to remove those idle annotations from the service.

- openshift/oc#720
- openshift/router#225
@frobware
Copy link
Contributor Author

frobware commented Feb 5, 2021

/cherry-pick release-4.6

@openshift-cherrypick-robot

@frobware: new pull request created: #253

In response to this:

/cherry-pick release-4.6

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

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. bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants