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

HOSTEDCP-1553: Add annotation to customize log verbosity of kube-apiserver #4026

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jared-hayes-dev
Copy link

What this PR does / why we need it:
Adds annotation to support configuring kube-apiserver log verbosity to a value higher than default of 2.

Which issue(s) this PR fixes (optional, use fixes #<issue_number>(, fixes #<issue_number>, ...) format, where issue_number might be a GitHub issue, or a Jira story:
Fixes # https://issues.redhat.com/browse/OCPBUGS-32763

Checklist

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

@openshift-ci openshift-ci bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/needs-area needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 13, 2024
Copy link
Contributor

openshift-ci bot commented May 13, 2024

Hi @jared-hayes-dev. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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-sigs/prow repository.

@openshift-ci openshift-ci bot added area/control-plane-operator Indicates the PR includes changes for the control plane operator - in an OCP release area/hypershift-operator Indicates the PR includes changes for the hypershift operator and API - outside an OCP release and removed do-not-merge/needs-area labels May 13, 2024
@rtheis
Copy link
Contributor

rtheis commented May 13, 2024

/ok-to-test

@openshift-ci openshift-ci bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 13, 2024
@rtheis
Copy link
Contributor

rtheis commented May 13, 2024

/retitle HOSTEDCP-1553: Add annotation to customize log verbosity of kube-apiserver

@openshift-ci openshift-ci bot changed the title Add annotation to customize log verbosity of kube-apiserver HOSTEDCP-1553: Add annotation to customize log verbosity of kube-apiserver May 13, 2024
@openshift-ci-robot
Copy link

openshift-ci-robot commented May 13, 2024

@jared-hayes-dev: This pull request references HOSTEDCP-1553 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the epic to target the "4.16.0" version, but no target version was set.

In response to this:

What this PR does / why we need it:
Adds annotation to support configuring kube-apiserver log verbosity to a value higher than default of 2.

Which issue(s) this PR fixes (optional, use fixes #<issue_number>(, fixes #<issue_number>, ...) format, where issue_number might be a GitHub issue, or a Jira story:
Fixes # https://issues.redhat.com/browse/OCPBUGS-32763

Checklist

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label May 13, 2024
@@ -429,10 +429,17 @@ func buildKASContainerMain(image string, port int32, noProxyCIDRs []string, hcp
c.Command = []string{
"hyperkube",
}

// default to level of 2
kasVerbosityLevel := "-v2"
Copy link
Contributor

Choose a reason for hiding this comment

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

Just for my sanity, if we have --v=%d for others, mirror it here with --v=2


// default to level of 2
kasVerbosityLevel := "-v2"
if hcp.Annotations[hyperv1.KubeAPIServerVerbosityLevelAnnotation] != "" {
Copy link
Contributor

Choose a reason for hiding this comment

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

We should parse this as an integer and ignore it or error if it's not one - passing --v=whatever will crash the KAS.

kasAnnotationValue := hcp.Annotations[hyperv1.KubeAPIServerVerbosityLevelAnnotation]
_, err := strconv.Atoi(kasAnnotationValue)
// ensure integer value in annotation
if err == nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure what our stance is for the other annotations-as-APIs but exposing the error, when one exists, into status somewhere would help users understand why their attempt at influencing the log level is being ignored.

Copy link
Contributor

Choose a reason for hiding this comment

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

@stevekuznetsov a comment in the Jira indicates that we probably need a logging section in the HCP CRD. This of course would take a fair amount of work. As a alternative to this PR as it is now and a full HCP CRD update, would it be acceptable to default KAS logging to v3 instead of v2? Or maybe allow IBM Cloud to just set v3? We (IBM) rely on v3 log level to help us debug problems.

Copy link
Author

Choose a reason for hiding this comment

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

@stevekuznetsov bump on above comment. Do you have any feedback on this? If more changes are required around logging we would prefer to just bump the default verbosity level instead if that is acceptable.

_, err := strconv.Atoi(kasAnnotationValue)
// ensure integer value in annotation
if err == nil {
kasVerbosityLevel = fmt.Sprintf("--v=%s", kasAnnotationValue)
Copy link
Contributor

Choose a reason for hiding this comment

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

%d, use the int

@jared-hayes-dev jared-hayes-dev marked this pull request as ready for review May 16, 2024 14:54
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 16, 2024
@openshift-ci openshift-ci bot requested review from enxebre and sjenning May 16, 2024 14:58
@jeffnowicki
Copy link

/jira refresh

@openshift-ci-robot
Copy link

openshift-ci-robot commented May 16, 2024

@jeffnowicki: This pull request references HOSTEDCP-1553 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the epic to target only the "4.16.0" version, but multiple target versions were set.

In response to this:

/jira refresh

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 openshift-eng/jira-lifecycle-plugin repository.

@jeffnowicki
Copy link

/jira refresh

@openshift-ci-robot
Copy link

openshift-ci-robot commented May 16, 2024

@jeffnowicki: This pull request references HOSTEDCP-1553 which is a valid jira issue.

In response to this:

/jira refresh

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 openshift-eng/jira-lifecycle-plugin repository.

@jared-hayes-dev
Copy link
Author

/retest-required

1 similar comment
@jared-hayes-dev
Copy link
Author

/retest-required

@jared-hayes-dev
Copy link
Author

/retest-required

@muraee
Copy link
Contributor

muraee commented May 27, 2024

/approve

Copy link
Contributor

openshift-ci bot commented May 27, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jared-hayes-dev, muraee

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 27, 2024
@jared-hayes-dev
Copy link
Author

/retest-required

@jared-hayes-dev
Copy link
Author

/retest

Copy link
Contributor

openshift-ci bot commented May 28, 2024

@jared-hayes-dev: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-ibmcloud-roks 91a50a0 link false /test e2e-ibmcloud-roks
ci/prow/e2e-azure 91a50a0 link false /test e2e-azure
ci/prow/e2e-ibmcloud-iks 91a50a0 link false /test e2e-ibmcloud-iks

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-sigs/prow repository. I understand the commands that are listed here.

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/control-plane-operator Indicates the PR includes changes for the control plane operator - in an OCP release area/hypershift-operator Indicates the PR includes changes for the hypershift operator and API - outside an OCP release jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. ok-to-test Indicates a non-member PR verified by an org member that is safe to test.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants