From f1dee1a718674d723d4129416e873e5fd549b06c Mon Sep 17 00:00:00 2001 From: Ashesh Vidyut <134911583+absolutelightning@users.noreply.github.com> Date: Tue, 19 Dec 2023 03:57:23 +0530 Subject: [PATCH] Net 6603 (#19718) * Update docs for NET-6603 * json format * json caps * Update website/content/docs/k8s/k8s-cli.mdx Co-authored-by: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> --------- Co-authored-by: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> --- website/content/docs/k8s/k8s-cli.mdx | 41 ++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/website/content/docs/k8s/k8s-cli.mdx b/website/content/docs/k8s/k8s-cli.mdx index df986a5885..c91f02fd59 100644 --- a/website/content/docs/k8s/k8s-cli.mdx +++ b/website/content/docs/k8s/k8s-cli.mdx @@ -161,6 +161,7 @@ $ consul-k8s proxy list | ------------------------------------ | ----------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | | `-all-namespaces`, `-A` | `Boolean` List pods in all Kubernetes namespaces. | `false` | | `-namespace`, `-n` | `String` The Kubernetes namespace to list proxies in. | Current [kubeconfig](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/) namespace. | +| `-output-format`, `-o` | `String` If set to json, outputs the result in json format, else table format | `table` Refer to the [Global Options](#global-options) for additional options that you can use when installing Consul on Kubernetes. @@ -229,6 +230,46 @@ default client-767ccfc8f9-ggrtx Sidecar default frontend-676564547c-v2mfq Sidecar ``` +Display all Pods across all namespaces that run proxies managed by Consul in JSON format + +```shell-session +$ consul-k8s proxy list -A -o json +Namespace: All namespaces + +[ + { + "Name": "frontend-6fd97b8fb5-spqb8", + "Namespace": "default", + "Type": "Sidecar" + }, + { + "Name": "nginx-6d7469694f-p5wrz", + "Namespace": "default", + "Type": "Sidecar" + }, + { + "Name": "payments-667d87bf95-ktb8n", + "Namespace": "default", + "Type": "Sidecar" + }, + { + "Name": "product-api-7c4d77c7c9-g4g2b", + "Namespace": "default", + "Type": "Sidecar" + }, + { + "Name": "product-api-db-685c844cb-k5l8f", + "Namespace": "default", + "Type": "Sidecar" + }, + { + "Name": "public-api-567d949866-cgksl", + "Namespace": "default", + "Type": "Sidecar" + } +] +``` + ### `proxy read` The `proxy read` command allows you to inspect the configuration of Envoy proxies running on a given Pod.