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

Validate more static pods on masters #9049

Merged
merged 2 commits into from
May 4, 2020

Conversation

johngmyers
Copy link
Member

@johngmyers johngmyers commented May 3, 2020

This should cut down on cluster validation flapping.

Not testing the etcd pods as their k8s-app annotation depends on whether or not the cluster is configured to use etcd-manager. (It's also unlikely kube-apiserver would be ready without them.) Not testing kube-proxy pods because whether or not they're supposed to be there depends on the cluster spec.

Suppressing the static pod checks on non-ready nodes to cut down on redundant failure messages.
/area rolling-update

@k8s-ci-robot k8s-ci-robot added area/rolling-update cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 3, 2020
var masterStaticPods = []string{
"kube-apiserver",
"kube-controller-manager",
"kube-scheduler",
Copy link
Member

Choose a reason for hiding this comment

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

Just curious, do etcd-manager-* startic pods get checked also?

Copy link
Member Author

@johngmyers johngmyers May 4, 2020

Choose a reason for hiding this comment

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

No. If the cluster uses the legacy etcd provider there won't be any etcd-manager-* pods. Checking the cluster's spec would add a lot of complexity. I suspect the kube-apiserver pods won't be able to go into ready state without etcd pods.

Copy link
Member

Choose a reason for hiding this comment

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

OK, probably not worth the trouble for now. Thanks.

@hakman
Copy link
Member

hakman commented May 4, 2020

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 4, 2020
delete(masterWithoutManager, nodeByAddress[pod.Status.HostIP])
app := pod.GetLabels()["k8s-app"]
if pod.Namespace == "kube-system" && masterWithoutPod[nodeByAddress[pod.Status.HostIP]][app] {
delete(masterWithoutPod[nodeByAddress[pod.Status.HostIP]], app)
Copy link
Member

Choose a reason for hiding this comment

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

This does assume that all the pods are static pods; that's true I believe. I do wonder why we did it this way, it looks like spec.nodeName is populated on the pods when I checked.

@justinsb
Copy link
Member

justinsb commented May 4, 2020

Thanks @johngmyers - looks great. Not sure why we're not using spec.nodeName - maybe that is only populated in recent k8s versions? (Do you remember?)

/approve
/lgtm

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: johngmyers, justinsb

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 May 4, 2020
@k8s-ci-robot k8s-ci-robot merged commit 7da181e into kubernetes:master May 4, 2020
@k8s-ci-robot k8s-ci-robot added this to the v1.18 milestone May 4, 2020
@johngmyers johngmyers deleted the validate-more-static branch May 4, 2020 18:17
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. area/rolling-update 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.

None yet

4 participants