-
Notifications
You must be signed in to change notification settings - Fork 296
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
base: main
Are you sure you want to change the base?
HOSTEDCP-1553: Add annotation to customize log verbosity of kube-apiserver #4026
Conversation
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 Once the patch is verified, the new status will be reflected by the 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. |
/ok-to-test |
/retitle HOSTEDCP-1553: Add annotation to customize log verbosity of kube-apiserver |
@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:
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. |
@@ -429,10 +429,17 @@ func buildKASContainerMain(image string, port int32, noProxyCIDRs []string, hcp | |||
c.Command = []string{ | |||
"hyperkube", | |||
} | |||
|
|||
// default to level of 2 | |||
kasVerbosityLevel := "-v2" |
There was a problem hiding this comment.
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] != "" { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
%d
, use the int
/jira refresh |
@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:
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. |
/jira refresh |
@jeffnowicki: This pull request references HOSTEDCP-1553 which is a valid jira issue. In response to this:
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. |
/retest-required |
1 similar comment
/retest-required |
0c57cab
to
91a50a0
Compare
/retest-required |
/approve |
[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 |
/retest-required |
/retest |
@jared-hayes-dev: The following tests failed, say
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. |
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