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

Disable some flags in kube-apiserver when logging-format is not text #13264

Merged
merged 1 commit into from
Feb 17, 2022

Conversation

h3poteto
Copy link
Contributor

Fixes #13245

Disable these flags because these are not accepted when I use json as logging-format.

  • --logtostderr
  • --alsologtostderr
  • --log-file

According to Kubernetes document:

Non-default formats don't honor these flags: --add-dir-header, --alsologtostderr, --log-backtrace-at, --log-dir, --log-file, --log-file-max-size, --logtostderr, --one-output, --skip-headers, --skip-log-headers, --stderrthreshold, --vmodule.

https://kubernetes.io/docs/reference/command-line-tools-reference/kube-apiserver/

And when I specify these flags, kube-apiserver says an error.

Disable these flags because these are not accepted.
* --logtostderr
* --alsologtostderr
* --log-file
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 16, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @h3poteto. Thanks for your PR.

I'm waiting for a kubernetes 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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Feb 16, 2022
@hakman
Copy link
Member

hakman commented Feb 16, 2022

/ok-to-test

@k8s-ci-robot k8s-ci-robot 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 Feb 16, 2022
"--logtostderr=false", // https://github.com/kubernetes/klog/issues/60
"--alsologtostderr",
"--log-file=/var/log/kube-apiserver.log")
if kubeAPIServer.LogFormat != "" && kubeAPIServer.LogFormat != "text" {
Copy link
Member

Choose a reason for hiding this comment

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

Should this be done for b.IsKubernetesGTE("1.23") too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, when Kubernetes version is greater than 1.23, we use go-runner and we don't specify these logging options as kube-apiserver's flags. So it is no problem.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hakman

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 lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Feb 17, 2022
k8s-ci-robot added a commit that referenced this pull request Feb 17, 2022
…-upstream-release-1.22

Automated cherry pick of #13264: Disable some flags in kube-apiserver when logging-format is
@h3poteto
Copy link
Contributor Author

/retest

k8s-ci-robot added a commit that referenced this pull request Feb 17, 2022
…-upstream-release-1.23

Automated cherry pick of #13264: Disable some flags in kube-apiserver when logging-format is
@k8s-ci-robot k8s-ci-robot merged commit 49776c1 into kubernetes:master Feb 17, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.24 milestone Feb 17, 2022
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/nodeup 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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

kube-apiserver crashes after setting "logFormat: json"
3 participants