Update installation instructions with snap (#4171)
* Update installation instructions with snap Update installation instructions with snap - the package manager for Ubuntu and other Linux distributions. * fix md formatting * fix shell formating * fix shell block * fix shell for Check the kubectl configuration * switch to full width shell
This commit is contained in:
committed by
Andrew Chen
parent
dc4819e3ff
commit
24820772e5
@@ -91,35 +91,45 @@ Here are a few methods to install kubectl.
|
|||||||
|
|
||||||
kubectl can be installed as part of the Google Cloud SDK.
|
kubectl can be installed as part of the Google Cloud SDK.
|
||||||
|
|
||||||
1. Install the [Google Cloud SDK](https://cloud.google.com/sdk/).
|
1. Install the [Google Cloud SDK](https://cloud.google.com/sdk/).
|
||||||
2. Run the following command to install `kubectl`:
|
2. Run the following command to install `kubectl`:
|
||||||
```shell
|
|
||||||
gcloud components install kubectl
|
gcloud components install kubectl
|
||||||
```
|
|
||||||
3. Run `kubectl version` to verify that the verison you've installed is sufficiently up-to-date.
|
3. Run `kubectl version` to verify that the verison you've installed is sufficiently up-to-date.
|
||||||
|
|
||||||
|
## Install with snap on Ubuntu
|
||||||
|
|
||||||
|
kubectl is available as a [snap](https://snapcraft.io/) application.
|
||||||
|
|
||||||
|
1. If you are on Ubuntu or one of other Linux distributions that support [snap](https://snapcraft.io/docs/core/install) package manager, you can install with:
|
||||||
|
|
||||||
|
sudo snap install kubectl --classic
|
||||||
|
|
||||||
|
2. Run `kubectl version` to verify that the verison you've installed is sufficiently up-to-date.
|
||||||
|
|
||||||
## Install with Homebrew on macOS
|
## Install with Homebrew on macOS
|
||||||
|
|
||||||
1. If you are on macOS and using [Homebrew](https://brew.sh/) package manager, you can install with:
|
1. If you are on macOS and using [Homebrew](https://brew.sh/) package manager, you can install with:
|
||||||
```shell
|
|
||||||
brew install kubectl
|
brew install kubectl
|
||||||
```
|
|
||||||
2. Run `kubectl version` to verify that the verison you've installed is sufficiently up-to-date.
|
2. Run `kubectl version` to verify that the verison you've installed is sufficiently up-to-date.
|
||||||
|
|
||||||
## Install with Chocolatey on Windows
|
## Install with Chocolatey on Windows
|
||||||
|
|
||||||
1. If you are on Windows and using [Chocolatey](https://chocolatey.org) package manager, you can install with:
|
1. If you are on Windows and using [Chocolatey](https://chocolatey.org) package manager, you can install with:
|
||||||
```shell
|
|
||||||
choco install kubernetes-cli
|
choco install kubernetes-cli
|
||||||
```
|
|
||||||
2. Run `kubectl version` to verify that the verison you've installed is sufficiently up-to-date.
|
2. Run `kubectl version` to verify that the verison you've installed is sufficiently up-to-date.
|
||||||
3. Configure kubectl to use a remote kubernetes cluster:
|
3. Configure kubectl to use a remote kubernetes cluster:
|
||||||
```shell
|
|
||||||
cd C:\users\yourusername (Or wherever your %HOME% directory is)
|
cd C:\users\yourusername (Or wherever your %HOME% directory is)
|
||||||
mkdir .kube
|
mkdir .kube
|
||||||
cd .kube
|
cd .kube
|
||||||
touch config
|
touch config
|
||||||
```
|
|
||||||
Edit the config file with a text editor of your choice, such as Notepad for example.
|
Edit the config file with a text editor of your choice, such as Notepad for example.
|
||||||
|
|
||||||
## Configure kubectl
|
## Configure kubectl
|
||||||
@@ -136,9 +146,11 @@ $ kubectl cluster-info
|
|||||||
If you see a URL response, kubectl is correctly configured to access your cluster.
|
If you see a URL response, kubectl is correctly configured to access your cluster.
|
||||||
|
|
||||||
If you see a message similar to the following, kubectl is not correctly configured:
|
If you see a message similar to the following, kubectl is not correctly configured:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
The connection to the server <server-name:port> was refused - did you specify the right host or port?
|
The connection to the server <server-name:port> was refused - did you specify the right host or port?
|
||||||
```
|
```
|
||||||
|
|
||||||
## Enabling shell autocompletion
|
## Enabling shell autocompletion
|
||||||
|
|
||||||
kubectl includes autocompletion support, which can save a lot of typing!
|
kubectl includes autocompletion support, which can save a lot of typing!
|
||||||
|
|||||||
Reference in New Issue
Block a user