https://www.centlinux.com/2022/11/install-kubernetes-master-node-rocky-linux.html
CNI Plugin:
https://www.tkng.io/cni/flannel/
kubeadm init
kubeadm init --pod-network-cidr=10.244.0.0/16
Create file: /run/flannel/subnet.env
FLANNEL_NETWORK=10.244.0.0/16
FLANNEL_SUBNET=10.244.0.1/24
FLANNEL_MTU=1450
FLANNEL_IPMASQ=true
Testing Deployment
kubectl get pods --all-namespaces
kubectl run test --image=nginx
kubectl get pod -o wide
Flannel File Path:
/opt/cni/bin/flannel
Kubelet Logs:
journalctl -u kubelet
kubectl cluster-info
Useful Commands:
kubectl get pods –all-namespaces
kubectl run test –image=nginx
kubectl get pod -o wide
kubeadm
kubeadm reset
kubeadm init
kubeadm get node
kubeadm config images pull
kubeadm join –help | grep token
Kubernetes Deployment:
Create YAML File:
test-deployment.yaml
Apply/Create YAML file
kubectl apply -f test-deployment.yaml
Display Created Pods
kubectl get pod
kubectl get deployment
kubectl delete pod test 1 test 2
Display Service & Endpoints
kubectl get svc
kubectl describe svc service-name
kubectl get ep (endpoints)
POD DNS Resolution not working:
kubectl -n kube-system rollout restart deployment coredns
Fully Qualified Domain Name:
<servicename>.<namespace>.svc.cluster.local