--https://share.google/aimode/mNvlnzfTE0U5g0GcL
To create a production-ready Kubernetes cluster using
kubeadm, you must prepare one Master Node (Control Plane) with at least 2 vCPUs and 2 GB RAM, and one or more Worker Nodes with at least 1 vCPU and 1 GB RAM. [1, 2]1. Prerequisites (Run on ALL Nodes)
Execute these commands on both the Master and Worker machines to configure the underlying system. [1]
- Disable swap (Kubernetes requires swap to be off):bash
sudo swapoff -a sudo sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstabகுறியீட்டைக் கவனமாகப் பயன்படுத்துங்கள். - Enable IPv4 forwarding and load required kernel modules:bash
cat <<EOF | sudo tee /etc/modules-load.d/k8s.conf overlay br_netfilter EOF sudo modprobe overlay sudo modprobe br_netfilter cat <<EOF | sudo tee /etc/sysctl.d/k8s.conf net.bridge.bridge-nf-call-iptables = 1 net.bridge.bridge-nf-call-ip6tables = 1 net.ipv4.ip_forward = 1 EOF sudo sysctl --systemகுறியீட்டைக் கவனமாகப் பயன்படுத்துங்கள். - Install containerd:bash
sudo apt-get update sudo apt-get install -y containerd sudo mkdir -p /etc/containerd containerd config default | sudo tee /etc/containerd/config.toml > /dev/null sudo sed -i 's/SystemdCgroup = false/SystemdCgroup = true/g' /etc/containerd/config.toml sudo systemctl restart containerdகுறியீட்டைக் கவனமாகப் பயன்படுத்துங்கள். - Install kubelet, kubeadm, and kubectl:[1, 2, 3, 4, 5]bash
sudo apt-get update && sudo apt-get install -y apt-transport-https curl curl -fsSL https://k8s.io | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-archive-keyring.gpg echo "deb [signed-by=/etc/apt/keyrings/kubernetes-archive-keyring.gpg] https://k8s.io /" | sudo tee /etc/apt/sources.list.d/kubernetes.list sudo apt-get update sudo apt-get install -y kubelet kubeadm kubectl sudo apt-mark hold kubelet kubeadm kubectlகுறியீட்டைக் கவனமாகப் பயன்படுத்துங்கள்.
2. Initialize the Master Node (Run ONLY on Master Node)
- Initialize the cluster using a designated Pod network CIDR block:bash
sudo kubeadm init --pod-network-cidr=192.168.0.0/16குறியீட்டைக் கவனமாகப் பயன்படுத்துங்கள். - Configure cluster access for your non-root user (copied from the output of the command above):bash
mkdir -p $HOME/.kube sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config sudo chown $(id -u):$(id -g) $HOME/.kube/configகுறியீட்டைக் கவனமாகப் பயன்படுத்துங்கள். - Deploy a Pod Network plugin (Calico) so your containers can communicate:bash
kubectl create -f https://githubusercontent.com kubectl create -f https://githubusercontent.comகுறியீட்டைக் கவனமாகப் பயன்படுத்துங்கள்.
3. Join the Worker Node (Run ONLY on Worker Node)
The worker node connects back to the master plane to begin receiving containers. [1]
4. Verify Cluster Health (Run ONLY on Master Node)
Check if your cluster nodes are linked together successfully.
- Check node status:[1]bash
kubectl get nodesகுறியீட்டைக் கவனமாகப் பயன்படுத்துங்கள்.
If you are setting this up, tell me:
- What cloud platform or environment (AWS, bare-metal, VirtualBox) are you using?
- Which Kubernetes version do you specifically want to run?
I can give you the exact firewall port configurations or helper scripts for your specific setup.