diff --git a/website/content/docs/k8s/installation/install.mdx b/website/content/docs/k8s/installation/install.mdx index b7858192fb..291213446e 100644 --- a/website/content/docs/k8s/installation/install.mdx +++ b/website/content/docs/k8s/installation/install.mdx @@ -17,20 +17,70 @@ a server running inside or outside of Kubernetes. You can install Consul on Kubernetes using the following methods: -1. [Helm chart install](#helm-chart-installation) 1. [Consul K8s CLI install BETA.](#consul-k8s-cli-installation) +1. [Helm chart install](#helm-chart-installation) Refer to the [architecture](/docs/k8s/installation/install#architecture) section to learn more about the general architecture of Consul on Kubernetes. For a hands-on experience with Consul as a service mesh for Kubernetes, follow the [Getting Started with Consul service mesh](https://learn.hashicorp.com/tutorials/consul/service-mesh-deploy?utm_source=WEBSITE&utm_medium=WEB_IO&utm_offer=ARTICLE_PAGE&utm_content=DOCS) tutorial. +## Consul K8s CLI Installation + +We recommend using the [Consul K8S CLI](/docs/k8s/k8s-cli) to install Consul on Kubernetes for single-cluster deployments. You can install Consul on Kubernetes using the Consul K8s CLI tool after installing the CLI. + +-> **Consul K8s CLI is currently in beta**: The tools is not recommended for production environments. + +Before beginning the installation process, verify that `kubectl` is already configured to authenticate to the Kubernetes cluster using a valid `kubeconfig` file. + +The [Homebrew](https://brew.sh) package manager is required to complete the following installation instructions. + +1. Install the HashiCorp `tap`, which is a repository of all Homebrew packages for HashiCorp: + ```shell-session + brew tap hashicorp/tap + ``` + +1. Install the Consul K8s CLI with the `hashicorp/tap/consul` formula. + ```shell-session + brew install hashicorp/tap/consul-k8s + ``` + +1. Issue the `install` subcommand to install Consul on Kubernetes: + + ```shell-session + consul-k8s install + ``` + + Refer to the [Consul K8s CLI reference](/docs/k8s/k8s-cli) for details about all commands and available options. + + If you did not set the `-auto-approve` option to `true`, you will be prompted to proceed with the installation if the pre-install checks pass. + + ```shell-session + ==> Pre-Install Checks + ✓ No existing installations found + ✓ No previous persistent volume claims found + ✓ No previous secrets found + + ==> Consul Installation Summary + Installation name: consul + Namespace: myns + Overrides: + connectInject: + enabled: true + global: + name: consul + server: + bootstrapExpect: 1 + replicas: 1 + + Proceed with installation? (y/n) + ``` + +1. Enter `y` to proceed. The pre-install checks may fail if existing `PersistentVolumeClaims` (PVC) are detected. Refer to the [uninstall instructions](/docs/k8s/operations/uninstall#uninstall-consul) for information about removing PVCs. + ## Helm Chart Installation -The recommended way to run Consul on Kubernetes is via the -[Helm chart](/docs/k8s/helm). This will install and configure -all the necessary components to run Consul. The configuration enables you -to run a server cluster, a client cluster, or both. +We recommend using the Consul Helm chart to install Consul on Kubernetes for multi-cluster installations that involve cross-partition of cross datacenter communication. The Helm chart installs and configures all necessary components to run Consul. The configuration enables you to run a server cluster, a client cluster, or both. Step-by-step tutorials for how to deploy Consul to Kubernetes, please see our [Deploy to Kubernetes](https://learn.hashicorp.com/collections/consul/kubernetes-deploy) @@ -132,45 +182,6 @@ NAME: consul If you've already installed Consul and want to make changes, you'll need to run `helm upgrade`. See [Upgrading](/docs/k8s/operations/upgrading) for more details. -## Consul K8s CLI Installation - -You can install Consul on Kubernetes using the Consul K8s CLI tool. -The tool is currently availabe as an alpha release and is not recommended for production environments. - -1. Download and build the CLI as described in the [Consul K8s CLI reference](/docs/k8s/k8s-cli). -1. Issue the `install` subcommand to install Consul on Kubernetes: - - ```shell-session - consul-k8s install - ``` - - Refer to the [Consul K8s CLI reference](/docs/k8s/k8s-cli) for details about all commands and available options. - - If you did not set the `-auto-approve` option to `true`, you will be prompted to proceed with the installation if the pre-install checks pass. - - ```shell-session - ==> Pre-Install Checks - ✓ No existing installations found - ✓ No previous persistent volume claims found - ✓ No previous secrets found - - ==> Consul Installation Summary - Installation name: consul - Namespace: myns - Overrides: - connectInject: - enabled: true - global: - name: consul - server: - bootstrapExpect: 1 - replicas: 1 - - Proceed with installation? (y/n) - ``` - -1. Enter `y` to proceed. The pre-install checks may fail if existing `PersistentVolumeClaims` (PVC) are detected. Refer to the [uninstall instructions](/docs/k8s/operations/uninstall#uninstall-consul) for information about removing PVCs. - ## Viewing the Consul UI The Consul UI is enabled by default when using the Helm chart. diff --git a/website/content/docs/k8s/k8s-cli.mdx b/website/content/docs/k8s/k8s-cli.mdx index 6c51c103e2..fcea2725f2 100644 --- a/website/content/docs/k8s/k8s-cli.mdx +++ b/website/content/docs/k8s/k8s-cli.mdx @@ -12,26 +12,31 @@ This topic describes the commands, subcommands, and available options for using ~> Consul K8s CLI is is currently availabe as a beta release and is not recommended for production environments. -## Download and Build the Binary +## Install the Consul K8s CLI -1. Clone the [consul-k8s](https://github.com/hashicorp/consul-k8s/tree/main/cli) project. -1. Navigate to the `consul-k8s/cli` directory and issue the following command to build the tool: +The [Homebrew](https://brew.sh) package manager is required to complete the following installation instructions. - ```shell-session - go build -o bin/consul-k8s - ``` +1. Install the HashiCorp `tap`, which is a repository of all Homebrew packages for HashiCorp: + ```shell-session + brew tap hashicorp/tap + ``` + +1. Install the Consul K8s CLI with `hashicorp/tap/consul` formula. + ```shell-session + brew install hashicorp/tap/consul-k8s + ``` -1. (Optional) Move the binary to you `$PATH` for ease of use, e.g.: +1. If you have already provisioned a Kubernetes cluster and have already configured access to the cluster via a `kubeconfig` file, you are ready to install Consul K8s. Issue the `install` subcommand to install Consul on Kubernetes: - ```shell-session - mv bin/consul-k8s /usr/local/bin/consul-k8s - ``` + ```shell-session + consul-k8s install + ``` 1. (Optional) Issue the `consul-k8s version` command to verify the installation: ```shell-session consul-k8s version - consul-k8s 0.35.0 + consul-k8s 0.36.0 ``` ## Usage diff --git a/website/content/docs/k8s/operations/uninstall.mdx b/website/content/docs/k8s/operations/uninstall.mdx index ececce827c..19ffbc66af 100644 --- a/website/content/docs/k8s/operations/uninstall.mdx +++ b/website/content/docs/k8s/operations/uninstall.mdx @@ -8,6 +8,23 @@ description: Uninstall Consul on Kubernetes You can uninstall Consul using Helm commands or the Consul K8s CLI. +## Consul K8s CLI + +Issue the `consul-k8s uninstall` command to remove Consul on Kubernetes. You can specify the installation name, namespace, and data retention behavior using the applicable options. By default, the uninstallation preserves the secrets and PVCs that are provisioned by Consul on Kubernetes. + +```shell-session +$ consul-k8s uninstall +``` + + +In the following example, Consul will be uninstalled and the data removed without prompting you to verify the operations: + +```shell-session +$ consul-k8s uninstall -auto-approve=true -wipe-data=true +``` + +Refer to the [Consul K8s CLI reference](/docs/k8s/k8s-cli#uninstall) topic for details. + ## Helm commands Run the `helm uninstall` **and** manually remove resources that Helm does not delete. @@ -85,20 +102,3 @@ Run the `helm uninstall` **and** manually remove resources that Helm does not de $ kubectl delete serviceaccount consul-tls-init serviceaccount "consul-tls-init" deleted ``` - -## Consul K8s CLI - -Issue the `consul-k8s uninstall` command to remove Consul on Kubernetes. You can specify the installation name, namespace, and data retention behavior using the applicable options. By default, the uninstallation preserves the secrets and PVCs that are provisioned by Consul on Kubernetes. - -```shell-session -$ consul-k8s uninstall -``` - - -In the following example, Consul will be uninstalled and the data removed without prompting you to verify the operations: - -```shell-session -$ consul-k8s uninstall -auto-approve=true -wipe-data=true -``` - -Refer to the [Consul K8s CLI reference](/docs/k8s/k8s-cli#uninstall) topic for details.