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

Merged

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

@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
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label May 31, 2024
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 1, 2024
@rtheis
Copy link
Contributor

rtheis commented Jun 3, 2024

@jared-hayes-dev please rebase your PR.

@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Jun 3, 2024
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 3, 2024
@jared-hayes-dev
Copy link
Author

/retest

6 similar comments
@jared-hayes-dev
Copy link
Author

/retest

@rtheis
Copy link
Contributor

rtheis commented Jun 4, 2024

/retest

@jared-hayes-dev
Copy link
Author

/retest

@jared-hayes-dev
Copy link
Author

/retest

@rtheis
Copy link
Contributor

rtheis commented Jun 5, 2024

/retest

@jared-hayes-dev
Copy link
Author

/retest

Copy link
Contributor

@rtheis rtheis left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jun 6, 2024
Copy link
Contributor

openshift-ci bot commented Jun 6, 2024

[APPROVALNOTIFIER] This PR is APPROVED

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

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

@jared-hayes-dev
Copy link
Author

/retest

Copy link
Contributor

openshift-ci bot commented Jun 6, 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-iks 4aff1a1 link false /test e2e-ibmcloud-iks
ci/prow/e2e-azure 4aff1a1 link false /test e2e-azure
ci/prow/e2e-ibmcloud-roks 4aff1a1 link false /test e2e-ibmcloud-roks

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.

@jared-hayes-dev
Copy link
Author

/retest

@openshift-merge-bot openshift-merge-bot bot merged commit a283cf0 into openshift:main Jun 7, 2024
13 of 16 checks passed
@rtheis
Copy link
Contributor

rtheis commented Jun 7, 2024

/cherry-pick release-4.16

@rtheis
Copy link
Contributor

rtheis commented Jun 7, 2024

/cherry-pick release-4.15

@rtheis
Copy link
Contributor

rtheis commented Jun 7, 2024

/cherry-pick release-4.16

@openshift-cherrypick-robot

@rtheis: #4026 failed to apply on top of branch "release-4.16":

Applying: rebase + merge conflicts
Using index info to reconstruct a base tree...
M	api/hypershift/v1beta1/hostedcluster_types.go
M	hypershift-operator/controllers/hostedcluster/hostedcluster_controller.go
Falling back to patching base and 3-way merge...
Auto-merging hypershift-operator/controllers/hostedcluster/hostedcluster_controller.go
Auto-merging api/hypershift/v1beta1/hostedcluster_types.go
CONFLICT (content): Merge conflict in api/hypershift/v1beta1/hostedcluster_types.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 rebase + merge conflicts
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-4.16

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.

@rtheis
Copy link
Contributor

rtheis commented Jun 7, 2024

@jared-hayes-dev please manually cherry-pick this change to 4.16 and 4.15.

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. lgtm Indicates that a PR is ready to be merged. 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

8 participants