...
> sudo hostnamectl set-hostname k8smaster1 > sudo hostnamectl
Generate SSH Key
As test:
> ssh-keygen -t rsa -b 2048
Copy to other nodes
> ssh-copy-id test@172.20.233.182
...
> ssh-copy-id test@172.20.233.186
As root:
> sudo su
> ssh> ssh-keygen -t rsa -b 2048
Copy to other nodes
> ssh-copy-id id test@172.20.233.182
...
> ssh-copy-id test@172.20.233.186
...
Code Block |
---|
[init] Using Kubernetes version: v1.13.4 [preflight] Running pre-flight checks ... Your Kubernetes master has initialized successfully! To start using your cluster, you need to run the following as a regular user: mkdir -p $HOME/.kube sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config sudo chown $(id -u):$(id -g) $HOME/.kube/config You should now deploy a pod network to the cluster. Run "kubectl apply -f [podnetwork].yaml" with one of the options listed at: https://kubernetes.io/docs/concepts/cluster-administration/addons/ You can now join any number of machines by running the following on each node as root: kubeadm join k8slb.ott.dev.intra:6443 --token 80g665ktemf3.bhpvg9w5inpgeimtpshisb9lspt1i40i --discovery-token-ca-cert-hash sha256:2b37c8b0ce18cc9710eb53c7eb7ece209645b02bd906da2f09f26b8f1d29fb9e1e737466a59f00083a4ddf43c9fcf446a5b1cee8346afd1565d341fe5dee2c46 |
Record the kubeadm join command!
...
Code Block |
---|
NAMESPACE NAME READY STATUS RESTARTS AGE kube-system coredns-86c58d9df4-8zk5t 1/1 Running 0 47h kube-system coredns-86c58d9df4-tsftk 1/1 Running 0 47h kube-system etcd-k8master 1/1 Running 1 47h kube-system kube-apiserver-k8master 1/1 Running 1 47h kube-system kube-controller-manager-k8master 1/1 Running 1 47h kube-system kube-flannel-ds-amd64-fl5wp 1/1 Running 0 12s kube-system kube-proxy-88gdq 1/1 Running 1 47h kube-system kube-scheduler-k8master 1/1 Running 1 47h |
By default, your cluster will not schedule pods on the master for security reasons. If you want to be able to schedule pods on the master, e.g. for a single-machine Kubernetes cluster for development, run:
...
Copy Certificates to Other Master Nodes
...