From 3db6e572dca3ace8ebaf7583d77485d59e487a70 Mon Sep 17 00:00:00 2001 From: Ming Zhao Date: Tue, 10 Oct 2017 11:44:44 -0700 Subject: [PATCH 1/3] Add instructions on how to setup kubectl --- docs/setup/independent/create-cluster-kubeadm.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/setup/independent/create-cluster-kubeadm.md b/docs/setup/independent/create-cluster-kubeadm.md index ac9f39eed2..fa10091cf7 100644 --- a/docs/setup/independent/create-cluster-kubeadm.md +++ b/docs/setup/independent/create-cluster-kubeadm.md @@ -179,6 +179,13 @@ 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): +``` + mkdir -p $HOME/.kube + sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config + sudo chown $(id -u):$(id -g) $HOME/.kube/config +``` + Make a record of the `kubeadm join` command that `kubeadm init` outputs. You will need this in a moment. From fa82d4fedf3ac29c761f06ea6b3d6020110d53bb Mon Sep 17 00:00:00 2001 From: Ming Zhao Date: Sun, 22 Oct 2017 22:57:05 -0700 Subject: [PATCH 2/3] 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. From 67dac7b59c871e06c9885d982a45887b351ffd02 Mon Sep 17 00:00:00 2001 From: Ming Zhao Date: Sun, 22 Oct 2017 22:59:34 -0700 Subject: [PATCH 3/3] Use the format of kubeadm init --- docs/setup/independent/create-cluster-kubeadm.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/setup/independent/create-cluster-kubeadm.md b/docs/setup/independent/create-cluster-kubeadm.md index bb4f3bdb1d..f2eacad637 100644 --- a/docs/setup/independent/create-cluster-kubeadm.md +++ b/docs/setup/independent/create-cluster-kubeadm.md @@ -178,7 +178,7 @@ as root: kubeadm join --token : --discovery-token-ca-cert-hash sha256: ``` -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): +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