Conversation
Added a section how to use it for troubleshooting the Operator docs
This PR is based on K8SPG-760-Env-vars PR and must be merged after it.
modified: docs/env-var-operator.md
modified: docs/troubleshoot-operator.md
There was a problem hiding this comment.
Pull request overview
This PR adds comprehensive documentation for the Operator environment variables and introduces a new pprof profiling section for troubleshooting. The changes create a new reference page (env-var-operator.md) that documents all available environment variables for configuring the Percona Operator for PostgreSQL, and adds a troubleshooting section on how to use pprof for performance profiling.
Changes:
- Added a complete reference guide for Operator environment variables including
LOG_LEVEL,DISABLE_TELEMETRY,PGO_FEATURE_GATES,LOG_STRUCTURED,PGO_WORKERS,WATCH_NAMESPACE,PGO_NAMESPACE, andPPROF_BIND_ADDRESS - Added a new "Profiling the Operator with pprof" section to the troubleshooting documentation with step-by-step instructions for collecting CPU, memory, and goroutine profiles
- Cross-linked the two documents for easy navigation between environment variable reference and usage instructions
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| docs/env-var-operator.md | New comprehensive reference documentation for all Operator environment variables, including descriptions, default values, examples, and instructions for updating them via kubectl and Helm |
| docs/troubleshoot-operator.md | Added new section on profiling the Operator with pprof, including setup, collection, and analysis instructions with appropriate security warnings |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| * For installations via `kubectl`, edit the Operator Deployment manifest `deploy/operator.yaml` or `deploy/cw-operator.yaml`. Alternatively you can modify the Deployment resource in `deploy/bundle.yaml`, or `deploy/cw-bundle.yaml` files. | ||
| * For Helm installations you can set environment variables through Helm values when you install the `percona/pg-operator` chart. | ||
| * For installations on OpenShift, you can edit the manifests and aplly them with the `oc apply` command. If you installed via the [Operator Lifecycle Manager (OLM)](openshift.md#install-the-operator-via-the-operator-lifecycle-manager-olm), you can configure environment variables through the OLM subscription. |
There was a problem hiding this comment.
Spelling error: "aplly" should be "apply".
| * For installations on OpenShift, you can edit the manifests and aplly them with the `oc apply` command. If you installed via the [Operator Lifecycle Manager (OLM)](openshift.md#install-the-operator-via-the-operator-lifecycle-manager-olm), you can configure environment variables through the OLM subscription. | |
| * For installations on OpenShift, you can edit the manifests and apply them with the `oc apply` command. If you installed via the [Operator Lifecycle Manager (OLM)](openshift.md#install-the-operator-via-the-operator-lifecycle-manager-olm), you can configure environment variables through the OLM subscription. |
|
|
||
| ### `LOG_STRUCTURED` | ||
|
|
||
| Controls whether the Operator outputs logs in a structured JSON format instead of the plain text. Structured logging is useful for log aggregation tools. |
There was a problem hiding this comment.
There is an extra space between "format" and "instead". It should be "JSON format instead of the plain text".
| Controls whether the Operator outputs logs in a structured JSON format instead of the plain text. Structured logging is useful for log aggregation tools. | |
| Controls whether the Operator outputs logs in a structured JSON format instead of the plain text. Structured logging is useful for log aggregation tools. |
|
|
||
| Specifies the Kubernetes namespace where the Operator itself is deployed and runs. The value is set automatically by Kubernetes from `metadata.namespace` via a downward API `fieldRef`. | ||
|
|
||
| This variable is used by the Operator to refer objects like Secrets for the normal functioning of the operator. |
There was a problem hiding this comment.
Inconsistent capitalization: "operator" should be "Operator" to match the convention used throughout the rest of the document where "Operator" is capitalized when referring to the Percona Operator for PostgreSQL.
| This variable is used by the Operator to refer objects like Secrets for the normal functioning of the operator. | |
| This variable is used by the Operator to refer objects like Secrets for the normal functioning of the Operator. |
| * If you set `PGO_WORKERS=4` but only have one PerconaPGCluster object, the operator still reconciles this object serially. | ||
| * If you set `PGO_WORKERS=4` and have two PerconaPGCluster objects (A and B), the operator uses two separate threads to reconcile each object in parallel; however, it always processes events for each individual object sequentially. |
There was a problem hiding this comment.
Inconsistent capitalization: both instances of "operator" should be "Operator" to match the convention used throughout the document when referring to the Percona Operator for PostgreSQL.
| * If you set `PGO_WORKERS=4` but only have one PerconaPGCluster object, the operator still reconciles this object serially. | |
| * If you set `PGO_WORKERS=4` and have two PerconaPGCluster objects (A and B), the operator uses two separate threads to reconcile each object in parallel; however, it always processes events for each individual object sequentially. | |
| * If you set `PGO_WORKERS=4` but only have one PerconaPGCluster object, the Operator still reconciles this object serially. | |
| * If you set `PGO_WORKERS=4` and have two PerconaPGCluster objects (A and B), the Operator uses two separate threads to reconcile each object in parallel; however, it always processes events for each individual object sequentially. |
|
|
||
| ### `LOG_LEVEL` | ||
|
|
||
| Controls the verbosity of the operator's logging output. This helps with debugging and monitoring the Operator behavior. |
There was a problem hiding this comment.
Inconsistent capitalization: "operator's" should be "Operator's" to match the convention used throughout the document when referring to the Percona Operator for PostgreSQL.
| Controls the verbosity of the operator's logging output. This helps with debugging and monitoring the Operator behavior. | |
| Controls the verbosity of the Operator's logging output. This helps with debugging and monitoring the Operator behavior. |
|
|
||
| Enables experimental or advanced features in the Operator. Feature gates allow you to opt into specific functionality that may not be enabled by default. | ||
|
|
||
| The value needs to be a key-value with comma-separated list of feature gates. By default this variable is not set in the Operator. |
There was a problem hiding this comment.
Awkward phrasing: "The value needs to be a key-value with comma-separated list" should be "The value is a comma-separated list of key-value pairs" or "The value is a comma-separated list of feature gate key-value pairs" for better clarity.
| The value needs to be a key-value with comma-separated list of feature gates. By default this variable is not set in the Operator. | |
| The value is a comma-separated list of feature gate key-value pairs. By default this variable is not set in the Operator. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Added a section how to use it for troubleshooting the Operator docs
This PR is based on K8SPG-760-Env-vars PR and must be merged after it.