From 6c9bb00882bd9adb2cd70d8a439acd9941a9df0a Mon Sep 17 00:00:00 2001 From: Amit <5795880+amacvar@users.noreply.github.com> Date: Tue, 4 Aug 2026 01:05:26 -0400 Subject: [PATCH 1/2] Update kubectl-plugin.mdx fixed mixed sh and output sections into their own boxes for easier copy paste --- .../1/kubectl-plugin.mdx | 48 +++++++++++++------ 1 file changed, 34 insertions(+), 14 deletions(-) diff --git a/product_docs/docs/postgres_for_kubernetes/1/kubectl-plugin.mdx b/product_docs/docs/postgres_for_kubernetes/1/kubectl-plugin.mdx index a80192fff6e..60ed774aa0f 100644 --- a/product_docs/docs/postgres_for_kubernetes/1/kubectl-plugin.mdx +++ b/product_docs/docs/postgres_for_kubernetes/1/kubectl-plugin.mdx @@ -46,8 +46,11 @@ wget https://github.com/EnterpriseDB/kubectl-cnp/releases/download/v1.30.0/kubec Then, with superuser privileges, install from the local file using `dpkg`: -```console -$ sudo dpkg -i kube-plugin.deb +```sh +sudo dpkg -i kube-plugin.deb +``` + +```output Selecting previously unselected package cnp. (Reading database ... 6688 files and directories currently installed.) Preparing to unpack kube-plugin.deb ... @@ -67,8 +70,11 @@ curl -L https://github.com/EnterpriseDB/kubectl-cnp/releases/download/v1.30.0/ku Then, with superuser privileges, install with `yum`, and you're ready to use: -```console -$ sudo yum --disablerepo=* localinstall kube-plugin.rpm +```sh +sudo yum --disablerepo=* localinstall kube-plugin.rpm +``` + +```output Failed to set locale, defaulting to C.UTF-8 Dependencies resolved. ==================================================================================================== @@ -796,9 +802,11 @@ kubectl cnp report cluster cluster-example -f --tail 3 With the `-o` option omitted, and with `--output` specified: -```console -$ kubectl cnp logs cluster cluster-example --output my-cluster.log +```sh +kubectl cnp logs cluster cluster-example --output my-cluster.log +``` +```output Successfully written logs to "my-cluster.log" ``` @@ -810,8 +818,11 @@ into a human-readable output, and attempts to sort the entries by timestamp. It can be used in combination with `kubectl cnp logs cluster`, as shown in the following example: -```console -$ kubectl cnp logs cluster cluster-example | kubectl cnp logs pretty +```sh +kubectl cnp logs cluster cluster-example | kubectl cnp logs pretty +``` + +```output 2024-10-15T17:35:00.336 INFO cluster-example-1 instance-manager Starting {{name.ln}} Instance Manager 2024-10-15T17:35:00.336 INFO cluster-example-1 instance-manager Checking for free disk space for WALs before starting PostgreSQL 2024-10-15T17:35:00.347 INFO cluster-example-1 instance-manager starting tablespace manager @@ -823,8 +834,11 @@ Alternatively, it can be used in combination with other commands that produce {{name.abbr}} logs in JSON format, such as `stern`, or `kubectl logs`, as in the following example: -```console -$ kubectl logs cluster-example-1 | kubectl cnp logs pretty +```sh +kubectl logs cluster-example-1 | kubectl cnp logs pretty +``` + +```output 2024-10-15T17:35:00.336 INFO cluster-example-1 instance-manager Starting {{name.ln}} Instance Manager 2024-10-15T17:35:00.336 INFO cluster-example-1 instance-manager Checking for free disk space for WALs before starting PostgreSQL 2024-10-15T17:35:00.347 INFO cluster-example-1 instance-manager starting tablespace manager @@ -837,8 +851,11 @@ to display logs for specific pods or loggers, or to filter logs by severity level. Here's an example: -```console -$ kubectl cnp logs cluster cluster-example | kubectl cnp logs pretty --pods cluster-example-1 --loggers postgres --log-level info +```sh +kubectl cnp logs cluster cluster-example | kubectl cnp logs pretty --pods cluster-example-1 --loggers postgres --log-level info +``` + +```output 2024-10-15T17:35:00.509 INFO cluster-example-1 postgres 2024-10-15 17:35:00.509 UTC [29] LOG: redirecting log output to logging collector process 2024-10-15T17:35:00.509 INFO cluster-example-1 postgres 2024-10-15 17:35:00.509 UTC [29] HINT: Future log output will appear in directory "/controller/log"... 2024-10-15T17:35:00.510 INFO cluster-example-1 postgres 2024-10-15 17:35:00.509 UTC [29] LOG: ending log output to stderr @@ -854,8 +871,11 @@ mode. The sub-command will add a group separator line, `---`, at the end of each sorted group. The size of the grouping can be configured via the `--sorting-group-size` flag (default: 1000), as illustrated in the following example: -```console -$ kubectl cnp logs cluster cluster-example | kubectl cnp logs pretty --sorting-group-size=3 +```sh +kubectl cnp logs cluster cluster-example | kubectl cnp logs pretty --sorting-group-size=3 +``` + +```output 2024-10-15T17:35:20.426 INFO cluster-example-2 instance-manager Starting {{name.ln}} Instance Manager 2024-10-15T17:35:20.426 INFO cluster-example-2 instance-manager Checking for free disk space for WALs before starting PostgreSQL 2024-10-15T17:35:20.438 INFO cluster-example-2 instance-manager starting tablespace manager From 16528f0ebf425eabf7bcb034df036cee16a614a6 Mon Sep 17 00:00:00 2001 From: Amit <5795880+amacvar@users.noreply.github.com> Date: Tue, 4 Aug 2026 12:39:36 -0400 Subject: [PATCH 2/2] Improve formatting for kubectl plugin documentation per sharp vision from Gaby Vargas - updated code blocks to use 'sh' syntax highlighting and improved formatting for backup and psql commands. --- .../1/kubectl-plugin.mdx | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/product_docs/docs/postgres_for_kubernetes/1/kubectl-plugin.mdx b/product_docs/docs/postgres_for_kubernetes/1/kubectl-plugin.mdx index 60ed774aa0f..0838e9bffd4 100644 --- a/product_docs/docs/postgres_for_kubernetes/1/kubectl-plugin.mdx +++ b/product_docs/docs/postgres_for_kubernetes/1/kubectl-plugin.mdx @@ -1025,7 +1025,10 @@ kubectl cnp backup [cluster_name] -m volumeSnapshot The created backup will be named after the request time: ```console -$ kubectl cnp backup cluster-example +kubectl cnp backup cluster-example +``` + +```output backup/cluster-example-20230121002300 created ``` @@ -1052,9 +1055,11 @@ As you will be connecting as `postgres` user, in production environments this method should be used with extreme care, by authorized personnel only. !!! -```console -$ kubectl cnp psql cluster-example +```sh +kubectl cnp psql cluster-example +``` +```output psql (17.0 (Debian 17.0-1.pgdg110+1)) Type "help" for help. @@ -1064,9 +1069,11 @@ postgres=# By default, the command will connect to the primary instance. The user can select to work against a replica by using the `--replica` option: -```console -$ kubectl cnp psql --replica cluster-example +```sh +kubectl cnp psql --replica cluster-example +``` +```output psql (17.0 (Debian 17.0-1.pgdg110+1)) Type "help" for help.