update to include sudo for various commands (#9031)
Also, if the kubernetes.list does not exist you will not be able to edit it, so adding touch and then add the line will prevent errors with installing via apt-get.
This commit is contained in:
parent
8558241ef4
commit
77cf8d542b
|
|
@ -26,13 +26,12 @@ Here are a few methods to install kubectl.
|
||||||
|
|
||||||
{{< tabs name="kubectl_install" >}}
|
{{< tabs name="kubectl_install" >}}
|
||||||
{{< tab name="Ubuntu, Debian or HypriotOS" codelang="bash" >}}
|
{{< tab name="Ubuntu, Debian or HypriotOS" codelang="bash" >}}
|
||||||
apt-get update && apt-get install -y apt-transport-https
|
sudo apt-get update && sudo apt-get install -y apt-transport-https
|
||||||
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
|
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
|
||||||
cat <<EOF >/etc/apt/sources.list.d/kubernetes.list
|
sudo touch /etc/apt/sources.list.d/kubernetes.list
|
||||||
deb http://apt.kubernetes.io/ kubernetes-xenial main
|
echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee -a /etc/apt/sources.list.d/kubernetes.list
|
||||||
EOF
|
sudo apt-get update
|
||||||
apt-get update
|
sudo apt-get install -y kubectl
|
||||||
apt-get install -y kubectl
|
|
||||||
{{< /tab >}}
|
{{< /tab >}}
|
||||||
{{< tab name="CentOS, RHEL or Fedora" codelang="bash" >}}cat <<EOF > /etc/yum.repos.d/kubernetes.repo
|
{{< tab name="CentOS, RHEL or Fedora" codelang="bash" >}}cat <<EOF > /etc/yum.repos.d/kubernetes.repo
|
||||||
[kubernetes]
|
[kubernetes]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue