kubeadm - nlpie/nlp-adapt-kube GitHub Wiki
Requirements: TODO
- see Installing kubeadm (see specific instructions for your OS here)
- run
kubeadm initto create configuration (only on new nodes before joining cluster)
sudo su -systemctl enable kubelet && systemctl start kubeletecho '1' > /proc/sys/net/bridge/bridge-nf-call-iptables
-
sudo swapoff -a(or for permanent solution:) -
sudo vi /etc/fstaband edit out swap drive`
-
sudo iptables -I INPUT -p tcp -m tcp --dport 6443 -j ACCEPT(NB: may need OVERRIDE rule, depending on policy) sudo /sbin/service iptables savesudo service iptables restart
-
sudo iptables -I INPUT -p tcp -m tcp --dport 10250 -j ACCEPT(NB: may need OVERRIDE rule, depending on policy) -
sudo /sbin/service iptables save3sudo service iptables restart
On node you wish to limit resources used by kubernetes, add
--system-reserved=cpu=500m,memory=1Gi to the file /etc/systemd/system/kubelet.service.d/10-kubeadm.conf`
-
kubeadm init --pod-network-cidr=192.168.0.0/16(initialize) kubectl apply -f https://docs.projectcalico.org/v3.3/getting-started/kubernetes/installation/hosted/rbac-kdd.yamlkubectl apply -f https://docs.projectcalico.org/v3.3/getting-started/kubernetes/installation/hosted/kubernetes-datastore/calico-networking/1.7/calico.yaml
-- for calico cni (to be done on all nodes post installation of Calico) --
sudo iptables -I cali-failsafe-in -p tcp --match multiport --dport 179 -j ACCEPTsudo /sbin/service iptables savesudo service iptables restart
mkdir -p $HOME/.kubesudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/configsudo chown $(id -u):$(id -g) $HOME/.kube/config
- run command returned by
kubeinit(sudo kubeadm join (token and csr output here)) with token output on all nodes to join
- to add new nodes in existing cluster:
kubeadm token create --print-join-command
kubectl get nodeskubectl drain <node name> --delete-local-data --force --ignore-daemonsets
kubectl delete node <node name>-
kubeadm reset(do on node)
kubectl get nodes --show-labelskubectl label --overwrite=true nodes atlas0.ahc.umn.edu node=atlas0 # add label
- Install: https://docs.aws.amazon.com/eks/latest/userguide/dashboard-tutorial.html
- Accessing: https://docs.oracle.com/cd/E52668_01/E88884/html/kube_admin_dashboard.html
TODO:
- Add example workflows
- Monitoring commands (get/describe/top/etc.)