How to Install Kubernetes Cluster on Ubuntu 23.04

Sdílet
Vložit
  • čas přidán 18. 03. 2023
  • Step by step how to Install Kubernetes Cluster on Ubuntu 23.04 LTS
    Kubernetes is an open source container orchestration tool developed by Google. It is used for clustering and managing clusters of containerized applications - a process known in the computing world as "orchestration".
    Commands as PDF: justpaste.it/akhqs
    Important:
    please replace BT in the commands to the "bigger than sign"
    and replace LT in the commands to the "less than sign"
    or simple copy commands from attached justpastit link
    0:01
    set hostname /etc/hosts and add nodes hostname
    make sure nodes and master can communicate
    both nodes and master shuld be able to ping 8.8.8.8
    hardware requirements: Ubuntu 23.04, Minimum 2GB RAM, Minimum 2 CPU core.
    0:27
    Disable swap befor installing kuerbnetes:
    sudo swapon --show
    sudo swapoff -a
    sudo sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab
    0:41
    Load kernel modules:
    sudo tee /etc/modules-load.d/containerd.conf LTLTEOF
    overlay
    br_netfilter
    EOF
    sudo modprobe overlay
    sudo modprobe br_netfilter
    sudo tee /etc/sysctl.d/kubernetes.conf LTLTEOF
    net.bridge.bridge-nf-call-ip6tables = 1
    net.bridge.bridge-nf-call-iptables = 1
    net.ipv4.ip_forward = 1
    EOF
    sudo sysctl --system
    0:56
    install needed packages:
    sudo apt install -y curl gnupg2 software-properties-common apt-transport-https ca-certificates
    1:06 Add docker key and repo:
    sudo curl -fsSL download.docker.com/linux/ubu... | sudo gpg --dearmour -o /etc/apt/trusted.gpg.d/docker.gpg
    sudo add-apt-repository "deb [arch=amd64] download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
    sudo add-apt-repository "deb [arch=amd64] download.docker.com/linux/ubuntu jammy stable"
    sudo apt update
    1:40 Install and setp containerd runtime:
    sudo apt install -y containerd.io
    containerd config default | sudo tee /etc/containerd/config.toml BT/dev/null 2BT&1
    sudo sed -i 's/SystemdCgroup \= false/SystemdCgroup \= true/g' /etc/containerd/config.toml
    sudo systemctl restart containerd
    sudo systemctl enable containerd
    2:04 make repo able to install kubernetes:
    curl -s packages.cloud.google.com/apt... | sudo gpg --dearmour -o /etc/apt/trusted.gpg.d/kubernetes-xenial.gpg
    sudo apt-add-repository "deb apt.kubernetes.io/ kubernetes-xenial main"
    2:20 install kubeadm & kubectl & kubelet:
    sudo apt update
    sudo apt install -y kubelet kubeadm kubectl
    sudo apt-mark hold kubelet kubeadm kubectl
    2:37 set kubeadm und fix error kubernetes error execution phase preflight:
    sudo kubeadm init --control-plane-endpoint=master.linuxsyr.com
    export KUBECONFIG=/etc/kubernetes/admin.conf
    (set export command at startup)
    5:52 setup Calico network plugig:
    kubectl apply -f raw.githubusercontent.com/pro...
    kubectl cluster-info
    copy join command and join the nodes.
    kubectl get nodes
    6:21 join a new node to cluster
    to generate new join token and command:
    kubeadm token create --print-join-command
    9:59 fix /proc/sys/net/ipv4/ip_forward contents are not set to 1:
    echo 1 LT /etc/proc/sys/net/ipv4/ip_forward
    10:26 make node status on master ready
    installation finished
    if you get error execution phase preflight: [preflight] Some fatal errors occurred: [ERROR Port-6443]: Port 6443 is in use. See this:
    • kubeadm init error res...
    if you get this error: kubectl get nodes Config not found: /root/admin.conf | couldn't get current server API group list
    • kubectl get nodes Conf...
  • Věda a technologie

Komentáře • 1

  • @iykedee
    @iykedee Před 11 měsíci

    🤟🏾👍🏾👍🏾