Kubernetes Wiki Doc: [[TOC(Documentation/f*, depth=3)]] == Tutorial: Kubernetes Setup== Requirements: 1. [https://www.orbit-lab.org/wiki/Documentation/CGettingStarted Setup/Practice] of Orbit Nodes. 2. Any available Orbit Sandbox Node 3. Ubuntu 20.04.5 LTS or Ubuntu 22.04.2 LTS (Choice is up to you) ---- In this tutorial, we will be using one of the sb1 nodes for setting up Kubernetes. However, sb(1-10) should also be capable for Kubernetes setup. Make sure you have Ubuntu 20.04.5 (**baseline20.04.ndz**) or 22.04.2 (**ubuntu2204-beta.ndz**) LTS. To get the Ubuntu Version, follow these steps after ssh'ing into your console. Substitute for the image and node you want. The below steps illustrate loading Ubuntu 20.04.5 LTS for node1-2 of sb1. For the sb1 console, {{{#!shell username@console:~$ omf tell -t node1-2 -a offh }}} {{{#!shell username@console:~$ omf load -t node1-2 -i baseline20.04.ndz }}} {{{#!shell username@console:~$ omf tell -t node1-2 -a on }}} To verify if you have loaded your Ubuntu version properly, use this command after ssh into the node1-2 {{{#!shell root@node1-2:~# lsb_release -a }}} This will list the current version of Ubuntu loaded. Example Image: [[Image(lsb_release.jpg)]] === Set up a Kubernetes Cluster === After loading your version of Ubuntu, you can follow the below steps to install Kubernetes 1. Update and Upgrade Packages: {{{#!shell root@node1-2:~# sudo apt-get update && sudo apt-get upgrade }}} 2. Install Docker: {{{#!shell root@node1-2:~# sudo apt install docker.io }}} 3. Configure Docker to use systemd for the management of the container’s cgroups: {{{#!shell root@node1-2:~# cat </dev/null }}} {{{#!shell root@node1-2:~# echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list }}} 9. Install Kubernetes: {{{#!shell root@node1-2:~# sudo apt-get update }}} {{{#!shell root@node1-2:~# sudo apt-get install -y kubelet kubeadm kubectl }}} {{{#!shell root@node1-2:~# sudo apt-mark hold kubelet kubeadm kubectl }}} 10. Initialize the Kubernetes Cluster: {{{#!shell root@node1-2:~# kubeadm init --pod-network-cidr=10.19.0.0/16 }}} You should see an output which includes a `kubeadm join` command, save this command for use on the worker nodes. 11. Set KUBECONFIG environment variable: {{{#!shell root@node1-2:~# export KUBECONFIG=/etc/kubernetes/admin.conf }}} 12. Apply Flannel network overlay: {{{#!shell root@node1-2:~# kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml }}} === Joining Worker Nodes to the Cluster === To join worker nodes to the Kubernetes cluster, run the `kubeadm join` command that was outputted by the `kubeadm init` command. Example: {{{#!shell root@node1-2:~# kubeadm join 10.19.1.5:6443 --token o1cttx.z9al8w8ljqcmqb4y --discovery-token-ca-cert-hash sha256:6ecd74d7eca0299b80499cf2e2e1c87c4079c3d234282be5822761880998853e }}} = Hope You Figure Out the Purpose of Kubernetes =