operator-sdk icon indicating copy to clipboard operation
operator-sdk copied to clipboard

Document setting logging with Kustomize

Open ringerc opened this issue 3 years ago • 5 comments
trafficstars

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:

ringerc avatar May 13 '22 02:05 ringerc

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...

ringerc avatar May 13 '22 02:05 ringerc

@jmrodri I've merged your changes. I will need to satisfy the DCO too, then I can merge this.

ringerc avatar Jun 04 '22 01:06 ringerc

@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.

ringerc avatar Jun 04 '22 01:06 ringerc

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

ringerc avatar Jun 09 '22 04:06 ringerc

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

openshift-bot avatar Sep 07 '22 09:09 openshift-bot

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

openshift-bot avatar Oct 08 '22 00:10 openshift-bot

/lifecycle frozen

jmrodri avatar Oct 08 '22 00:10 jmrodri

@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.

openshift-ci[bot] avatar Oct 08 '22 00:10 openshift-ci[bot]

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 avatar Nov 07 '22 08:11 openshift-bot

@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.

openshift-ci[bot] avatar Nov 07 '22 08:11 openshift-ci[bot]