From 26d342291722992f646561d76a1885b391b6a89c Mon Sep 17 00:00:00 2001 From: Ahmet Alp Balkan Date: Mon, 11 Nov 2019 11:19:34 -0800 Subject: [PATCH] Install option as a kubectl plugin (#182) Signed-off-by: Ahmet Alp Balkan --- .travis.yml | 1 + README.md | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/.travis.yml b/.travis.yml index 5fa4b31..0c05325 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ before_install: - sudo curl -fsSL -o /usr/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/v1.13.1/bin/linux/amd64/kubectl - sudo chmod +x /usr/bin/kubectl script: + - basename /usr/bin - bats test/kubectx.bats - bats test/kubens.bats - shellcheck kubectx diff --git a/README.md b/README.md index 32e67aa..7dbc455 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ This repository provides both `kubectx` and `kubens` tools. +[Install →](#installation) **`kubectx`** helps you switch between clusters back and forth: @@ -85,6 +86,31 @@ Active namespace is "default". ## Installation +There are several installation options: + +- As kubectl plugins (macOS/Linux) +- macOS + - Homebrew (recommended) + - MacPorts +- Linux + - manual installation/upgrades + - Arch Linux + - Debian/Ubuntu + +### Kubectl Plugins (macOS and Linux) + +You can install and use [Krew](https://github.com/kubernetes-sigs/krew/) kubectl +plugin manager to get `kubectx` and `kubens`. **NOTE:** This will not install +shell completion scripts, if you want those, choose another installation method +below. + +```sh +kubectl krew install ctx +kubectl krew install ns +``` + +After installing, the tools will be available as `kubectl ctx` and `kubectl ns`. + ### macOS #### Homebrew