k8 bootstrap (kubeadm)
- sshd - Disable passwordauth
- kube user
- Create kube user
- Add kube user to appropriate groups(sudo, wheel)
- Create ssh pair key for kube user
- Add ssh pub key to authorized keys for kube user
- Fetch priv key and stores under
~/kube_keys/<fqdn>/<key_name>
- Either
- Create random password for kube user and store it somewhere
- Create sudo entry for
NOPASSWD
-
Install/config container runtime
- docker.io
- exec-opts
/etc/docker/daemon.json
{ "exec-opts": ["native.cgroupdriver=systemd"] }
- exec-opts
/etc/docker/daemon.json
- cri-o ?
- docker.io
-
Import kubernetes gpg keys
- apt.kubernetes.io/doc/apt-key.gpg
- yum ?
-
Enable repo
-
Install packages
- kubelet
- kubeadm
- kubectl
- init masternode
- copy kube configs to kube user
mkdir -p $HOME/.kube sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config sudo chown $(id -u):$(id -g) $HOME/.kube/config
- add completions to ~/.bashrc
- echo 'source <(kubectl completion bash)' >> ~/.bashrc
- echo 'source <(kubeadm completion bash)' >> ~/.bashrc
- Install a SDN
- flannel
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
- calico
kubectl apply -f https://docs.projectcalico.org/v3.2/getting-started/kubernetes/installation/hosted/etcd.yaml kubectl apply -f https://docs.projectcalico.org/v3.2/getting-started/kubernetes/installation/rbac.yaml kubectl apply -f https://docs.projectcalico.org/v3.2/getting-started/kubernetes/installation/hosted/calico.yaml
- flannel
- Join node to master
kubeadm join w.x.y.z:6443 --token 123456.1234567890 --discovery-token-ca-cert-hash sha256:01234567890abcd..
- Create users for contexts
- Create contexts
- Backup etcd (?)
- Remove nodes from the cluster