From fa82d4fedf3ac29c761f06ea6b3d6020110d53bb Mon Sep 17 00:00:00 2001 From: Ming Zhao Date: Sun, 22 Oct 2017 22:57:05 -0700 Subject: [PATCH] update kubectl instruction --- docs/setup/independent/create-cluster-kubeadm.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/setup/independent/create-cluster-kubeadm.md b/docs/setup/independent/create-cluster-kubeadm.md index fa10091cf7..bb4f3bdb1d 100644 --- a/docs/setup/independent/create-cluster-kubeadm.md +++ b/docs/setup/independent/create-cluster-kubeadm.md @@ -178,13 +178,16 @@ as root: kubeadm join --token : --discovery-token-ca-cert-hash sha256: ``` - -To let kubectl work in the following steps, you need to run these commands as a regular user (which is part of the output above): +To make kubectl work for your non-root user, you might want to run these commands (which is also a part of the kubeadm init output): ``` mkdir -p $HOME/.kube sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config sudo chown $(id -u):$(id -g) $HOME/.kube/config ``` +Alternatively, if you are the root user, you could run this: +``` +export KUBECONFIG=/etc/kubernetes/admin.conf +``` Make a record of the `kubeadm join` command that `kubeadm init` outputs. You will need this in a moment.