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.