docs: Add specific version install guide for `consul-k8s` CLI, refactor install (#12114)

* docs: Add specific version install guide for `consul-k8s` CLI

* parameterize version

* remove extra path

* Update k8s-cli.mdx

* slight formatting

* Update k8s-cli.mdx

* specific version details in overall install guide

* shell details

* Update install.mdx

* Update k8s-cli.mdx

* Update install.mdx

* broken link

* typo

* Update website/content/docs/k8s/installation/compatibility.mdx

Co-authored-by: mrspanishviking <kcardenas@hashicorp.com>

* Update website/content/docs/k8s/k8s-cli.mdx

Co-authored-by: mrspanishviking <kcardenas@hashicorp.com>

* Update website/content/docs/k8s/k8s-cli.mdx

Co-authored-by: mrspanishviking <kcardenas@hashicorp.com>

* Update website/content/docs/k8s/k8s-cli.mdx

Co-authored-by: mrspanishviking <kcardenas@hashicorp.com>

* Update website/content/docs/k8s/k8s-cli.mdx

Co-authored-by: mrspanishviking <kcardenas@hashicorp.com>

* Update website/content/docs/k8s/k8s-cli.mdx

Co-authored-by: mrspanishviking <kcardenas@hashicorp.com>

* Update website/content/docs/k8s/k8s-cli.mdx

Co-authored-by: mrspanishviking <kcardenas@hashicorp.com>

* Update website/content/docs/k8s/k8s-cli.mdx

Co-authored-by: mrspanishviking <kcardenas@hashicorp.com>

* Update website/content/docs/k8s/k8s-cli.mdx

Co-authored-by: mrspanishviking <kcardenas@hashicorp.com>

* Update website/content/docs/k8s/installation/install.mdx

Co-authored-by: mrspanishviking <kcardenas@hashicorp.com>

* moving install cli commands to separate page

* add tabs, wip

* add specific distro install guides

* add upgrade tabs

* build failure

* not sure why heading is not working

* remove whitespace

* add more whitespace

* fixes on formatting

* remove package lock

* add back package lock json

* test

* latest

* remove modified file

* adding fix to yum install

* create folder for upgrade and move upgrade cli there

* revert package-lock

* adding upgrade file

* Update website/content/docs/k8s/upgrade/upgrade-cli.mdx

Co-authored-by: Thomas Eckert <teckert@hashicorp.com>

* Update website/content/docs/k8s/installation/install-cli.mdx

Co-authored-by: Thomas Eckert <teckert@hashicorp.com>

* Update website/content/docs/k8s/installation/install-cli.mdx

Co-authored-by: Thomas Eckert <teckert@hashicorp.com>

* Update install-cli.mdx

* multi-line copy

Co-authored-by: mrspanishviking <kcardenas@hashicorp.com>
Co-authored-by: Thomas Eckert <teckert@hashicorp.com>
This commit is contained in:
David Yu 2022-01-20 08:26:31 -08:00 committed by GitHub
parent baf886c6f3
commit d8b9eb7756
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 303 additions and 49 deletions

View File

@ -12,7 +12,7 @@ For every release of Consul on Kubernetes, a Helm chart, `consul-k8s-control-pla
### Version 0.33.0 and above
Starting with Consul Kubernetes 0.33.0, Consul Kubernetes versions all of it components (`consul-k8s` CLI, `consul-k8s-control-plane`, and Helm chart) with a single version.
Starting with Consul Kubernetes 0.33.0, Consul Kubernetes versions all of its components (`consul-k8s` CLI, `consul-k8s-control-plane`, and Helm chart) with a single semantic version.
| Consul Version | Compatible consul-k8s Versions |
| -------------- | ------------------------------- |
@ -37,16 +37,16 @@ Supported versions of Envoy for Consul versions are also found in [Envoy - Suppo
## Red Hat OpenShift compatability
Consul Kubernetes delivered Red Hat OpenShift support starting with Consul Helm chart version 0.25.0 for Consul 1.8.4 Please note the following details regarding OpenShift support.
Consul Kubernetes delivered Red Hat OpenShift support starting with Consul Helm chart version 0.25.0 for Consul 1.8.4. Please note the following details regarding OpenShift support.
- Red Hat OpenShift is only supported for OpenShift 4.4.x and above.
- Only the default CNI Plugin, [OpenShift SDN CNI Plugin](https://docs.openshift.com/container-platform/4.9/networking/openshift_sdn/about-openshift-sdn.html) is currently supported.
## Vault as a Secrets Backend compatibility
Starting with Consul K8s 0.39.0 and Consul 1.11.x, Consul Kubernetes supports the ability to utilize Vault as the secrets backend for all the secrets utilized by Consul Kubernetes.
Starting with Consul K8s 0.39.0 and Consul 1.11.x, Consul Kubernetes supports the ability to utilize Vault as the secrets backend for all the secrets utilized by Consul on Kubernetes.
| `consul-k8s` Versions | Compatible Vault Versions | Compatible Vault K8s Versions |
| `consul-k8s` Versions | Compatible Vault Versions | Compatible `vault-k8s` Versions |
| ------------------------ | --------------------------| ----------------------------- |
| 0.39.0 - latest | 1.9.0 - latest | 0.14.0 - latest |

View File

@ -0,0 +1,205 @@
---
layout: docs
page_title: Installing the Consul K8s CLI
description: >-
Consul K8s CLI is a tool for quickly installing and interacting with Consul on Kubernetes.
---
# Installing the Consul K8s CLI
Consul K8s CLI is a tool for quickly installing and interacting with Consul on Kubernetes. Ensure that you are installing the correct version of the CLI for your Consul on Kubernetes deployment, as the CLI and the control plane are version dependent.
## Install the CLI
These instructions describe how to install the latest version of the CLI depending on your Operating System, and are suited for fresh installations of Consul on Kubernetes.
<Tabs>
<Tab heading="MacOS">
The [Homebrew](https://brew.sh) package manager is required to complete the following installation instructions. The Homebrew formulae will always install the latest version of a binary. If you are looking to install a specific version of the CLI please follow [Install a specific version of Consul K8s CLI](#install-a-specific-version-of-consul-k8s-cli).
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. 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
$ consul-k8s install <OPTIONS>
```
1. (Optional) Issue the `consul-k8s version` command to verify the installation:
```shell-session
$ consul-k8s version
consul-k8s 0.39.0
```
</Tab>
<Tab heading="Linux - Ubuntu/Debian">
1. Add the HashiCorp GPG key.
```shell-session
$ curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
```
1. Add the HashiCorp apt repository.
```shell-session
$ sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
```
1. Run apt-get install to install the `consul-k8s` CLI.
```shell-session
$ sudo apt-get update && sudo apt-get install consul-k8s
```
1. (Optional) Issue the `consul-k8s version` command to verify the installation.
```shell-session
$ consul-k8s version
consul-k8s 0.39.0
```
</Tab>
<Tab heading="Linux - CentOS/RHEL">
1. Install `yum-config-manager` to manage your repositories.
```shell-session
$ sudo yum install -y yum-utils
```
1. Use `yum-config-manager` to add the official HashiCorp Linux repository.
```shell-session
$ sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
```
1. Install the `consul-k8s` CLI.
```shell-session
$ sudo yum -y install consul-k8s
```
1. (Optional) Issue the `consul-k8s version` command to verify the installation.
```shell-session
$ consul-k8s version
consul-k8s 0.39.0
```
</Tab>
</Tabs>
## Install a specific version of the CLI
These instructions describe how to install a specific version of the CLI and are best suited for installing or managing specific versions of the Consul on Kubernetes control plane.
<Tabs>
<Tab heading="MacOS">
Homebrew does not provide a method to install previous versions of a package. The Consul K8s CLI will need to be installed manually. Previous versions of the Consul K8s CLI could be used to install a specific version of Consul on the Kubernetes control plane. Manual upgrades to the Consul K8s CLI is also performed in the same manner, provided that the Consul K8s CLI was manually installed before.
1. Download the desired Consul K8s CLI using the following `curl` command. Enter the approriate version for your deployment via the `$VERSION` environment variable.
```shell-session
$ export VERSION=0.39.0 && \
curl --location "https://releases.hashicorp.com/consul-k8s/${VERSION}/consul-k8s_${VERSION}_darwin_amd64.zip" --output consul-k8s-cli.zip
```
1. Unzip the zip file ouput to extract the `consul-k8s` CLI binary. This overwrites existing files and also creates a `.consul-k8s` subdirectory in your `$HOME` folder.
```shell-session
$ unzip -o consul-k8s-cli.zip -d ~/.consul-k8s
```
1. Add the path to your directory. In order to persist the `$PATH` across sessions, you will need to add this to your shellrc (i.e. shell run commands) file for the shell used by your terminal.
```shell-session
$ export PATH=$PATH:$HOME/.consul-k8s/
```
1. (Optional) Issue the `consul-k8s version` command to verify the installation.
```shell-session
$ consul-k8s version
consul-k8s 0.39.0
```
</Tab>
<Tab heading="Linux - Ubuntu/Debian">
1. Add the HashiCorp GPG key.
```shell-session
$ curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
```
1. Add the HashiCorp apt repository.
```shell-session
$ sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
```
1. Run apt-get install to install the `consul-k8s` CLI.
```shell-session
$ export VERSION=0.39.0 && \
sudo apt-get update && sudo apt-get install consul-k8s=${VERSION}
```
1. (Optional) Issue the `consul-k8s version` command to verify the installation.
```shell-session
$ consul-k8s version
consul-k8s 0.39.0
```
</Tab>
<Tab heading="Linux - CentOS/RHEL">
1. Install `yum-config-manager` to manage your repositories.
```shell-session
$ sudo yum install -y yum-utils
```
1. Use `yum-config-manager` to add the official HashiCorp Linux repository.
```shell-session
$ sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
```
1. Install the `consul-k8s` CLI.
```shell-session
$ export VERSION=-0.39.0 && \
sudo yum -y install consul-k8s-${VERSION}-1
```
1. (Optional) Issue the `consul-k8s version` command to verify the installation.
```shell-session
$ consul-k8s version
consul-k8s 0.39.0
```
</Tab>
</Tabs>

View File

@ -33,6 +33,8 @@ Before beginning the installation process, verify that `kubectl` is already conf
The [Homebrew](https://brew.sh) package manager is required to complete the following installation instructions.
-> ** NOTE:** To deploy a previous version of Consul on Kubernetes via the CLI, you will need to first download the specific version of the CLI that matches the version of the control plane that you would like to deploy. Please follow [Install a specific version of Consul K8s CLI](/docs/k8s/installation/install-cli#install-a-specific-version-of-the-cli).
1. Install the HashiCorp `tap`, which is a repository of all Homebrew packages for HashiCorp:
```shell-session
$ brew tap hashicorp/tap

View File

@ -8,50 +8,7 @@ description: >-
# Consul K8s CLI Reference
Consul K8s CLI is a tool for quickly installing and interacting with Consul on Kubernetes.
This topic describes the commands, subcommands, and available options for using Consul K8s CLI.
## Install the Consul K8s CLI
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 `hashicorp/tap/consul` formula.
```shell-session
brew install hashicorp/tap/consul-k8s
```
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
consul-k8s install <OPTIONS>
```
1. (Optional) Issue the `consul-k8s version` command to verify the installation:
```shell-session
consul-k8s version
consul-k8s 0.39.0
```
## Upgrade the Consul K8s CLI
The [Homebrew](https://brew.sh) package manager is required to complete the following installation instructions. The `brew upgrade` command assumes that Hashicorp `tap` repository has already been installed from a prior install.
1. Upgrade the Consul K8s CLI with the latest `consul-k8s` package.
```shell-session
brew upgrade consul-k8s
```
2. (Optional) Issue the `consul-k8s version` command to verify the installation:
```shell-session
consul-k8s version
consul-k8s 0.39.0
```
This topic describes the subcommands and available options for using Consul K8s CLI.
## Usage

View File

@ -0,0 +1,82 @@
---
layout: docs
page_title: Upgrade the Consul K8s CLI
description: >-
Consul K8s CLI is a tool for quickly installing and interacting with Consul on Kubernetes.
---
# Upgrade the Consul K8s CLI
Consul K8s CLI is a tool for quickly installing and interacting with Consul on Kubernetes. Ensure that you are running the correct version of the CLI prior to upgrading your Consul on Kubernetes deployment, as the CLI and the control plane are version dependent.
## Upgrade the CLI
These instructions describe how to upgrade the current installed version of the CLI to the latest version. If you are looking to upgrade to a specific version, please follow [Install a specific version of the CLI](/docs/k8s/installation/install-cli#install-a-specific-version-of-the-cli).
<Tabs>
<Tab heading="MacOS">
The [Homebrew](https://brew.sh) package manager is required to complete the following installation instructions. The `brew upgrade` command assumes that Hashicorp `tap` repository has already been installed from a prior install.
1. Upgrade the Consul K8s CLI with the latest `consul-k8s` package.
```shell-session
$ brew upgrade consul-k8s
```
1. (Optional) Issue the `consul-k8s version` command to verify the installation:
```shell-session
$ consul-k8s version
consul-k8s 0.39.0
```
</Tab>
<Tab heading="Linux - Ubuntu/Debian">
1. Upgrade all the available packages on your system.
```shell-session
$ sudo apt-get update
```
1. Upgrade the Consul K8s CLI with the latest `consul-k8s` package.
```shell-session
$ sudo apt-get --only-upgrade install consul-k8s
```
1. (Optional) Issue the `consul-k8s version` command to verify the installation:
```shell-session
$ consul-k8s version
consul-k8s 0.39.0
```
</Tab>
<Tab heading="Linux - CentOS/RHEL">
1. Upgrade all the available packages on your system.
```shell-session
$ sudo yum update
```
1. Upgrade the Consul K8s CLI with the latest `consul-k8s` package.
```shell-session
$ sudo yum update consul-k8s
```
1. (Optional) Issue the `consul-k8s version` command to verify the installation:
```shell-session
$ consul-k8s version
consul-k8s 0.39.0
```
</Tab>
</Tabs>

View File

@ -374,6 +374,10 @@
"title": "Installing Consul on Kubernetes",
"path": "k8s/installation/install"
},
{
"title": "Installing Consul K8s CLI",
"path": "k8s/installation/install-cli"
},
{
"title": "Platform Guides",
"routes": [
@ -543,8 +547,12 @@
"title": "Upgrade",
"routes": [
{
"title": "Overview",
"title": "Upgrading Consul on Kubernetes",
"path": "k8s/upgrade"
},
{
"title": "Upgrading Consul K8s CLI",
"path": "k8s/upgrade/upgrade-cli"
}
]
},