Changes between Version 1 and Version 2 of Tutorials/m0SDN/k8s
- Timestamp:
- Jul 12, 2023, 7:01:56 PM (17 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Tutorials/m0SDN/k8s
v1 v2 1 Certainly, I've updated the node information in the document to reflect "node1-5" instead of "node1-2". Here it is: 2 1 3 Kubernetes Wiki Doc: 2 4 [[TOC(Documentation/f*, depth=3)]] … … 17 19 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. 18 20 19 The below steps illustrate loading Ubuntu 20.04.5 LTS for node1- 2of sb1. For the sb1 console,21 The below steps illustrate loading Ubuntu 20.04.5 LTS for node1-5 of sb1. For the sb1 console, 20 22 21 23 {{{#!shell 22 username@console:~$ omf tell -t node1- 2-a offh24 username@console:~$ omf tell -t node1-5 -a offh 23 25 }}} 24 26 25 27 {{{#!shell 26 username@console:~$ omf load -t node1- 2-i baseline20.04.ndz28 username@console:~$ omf load -t node1-5 -i baseline20.04.ndz 27 29 }}} 28 30 29 31 {{{#!shell 30 username@console:~$ omf tell -t node1- 2-a on32 username@console:~$ omf tell -t node1-5 -a on 31 33 }}} 32 34 33 To verify if you have loaded your Ubuntu version properly, use this command after ssh into the node1- 235 To verify if you have loaded your Ubuntu version properly, use this command after ssh into the node1-5 34 36 35 37 {{{#!shell 36 root@node1- 2:~# lsb_release -a38 root@node1-5:~# lsb_release -a 37 39 }}} 38 40 … … 48 50 1. Update and Upgrade Packages: 49 51 {{{#!shell 50 root@node1- 2:~# sudo apt-get update && sudo apt-get upgrade52 root@node1-5:~# sudo apt-get update && sudo apt-get upgrade 51 53 }}} 52 54 53 55 2. Install Docker: 54 56 {{{#!shell 55 root@node1- 2:~# sudo apt install docker.io57 root@node1-5:~# sudo apt install docker.io 56 58 }}} 57 59 58 60 3. Configure Docker to use systemd for the management of the container’s cgroups: 59 61 {{{#!shell 60 root@node1- 2:~# cat <<EOF | sudo tee /etc/docker/daemon.json62 root@node1-5:~# cat <<EOF | sudo tee /etc/docker/daemon.json 61 63 { 62 64 "exec-opts": ["native.cgroupdriver=systemd"], … … 72 74 4. Enable Docker: 73 75 {{{#!shell 74 root@node1- 2:~# sudo systemctl enable docker76 root@node1-5:~# sudo systemctl enable docker 75 77 }}} 76 78 77 79 5. Reload the systemd manager configuration: 78 80 {{{#!shell 79 root@node1- 2:~# sudo systemctl daemon-reload81 root@node1-5:~# sudo systemctl daemon-reload 80 82 }}} 81 83 82 84 6. Restart Docker: 83 85 {{{#!shell 84 root@node1- 2:~# sudo systemctl restart docker86 root@node1-5:~# sudo systemctl restart docker 85 87 }}} 86 88 87 89 7. Update and Upgrade Packages again: 88 90 {{{#!shell 89 root@node1- 2:~# apt update && apt upgrade -y91 root@node1-5:~# apt update && apt upgrade -y 90 92 }}} 91 93 92 94 8. Add Kubernetes to the repository list: 93 95 {{{#!shell 94 root@node1- 2:~# curl -sSL https://packages.cloud.google.com/apt/doc/apt-key.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/kubernetes-archive-keyring.gpg >/dev/null96 root@node1-5:~# curl -sSL https://packages.cloud.google.com/apt/doc/apt-key.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/kubernetes-archive-keyring.gpg >/dev/null 95 97 }}} 96 98 {{{#!shell 97 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.list99 root@node1-5:~# 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 98 100 }}} 99 101 100 102 9. Install Kubernetes: 101 103 {{{#!shell 102 root@node1- 2:~# sudo apt-get update104 root@node1-5:~# sudo apt-get update 103 105 }}} 104 106 {{{#!shell 105 root@node1- 2:~# sudo apt-get install -y kubelet kubeadm kubectl107 root@node1-5:~# sudo apt-get install -y kubelet kubeadm kubectl 106 108 }}} 107 109 {{{#!shell 108 root@node1- 2:~# sudo apt-mark hold kubelet kubeadm kubectl110 root@node1-5:~# sudo apt-mark hold kubelet kubeadm kubectl 109 111 }}} 110 112 111 113 10. Initialize the Kubernetes Cluster: 112 114 {{{#!shell 113 root@node1- 2:~# kubeadm init --pod-network-cidr=10.19.0.0/16115 root@node1-5:~# kubeadm init --pod-network-cidr=10.19.0.0/16 114 116 }}} 115 117 … … 118 120 11. Set KUBECONFIG environment variable: 119 121 {{{#!shell 120 root@node1- 2:~# export KUBECONFIG=/etc/kubernetes/admin.conf122 root@node1-5:~# export KUBECONFIG=/etc/kubernetes/admin.conf 121 123 }}} 122 124 123 125 12. Apply Flannel network overlay: 124 126 {{{#!shell 125 root@node1- 2:~# kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml127 root@node1-5:~# kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml 126 128 }}} 127 129 … … 131 133 Example: 132 134 {{{#!shell 133 root@node1- 2:~# kubeadm join 10.19.1.5:6443 --token o1cttx.z9al8w8ljqcmqb4y --discovery-token-ca-cert-hash sha256:6ecd74d7eca0299b80499cf2e2e1c87c4079c3d234282be5822761880998853e135 root@node1-5:~# kubeadm join 10.19.1.5:6443 --token o1cttx.z9al8w8ljqcmqb4y --discovery-token-ca-cert-hash sha256:6ecd74d7eca0299b80499cf2e2e1c87c4079c3d234282be5822761880998853e 134 136 }}} 135 137 136 = Hope You Figure Out the Purpose of Kubernetes =