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

🌱 Add log level for kube components patch to ClusterClass #9493

Conversation

killianmuldoon
Copy link
Contributor

@killianmuldoon killianmuldoon commented Sep 25, 2023

Adds svariables and matching patches to set log levels for topology based clusters in e2e. The motivation for adding this is to help debug #8816.

The patch is enabled for that test in this PR, but this seems like a generally useful flag for helping debug e2e tests.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-area PR is missing an area label size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 25, 2023
Copy link
Contributor Author

@killianmuldoon killianmuldoon left a comment

Choose a reason for hiding this comment

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

/area e2e-testing

@nawazkh @kubernetes-sigs/cluster-api-release-team

@k8s-ci-robot k8s-ci-robot added area/e2e-testing Issues or PRs related to e2e testing and removed do-not-merge/needs-area PR is missing an area label labels Sep 25, 2023
@killianmuldoon
Copy link
Contributor Author

/test

@k8s-ci-robot
Copy link
Contributor

@killianmuldoon: The /test command needs one or more targets.
The following commands are available to trigger required jobs:

  • /test pull-cluster-api-build-main
  • /test pull-cluster-api-e2e-full-dualstack-and-ipv6-main
  • /test pull-cluster-api-e2e-full-main
  • /test pull-cluster-api-e2e-main
  • /test pull-cluster-api-e2e-mink8s-main
  • /test pull-cluster-api-e2e-workload-upgrade-1-28-latest-main
  • /test pull-cluster-api-test-main
  • /test pull-cluster-api-test-mink8s-main
  • /test pull-cluster-api-verify-main

The following commands are available to trigger optional jobs:

  • /test pull-cluster-api-apidiff-main
  • /test pull-cluster-api-e2e-scale-main-experimental

Use /test all to run the following jobs that were automatically triggered:

  • pull-cluster-api-apidiff-main
  • pull-cluster-api-build-main
  • pull-cluster-api-e2e-main
  • pull-cluster-api-test-main
  • pull-cluster-api-verify-main

In response to this:

/test

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.

@killianmuldoon
Copy link
Contributor Author

/test pull-cluster-api-e2e-full-dualstack-and-ipv6-main

Copy link
Member

@chrischdi chrischdi left a comment

Choose a reason for hiding this comment

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

/lgtm

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

LGTM label has been added.

Git tree hash: bf926fb99a46ca66bc23bad02b9a1319d91a4691

@killianmuldoon
Copy link
Contributor Author

I'll merge this once I've taken a look at the output logs in the dualstack tests where it's enabled.

@fabriziopandini
Copy link
Member

/lgtm
we can eventually iterate later and make this more flexible

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 25, 2023
@killianmuldoon
Copy link
Contributor Author

/test pull-cluster-api-e2e-full-dualstack-and-ipv6-main

@killianmuldoon
Copy link
Contributor Author

/test pull-cluster-api-e2e-full-dualstack-and-ipv6-main

@killianmuldoon
Copy link
Contributor Author

/test pull-cluster-api-e2e-full-dualstack-and-ipv6-main

@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 Sep 26, 2023
@killianmuldoon killianmuldoon changed the title 🌱 Add debug logging patch to ClusterClass 🌱 Add log level for kube components patch to ClusterClass Sep 26, 2023
@killianmuldoon
Copy link
Contributor Author

killianmuldoon commented Sep 26, 2023

Updated this so there's two variables - one for the kube control plane and another for kubelets. I think that's broken down enough for our needs - kubelet doesn't tend to log much in our tests as we don't schedule many pods. Log level 4 is way too high for the api server and the controller-manager though.

I looked at the kind tests where they set log level 4 and they end up with multiple files and don't have all of the logs from the test run AFAICT. Log level 2 seems like it will be useful for figuring out what's going wrong in the flake

@killianmuldoon
Copy link
Contributor Author

Looks in working order now - the output with the higher log levels is here

Comment on lines 133 to 144
- name: kubeControlPlaneLogLevel
schema:
openAPIV3Schema:
type: string
description: "Log level for kube-apiserver, kube-scheduler and kube-controller-manager"
default: "0"
- name: kubeletLogLevel
schema:
openAPIV3Schema:
type: string
description: "Log level for kubelets on control plane and worker nodes"
default: "0"
Copy link
Member

Choose a reason for hiding this comment

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

NIT!

Suggested change
- name: kubeControlPlaneLogLevel
schema:
openAPIV3Schema:
type: string
description: "Log level for kube-apiserver, kube-scheduler and kube-controller-manager"
default: "0"
- name: kubeletLogLevel
schema:
openAPIV3Schema:
type: string
description: "Log level for kubelets on control plane and worker nodes"
default: "0"
- name: kubeControlPlaneLogLevel
schema:
openAPIV3Schema:
type: string
description: "Log level for kube-apiserver, kube-scheduler and kube-controller-manager"
default: ""
- name: kubeletLogLevel
schema:
openAPIV3Schema:
type: string
description: "Log level for kubelets on control plane and worker nodes"
default: ""

I'd suggest to default to empty string and not patch if the value is empty string (enabledIf). This way we would always keep the default. (may require to split the patch with regards to the variables)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should be done now

@killianmuldoon
Copy link
Contributor Author

I'll also have to cherry-pick this back to v1.5 manually so we get coverage there for the flakes in the test. Can't auto-cherry-pick because of the MachinePool stuff.

@killianmuldoon
Copy link
Contributor Author

/retest

@killianmuldoon
Copy link
Contributor Author

I verified this locally - but I can add PR-Blocking to the test if you want to be sure it works. Just don't want to have to run the full dualstack suite again to see some log lines 😅

@killianmuldoon
Copy link
Contributor Author

/hold

For CI run with blocking on the dualstack test.

@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 Sep 26, 2023
@killianmuldoon
Copy link
Contributor Author

Going to revert the PR-Blocking change: Logs from the run are here if you'd like to compare: https://gcsweb.k8s.io/gcs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_cluster-api/9493/pull-cluster-api-e2e-main/1706665816436510720/artifacts/clusters/

Signed-off-by: killianmuldoon <kmuldoon@vmware.com>
@killianmuldoon
Copy link
Contributor Author

/hold cancel

@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 Sep 26, 2023
Copy link
Member

@chrischdi chrischdi left a comment

Choose a reason for hiding this comment

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

/lgtm

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

LGTM label has been added.

Git tree hash: e424ec3c5e608f0abdee5c3b3df1ee3fb21ed586

@killianmuldoon
Copy link
Contributor Author

Thanks for the help with this one @chrischdi!

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: killianmuldoon

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 Sep 26, 2023
@k8s-ci-robot k8s-ci-robot merged commit 8d0dc91 into kubernetes-sigs:main Sep 26, 2023
20 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.6 milestone Sep 26, 2023
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/e2e-testing Issues or PRs related to e2e testing 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