operator-sdk
operator-sdk copied to clipboard
Document setting logging with Kustomize
Description of the change:
Add a short example showing how to configure the Zap log level for the operator with Kustomize.
Patches https://sdk.operatorframework.io/docs/building-operators/golang/references/logging/
Motivation for the change:
The Zap logger framework does not appear to support using environment-variables for setting the log level etc, so users need to be able to modify the command line to set log levels.
Kustomize is very commonly used to deploy operators. Document how to set the log level with a Kustomize patch, without having to copy the whole Deployment and hack it by hand.
Ideally the controller would support log level configuration in the environment and document it, so a simple ConfigMap with envFrom could be used to control logging instead. But in the absence of this, documenting how to set up log levels somehow is desirable.
Checklist
If the pull request includes user-facing changes, extra documentation is required:
- [ ] Add a new changelog fragment in
changelog/fragments(seechangelog/fragments/00-template.yaml) n/a - [ ] Add or update relevant sections of the docs website in
website/content/en/docsn/a
On a semi-related side-note, Kustomize's inability to use xpath/jsonpath like selectors to match patch targets is agony - we can't write /spec/template/spec/containers/[?.name=="controller-manager"]/args/- for example...
@jmrodri I've merged your changes. I will need to satisfy the DCO too, then I can merge this.
@jmrodri I have rebased to apply your wording changes as fixups to this PR to make the DCO checker happy. Once your approval state is changed I will merge. Thanks for the review.
Failed to merge because
External link https://kind.sigs.k8s.io/ failed: got a time out (response code 0)
@jmrodri
Suspect just needs a retry
Issues go stale after 90d of inactivity.
Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.
If this issue is safe to close now please do so with /close.
/lifecycle stale
Stale issues rot after 30d of inactivity.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen.
If this issue is safe to close now please do so with /close.
/lifecycle rotten /remove-lifecycle stale
/lifecycle frozen
@jmrodri: The lifecycle/frozen label cannot be applied to Pull Requests.
In response to this:
/lifecycle frozen
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.
Rotten issues close after 30d of inactivity.
Reopen the issue by commenting /reopen.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Exclude this issue from closing again by commenting /lifecycle frozen.
/close
@openshift-bot: Closed this PR.
In response to this:
Rotten issues close after 30d of inactivity.
Reopen the issue by commenting
/reopen. Mark the issue as fresh by commenting/remove-lifecycle rotten. Exclude this issue from closing again by commenting/lifecycle frozen./close
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.