Skip to content

Commit 4f011df

Browse files
authored
Merge pull request #154 from epics-containers/propose-kubeconfig
Propose KUBECONFIG
2 parents c7bbe6f + 7b7bb4e commit 4f011df

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

docs/tutorials/setup_k8s.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,14 @@ curl -sfL https://get.k3s.io | sh -
5656

5757
Kubectl is the command line tool for interacting with Kubernetes Clusters.
5858

59-
See https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/ for the latest instructions.
59+
Note that by default, the kubectl that comes with k3s reads its config from /etc/rancher/k3s/k3s.yaml and would therefore be run with sudo. By using $KUBECONFIG we conform to the standard version that reads its config from $HOME/.kube/config.
6060

6161
```
62-
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
63-
sudo mv kubectl /usr/local/bin/kubectl
64-
sudo chmod +x /usr/local/bin/kubectl
62+
echo 'export KUBECONFIG=$HOME/.kube/config' >> $HOME/.profile
63+
source $HOME/.profile
6564
```
6665

67-
Note that this is overwritting the kubectl that comes with k3s. That is a special version that reads its config from /etc/rancher/k3s/k3s.yaml and must therefore be run with sudo. The version we are installing here is the standard version that reads its config from $HOME/.kube/config.
66+
Then log out for this to be set for all shells.
6867

6968
### Configure kubectl
7069

0 commit comments

Comments
 (0)