From 24820772e51ec7ecb276d7bfaa0cfacc8adb829e Mon Sep 17 00:00:00 2001 From: Ihor Dvoretskyi Date: Fri, 23 Jun 2017 10:22:08 +0200 Subject: [PATCH] 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 --- docs/tasks/tools/install-kubectl.md | 58 +++++++++++++++++------------ 1 file changed, 35 insertions(+), 23 deletions(-) diff --git a/docs/tasks/tools/install-kubectl.md b/docs/tasks/tools/install-kubectl.md index 0fd5514904..4c84c348fd 100644 --- a/docs/tasks/tools/install-kubectl.md +++ b/docs/tasks/tools/install-kubectl.md @@ -91,35 +91,45 @@ Here are a few methods to install kubectl. kubectl can be installed as part of the Google Cloud SDK. - 1. Install the [Google Cloud SDK](https://cloud.google.com/sdk/). - 2. Run the following command to install `kubectl`: - ```shell -gcloud components install kubectl -``` - 3. Run `kubectl version` to verify that the verison you've installed is sufficiently up-to-date. +1. Install the [Google Cloud SDK](https://cloud.google.com/sdk/). +2. Run the following command to install `kubectl`: + + gcloud components install kubectl + +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 - 1. If you are on macOS and using [Homebrew](https://brew.sh/) package manager, you can install with: -```shell -brew install kubectl -``` - 2. Run `kubectl version` to verify that the verison you've installed is sufficiently up-to-date. +1. If you are on macOS and using [Homebrew](https://brew.sh/) package manager, you can install with: + + brew install kubectl + +2. Run `kubectl version` to verify that the verison you've installed is sufficiently up-to-date. ## Install with Chocolatey on Windows - 1. If you are on Windows and using [Chocolatey](https://chocolatey.org) package manager, you can install with: -```shell -choco install kubernetes-cli -``` - 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: -```shell -cd C:\users\yourusername (Or wherever your %HOME% directory is) -mkdir .kube -cd .kube -touch config -``` +1. If you are on Windows and using [Chocolatey](https://chocolatey.org) package manager, you can install with: + + choco install kubernetes-cli + +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: + + cd C:\users\yourusername (Or wherever your %HOME% directory is) + mkdir .kube + cd .kube + touch config + Edit the config file with a text editor of your choice, such as Notepad for example. ## 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 message similar to the following, kubectl is not correctly configured: + ```shell The connection to the server was refused - did you specify the right host or port? ``` + ## Enabling shell autocompletion kubectl includes autocompletion support, which can save a lot of typing!