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

wait on startup to get permissions #1858

Merged
merged 1 commit into from
Nov 17, 2022
Merged

Conversation

aojea
Copy link
Member

@aojea aojea commented Nov 12, 2022

The glbc component needs to get a CRD and have permission to read it, this is not inmidiate when bootstrapping a cluster so, instead of crashing and depending on a external component to restart the pod, we can active poll on this conditions before crashing.

This has the benefit of reducing the noise on the logs with panics, that may be misinterpreted by external tools processing the logs. It also improves the bootstrap latency.

We can observe this behavior in any of the jobs

F1112 06:42:03.275192       1 main.go:115] Failed to ensure BackendConfig CRD: failed to verify the existence of BackendConfig CRD: customresourcedefinitions.apiextensions.k8s.io "backendconfigs.cloud.google.com" is forbidden: User "system:controller:glbc" cannot get resource "customresourcedefinitions" in API group "apiextensions.k8s.io" at the cluster scope
goroutine 1 [running]:
k8s.io/klog/v2.stacks(0x1)

where the glbc controller panics multiple times because it does not has permissions
https://storage.googleapis.com/kubernetes-jenkins/logs/ci-ingress-gce-e2e/1591319036715601920/artifacts/e2e-c4f27e13ef-58614-master/glbc.log

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Nov 12, 2022
@aojea
Copy link
Member Author

aojea commented Nov 12, 2022

/assign @swetharepakula @spencerhance

just taking any of the jobs runs we can see these panics on the logs https://storage.googleapis.com/kubernetes-jenkins/logs/ci-ingress-gce-e2e/1591319036715601920/artifacts/e2e-c4f27e13ef-58614-master/glbc.log

The time of 1 minute is taken from the observation of that logs

@k8s-ci-robot
Copy link
Contributor

@aojea: GitHub didn't allow me to assign the following users: spencerhance.

Note that only kubernetes members with read permissions, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time.
For more information please see the contributor guide

In response to this:

/assign @swetharepakula @spencerhance

just taking any of the jobs runs we can see these panics on the logs https://storage.googleapis.com/kubernetes-jenkins/logs/ci-ingress-gce-e2e/1591319036715601920/artifacts/e2e-c4f27e13ef-58614-master/glbc.log

The time of 1 minute is taken from the observation of that logs

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.

Copy link
Contributor

@spencerhance spencerhance left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

cmd/glbc/main.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Nov 13, 2022
@aojea
Copy link
Member Author

aojea commented Nov 13, 2022

/hold

missing tests

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 13, 2022
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 13, 2022
@aojea
Copy link
Member Author

aojea commented Nov 13, 2022

/hold cancel

now I think I got it right

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 13, 2022
Copy link
Contributor

@spencerhance spencerhance left a comment

Choose a reason for hiding this comment

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

lgtm👍

return false, fmt.Errorf("failed to verify the existence of %v CRD: %v", meta.kind, err)
}
// CRD exists, get current resource version and update it
updateCRD = true
Copy link
Member

Choose a reason for hiding this comment

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

In a followup we should check if we even need to ensure. The case I am thinking is say we graduate an API, but had to rollback. We will fail here because in the rollback we try ensure a version without the graduated API.

@swetharepakula
Copy link
Member

Thanks Antonio!

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 17, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aojea, spencerhance, swetharepakula

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:

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 17, 2022
@k8s-ci-robot k8s-ci-robot merged commit 3249bbc into kubernetes:master Nov 17, 2022
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. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants