From fe123421c6f4aece72619b3a82323a7f60b15d20 Mon Sep 17 00:00:00 2001 From: Thomas Eckert Date: Wed, 20 Jul 2022 15:09:00 -0400 Subject: [PATCH 01/24] Clean and clarify intro --- website/content/docs/k8s/k8s-cli.mdx | 29 ++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/website/content/docs/k8s/k8s-cli.mdx b/website/content/docs/k8s/k8s-cli.mdx index f3757748b8..5e65292425 100644 --- a/website/content/docs/k8s/k8s-cli.mdx +++ b/website/content/docs/k8s/k8s-cli.mdx @@ -5,15 +5,15 @@ description: >- Consul K8s CLI is a tool for quickly installing and interacting with Consul on Kubernetes. --- -# Consul K8s CLI Reference +# Consul on Kubernetes CLI Reference -Consul K8s CLI is a tool for quickly installing and interacting with Consul on Kubernetes. -The Consul K8s CLI allows you to manage the lifecycle of Consul without requiring the usage of `Helm`, [Consul CLI](/commands/index), and `kubectl`. -The Consul K8s CLI offers a Kubernetes native experience for managing Consul. +The Consul on Kubernetes CLI, `consul-k8s`, is a tool for managing Consul +without requiring `Helm`, the [Consul CLI](/commands/index), or `kubectl`. --> **Note**: For guidance on how to install the Consul K8s CLI, visit the [Installing the Consul K8s CLI](/docs/k8s/installation/install-cli) documentation. +-> **Note**: For guidance on how to install `consul-k8s`, visit the +[Installing the Consul K8s CLI](/docs/k8s/installation/install-cli) documentation. -This topic describes the subcommands and available options for using Consul K8s CLI. +This topic describes the subcommands and available options for using `consul-k8s`. ## Usage @@ -27,11 +27,12 @@ $ consul-k8s You can use the following subcommands with `consul-k8s`. - - [install](#install) - - [uninstall](#uninstall) - - [status](#status) - - [upgrade](#upgrade) BETA - - [version](#version) + - [`install`](#install) + - [`proxy`](#proxy) + - [`status`](#status) + - [`uninstall`](#uninstall) + - [`upgrade`](#upgrade) + - [`version`](#version) ### `install` @@ -68,7 +69,7 @@ The following example command installs Consul according in the `myNS` namespace $ consul-k8s install -preset=secure -namespace=myNS ``` -The following example commands install Consul on Kubernetes using custom values, files, or strings that are set via flags. The underlying Consul-on-Kubernetes Helm chart uses the flags to customize the installation. The flags are comparable to the `helm install` [flags](https://helm.sh/docs/helm/helm_install/#helm-install). +The following example commands install Consul on Kubernetes using custom values, files, or strings that are set via flags. The underlying Consul-on-Kubernetes Helm chart uses the flags to customize the installation. The flags are comparable to the `helm install` [flags](https://helm.sh/docs/helm/helm_install/#helm-install). ```shell-session $ consul-k8s install -set key=value @@ -120,7 +121,7 @@ $ consul-k8s uninstall -namespace=my-ns -name=my-consul -wipe-data=true -auto-ap ### `status` -The `status` command provides an overall status summary of the Consul on Kubernetes installation. It also provides the config that was used to deploy Consul K8s and provides a quick glance at the health of both Consul servers and clients. This command does not take in any flags. +The `status` command provides an overall status summary of the Consul on Kubernetes installation. It also provides the config that was used to deploy Consul K8s and provides a quick glance at the health of both Consul servers and clients. This command does not take in any flags. ```shell-session $ consul-k8s status @@ -165,7 +166,7 @@ $ consul-k8s status ### `upgrade` --> The `consul-k8s upgrade` **subcommand is currently in beta**: This subcommand is not recommended for production environments. +-> The `consul-k8s upgrade` **subcommand is currently in beta**: This subcommand is not recommended for production environments. The `upgrade` command upgrades the Consul on Kubernetes components to the current version of the `consul-k8s` cli. Prior to running `consul-k8s upgrade`, the `consul-k8s` CLI should first be upgraded to the latest version as described [Upgrade the Consul K8s CLI](#upgrade-the-consul-k8s-cli) From 2ec29f6696f563c94f2c1c73ac54ae25a103e383 Mon Sep 17 00:00:00 2001 From: Thomas Eckert Date: Wed, 20 Jul 2022 15:14:14 -0400 Subject: [PATCH 02/24] Move uninstall down to be alphabetically sorted --- website/content/docs/k8s/k8s-cli.mdx | 58 ++++++++++++++-------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/website/content/docs/k8s/k8s-cli.mdx b/website/content/docs/k8s/k8s-cli.mdx index 5e65292425..51bdf464b3 100644 --- a/website/content/docs/k8s/k8s-cli.mdx +++ b/website/content/docs/k8s/k8s-cli.mdx @@ -90,35 +90,6 @@ The following example commands install Consul on Kubernetes using custom values, $ consul-k8s install -set-string key=value-bool ``` -### `uninstall` - -The `uninstall` command removes Consul from Kubernetes. - -```shell-session -$ consul-k8s uninstall -``` - -The following options are available. - -| Flag | Description | Default | Required | -| --------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -------- | -| `-auto-approve`                                     | Boolean value that enables you to skip the removal confirmation prompt. | `false` | Optional | -| `-name` | String value for the name of the installation to remove. | none | Optional | -| `-namespace` | String value that specifies the namespace of the Consul installation to remove. | `consul` | Optional | -| `-timeout` | Specifies how long to wait for the removal process to complete before timing out. The value is specified with an integer and string value indicating a unit of time.
The following units are supported:
`ms` (milliseconds)
`s` (seconds)
`m` (minutes)
`h` (hours)
In the following example, removal will timeout after one minute:
`consul-k8s uninstall -timeout 1m` | `10m` | Optional | -| `-wipe-data` | Boolean value that deletes PVCs and secrets associated with the Consul installation during installation.
Data will be removed without a verification prompt if the `-auto-approve` flag is set to `true`. | `false`
Instructions for removing data will be printed to the console. | Optional | -| `--help` | Prints usage information for this option. | none | Optional | - -See [Global Options](#global-options) for additional commands that you can use when uninstalling Consul from Kubernetes. - -#### Example Command - -The following example command immediately uninstalls Consul from the `my-ns` namespace with the name `my-consul` and removes PVCs and secrets associated with the installation without asking for verification: - -```shell-session -$ consul-k8s uninstall -namespace=my-ns -name=my-consul -wipe-data=true -auto-approve=true -``` - ### `status` The `status` command provides an overall status summary of the Consul on Kubernetes installation. It also provides the config that was used to deploy Consul K8s and provides a quick glance at the health of both Consul servers and clients. This command does not take in any flags. @@ -164,6 +135,35 @@ $ consul-k8s status ✓ Consul clients healthy (3/3) ``` +### `uninstall` + +The `uninstall` command removes Consul from Kubernetes. + +```shell-session +$ consul-k8s uninstall +``` + +The following options are available. + +| Flag | Description | Default | Required | +| --------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -------- | +| `-auto-approve`                                     | Boolean value that enables you to skip the removal confirmation prompt. | `false` | Optional | +| `-name` | String value for the name of the installation to remove. | none | Optional | +| `-namespace` | String value that specifies the namespace of the Consul installation to remove. | `consul` | Optional | +| `-timeout` | Specifies how long to wait for the removal process to complete before timing out. The value is specified with an integer and string value indicating a unit of time.
The following units are supported:
`ms` (milliseconds)
`s` (seconds)
`m` (minutes)
`h` (hours)
In the following example, removal will timeout after one minute:
`consul-k8s uninstall -timeout 1m` | `10m` | Optional | +| `-wipe-data` | Boolean value that deletes PVCs and secrets associated with the Consul installation during installation.
Data will be removed without a verification prompt if the `-auto-approve` flag is set to `true`. | `false`
Instructions for removing data will be printed to the console. | Optional | +| `--help` | Prints usage information for this option. | none | Optional | + +See [Global Options](#global-options) for additional commands that you can use when uninstalling Consul from Kubernetes. + +#### Example Command + +The following example command immediately uninstalls Consul from the `my-ns` namespace with the name `my-consul` and removes PVCs and secrets associated with the installation without asking for verification: + +```shell-session +$ consul-k8s uninstall -namespace=my-ns -name=my-consul -wipe-data=true -auto-approve=true +``` + ### `upgrade` -> The `consul-k8s upgrade` **subcommand is currently in beta**: This subcommand is not recommended for production environments. From 73e8b3cc0d44b0b6c2c9217b11b41bbf899ea02b Mon Sep 17 00:00:00 2001 From: Thomas Eckert Date: Thu, 21 Jul 2022 17:47:39 -0400 Subject: [PATCH 03/24] Add proxy list docs --- website/content/docs/k8s/k8s-cli.mdx | 107 +++++++++++++++++++++++++-- 1 file changed, 102 insertions(+), 5 deletions(-) diff --git a/website/content/docs/k8s/k8s-cli.mdx b/website/content/docs/k8s/k8s-cli.mdx index 51bdf464b3..ebd50de09d 100644 --- a/website/content/docs/k8s/k8s-cli.mdx +++ b/website/content/docs/k8s/k8s-cli.mdx @@ -27,16 +27,18 @@ $ consul-k8s You can use the following subcommands with `consul-k8s`. - - [`install`](#install) - - [`proxy`](#proxy) - - [`status`](#status) + - [`install`](#install) installs Consul to your Kubernetes cluster. + - [`proxy`](#proxy) allows you to interact with proxies managed by Consul on your Kubernetes cluster. + - [`proxy list`](#proxy-list) + - [`proxy read`](#proxy-read) + - [`status`](#status) displays the - [`uninstall`](#uninstall) - [`upgrade`](#upgrade) - [`version`](#version) ### `install` -The `install` command installs Consul on Kubernetes. +The `install` command installs Consul to your Kubernetes cluster. ```shell-session $ consul-k8s install @@ -57,7 +59,7 @@ The following options are available. | `-timeout` | Specifies how long to wait for the installation process to complete before timing out. The value is specified with an integer and string value indicating a unit of time.
The following units are supported:
`ms` (milliseconds)
`s` (seconds)
`m` (minutes)
In the following example, installation will timeout after one minute:
`consul-k8s install -timeout 1m` | `10m` | Optional | | `-wait` | Boolean value that determines if Consul should wait for resources in the installation to be ready before exiting the command. | `true` | Optional | | `-verbose`, `-v` | Boolean value that specifies whether to output verbose logs from the install command with the status of resources being installed. | `false` | Optional | -| `--help` | Prints usage information for this option. | none | Optional | +| `-help`, `-h` | Prints usage information for this option. | none | Optional | See [Global Options](#global-options) for additional commands that you can use when installing Consul on Kubernetes. @@ -90,6 +92,101 @@ The following example commands install Consul on Kubernetes using custom values, $ consul-k8s install -set-string key=value-bool ``` +### `proxy` + +The `proxy` command exposes two subcommands for interacting proxies managed by +Consul in your Kubernetes Cluster. + +- [`proxy list`](#proxy-list) List all Kubernetes pods running proxies managed by Consul. +- [`proxy read`](#proxy-read) Inspect the Envoy configuration for a given Pod. + +### `proxy list` + +```shell-session +$ consul-k8s proxy list +``` + +| Flag | Description | Default | Required | +| -------------------------------------------- | ----------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | -------- | +| `-all-namespaces`, `-A`       | `Boolean` List pods in all Kubernetes namespaces. | `false` | Optional | +| `-namespace`, `-n` | `String` The Kubernetes namespace to list proxies in. | Current [kubeconfig](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/) namespace. | Optional | + +See [Global Options](#global-options) for additional commands that you can use +when installing Consul on Kubernetes. + +This command will list proxies alongside their `Type`. Types of proxies include + +- `Sidecar`: these will be the majority of pods in the cluster. They run the + proxy in a sidecar pattern to network the pod as a service in the mesh. +- `API Gateway`: these pods run a proxy to manage connections with networks + outside of the Consul cluster. [Read more about API gateways](/docs/api-gateway) +- `Ingress Gateway`: these pods run a proxy to manage ingress into the + Kubernetes cluster. [Read more about ingress gateways](/docs/k8s/connect/ingress-gateways) +- `Terminating Gateway`: these pods run a proxy to control connections to + external services. [Read more about terminating gateways](/docs/k8s/connect/terminating-gateways) +- `Mesh Gateway`: these pods run a proxy to manage connections between + Consul clusters connected using mesh federation. [Read more about Consul Mesh Federation](/docs/k8s/installation/multi-cluster/kubernetes) + +#### Example Commands + +Display all pods in the current Kubernetes namespace which run proxies managed +by Consul. Note that `Sidecar` pods are pods which are running the proxy in a +sidecar pattern and are services running in the mesh. + +```shell-session +$ consul-k8s proxy list +``` + +``` +Namespace: default + +Name Type +backend-658b679b45-d5xlb Sidecar +client-767ccfc8f9-6f6gx Sidecar +client-767ccfc8f9-f8nsn Sidecar +client-767ccfc8f9-ggrtx Sidecar +frontend-676564547c-v2mfq Sidecar +``` + +Display all pods in the `consul` Kubernetes namespace which run proxies managed +by Consul. Note that these pods are labeled with the type `Ingress Gateway`. +They run a proxy managed by Consul for controlling ingress into the Kubernetes +cluster. + +```shell-session +$ consul-k8s proxy list -n consul +``` + +``` +Namespace: consul + +Name Type +consul-ingress-gateway-6fb5544485-br6fl Ingress Gateway +consul-ingress-gateway-6fb5544485-m54sp Ingress Gateway +``` + +Display all pods across all + +```shell-session +$ consul-k8s proxy list -A +``` + +``` +Namespace: All Namespaces + +Namespace Name Type +consul consul-ingress-gateway-6fb5544485-br6fl Ingress Gateway +consul consul-ingress-gateway-6fb5544485-m54sp Ingress Gateway +default backend-658b679b45-d5xlb Sidecar +default client-767ccfc8f9-6f6gx Sidecar +default client-767ccfc8f9-f8nsn Sidecar +default client-767ccfc8f9-ggrtx Sidecar +default frontend-676564547c-v2mfq Sidecar +``` + +### `proxy read` + + ### `status` The `status` command provides an overall status summary of the Consul on Kubernetes installation. It also provides the config that was used to deploy Consul K8s and provides a quick glance at the health of both Consul servers and clients. This command does not take in any flags. From 16c85630496b6e63cd32b4d4948ba7e315af84db Mon Sep 17 00:00:00 2001 From: Thomas Eckert Date: Fri, 22 Jul 2022 12:14:01 -0400 Subject: [PATCH 04/24] Add descriptions to the subjects --- website/content/docs/k8s/k8s-cli.mdx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/website/content/docs/k8s/k8s-cli.mdx b/website/content/docs/k8s/k8s-cli.mdx index ebd50de09d..0feeab6e6c 100644 --- a/website/content/docs/k8s/k8s-cli.mdx +++ b/website/content/docs/k8s/k8s-cli.mdx @@ -23,18 +23,18 @@ Consul K8s CLI uses the following syntax: $ consul-k8s ``` -## Subcommands +## Commands -You can use the following subcommands with `consul-k8s`. +You can use the following commands with `consul-k8s`. - [`install`](#install) installs Consul to your Kubernetes cluster. - [`proxy`](#proxy) allows you to interact with proxies managed by Consul on your Kubernetes cluster. - - [`proxy list`](#proxy-list) - - [`proxy read`](#proxy-read) - - [`status`](#status) displays the - - [`uninstall`](#uninstall) - - [`upgrade`](#upgrade) - - [`version`](#version) + - [`proxy list`](#proxy-list) displays all relevant proxies. + - [`proxy read`](#proxy-read) displays the configuration of proxies on a given Pod. + - [`status`](#status) displays the status of your Consul installation along with its configuration. + - [`uninstall`](#uninstall) uninstalls Consul from your Kubernetes cluster. + - [`upgrade`](#upgrade) modifies your Consul installation's configuration. + - [`version`](#version) displays the version of Consul on Kubernetes that is installed. ### `install` From acf4758e1207b33ec0f5a0254c50d2e546746e8a Mon Sep 17 00:00:00 2001 From: Thomas Eckert Date: Fri, 22 Jul 2022 13:43:38 -0400 Subject: [PATCH 05/24] Add options and examples to proxy read --- website/content/docs/k8s/k8s-cli.mdx | 172 ++++++++++++++++++++++++++- 1 file changed, 167 insertions(+), 5 deletions(-) diff --git a/website/content/docs/k8s/k8s-cli.mdx b/website/content/docs/k8s/k8s-cli.mdx index 0feeab6e6c..66351d7e1a 100644 --- a/website/content/docs/k8s/k8s-cli.mdx +++ b/website/content/docs/k8s/k8s-cli.mdx @@ -130,8 +130,7 @@ This command will list proxies alongside their `Type`. Types of proxies include #### Example Commands Display all pods in the current Kubernetes namespace which run proxies managed -by Consul. Note that `Sidecar` pods are pods which are running the proxy in a -sidecar pattern and are services running in the mesh. +by Consul. ```shell-session $ consul-k8s proxy list @@ -149,9 +148,7 @@ frontend-676564547c-v2mfq Sidecar ``` Display all pods in the `consul` Kubernetes namespace which run proxies managed -by Consul. Note that these pods are labeled with the type `Ingress Gateway`. -They run a proxy managed by Consul for controlling ingress into the Kubernetes -cluster. +by Consul. ```shell-session $ consul-k8s proxy list -n consul @@ -186,6 +183,171 @@ default frontend-676564547c-v2mfq Sidecar ### `proxy read` +The `proxy read` command allows you to inspect the configuration of any Envoy proxies running on a given Pod. + +```shell-session +$ consul-k8s proxy read +``` + +The command takes a required value, ``. This should be the full name +of a Kubernetes Pod. + +The following options are available. + +| Flag | Description | Default | Required | +| ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------- | -------- | +| `-namespace`, `-n`         | `String` The namespace where the target Pod can be found. | Current [kubeconfig](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/) namespace. | Optional | +| `-output`, `-o` | `String` Output the Envoy configuration as 'table', 'json', or 'raw'. | `'table'` | Optional | +| `-clusters` | `Boolean` Filter output to only show clusters. | `false` | Optional | +| `-endpoints` | `Boolean` Filter output to only show endpoints. | `false` | Optional | +| `-listeners` | `Boolean` Filter output to only show listeners. | `false` | Optional | +| `-routes` | `Boolean` Filter output to only show routes. | `false` | Optional | +| `-secrets` | `Boolean` Filter output to only show secrets. | `false` | Optional | +| `-address` | `String` Filter clusters, endpoints, and listeners output to only those with endpoint addresses which contain the given value. | `""` | Optional | +| `-fqdn` | `String` Filter cluster output to only clusters with a fully qualified domain name which contains the given value. | `""` | Optional | +| `-port` | `Int` Filter endpoints output to only endpoints with the given port number. | `-1` which does not filter by port | Optional | + +#### Example commands + +Get the configuration summary for the Envoy proxy running on the Pod +`backend-658b679b45-d5xlb`. + +```shell-session +$ consul-k8s proxy read backend-658b679b45-d5xlb +``` + +``` +Envoy configuration for backend-658b679b45-d5xlb in namespace default: + +==> Clusters (5) +Name FQDN Endpoints Type Last Updated +local_agent local_agent 192.168.79.187:8502 STATIC 2022-05-13T04:22:39.553Z +client client.default.dc1.internal.bc3815c2-1a0f-f3ff-a2e9-20d791f08d00.consul EDS 2022-07-21T12:12:27.335Z +frontend frontend.default.dc1.internal.bc3815c2-1a0f-f3ff-a2e9-20d791f08d00.consul EDS 2022-07-21T12:12:27.242Z +local_app local_app 127.0.0.1:8080 STATIC 2022-05-13T04:22:39.655Z +original-destination original-destination ORIGINAL_DST 2022-05-13T04:22:39.743Z + + +==> Endpoints (6) +Address:Port Cluster Weight Status +192.168.79.187:8502 local_agent 1.00 HEALTHY +192.168.18.110:20000 1.00 HEALTHY +192.168.52.101:20000 1.00 HEALTHY +192.168.65.131:20000 1.00 HEALTHY +192.168.63.120:20000 1.00 HEALTHY +127.0.0.1:8080 local_app 1.00 HEALTHY + + +==> Listeners (2) +Name Address:Port Direction Filter Chain Match Filters Last Updated +public_listener 192.168.69.179:20000 INBOUND Any * -> local_app/ 2022-07-21T12:12:42.148Z +outbound_listener 127.0.0.1:15001 OUTBOUND 10.100.134.173/32, 240.0.0.3/32 -> client.default.dc1.internal.bc3815c2-1a0f-f3ff-a2e9-20d791f08d00.consul 2022-07-18T15:31:03.246Z + 10.100.31.2/32, 240.0.0.5/32 -> frontend.default.dc1.internal.bc3815c2-1a0f-f3ff-a2e9-20d791f08d00.consul + Any -> original-destination + + +==> Routes (1) +Name Destination Cluster Last Updated +public_listener local_app/ 2022-07-21T12:12:42.147Z + + +==> Secrets (0) +Name Type Last Updated + +``` + +Get the Envoy configuration summary for all clusters with a fully qualified +domain name which includes `"default"`. Display only clusters and listeners. + +```shell-session +$ consul-k8s proxy read backend-658b679b45-d5xlb -fqdn default -clusters -listeners +``` + +``` +Envoy configuration for backend-658b679b45-d5xlb in namespace default: + +==> Filters applied + Fully qualified domain names containing: default + +==> Clusters (2) +Name FQDN Endpoints Type Last Updated +client client.default.dc1.internal.bc3815c2-1a0f-f3ff-a2e9-20d791f08d00.consul EDS 2022-07-21T12:12:27.335Z +frontend frontend.default.dc1.internal.bc3815c2-1a0f-f3ff-a2e9-20d791f08d00.consul EDS 2022-07-21T12:12:27.242Z + + +==> Listeners (2) +Name Address:Port Direction Filter Chain Match Filters Last Updated +public_listener 192.168.69.179:20000 INBOUND Any * -> local_app/ 2022-07-21T12:12:42.148Z +outbound_listener 127.0.0.1:15001 OUTBOUND 10.100.134.173/32, 240.0.0.3/32 -> client.default.dc1.internal.bc3815c2-1a0f-f3ff-a2e9-20d791f08d00.consul 2022-07-18T15:31:03.246Z + 10.100.31.2/32, 240.0.0.5/32 -> frontend.default.dc1.internal.bc3815c2-1a0f-f3ff-a2e9-20d791f08d00.consul + Any -> original-destination + +``` + +Get the raw Envoy configuration dump for the Envoy proxy running on the Pod +`backend-658b679b45-d5xlb`. The raw configuration will be output for each +service as a JSON map. The [JQ command line tool](https://stedolan.github.io/jq/) +can be used to index into the configuration for the service you want to inspect. + +See the [Envoy config dump documentation](https://www.envoyproxy.io/docs/envoy/latest/api-v3/admin/v3/config_dump.proto) +for more information on the structure of the config dump. + +```shell-session +$ consul-k8s proxy read backend-658b679b45-d5xlb -o raw +``` + +``` +{ + "backend-658b679b45-d5xlb": { + "configs": [ + { + "@type": "type.googleapis.com/envoy.admin.v3.BootstrapConfigDump", + "bootstrap": { + // [-- snip 1201 lines --] + }, + "last_updated": "2022-05-13T04:22:39.488Z" + }, + { + "@type": "type.googleapis.com/envoy.admin.v3.ClustersConfigDump", + "static_clusters": [ + // [-- snip 42 lines --] + ], + "dynamic_active_clusters": [ + // [-- snip 144 lines --] + ] + }, + { + "@type": "type.googleapis.com/envoy.admin.v3.EndpointsConfigDump", + "static_endpoint_configs": [ + // [-- snip 29 lines --] + ], + "dynamic_endpoint_configs": [ + // [-- snip 120 lines --] + ] + }, + { + "@type": "type.googleapis.com/envoy.admin.v3.ListenersConfigDump", + "dynamic_listeners": [ + // [-- snip 216 lines --] + ] + }, + { + "@type": "type.googleapis.com/envoy.admin.v3.ScopedRoutesConfigDump" + }, + { + "@type": "type.googleapis.com/envoy.admin.v3.RoutesConfigDump", + "static_route_configs": [ + // [-- snip 25 lines --] + ] + }, + { + "@type": "type.googleapis.com/envoy.admin.v3.SecretsConfigDump" + } + ] + } +} +``` + ### `status` From 418bc1ca04db8750e1edd815a3ff60bb7c7a71cb Mon Sep 17 00:00:00 2001 From: Thomas Eckert Date: Mon, 8 Aug 2022 12:53:41 -0400 Subject: [PATCH 06/24] Update the table of contents with better descriptions --- website/content/docs/k8s/k8s-cli.mdx | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/website/content/docs/k8s/k8s-cli.mdx b/website/content/docs/k8s/k8s-cli.mdx index 66351d7e1a..0053bb5637 100644 --- a/website/content/docs/k8s/k8s-cli.mdx +++ b/website/content/docs/k8s/k8s-cli.mdx @@ -13,28 +13,28 @@ without requiring `Helm`, the [Consul CLI](/commands/index), or `kubectl`. -> **Note**: For guidance on how to install `consul-k8s`, visit the [Installing the Consul K8s CLI](/docs/k8s/installation/install-cli) documentation. -This topic describes the subcommands and available options for using `consul-k8s`. +This topic describes the commands and available options for using `consul-k8s`. ## Usage -Consul K8s CLI uses the following syntax: +The Consul on Kubernetes CLI uses the following syntax: ```shell-session -$ consul-k8s +$ consul-k8s ``` ## Commands You can use the following commands with `consul-k8s`. - - [`install`](#install) installs Consul to your Kubernetes cluster. - - [`proxy`](#proxy) allows you to interact with proxies managed by Consul on your Kubernetes cluster. - - [`proxy list`](#proxy-list) displays all relevant proxies. - - [`proxy read`](#proxy-read) displays the configuration of proxies on a given Pod. - - [`status`](#status) displays the status of your Consul installation along with its configuration. - - [`uninstall`](#uninstall) uninstalls Consul from your Kubernetes cluster. - - [`upgrade`](#upgrade) modifies your Consul installation's configuration. - - [`version`](#version) displays the version of Consul on Kubernetes that is installed. + - [`install`](#install): Install Consul on Kubernetes. + - [`proxy`](#proxy): Inspect Envoy proxies managed by Consul. + - [`proxy list`](#proxy-list): List all Pods running proxies managed by Consul. + - [`proxy read`](#proxy-read): Inspect the Envoy configuration for a given Pod. + - [`status`](#status): Check the status of a Consul installation on Kubernetes. + - [`uninstall`](#uninstall): Uninstall Consul deployment. + - [`upgrade`](#upgrade): Upgrade Consul on Kubernetes from an existing installation. + - [`version`](#version): Print the version of the Consul on Kubernetes CLI. ### `install` From 89f3b2979fbc6b016bea9b4514a1345c24b51772 Mon Sep 17 00:00:00 2001 From: Thomas Eckert Date: Mon, 8 Aug 2022 12:57:48 -0400 Subject: [PATCH 07/24] Remove "Required" column from options (they are all optional) --- website/content/docs/k8s/k8s-cli.mdx | 112 +++++++++++++-------------- 1 file changed, 56 insertions(+), 56 deletions(-) diff --git a/website/content/docs/k8s/k8s-cli.mdx b/website/content/docs/k8s/k8s-cli.mdx index 0053bb5637..fe2154bd3d 100644 --- a/website/content/docs/k8s/k8s-cli.mdx +++ b/website/content/docs/k8s/k8s-cli.mdx @@ -46,20 +46,20 @@ $ consul-k8s install The following options are available. -| Flag | Description | Default | Required | -| --------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- | -------- | -| `-auto-approve`                                     | Boolean value that enables you to skip the installation confirmation prompt. | `false` | Optional | -| `-dry-run` | Boolean value that validates the installation and returns a summary. | `false` | Optional | -| `-config-file` | String value that specifies the path to a file containing custom installation configurations, e.g., Consul Helm chart values file.
You can use the `-config-file` flag multiple times to specify multiple files. | none | Optional | -| `-namespace` | String value that specifies the namespace of the Consul installation. | `consul` | Optional | -| `-preset` | String value that installs Consul based on a preset configuration. You can specify the following values:
`demo`: Installs a single replica server with sidecar injection enabled; useful for testing service mesh functionality.
`secure`: Installs a single replica server with sidecar injection, ACLs, and TLS enabled; useful for testing service mesh functionality. | Configuration of the Consul Helm chart. | Optional | -| `-set` | String value that enables you to set a customizable value. This flag is comparable to the `helm install --set` flag.
You can use the `-set` flag multiple times to set multiple values.
Consul Helm chart values are supported. | none | Optional | -| `-set-file` | String value that specifies the name of an arbitrary config file. This flag is comparable to the `helm install --set-file`
flag. The contents of the file will be used to set a customizable value. You can use the `-set-file` flag multiple times to specify multiple files.
Consul Helm chart values are supported. | none | Optional | -| `-set-string` | String value that enables you to set a customizable string value. This flag is comparable to the `helm install --set-string`
flag. You can use the `-set-string` flag multiple times to specify multiple strings.
Consul Helm chart values are supported. | none | Optional | -| `-timeout` | Specifies how long to wait for the installation process to complete before timing out. The value is specified with an integer and string value indicating a unit of time.
The following units are supported:
`ms` (milliseconds)
`s` (seconds)
`m` (minutes)
In the following example, installation will timeout after one minute:
`consul-k8s install -timeout 1m` | `10m` | Optional | -| `-wait` | Boolean value that determines if Consul should wait for resources in the installation to be ready before exiting the command. | `true` | Optional | -| `-verbose`, `-v` | Boolean value that specifies whether to output verbose logs from the install command with the status of resources being installed. | `false` | Optional | -| `-help`, `-h` | Prints usage information for this option. | none | Optional | +| Flag | Description | Default | +| --------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- | +| `-auto-approve`                                     | Boolean value that enables you to skip the installation confirmation prompt. | `false` | +| `-dry-run` | Boolean value that validates the installation and returns a summary. | `false` | +| `-config-file` | String value that specifies the path to a file containing custom installation configurations, e.g., Consul Helm chart values file.
You can use the `-config-file` flag multiple times to specify multiple files. | none | +| `-namespace` | String value that specifies the namespace of the Consul installation. | `consul` | +| `-preset` | String value that installs Consul based on a preset configuration. You can specify the following values:
`demo`: Installs a single replica server with sidecar injection enabled; useful for testing service mesh functionality.
`secure`: Installs a single replica server with sidecar injection, ACLs, and TLS enabled; useful for testing service mesh functionality. | Configuration of the Consul Helm chart. | +| `-set` | String value that enables you to set a customizable value. This flag is comparable to the `helm install --set` flag.
You can use the `-set` flag multiple times to set multiple values.
Consul Helm chart values are supported. | none | +| `-set-file` | String value that specifies the name of an arbitrary config file. This flag is comparable to the `helm install --set-file`
flag. The contents of the file will be used to set a customizable value. You can use the `-set-file` flag multiple times to specify multiple files.
Consul Helm chart values are supported. | none | +| `-set-string` | String value that enables you to set a customizable string value. This flag is comparable to the `helm install --set-string`
flag. You can use the `-set-string` flag multiple times to specify multiple strings.
Consul Helm chart values are supported. | none | +| `-timeout` | Specifies how long to wait for the installation process to complete before timing out. The value is specified with an integer and string value indicating a unit of time.
The following units are supported:
`ms` (milliseconds)
`s` (seconds)
`m` (minutes)
In the following example, installation will timeout after one minute:
`consul-k8s install -timeout 1m` | `10m` | +| `-wait` | Boolean value that determines if Consul should wait for resources in the installation to be ready before exiting the command. | `true` | +| `-verbose`, `-v` | Boolean value that specifies whether to output verbose logs from the install command with the status of resources being installed. | `false` | +| `-help`, `-h` | Prints usage information for this option. | none | See [Global Options](#global-options) for additional commands that you can use when installing Consul on Kubernetes. @@ -106,10 +106,10 @@ Consul in your Kubernetes Cluster. $ consul-k8s proxy list ``` -| Flag | Description | Default | Required | -| -------------------------------------------- | ----------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | -------- | -| `-all-namespaces`, `-A`       | `Boolean` List pods in all Kubernetes namespaces. | `false` | Optional | -| `-namespace`, `-n` | `String` The Kubernetes namespace to list proxies in. | Current [kubeconfig](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/) namespace. | Optional | +| Flag | Description | Default | +| -------------------------------------------- | ----------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| `-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. | See [Global Options](#global-options) for additional commands that you can use when installing Consul on Kubernetes. @@ -194,18 +194,18 @@ of a Kubernetes Pod. The following options are available. -| Flag | Description | Default | Required | -| ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------- | -------- | -| `-namespace`, `-n`         | `String` The namespace where the target Pod can be found. | Current [kubeconfig](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/) namespace. | Optional | -| `-output`, `-o` | `String` Output the Envoy configuration as 'table', 'json', or 'raw'. | `'table'` | Optional | -| `-clusters` | `Boolean` Filter output to only show clusters. | `false` | Optional | -| `-endpoints` | `Boolean` Filter output to only show endpoints. | `false` | Optional | -| `-listeners` | `Boolean` Filter output to only show listeners. | `false` | Optional | -| `-routes` | `Boolean` Filter output to only show routes. | `false` | Optional | -| `-secrets` | `Boolean` Filter output to only show secrets. | `false` | Optional | -| `-address` | `String` Filter clusters, endpoints, and listeners output to only those with endpoint addresses which contain the given value. | `""` | Optional | -| `-fqdn` | `String` Filter cluster output to only clusters with a fully qualified domain name which contains the given value. | `""` | Optional | -| `-port` | `Int` Filter endpoints output to only endpoints with the given port number. | `-1` which does not filter by port | Optional | +| Flag | Description | Default | +| ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------- | +| `-namespace`, `-n`         | `String` The namespace where the target Pod can be found. | Current [kubeconfig](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/) namespace. | +| `-output`, `-o` | `String` Output the Envoy configuration as 'table', 'json', or 'raw'. | `'table'` | +| `-clusters` | `Boolean` Filter output to only show clusters. | `false` | +| `-endpoints` | `Boolean` Filter output to only show endpoints. | `false` | +| `-listeners` | `Boolean` Filter output to only show listeners. | `false` | +| `-routes` | `Boolean` Filter output to only show routes. | `false` | +| `-secrets` | `Boolean` Filter output to only show secrets. | `false` | +| `-address` | `String` Filter clusters, endpoints, and listeners output to only those with endpoint addresses which contain the given value. | `""` | +| `-fqdn` | `String` Filter cluster output to only clusters with a fully qualified domain name which contains the given value. | `""` | +| `-port` | `Int` Filter endpoints output to only endpoints with the given port number. | `-1` which does not filter by port | #### Example commands @@ -404,14 +404,14 @@ $ consul-k8s uninstall The following options are available. -| Flag | Description | Default | Required | -| --------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -------- | -| `-auto-approve`                                     | Boolean value that enables you to skip the removal confirmation prompt. | `false` | Optional | -| `-name` | String value for the name of the installation to remove. | none | Optional | -| `-namespace` | String value that specifies the namespace of the Consul installation to remove. | `consul` | Optional | -| `-timeout` | Specifies how long to wait for the removal process to complete before timing out. The value is specified with an integer and string value indicating a unit of time.
The following units are supported:
`ms` (milliseconds)
`s` (seconds)
`m` (minutes)
`h` (hours)
In the following example, removal will timeout after one minute:
`consul-k8s uninstall -timeout 1m` | `10m` | Optional | -| `-wipe-data` | Boolean value that deletes PVCs and secrets associated with the Consul installation during installation.
Data will be removed without a verification prompt if the `-auto-approve` flag is set to `true`. | `false`
Instructions for removing data will be printed to the console. | Optional | -| `--help` | Prints usage information for this option. | none | Optional | +| Flag | Description | Default | +| --------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `-auto-approve`                                     | Boolean value that enables you to skip the removal confirmation prompt. | `false` | +| `-name` | String value for the name of the installation to remove. | none | +| `-namespace` | String value that specifies the namespace of the Consul installation to remove. | `consul` | +| `-timeout` | Specifies how long to wait for the removal process to complete before timing out. The value is specified with an integer and string value indicating a unit of time.
The following units are supported:
`ms` (milliseconds)
`s` (seconds)
`m` (minutes)
`h` (hours)
In the following example, removal will timeout after one minute:
`consul-k8s uninstall -timeout 1m` | `10m` | +| `-wipe-data` | Boolean value that deletes PVCs and secrets associated with the Consul installation during installation.
Data will be removed without a verification prompt if the `-auto-approve` flag is set to `true`. | `false`
Instructions for removing data will be printed to the console. | +| `--help` | Prints usage information for this option. | none | See [Global Options](#global-options) for additional commands that you can use when uninstalling Consul from Kubernetes. @@ -435,20 +435,20 @@ $ consul-k8s upgrade The following options are available. -| Flag | Description | Default | Required | -| --------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- | -------- | -| `-auto-approve`                                     | Boolean value that enables you to skip the upgrade confirmation prompt. | `false` | Optional | -| `-dry-run` | Boolean value that allows you to run pre-upgrade checks and returns a summary of the upgrade. | `false` | Optional | -| `-config-file` | String value that specifies the path to a file containing custom upgrade configurations, e.g., Consul Helm chart values file.
You can use the `-config-file` flag multiple times to specify multiple files. | none | Optional | -| `-namespace` | String value that specifies the namespace of the Consul installation. | `consul` | Optional | -| `-preset` | String value that upgrades Consul based on a preset configuration. | Configuration of the Consul Helm chart. | Optional | -| `-set` | String value that enables you to set a customizable value. This flag is comparable to the `helm upgrade --set` flag.
You can use the `-set` flag multiple times to set multiple values.
Consul Helm chart values are supported. | none | Optional | -| `-set-file` | String value that specifies the name of an arbitrary config file. This flag is comparable to the `helm upgrade --set-file`
flag. The contents of the file will be used to set a customizable value. You can use the `-set-file` flag multiple times to specify multiple files.
Consul Helm chart values are supported. | none | Optional | -| `-set-string` | String value that enables you to set a customizable string value. This flag is comparable to the `helm upgrade --set-string`
flag. You can use the `-set-string` flag multiple times to specify multiple strings.
Consul Helm chart values are supported. | none | Optional | -| `-timeout` | Specifies how long to wait for the upgrade process to complete before timing out. The value is specified with an integer and string value indicating a unit of time.
The following units are supported:
`ms` (milliseconds)
`s` (seconds)
`m` (minutes)
In the following example, the upgrade will timeout after one minute:
`consul-k8s upgrade -timeout 1m` | `10m` | Optional | -| `-wait` | Boolean value that determines if Consul should wait for resources in the upgrade to be ready before exiting the command. | `true` | Optional | -| `-verbose`, `-v` | Boolean value that specifies whether to output verbose logs from the upgrade command with the status of resources being upgraded. | `false` | Optional | -| `--help` | Prints usage information for this option. | none | Optional | +| Flag | Description | Default | +| --------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- | +| `-auto-approve`                                     | Boolean value that enables you to skip the upgrade confirmation prompt. | `false` | +| `-dry-run` | Boolean value that allows you to run pre-upgrade checks and returns a summary of the upgrade. | `false` | +| `-config-file` | String value that specifies the path to a file containing custom upgrade configurations, e.g., Consul Helm chart values file.
You can use the `-config-file` flag multiple times to specify multiple files. | none | +| `-namespace` | String value that specifies the namespace of the Consul installation. | `consul` | +| `-preset` | String value that upgrades Consul based on a preset configuration. | Configuration of the Consul Helm chart. | +| `-set` | String value that enables you to set a customizable value. This flag is comparable to the `helm upgrade --set` flag.
You can use the `-set` flag multiple times to set multiple values.
Consul Helm chart values are supported. | none | +| `-set-file` | String value that specifies the name of an arbitrary config file. This flag is comparable to the `helm upgrade --set-file`
flag. The contents of the file will be used to set a customizable value. You can use the `-set-file` flag multiple times to specify multiple files.
Consul Helm chart values are supported. | none | +| `-set-string` | String value that enables you to set a customizable string value. This flag is comparable to the `helm upgrade --set-string`
flag. You can use the `-set-string` flag multiple times to specify multiple strings.
Consul Helm chart values are supported. | none | +| `-timeout` | Specifies how long to wait for the upgrade process to complete before timing out. The value is specified with an integer and string value indicating a unit of time.
The following units are supported:
`ms` (milliseconds)
`s` (seconds)
`m` (minutes)
In the following example, the upgrade will timeout after one minute:
`consul-k8s upgrade -timeout 1m` | `10m` | +| `-wait` | Boolean value that determines if Consul should wait for resources in the upgrade to be ready before exiting the command. | `true` | +| `-verbose`, `-v` | Boolean value that specifies whether to output verbose logs from the upgrade command with the status of resources being upgraded. | `false` | +| `--help` | Prints usage information for this option. | none | See [Global Options](#global-options) for additional commands that you can use when installing Consul on Kubernetes. @@ -470,7 +470,7 @@ $ consul-k8s --version The following global options are available. -| Flag | Description | Default | Required | -| ------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ------- | -------- | -| `-context`                   | String value that sets the Kubernetes context to use for Consul K8s CLI operations. | none | Optional | -| `-kubeconfig`
Alias: `-c` | String value that specifies the path to the `kubeconfig` file.
| none | Optional | +| Flag | Description | Default | +| ------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ------- | +| `-context`                   | String value that sets the Kubernetes context to use for Consul K8s CLI operations. | none | +| `-kubeconfig`
Alias: `-c` | String value that specifies the path to the `kubeconfig` file.
| none | From 466dce19a96d56f4b13f5641812d8268383147b9 Mon Sep 17 00:00:00 2001 From: Thomas Eckert Date: Mon, 8 Aug 2022 14:56:50 -0400 Subject: [PATCH 08/24] Change   to --- website/content/docs/k8s/k8s-cli.mdx | 120 +++++++++++++-------------- 1 file changed, 60 insertions(+), 60 deletions(-) diff --git a/website/content/docs/k8s/k8s-cli.mdx b/website/content/docs/k8s/k8s-cli.mdx index fe2154bd3d..d7275c7d0b 100644 --- a/website/content/docs/k8s/k8s-cli.mdx +++ b/website/content/docs/k8s/k8s-cli.mdx @@ -2,13 +2,13 @@ layout: docs page_title: Consul K8s CLI Reference description: >- - Consul K8s CLI is a tool for quickly installing and interacting with Consul on Kubernetes. + The Consul on Kubernetes CLI is a tool for installing and managing Consul on Kubernetes. --- # Consul on Kubernetes CLI Reference The Consul on Kubernetes CLI, `consul-k8s`, is a tool for managing Consul -without requiring `Helm`, the [Consul CLI](/commands/index), or `kubectl`. +without needing `Helm`, the [Consul CLI](/commands/index), or `kubectl`. -> **Note**: For guidance on how to install `consul-k8s`, visit the [Installing the Consul K8s CLI](/docs/k8s/installation/install-cli) documentation. @@ -46,26 +46,26 @@ $ consul-k8s install The following options are available. -| Flag | Description | Default | -| --------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- | -| `-auto-approve`                                     | Boolean value that enables you to skip the installation confirmation prompt. | `false` | -| `-dry-run` | Boolean value that validates the installation and returns a summary. | `false` | -| `-config-file` | String value that specifies the path to a file containing custom installation configurations, e.g., Consul Helm chart values file.
You can use the `-config-file` flag multiple times to specify multiple files. | none | -| `-namespace` | String value that specifies the namespace of the Consul installation. | `consul` | -| `-preset` | String value that installs Consul based on a preset configuration. You can specify the following values:
`demo`: Installs a single replica server with sidecar injection enabled; useful for testing service mesh functionality.
`secure`: Installs a single replica server with sidecar injection, ACLs, and TLS enabled; useful for testing service mesh functionality. | Configuration of the Consul Helm chart. | -| `-set` | String value that enables you to set a customizable value. This flag is comparable to the `helm install --set` flag.
You can use the `-set` flag multiple times to set multiple values.
Consul Helm chart values are supported. | none | -| `-set-file` | String value that specifies the name of an arbitrary config file. This flag is comparable to the `helm install --set-file`
flag. The contents of the file will be used to set a customizable value. You can use the `-set-file` flag multiple times to specify multiple files.
Consul Helm chart values are supported. | none | -| `-set-string` | String value that enables you to set a customizable string value. This flag is comparable to the `helm install --set-string`
flag. You can use the `-set-string` flag multiple times to specify multiple strings.
Consul Helm chart values are supported. | none | -| `-timeout` | Specifies how long to wait for the installation process to complete before timing out. The value is specified with an integer and string value indicating a unit of time.
The following units are supported:
`ms` (milliseconds)
`s` (seconds)
`m` (minutes)
In the following example, installation will timeout after one minute:
`consul-k8s install -timeout 1m` | `10m` | -| `-wait` | Boolean value that determines if Consul should wait for resources in the installation to be ready before exiting the command. | `true` | -| `-verbose`, `-v` | Boolean value that specifies whether to output verbose logs from the install command with the status of resources being installed. | `false` | -| `-help`, `-h` | Prints usage information for this option. | none | +| Flag | Description | Default | +| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------| +|
`-auto-approve` | Boolean value that enables you to skip the installation confirmation prompt. | `false` | +| `-dry-run` | Boolean value that validates the installation and returns a summary. | `false` | +| `-config-file` | String value that specifies the path to a file containing custom installation configurations, e.g., Consul Helm chart values file.
You can use the `-config-file` flag multiple times to specify multiple files. | none | +| `-namespace` | String value that specifies the namespace of the Consul installation. | `consul` | +| `-preset` | String value that installs Consul based on a preset configuration. You can specify the following values:
`demo`: Installs a single replica server with sidecar injection enabled; useful for testing service mesh functionality.
`secure`: Installs a single replica server with sidecar injection, ACLs, and TLS enabled; useful for testing service mesh functionality. | Configuration of the Consul Helm chart. | +| `-set` | String value that enables you to set a customizable value. This flag is comparable to the `helm install --set` flag.
You can use the `-set` flag multiple times to set multiple values.
Consul Helm chart values are supported. | none | +| `-set-file` | String value that specifies the name of an arbitrary config file. This flag is comparable to the `helm install --set-file`
flag. The contents of the file will be used to set a customizable value. You can use the `-set-file` flag multiple times to specify multiple files.
Consul Helm chart values are supported. | none | +| `-set-string` | String value that enables you to set a customizable string value. This flag is comparable to the `helm install --set-string`
flag. You can use the `-set-string` flag multiple times to specify multiple strings.
Consul Helm chart values are supported. | none | +| `-timeout` | Specifies how long to wait for the installation process to complete before timing out. The value is specified with an integer and string value indicating a unit of time.
The following units are supported:
`ms` (milliseconds)
`s` (seconds)
`m` (minutes)
In the following example, installation will timeout after one minute:
`consul-k8s install -timeout 1m` | `10m` | +| `-wait` | Boolean value that determines if Consul should wait for resources in the installation to be ready before exiting the command. | `true` | +| `-verbose`, `-v` | Boolean value that specifies whether to output verbose logs from the install command with the status of resources being installed. | `false` | +| `-help`, `-h` | Prints usage information for this option. | none | See [Global Options](#global-options) for additional commands that you can use when installing Consul on Kubernetes. #### Example Commands -The following example command installs Consul according in the `myNS` namespace according to the `secure` preset. +The following example command installs Consul in the `myNS` namespace according to the `secure` preset. ```shell-session $ consul-k8s install -preset=secure -namespace=myNS @@ -106,10 +106,10 @@ Consul in your Kubernetes Cluster. $ consul-k8s proxy list ``` -| Flag | Description | Default | -| -------------------------------------------- | ----------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | -| `-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. | +| Flag | Description | Default | +| ------------------------------------ | ----------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| `-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. | See [Global Options](#global-options) for additional commands that you can use when installing Consul on Kubernetes. @@ -169,7 +169,7 @@ $ consul-k8s proxy list -A ``` ``` -Namespace: All Namespaces +Namespace: All namespaces Namespace Name Type consul consul-ingress-gateway-6fb5544485-br6fl Ingress Gateway @@ -194,18 +194,18 @@ of a Kubernetes Pod. The following options are available. -| Flag | Description | Default | -| ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------- | -| `-namespace`, `-n`         | `String` The namespace where the target Pod can be found. | Current [kubeconfig](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/) namespace. | -| `-output`, `-o` | `String` Output the Envoy configuration as 'table', 'json', or 'raw'. | `'table'` | -| `-clusters` | `Boolean` Filter output to only show clusters. | `false` | -| `-endpoints` | `Boolean` Filter output to only show endpoints. | `false` | -| `-listeners` | `Boolean` Filter output to only show listeners. | `false` | -| `-routes` | `Boolean` Filter output to only show routes. | `false` | -| `-secrets` | `Boolean` Filter output to only show secrets. | `false` | -| `-address` | `String` Filter clusters, endpoints, and listeners output to only those with endpoint addresses which contain the given value. | `""` | -| `-fqdn` | `String` Filter cluster output to only clusters with a fully qualified domain name which contains the given value. | `""` | -| `-port` | `Int` Filter endpoints output to only endpoints with the given port number. | `-1` which does not filter by port | +| Flag | Description | Default | +| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------- | +| `-namespace`, `-n` | `String` The namespace where the target Pod can be found. | Current [kubeconfig](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/) namespace. | +| `-output`, `-o` | `String` Output the Envoy configuration as 'table', 'json', or 'raw'. | `'table'` | +| `-clusters` | `Boolean` Filter output to only show clusters. | `false` | +| `-endpoints` | `Boolean` Filter output to only show endpoints. | `false` | +| `-listeners` | `Boolean` Filter output to only show listeners. | `false` | +| `-routes` | `Boolean` Filter output to only show routes. | `false` | +| `-secrets` | `Boolean` Filter output to only show secrets. | `false` | +| `-address` | `String` Filter clusters, endpoints, and listeners output to only those with endpoint addresses which contain the given value. | `""` | +| `-fqdn` | `String` Filter cluster output to only clusters with a fully qualified domain name which contains the given value. | `""` | +| `-port` | `Int` Filter endpoints output to only endpoints with the given port number. | `-1` which does not filter by port | #### Example commands @@ -404,14 +404,14 @@ $ consul-k8s uninstall The following options are available. -| Flag | Description | Default | -| --------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -| `-auto-approve`                                     | Boolean value that enables you to skip the removal confirmation prompt. | `false` | -| `-name` | String value for the name of the installation to remove. | none | -| `-namespace` | String value that specifies the namespace of the Consul installation to remove. | `consul` | -| `-timeout` | Specifies how long to wait for the removal process to complete before timing out. The value is specified with an integer and string value indicating a unit of time.
The following units are supported:
`ms` (milliseconds)
`s` (seconds)
`m` (minutes)
`h` (hours)
In the following example, removal will timeout after one minute:
`consul-k8s uninstall -timeout 1m` | `10m` | -| `-wipe-data` | Boolean value that deletes PVCs and secrets associated with the Consul installation during installation.
Data will be removed without a verification prompt if the `-auto-approve` flag is set to `true`. | `false`
Instructions for removing data will be printed to the console. | -| `--help` | Prints usage information for this option. | none | +| Flag | Description | Default | +| ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `-auto-approve` | Boolean value that enables you to skip the removal confirmation prompt. | `false` | +| `-name` | String value for the name of the installation to remove. | none | +| `-namespace` | String value that specifies the namespace of the Consul installation to remove. | `consul` | +| `-timeout` | Specifies how long to wait for the removal process to complete before timing out. The value is specified with an integer and string value indicating a unit of time.
The following units are supported:
`ms` (milliseconds)
`s` (seconds)
`m` (minutes)
`h` (hours)
In the following example, removal will timeout after one minute:
`consul-k8s uninstall -timeout 1m` | `10m` | +| `-wipe-data` | Boolean value that deletes PVCs and secrets associated with the Consul installation during installation.
Data will be removed without a verification prompt if the `-auto-approve` flag is set to `true`. | `false`
Instructions for removing data will be printed to the console. | +| `--help` | Prints usage information for this option. | none | See [Global Options](#global-options) for additional commands that you can use when uninstalling Consul from Kubernetes. @@ -435,20 +435,20 @@ $ consul-k8s upgrade The following options are available. -| Flag | Description | Default | -| --------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- | -| `-auto-approve`                                     | Boolean value that enables you to skip the upgrade confirmation prompt. | `false` | -| `-dry-run` | Boolean value that allows you to run pre-upgrade checks and returns a summary of the upgrade. | `false` | -| `-config-file` | String value that specifies the path to a file containing custom upgrade configurations, e.g., Consul Helm chart values file.
You can use the `-config-file` flag multiple times to specify multiple files. | none | -| `-namespace` | String value that specifies the namespace of the Consul installation. | `consul` | -| `-preset` | String value that upgrades Consul based on a preset configuration. | Configuration of the Consul Helm chart. | -| `-set` | String value that enables you to set a customizable value. This flag is comparable to the `helm upgrade --set` flag.
You can use the `-set` flag multiple times to set multiple values.
Consul Helm chart values are supported. | none | -| `-set-file` | String value that specifies the name of an arbitrary config file. This flag is comparable to the `helm upgrade --set-file`
flag. The contents of the file will be used to set a customizable value. You can use the `-set-file` flag multiple times to specify multiple files.
Consul Helm chart values are supported. | none | -| `-set-string` | String value that enables you to set a customizable string value. This flag is comparable to the `helm upgrade --set-string`
flag. You can use the `-set-string` flag multiple times to specify multiple strings.
Consul Helm chart values are supported. | none | -| `-timeout` | Specifies how long to wait for the upgrade process to complete before timing out. The value is specified with an integer and string value indicating a unit of time.
The following units are supported:
`ms` (milliseconds)
`s` (seconds)
`m` (minutes)
In the following example, the upgrade will timeout after one minute:
`consul-k8s upgrade -timeout 1m` | `10m` | -| `-wait` | Boolean value that determines if Consul should wait for resources in the upgrade to be ready before exiting the command. | `true` | -| `-verbose`, `-v` | Boolean value that specifies whether to output verbose logs from the upgrade command with the status of resources being upgraded. | `false` | -| `--help` | Prints usage information for this option. | none | +| Flag | Description | Default | +| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- | +| `-auto-approve` | Boolean value that enables you to skip the upgrade confirmation prompt. | `false` | +| `-dry-run` | Boolean value that allows you to run pre-upgrade checks and returns a summary of the upgrade. | `false` | +| `-config-file` | String value that specifies the path to a file containing custom upgrade configurations, e.g., Consul Helm chart values file.
You can use the `-config-file` flag multiple times to specify multiple files. | none | +| `-namespace` | String value that specifies the namespace of the Consul installation. | `consul` | +| `-preset` | String value that upgrades Consul based on a preset configuration. | Configuration of the Consul Helm chart. | +| `-set` | String value that enables you to set a customizable value. This flag is comparable to the `helm upgrade --set` flag.
You can use the `-set` flag multiple times to set multiple values.
Consul Helm chart values are supported. | none | +| `-set-file` | String value that specifies the name of an arbitrary config file. This flag is comparable to the `helm upgrade --set-file`
flag. The contents of the file will be used to set a customizable value. You can use the `-set-file` flag multiple times to specify multiple files.
Consul Helm chart values are supported. | none | +| `-set-string` | String value that enables you to set a customizable string value. This flag is comparable to the `helm upgrade --set-string`
flag. You can use the `-set-string` flag multiple times to specify multiple strings.
Consul Helm chart values are supported. | none | +| `-timeout` | Specifies how long to wait for the upgrade process to complete before timing out. The value is specified with an integer and string value indicating a unit of time.
The following units are supported:
`ms` (milliseconds)
`s` (seconds)
`m` (minutes)
In the following example, the upgrade will timeout after one minute:
`consul-k8s upgrade -timeout 1m` | `10m` | +| `-wait` | Boolean value that determines if Consul should wait for resources in the upgrade to be ready before exiting the command. | `true` | +| `-verbose`, `-v` | Boolean value that specifies whether to output verbose logs from the upgrade command with the status of resources being upgraded. | `false` | +| `--help` | Prints usage information for this option. | none | See [Global Options](#global-options) for additional commands that you can use when installing Consul on Kubernetes. @@ -470,7 +470,7 @@ $ consul-k8s --version The following global options are available. -| Flag | Description | Default | -| ------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ------- | -| `-context`                   | String value that sets the Kubernetes context to use for Consul K8s CLI operations. | none | -| `-kubeconfig`
Alias: `-c` | String value that specifies the path to the `kubeconfig` file.
| none | +| Flag | Description | Default | +| -------------------------------- | ----------------------------------------------------------------------------------- | ------- | +| `-context` | String value that sets the Kubernetes context to use for Consul K8s CLI operations. | none | +| `-kubeconfig`, `-c` | String value that specifies the path to the `kubeconfig` file.
| none | From d278b56734c1de0fe6bca8c6256607702945a7dd Mon Sep 17 00:00:00 2001 From: Thomas Eckert Date: Mon, 8 Aug 2022 15:16:55 -0400 Subject: [PATCH 09/24] Add read command examples --- website/content/docs/k8s/k8s-cli.mdx | 286 +++++++++++++++++++-------- 1 file changed, 199 insertions(+), 87 deletions(-) diff --git a/website/content/docs/k8s/k8s-cli.mdx b/website/content/docs/k8s/k8s-cli.mdx index d7275c7d0b..43aaff33cc 100644 --- a/website/content/docs/k8s/k8s-cli.mdx +++ b/website/content/docs/k8s/k8s-cli.mdx @@ -97,8 +97,8 @@ The following example commands install Consul on Kubernetes using custom values, The `proxy` command exposes two subcommands for interacting proxies managed by Consul in your Kubernetes Cluster. -- [`proxy list`](#proxy-list) List all Kubernetes pods running proxies managed by Consul. -- [`proxy read`](#proxy-read) Inspect the Envoy configuration for a given Pod. +- [`proxy list`](#proxy-list): List all Pods running proxies managed by Consul. +- [`proxy read`](#proxy-read): Inspect the Envoy configuration for a given Pod. ### `proxy list` @@ -111,7 +111,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. | -See [Global Options](#global-options) for additional commands that you can use +See [Global Options](#global-options) for additional options that you can use when installing Consul on Kubernetes. This command will list proxies alongside their `Type`. Types of proxies include @@ -162,7 +162,7 @@ consul-ingress-gateway-6fb5544485-br6fl Ingress Gateway consul-ingress-gateway-6fb5544485-m54sp Ingress Gateway ``` -Display all pods across all +Display all pods across all namespaces which run proxies managed by Consul. ```shell-session $ consul-k8s proxy list -A @@ -183,14 +183,16 @@ default frontend-676564547c-v2mfq Sidecar ### `proxy read` -The `proxy read` command allows you to inspect the configuration of any Envoy proxies running on a given Pod. +The `proxy read` command allows you to inspect the configuration of Envoy proxies running on a given Pod. ```shell-session $ consul-k8s proxy read ``` The command takes a required value, ``. This should be the full name -of a Kubernetes Pod. +of a Kubernetes Pod. If a Pod is running more than one Envoy proxy managed by +Consul, as in the [Multiport configuration](https://www.consul.io/docs/k8s/connect#kubernetes-pods-with-multiple-ports), +configuration for all proxies in the Pod will be displayed. The following options are available. @@ -220,40 +222,38 @@ $ consul-k8s proxy read backend-658b679b45-d5xlb Envoy configuration for backend-658b679b45-d5xlb in namespace default: ==> Clusters (5) -Name FQDN Endpoints Type Last Updated -local_agent local_agent 192.168.79.187:8502 STATIC 2022-05-13T04:22:39.553Z -client client.default.dc1.internal.bc3815c2-1a0f-f3ff-a2e9-20d791f08d00.consul EDS 2022-07-21T12:12:27.335Z -frontend frontend.default.dc1.internal.bc3815c2-1a0f-f3ff-a2e9-20d791f08d00.consul EDS 2022-07-21T12:12:27.242Z -local_app local_app 127.0.0.1:8080 STATIC 2022-05-13T04:22:39.655Z -original-destination original-destination ORIGINAL_DST 2022-05-13T04:22:39.743Z +Name FQDN Endpoints Type Last Updated +local_agent local_agent 192.168.79.187:8502 STATIC 2022-05-13T04:22:39.553Z +client client.default.dc1.internal.bc3815c2-1a0f-f3ff-a2e9-20d791f08d00.consul 192.168.18.110:20000, 192.168.52.101:20000, 192.168.65.131:20000 EDS 2022-08-08T12:02:07.471Z +frontend frontend.default.dc1.internal.bc3815c2-1a0f-f3ff-a2e9-20d791f08d00.consul 192.168.63.120:20000 EDS 2022-08-08T12:02:07.354Z +local_app local_app 127.0.0.1:8080 STATIC 2022-05-13T04:22:39.655Z +original-destination original-destination ORIGINAL_DST 2022-05-13T04:22:39.743Z ==> Endpoints (6) -Address:Port Cluster Weight Status -192.168.79.187:8502 local_agent 1.00 HEALTHY -192.168.18.110:20000 1.00 HEALTHY -192.168.52.101:20000 1.00 HEALTHY -192.168.65.131:20000 1.00 HEALTHY -192.168.63.120:20000 1.00 HEALTHY -127.0.0.1:8080 local_app 1.00 HEALTHY - +Address:Port Cluster Weight Status +192.168.79.187:8502 local_agent 1.00 HEALTHY +192.168.18.110:20000 client.default.dc1.internal.bc3815c2-1a0f-f3ff-a2e9-20d791f08d00.consul 1.00 HEALTHY +192.168.52.101:20000 client.default.dc1.internal.bc3815c2-1a0f-f3ff-a2e9-20d791f08d00.consul 1.00 HEALTHY +192.168.65.131:20000 client.default.dc1.internal.bc3815c2-1a0f-f3ff-a2e9-20d791f08d00.consul 1.00 HEALTHY +192.168.63.120:20000 frontend.default.dc1.internal.bc3815c2-1a0f-f3ff-a2e9-20d791f08d00.consul 1.00 HEALTHY +127.0.0.1:8080 local_app 1.00 HEALTHY ==> Listeners (2) Name Address:Port Direction Filter Chain Match Filters Last Updated -public_listener 192.168.69.179:20000 INBOUND Any * -> local_app/ 2022-07-21T12:12:42.148Z -outbound_listener 127.0.0.1:15001 OUTBOUND 10.100.134.173/32, 240.0.0.3/32 -> client.default.dc1.internal.bc3815c2-1a0f-f3ff-a2e9-20d791f08d00.consul 2022-07-18T15:31:03.246Z - 10.100.31.2/32, 240.0.0.5/32 -> frontend.default.dc1.internal.bc3815c2-1a0f-f3ff-a2e9-20d791f08d00.consul - Any -> original-destination - +public_listener 192.168.69.179:20000 INBOUND Any * to local_app/ 2022-08-08T12:02:22.261Z +outbound_listener 127.0.0.1:15001 OUTBOUND 10.100.134.173/32, 240.0.0.3/32 to client.default.dc1.internal.bc3815c2-1a0f-f3ff-a2e9-20d791f08d00.consul 2022-07-18T15:31:03.246Z + 10.100.31.2/32, 240.0.0.5/32 to frontend.default.dc1.internal.bc3815c2-1a0f-f3ff-a2e9-20d791f08d00.consul + Any to original-destination ==> Routes (1) Name Destination Cluster Last Updated -public_listener local_app/ 2022-07-21T12:12:42.147Z - +public_listener local_app/ 2022-08-08T12:02:22.260Z ==> Secrets (0) Name Type Last Updated + ``` Get the Envoy configuration summary for all clusters with a fully qualified @@ -264,30 +264,181 @@ $ consul-k8s proxy read backend-658b679b45-d5xlb -fqdn default -clusters -listen ``` ``` -Envoy configuration for backend-658b679b45-d5xlb in namespace default: - ==> Filters applied Fully qualified domain names containing: default +Envoy configuration for backend-658b679b45-d5xlb in namespace default: + ==> Clusters (2) -Name FQDN Endpoints Type Last Updated -client client.default.dc1.internal.bc3815c2-1a0f-f3ff-a2e9-20d791f08d00.consul EDS 2022-07-21T12:12:27.335Z -frontend frontend.default.dc1.internal.bc3815c2-1a0f-f3ff-a2e9-20d791f08d00.consul EDS 2022-07-21T12:12:27.242Z +Name FQDN Endpoints Type Last Updated +client client.default.dc1.internal.bc3815c2-1a0f-f3ff-a2e9-20d791f08d00.consul 192.168.18.110:20000, 192.168.52.101:20000, 192.168.65.131:20000 EDS 2022-08-08T12:02:07.471Z +frontend frontend.default.dc1.internal.bc3815c2-1a0f-f3ff-a2e9-20d791f08d00.consul 192.168.63.120:20000 EDS 2022-08-08T12:02:07.354Z ==> Listeners (2) Name Address:Port Direction Filter Chain Match Filters Last Updated -public_listener 192.168.69.179:20000 INBOUND Any * -> local_app/ 2022-07-21T12:12:42.148Z -outbound_listener 127.0.0.1:15001 OUTBOUND 10.100.134.173/32, 240.0.0.3/32 -> client.default.dc1.internal.bc3815c2-1a0f-f3ff-a2e9-20d791f08d00.consul 2022-07-18T15:31:03.246Z - 10.100.31.2/32, 240.0.0.5/32 -> frontend.default.dc1.internal.bc3815c2-1a0f-f3ff-a2e9-20d791f08d00.consul - Any -> original-destination +public_listener 192.168.69.179:20000 INBOUND Any * to local_app/ 2022-08-08T12:02:22.261Z +outbound_listener 127.0.0.1:15001 OUTBOUND 10.100.134.173/32, 240.0.0.3/32 to client.default.dc1.internal.bc3815c2-1a0f-f3ff-a2e9-20d791f08d00.consul 2022-07-18T15:31:03.246Z + 10.100.31.2/32, 240.0.0.5/32 to frontend.default.dc1.internal.bc3815c2-1a0f-f3ff-a2e9-20d791f08d00.consul + Any to original-destination ``` -Get the raw Envoy configuration dump for the Envoy proxy running on the Pod -`backend-658b679b45-d5xlb`. The raw configuration will be output for each -service as a JSON map. The [JQ command line tool](https://stedolan.github.io/jq/) -can be used to index into the configuration for the service you want to inspect. +Get the Envoy configuration summary in a JSON format. Note that this is not the +same as the raw configuration dump from the admin API. This information is the +same as what is displayed in the table output above, but in a JSON format. + +```shell-session +$ consul-k8s proxy read backend-658b679b45-d5xlb -o json +``` + +``` +{ + "backend-658b679b45-d5xlb": { + "clusters": [ + { + "Name": "local_agent", + "FullyQualifiedDomainName": "local_agent", + "Endpoints": [ + "192.168.79.187:8502" + ], + "Type": "STATIC", + "LastUpdated": "2022-05-13T04:22:39.553Z" + }, + { + "Name": "client", + "FullyQualifiedDomainName": "client.default.dc1.internal.bc3815c2-1a0f-f3ff-a2e9-20d791f08d00.consul", + "Endpoints": [ + "192.168.18.110:20000", + "192.168.52.101:20000", + "192.168.65.131:20000" + ], + "Type": "EDS", + "LastUpdated": "2022-08-08T12:02:07.471Z" + }, + { + "Name": "frontend", + "FullyQualifiedDomainName": "frontend.default.dc1.internal.bc3815c2-1a0f-f3ff-a2e9-20d791f08d00.consul", + "Endpoints": [ + "192.168.63.120:20000" + ], + "Type": "EDS", + "LastUpdated": "2022-08-08T12:02:07.354Z" + }, + { + "Name": "local_app", + "FullyQualifiedDomainName": "local_app", + "Endpoints": [ + "127.0.0.1:8080" + ], + "Type": "STATIC", + "LastUpdated": "2022-05-13T04:22:39.655Z" + }, + { + "Name": "original-destination", + "FullyQualifiedDomainName": "original-destination", + "Endpoints": [], + "Type": "ORIGINAL_DST", + "LastUpdated": "2022-05-13T04:22:39.743Z" + } + ], + "endpoints": [ + { + "Address": "192.168.79.187:8502", + "Cluster": "local_agent", + "Weight": 1, + "Status": "HEALTHY" + }, + { + "Address": "192.168.18.110:20000", + "Cluster": "client.default.dc1.internal.bc3815c2-1a0f-f3ff-a2e9-20d791f08d00.consul", + "Weight": 1, + "Status": "HEALTHY" + }, + { + "Address": "192.168.52.101:20000", + "Cluster": "client.default.dc1.internal.bc3815c2-1a0f-f3ff-a2e9-20d791f08d00.consul", + "Weight": 1, + "Status": "HEALTHY" + }, + { + "Address": "192.168.65.131:20000", + "Cluster": "client.default.dc1.internal.bc3815c2-1a0f-f3ff-a2e9-20d791f08d00.consul", + "Weight": 1, + "Status": "HEALTHY" + }, + { + "Address": "192.168.63.120:20000", + "Cluster": "frontend.default.dc1.internal.bc3815c2-1a0f-f3ff-a2e9-20d791f08d00.consul", + "Weight": 1, + "Status": "HEALTHY" + }, + { + "Address": "127.0.0.1:8080", + "Cluster": "local_app", + "Weight": 1, + "Status": "HEALTHY" + } + ], + "listeners": [ + { + "Name": "public_listener", + "Address": "192.168.69.179:20000", + "FilterChain": [ + { + "Filters": [ + "* to local_app/" + ], + "FilterChainMatch": "Any" + } + ], + "Direction": "INBOUND", + "LastUpdated": "2022-08-08T12:02:22.261Z" + }, + { + "Name": "outbound_listener", + "Address": "127.0.0.1:15001", + "FilterChain": [ + { + "Filters": [ + "to client.default.dc1.internal.bc3815c2-1a0f-f3ff-a2e9-20d791f08d00.consul" + ], + "FilterChainMatch": "10.100.134.173/32, 240.0.0.3/32" + }, + { + "Filters": [ + "to frontend.default.dc1.internal.bc3815c2-1a0f-f3ff-a2e9-20d791f08d00.consul" + ], + "FilterChainMatch": "10.100.31.2/32, 240.0.0.5/32" + }, + { + "Filters": [ + "to original-destination" + ], + "FilterChainMatch": "Any" + } + ], + "Direction": "OUTBOUND", + "LastUpdated": "2022-07-18T15:31:03.246Z" + } + ], + "routes": [ + { + "Name": "public_listener", + "DestinationCluster": "local_app/", + "LastUpdated": "2022-08-08T12:02:22.260Z" + } + ], + "secrets": [] + } +} +``` + +Get the raw Envoy configuration dump and clusters information for the Envoy +proxy running on the Pod `backend-658b679b45-d5xlb`. The raw configuration will +be output for each service as a JSON map. The +[JQ command line tool](https://stedolan.github.io/jq/) can be used to index into +the configuration for the service you want to inspect. See the [Envoy config dump documentation](https://www.envoyproxy.io/docs/envoy/latest/api-v3/admin/v3/config_dump.proto) for more information on the structure of the config dump. @@ -296,59 +447,20 @@ for more information on the structure of the config dump. $ consul-k8s proxy read backend-658b679b45-d5xlb -o raw ``` +The output is truncated here for brevity. It follows the format below: + ``` { "backend-658b679b45-d5xlb": { - "configs": [ - { - "@type": "type.googleapis.com/envoy.admin.v3.BootstrapConfigDump", - "bootstrap": { - // [-- snip 1201 lines --] - }, - "last_updated": "2022-05-13T04:22:39.488Z" - }, - { - "@type": "type.googleapis.com/envoy.admin.v3.ClustersConfigDump", - "static_clusters": [ - // [-- snip 42 lines --] - ], - "dynamic_active_clusters": [ - // [-- snip 144 lines --] - ] - }, - { - "@type": "type.googleapis.com/envoy.admin.v3.EndpointsConfigDump", - "static_endpoint_configs": [ - // [-- snip 29 lines --] - ], - "dynamic_endpoint_configs": [ - // [-- snip 120 lines --] - ] - }, - { - "@type": "type.googleapis.com/envoy.admin.v3.ListenersConfigDump", - "dynamic_listeners": [ - // [-- snip 216 lines --] - ] - }, - { - "@type": "type.googleapis.com/envoy.admin.v3.ScopedRoutesConfigDump" - }, - { - "@type": "type.googleapis.com/envoy.admin.v3.RoutesConfigDump", - "static_route_configs": [ - // [-- snip 25 lines --] - ] - }, - { - "@type": "type.googleapis.com/envoy.admin.v3.SecretsConfigDump" - } - ] - } + "clusters": { + // [-- snip 372 lines --] output from the Envoy admin interface's /clusters endpoint. + }, + "config_dump": { + // [-- snip 1816 lines --] output from the Envoy admin interface's /config_dump?include_eds endpoint. + } } ``` - ### `status` The `status` command provides an overall status summary of the Consul on Kubernetes installation. It also provides the config that was used to deploy Consul K8s and provides a quick glance at the health of both Consul servers and clients. This command does not take in any flags. From 72df01047204db9311e30ff782320d16fa6b6070 Mon Sep 17 00:00:00 2001 From: Thomas Eckert Date: Mon, 8 Aug 2022 15:33:53 -0400 Subject: [PATCH 10/24] Make external reference links sentences --- website/content/docs/k8s/k8s-cli.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/website/content/docs/k8s/k8s-cli.mdx b/website/content/docs/k8s/k8s-cli.mdx index 43aaff33cc..a122c794ce 100644 --- a/website/content/docs/k8s/k8s-cli.mdx +++ b/website/content/docs/k8s/k8s-cli.mdx @@ -119,13 +119,13 @@ This command will list proxies alongside their `Type`. Types of proxies include - `Sidecar`: these will be the majority of pods in the cluster. They run the proxy in a sidecar pattern to network the pod as a service in the mesh. - `API Gateway`: these pods run a proxy to manage connections with networks - outside of the Consul cluster. [Read more about API gateways](/docs/api-gateway) + outside of the Consul cluster. [Read more about API gateways](/docs/api-gateway). - `Ingress Gateway`: these pods run a proxy to manage ingress into the - Kubernetes cluster. [Read more about ingress gateways](/docs/k8s/connect/ingress-gateways) + Kubernetes cluster. [Read more about ingress gateways](/docs/k8s/connect/ingress-gateways). - `Terminating Gateway`: these pods run a proxy to control connections to - external services. [Read more about terminating gateways](/docs/k8s/connect/terminating-gateways) + external services. [Read more about terminating gateways](/docs/k8s/connect/terminating-gateways). - `Mesh Gateway`: these pods run a proxy to manage connections between - Consul clusters connected using mesh federation. [Read more about Consul Mesh Federation](/docs/k8s/installation/multi-cluster/kubernetes) + Consul clusters connected using mesh federation. [Read more about Consul Mesh Federation](/docs/k8s/installation/multi-cluster/kubernetes). #### Example Commands From 0c2efbee51e8a2f60dab58f9b87799ea527e035d Mon Sep 17 00:00:00 2001 From: Thomas Eckert Date: Mon, 8 Aug 2022 16:55:10 -0400 Subject: [PATCH 11/24] Update website/content/docs/k8s/k8s-cli.mdx Co-authored-by: Tu Nguyen --- website/content/docs/k8s/k8s-cli.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/content/docs/k8s/k8s-cli.mdx b/website/content/docs/k8s/k8s-cli.mdx index a122c794ce..0224e231cd 100644 --- a/website/content/docs/k8s/k8s-cli.mdx +++ b/website/content/docs/k8s/k8s-cli.mdx @@ -2,7 +2,7 @@ layout: docs page_title: Consul K8s CLI Reference description: >- - The Consul on Kubernetes CLI is a tool for installing and managing Consul on Kubernetes. + The Consul on Kubernetes CLI (consul-k8s) is a tool for installing and managing Consul on Kubernetes. --- # Consul on Kubernetes CLI Reference From 9f72758aab38515f48de07e08e871fae4e250071 Mon Sep 17 00:00:00 2001 From: Thomas Eckert Date: Mon, 8 Aug 2022 16:56:26 -0400 Subject: [PATCH 12/24] Clarify use of Helm --- website/content/docs/k8s/k8s-cli.mdx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/website/content/docs/k8s/k8s-cli.mdx b/website/content/docs/k8s/k8s-cli.mdx index 0224e231cd..b1adee2884 100644 --- a/website/content/docs/k8s/k8s-cli.mdx +++ b/website/content/docs/k8s/k8s-cli.mdx @@ -8,7 +8,8 @@ description: >- # Consul on Kubernetes CLI Reference The Consul on Kubernetes CLI, `consul-k8s`, is a tool for managing Consul -without needing `Helm`, the [Consul CLI](/commands/index), or `kubectl`. +without needing to directly interact with Helm, the [Consul CLI](/commands/index), +or `kubectl`. -> **Note**: For guidance on how to install `consul-k8s`, visit the [Installing the Consul K8s CLI](/docs/k8s/installation/install-cli) documentation. From f9420d13dead151465b1a003f19bd0dec744badd Mon Sep 17 00:00:00 2001 From: Thomas Eckert Date: Mon, 8 Aug 2022 16:57:31 -0400 Subject: [PATCH 13/24] to -> on Co-authored-by: Tu Nguyen --- website/content/docs/k8s/k8s-cli.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/content/docs/k8s/k8s-cli.mdx b/website/content/docs/k8s/k8s-cli.mdx index b1adee2884..eff2de7d8a 100644 --- a/website/content/docs/k8s/k8s-cli.mdx +++ b/website/content/docs/k8s/k8s-cli.mdx @@ -39,7 +39,7 @@ You can use the following commands with `consul-k8s`. ### `install` -The `install` command installs Consul to your Kubernetes cluster. +The `install` command installs Consul on your Kubernetes cluster. ```shell-session $ consul-k8s install From e1e1ead19f276e23dd01d9891f163d7971f514ea Mon Sep 17 00:00:00 2001 From: Thomas Eckert Date: Mon, 8 Aug 2022 16:58:19 -0400 Subject: [PATCH 14/24] Note -> Tip Co-authored-by: Tu Nguyen --- website/content/docs/k8s/k8s-cli.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/content/docs/k8s/k8s-cli.mdx b/website/content/docs/k8s/k8s-cli.mdx index eff2de7d8a..90a835aa04 100644 --- a/website/content/docs/k8s/k8s-cli.mdx +++ b/website/content/docs/k8s/k8s-cli.mdx @@ -11,7 +11,7 @@ The Consul on Kubernetes CLI, `consul-k8s`, is a tool for managing Consul without needing to directly interact with Helm, the [Consul CLI](/commands/index), or `kubectl`. --> **Note**: For guidance on how to install `consul-k8s`, visit the +-> **Tip:** For guidance on how to install `consul-k8s`, visit the [Installing the Consul K8s CLI](/docs/k8s/installation/install-cli) documentation. This topic describes the commands and available options for using `consul-k8s`. From e32f16cb45f264eed729cf089fd5ac18dcc74f3f Mon Sep 17 00:00:00 2001 From: Thomas Eckert Date: Mon, 8 Aug 2022 16:58:43 -0400 Subject: [PATCH 15/24] See -> Refer to the Co-authored-by: Tu Nguyen --- website/content/docs/k8s/k8s-cli.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/content/docs/k8s/k8s-cli.mdx b/website/content/docs/k8s/k8s-cli.mdx index 90a835aa04..f1e66bc91e 100644 --- a/website/content/docs/k8s/k8s-cli.mdx +++ b/website/content/docs/k8s/k8s-cli.mdx @@ -112,7 +112,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. | -See [Global Options](#global-options) for additional options that you can use +Refer to the [Global Options](#global-options) for additional options that you can use when installing Consul on Kubernetes. This command will list proxies alongside their `Type`. Types of proxies include From 46c2927eadd63299bff01eb91061540d59b0ed35 Mon Sep 17 00:00:00 2001 From: Thomas Eckert Date: Mon, 8 Aug 2022 17:03:01 -0400 Subject: [PATCH 16/24] Remove extra space from commands --- website/content/docs/k8s/k8s-cli.mdx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/website/content/docs/k8s/k8s-cli.mdx b/website/content/docs/k8s/k8s-cli.mdx index f1e66bc91e..cfd70abf8f 100644 --- a/website/content/docs/k8s/k8s-cli.mdx +++ b/website/content/docs/k8s/k8s-cli.mdx @@ -75,22 +75,22 @@ $ consul-k8s install -preset=secure -namespace=myNS The following example commands install Consul on Kubernetes using custom values, files, or strings that are set via flags. The underlying Consul-on-Kubernetes Helm chart uses the flags to customize the installation. The flags are comparable to the `helm install` [flags](https://helm.sh/docs/helm/helm_install/#helm-install). ```shell-session - $ consul-k8s install -set key=value +$ consul-k8s install -set key=value ``` ```shell-session - $ consul-k8s install -set key1=value1 -set key2=value2 +$ consul-k8s install -set key1=value1 -set key2=value2 ``` ```shell-session - $ consul-k8s install -set-file config1=value1.conf +$ consul-k8s install -set-file config1=value1.conf ``` ```shell-session - $ consul-k8s install -set-file config1=value1.conf -set-file config2=value2.conf +$ consul-k8s install -set-file config1=value1.conf -set-file config2=value2.conf ``` ```shell-session - $ consul-k8s install -set-string key=value-bool +$ consul-k8s install -set-string key=value-bool ``` ### `proxy` From f1f5776575f867441c15c13817bb3778a762be3e Mon Sep 17 00:00:00 2001 From: Thomas Eckert Date: Mon, 8 Aug 2022 17:08:18 -0400 Subject: [PATCH 17/24] Add colon Co-authored-by: Tu Nguyen --- website/content/docs/k8s/k8s-cli.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/content/docs/k8s/k8s-cli.mdx b/website/content/docs/k8s/k8s-cli.mdx index cfd70abf8f..7da9ba3640 100644 --- a/website/content/docs/k8s/k8s-cli.mdx +++ b/website/content/docs/k8s/k8s-cli.mdx @@ -115,7 +115,7 @@ $ consul-k8s proxy list Refer to the [Global Options](#global-options) for additional options that you can use when installing Consul on Kubernetes. -This command will list proxies alongside their `Type`. Types of proxies include +This command will list proxies alongside their `Type`. Types of proxies include: - `Sidecar`: these will be the majority of pods in the cluster. They run the proxy in a sidecar pattern to network the pod as a service in the mesh. From b641be8466bb055a340b616b30203770409ee6d0 Mon Sep 17 00:00:00 2001 From: Thomas Eckert Date: Mon, 8 Aug 2022 17:09:33 -0400 Subject: [PATCH 18/24] Clean up external links about proxies Co-authored-by: Tu Nguyen --- website/content/docs/k8s/k8s-cli.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/website/content/docs/k8s/k8s-cli.mdx b/website/content/docs/k8s/k8s-cli.mdx index 7da9ba3640..1923833701 100644 --- a/website/content/docs/k8s/k8s-cli.mdx +++ b/website/content/docs/k8s/k8s-cli.mdx @@ -120,13 +120,13 @@ This command will list proxies alongside their `Type`. Types of proxies include: - `Sidecar`: these will be the majority of pods in the cluster. They run the proxy in a sidecar pattern to network the pod as a service in the mesh. - `API Gateway`: these pods run a proxy to manage connections with networks - outside of the Consul cluster. [Read more about API gateways](/docs/api-gateway). + outside of the Consul cluster. Read more about [API gateways](/docs/api-gateway). - `Ingress Gateway`: these pods run a proxy to manage ingress into the - Kubernetes cluster. [Read more about ingress gateways](/docs/k8s/connect/ingress-gateways). + Kubernetes cluster. Read more about [ingress gateways](/docs/k8s/connect/ingress-gateways). - `Terminating Gateway`: these pods run a proxy to control connections to - external services. [Read more about terminating gateways](/docs/k8s/connect/terminating-gateways). + external services. Read more about [terminating gateways](/docs/k8s/connect/terminating-gateways). - `Mesh Gateway`: these pods run a proxy to manage connections between - Consul clusters connected using mesh federation. [Read more about Consul Mesh Federation](/docs/k8s/installation/multi-cluster/kubernetes). + Consul clusters connected using mesh federation. Read more about [Consul Mesh Federation](/docs/k8s/installation/multi-cluster/kubernetes). #### Example Commands From 07b240e79c9e1536786902808d57a799311e9259 Mon Sep 17 00:00:00 2001 From: Thomas Eckert Date: Mon, 8 Aug 2022 17:25:25 -0400 Subject: [PATCH 19/24] Combine shell sessions --- website/content/docs/k8s/k8s-cli.mdx | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/website/content/docs/k8s/k8s-cli.mdx b/website/content/docs/k8s/k8s-cli.mdx index 1923833701..2f470a9b3b 100644 --- a/website/content/docs/k8s/k8s-cli.mdx +++ b/website/content/docs/k8s/k8s-cli.mdx @@ -167,9 +167,6 @@ Display all pods across all namespaces which run proxies managed by Consul. ```shell-session $ consul-k8s proxy list -A -``` - -``` Namespace: All namespaces Namespace Name Type @@ -217,9 +214,6 @@ Get the configuration summary for the Envoy proxy running on the Pod ```shell-session $ consul-k8s proxy read backend-658b679b45-d5xlb -``` - -``` Envoy configuration for backend-658b679b45-d5xlb in namespace default: ==> Clusters (5) @@ -262,9 +256,6 @@ domain name which includes `"default"`. Display only clusters and listeners. ```shell-session $ consul-k8s proxy read backend-658b679b45-d5xlb -fqdn default -clusters -listeners -``` - -``` ==> Filters applied Fully qualified domain names containing: default @@ -291,9 +282,6 @@ same as what is displayed in the table output above, but in a JSON format. ```shell-session $ consul-k8s proxy read backend-658b679b45-d5xlb -o json -``` - -``` { "backend-658b679b45-d5xlb": { "clusters": [ @@ -442,15 +430,11 @@ be output for each service as a JSON map. The the configuration for the service you want to inspect. See the [Envoy config dump documentation](https://www.envoyproxy.io/docs/envoy/latest/api-v3/admin/v3/config_dump.proto) -for more information on the structure of the config dump. +for more information on the structure of the config dump. The output is +truncated here for brevity. It follows the format below: ```shell-session $ consul-k8s proxy read backend-658b679b45-d5xlb -o raw -``` - -The output is truncated here for brevity. It follows the format below: - -``` { "backend-658b679b45-d5xlb": { "clusters": { From 71027a4ce11cedd11fe930a4451d3b859f42d45c Mon Sep 17 00:00:00 2001 From: Thomas Eckert Date: Mon, 8 Aug 2022 17:28:36 -0400 Subject: [PATCH 20/24] Clean up raw copy Co-authored-by: Tu Nguyen --- website/content/docs/k8s/k8s-cli.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/website/content/docs/k8s/k8s-cli.mdx b/website/content/docs/k8s/k8s-cli.mdx index 2f470a9b3b..c013ed74d8 100644 --- a/website/content/docs/k8s/k8s-cli.mdx +++ b/website/content/docs/k8s/k8s-cli.mdx @@ -424,9 +424,9 @@ $ consul-k8s proxy read backend-658b679b45-d5xlb -o json ``` Get the raw Envoy configuration dump and clusters information for the Envoy -proxy running on the Pod `backend-658b679b45-d5xlb`. The raw configuration will -be output for each service as a JSON map. The -[JQ command line tool](https://stedolan.github.io/jq/) can be used to index into +proxy running on the Pod `backend-658b679b45-d5xlb`. This command will return +the raw configuration for each service as a JSON Map. You can use the +[JQ command line tool](https://stedolan.github.io/jq/) to index into the configuration for the service you want to inspect. See the [Envoy config dump documentation](https://www.envoyproxy.io/docs/envoy/latest/api-v3/admin/v3/config_dump.proto) From 0dbb3a634fceff7dce2a6bae7ce137d44e1125fa Mon Sep 17 00:00:00 2001 From: Thomas Eckert Date: Mon, 8 Aug 2022 17:32:47 -0400 Subject: [PATCH 21/24] Clean up copy for the raw example --- website/content/docs/k8s/k8s-cli.mdx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/website/content/docs/k8s/k8s-cli.mdx b/website/content/docs/k8s/k8s-cli.mdx index c013ed74d8..4f6d86b324 100644 --- a/website/content/docs/k8s/k8s-cli.mdx +++ b/website/content/docs/k8s/k8s-cli.mdx @@ -424,14 +424,15 @@ $ consul-k8s proxy read backend-658b679b45-d5xlb -o json ``` Get the raw Envoy configuration dump and clusters information for the Envoy -proxy running on the Pod `backend-658b679b45-d5xlb`. This command will return -the raw configuration for each service as a JSON Map. You can use the +proxy running on the Pod `backend-658b679b45-d5xlb`. This command will return +the raw configuration for each service as JSON. You can use the [JQ command line tool](https://stedolan.github.io/jq/) to index into the configuration for the service you want to inspect. -See the [Envoy config dump documentation](https://www.envoyproxy.io/docs/envoy/latest/api-v3/admin/v3/config_dump.proto) -for more information on the structure of the config dump. The output is -truncated here for brevity. It follows the format below: +Refer to the [Envoy config dump documentation](https://www.envoyproxy.io/docs/envoy/latest/api-v3/admin/v3/config_dump.proto) +for more information on the structure of the config dump. + +The following output is truncated for brevity. ```shell-session $ consul-k8s proxy read backend-658b679b45-d5xlb -o raw From edcca6e1a24d27828549bb9b9398e1dbe364e59d Mon Sep 17 00:00:00 2001 From: Thomas Eckert Date: Mon, 8 Aug 2022 21:26:38 -0400 Subject: [PATCH 22/24] Apply Adam's suggestions Co-authored-by: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> --- website/content/docs/k8s/k8s-cli.mdx | 32 ++++++++++++++-------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/website/content/docs/k8s/k8s-cli.mdx b/website/content/docs/k8s/k8s-cli.mdx index 4f6d86b324..907e7ac32b 100644 --- a/website/content/docs/k8s/k8s-cli.mdx +++ b/website/content/docs/k8s/k8s-cli.mdx @@ -8,10 +8,10 @@ description: >- # Consul on Kubernetes CLI Reference The Consul on Kubernetes CLI, `consul-k8s`, is a tool for managing Consul -without needing to directly interact with Helm, the [Consul CLI](/commands/index), +that does not require direct interaction with Helm, the [Consul CLI](/commands/index), or `kubectl`. --> **Tip:** For guidance on how to install `consul-k8s`, visit the +For guidance on how to install `consul-k8s`, refer to the [Installing the Consul K8s CLI](/docs/k8s/installation/install-cli) documentation. This topic describes the commands and available options for using `consul-k8s`. @@ -95,7 +95,7 @@ $ consul-k8s install -set-string key=value-bool ### `proxy` -The `proxy` command exposes two subcommands for interacting proxies managed by +The `proxy` command exposes two subcommands for interacting with proxies managed by Consul in your Kubernetes Cluster. - [`proxy list`](#proxy-list): List all Pods running proxies managed by Consul. @@ -115,22 +115,22 @@ $ consul-k8s proxy list Refer to the [Global Options](#global-options) for additional options that you can use when installing Consul on Kubernetes. -This command will list proxies alongside their `Type`. Types of proxies include: +This command lists proxies and their `Type`. Types of proxies include: -- `Sidecar`: these will be the majority of pods in the cluster. They run the - proxy in a sidecar pattern to network the pod as a service in the mesh. -- `API Gateway`: these pods run a proxy to manage connections with networks +- `Sidecar`: The majority of pods in the cluster are `Sidecar` types. They run the + proxy as a sidecar to connect the pod as a service in the mesh. +- `API Gateway`: These pods run a proxy to manage connections with networks outside of the Consul cluster. Read more about [API gateways](/docs/api-gateway). -- `Ingress Gateway`: these pods run a proxy to manage ingress into the +- `Ingress Gateway`: These pods run a proxy to manage ingress into the Kubernetes cluster. Read more about [ingress gateways](/docs/k8s/connect/ingress-gateways). -- `Terminating Gateway`: these pods run a proxy to control connections to +- `Terminating Gateway`: These pods run a proxy to control connections to external services. Read more about [terminating gateways](/docs/k8s/connect/terminating-gateways). -- `Mesh Gateway`: these pods run a proxy to manage connections between +- `Mesh Gateway`: These pods run a proxy to manage connections between Consul clusters connected using mesh federation. Read more about [Consul Mesh Federation](/docs/k8s/installation/multi-cluster/kubernetes). #### Example Commands -Display all pods in the current Kubernetes namespace which run proxies managed +Display all pods in the current Kubernetes namespace that run proxies managed by Consul. ```shell-session @@ -148,7 +148,7 @@ client-767ccfc8f9-ggrtx Sidecar frontend-676564547c-v2mfq Sidecar ``` -Display all pods in the `consul` Kubernetes namespace which run proxies managed +Display all pods in the `consul` Kubernetes namespace that run proxies managed by Consul. ```shell-session @@ -163,7 +163,7 @@ consul-ingress-gateway-6fb5544485-br6fl Ingress Gateway consul-ingress-gateway-6fb5544485-m54sp Ingress Gateway ``` -Display all pods across all namespaces which run proxies managed by Consul. +Display all Pods across all namespaces that run proxies managed by Consul. ```shell-session $ consul-k8s proxy list -A @@ -252,7 +252,7 @@ Name Type Last Updated ``` Get the Envoy configuration summary for all clusters with a fully qualified -domain name which includes `"default"`. Display only clusters and listeners. +domain name that includes `"default"`. Display only clusters and listeners. ```shell-session $ consul-k8s proxy read backend-658b679b45-d5xlb -fqdn default -clusters -listeners @@ -424,7 +424,7 @@ $ consul-k8s proxy read backend-658b679b45-d5xlb -o json ``` Get the raw Envoy configuration dump and clusters information for the Envoy -proxy running on the Pod `backend-658b679b45-d5xlb`. This command will return +proxy running on the Pod `backend-658b679b45-d5xlb`. The example command returns the raw configuration for each service as JSON. You can use the [JQ command line tool](https://stedolan.github.io/jq/) to index into the configuration for the service you want to inspect. @@ -449,7 +449,7 @@ $ consul-k8s proxy read backend-658b679b45-d5xlb -o raw ### `status` -The `status` command provides an overall status summary of the Consul on Kubernetes installation. It also provides the config that was used to deploy Consul K8s and provides a quick glance at the health of both Consul servers and clients. This command does not take in any flags. +The `status` command provides an overall status summary of the Consul on Kubernetes installation. It also provides the configuration that was used to deploy Consul K8s and information about the health of Consul servers and clients. This command does not take in any flags. ```shell-session $ consul-k8s status From b56fb1aa4454b644aafe41d9fe5cbfefa04b0268 Mon Sep 17 00:00:00 2001 From: Thomas Eckert Date: Tue, 9 Aug 2022 12:25:33 -0400 Subject: [PATCH 23/24] Remove the beta warning for the upgrade command --- website/content/docs/k8s/k8s-cli.mdx | 2 -- 1 file changed, 2 deletions(-) diff --git a/website/content/docs/k8s/k8s-cli.mdx b/website/content/docs/k8s/k8s-cli.mdx index 907e7ac32b..8f6467cbb0 100644 --- a/website/content/docs/k8s/k8s-cli.mdx +++ b/website/content/docs/k8s/k8s-cli.mdx @@ -523,8 +523,6 @@ $ consul-k8s uninstall -namespace=my-ns -name=my-consul -wipe-data=true -auto-ap ### `upgrade` --> The `consul-k8s upgrade` **subcommand is currently in beta**: This subcommand is not recommended for production environments. - The `upgrade` command upgrades the Consul on Kubernetes components to the current version of the `consul-k8s` cli. Prior to running `consul-k8s upgrade`, the `consul-k8s` CLI should first be upgraded to the latest version as described [Upgrade the Consul K8s CLI](#upgrade-the-consul-k8s-cli) ```shell-session