From 9b0a439ffaf4ae68a1b4bea2915c7206f2064fb7 Mon Sep 17 00:00:00 2001 From: Andrew Chen Date: Wed, 31 May 2017 12:59:27 -0700 Subject: [PATCH] Implement PR #3859 with tabs --- docs/tasks/tools/install-kubectl.md | 30 ++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/docs/tasks/tools/install-kubectl.md b/docs/tasks/tools/install-kubectl.md index 5ce242d903a14..fe1fcf864d7b5 100644 --- a/docs/tasks/tools/install-kubectl.md +++ b/docs/tasks/tools/install-kubectl.md @@ -23,18 +23,38 @@ Here are a few methods to install kubectl. 1. Download the latest release with the command: +{% capture macos %} ```shell -# OS X curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/darwin/amd64/kubectl +``` + +To download a specific version, replace the `$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)` portion of the command with the specific version. +For example, to download version 1.4.6 on MacOS, type: +`curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.4.6/bin/darwin/amd64/kubectl` +{% endcapture %} -# Linux +{% capture linux %} +```shell curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl +``` + +To download a specific version, replace the `$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)` portion of the command with the specific version. For example, to download version {{page.fullversion}} on Linux, type: +`curl -LO https://storage.googleapis.com/kubernetes-release/release/{{page.fullversion}}/bin/linux/amd64/kubectl` +{% endcapture %} -# Windows +{% capture win %} +```shell curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/windows/amd64/kubectl.exe ``` -To download a specific version, replace the `$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)` portion of the command with the specific version. For example, to download version 1.4.6 on MacOS, type: -`curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.4.6/bin/darwin/amd64/kubectl` + +To download a specific version, replace the `$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)` portion of the command with the specific version. For example, to download version {{page.fullversion}} on Windows, type: +`curl -LO https://storage.googleapis.com/kubernetes-release/release/{{page.fullversion}}/bin/windows/amd64/kubectl.exe` +{% endcapture %} + +{% assign tab_names = "macOS,Linux,Windows" | split: ',' | compact %} +{% assign tab_contents = site.emptyArray | push: macos | push: linux | push: win %} + +{% include tabs.md %} 2. Make the kubectl binary executable. ```shell