I can install Kubernetes successfully on a Ubuntu 16 server, and get the master node into a Ready status. But if I reboot/restart, I get the error message in the title when I try to use KUBECTL
.
Do I need to put the following commands given when I originally ran KUBEADM INIT
into my profile to persist?
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
I was following the recipe in the O'Reilly Kubernetes Cookbook, together with using Google's K8S docs and Serverfault.
I can successfully get all the system pods running, and I can successfully get both a master and a single worker running as Ready. But they don't persist over a reboot.
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system etcd-k8s-master 1/1 Running 0 1m
kube-system kube-apiserver-k8s-master 1/1 Running 0 2m
kube-system kube-controller-manager-k8s-master 1/1 Running 0 2m
kube-system kube-dns-86f4d74b45-phphd 3/3 Running 0 3m
kube-system kube-proxy-25mtq 1/1 Running 0 3m
kube-system kube-scheduler-k8s-master 1/1 Running 0 2m
kube-system weave-net-rfb6z 2/2 Running 0 50s
NAME STATUS ROLES AGE VERSION
k8s-master Ready master 9m v1.10.3
k8s-worker1 Ready <none> 14s v1.10.3