Lab 16.2 HA multiple master nodes cluster when using cri-o steps??
Hi Chris,
I've installed and configured successfully in accordance with steps listed on Lab 3.1 for 1 master and 1 worker node using cri-o container runtime to deploy.
However at Ex 16.1 HA Steps I gone through, I am aware of a 'Very Important' note about using cri-o container runtime situation required to create a NEW CLUSTER and pass DIFFERENT OPTIONS to kubeadm init. Now, I am trying to create a new cluster with 3 new master nodes where HA Proxy previously created is to be a load balancer for 3 master nodes as per this Lab scenario.
For such, I'd like to have your comments if the following steps are correct to setup a new cluster with HA when using cri-o. If not, please provide respective steps and commands for corrections.
For the first master(cp), the second master(cp2), the third master(cp3), all worker nodes.
Follow the LAB_16.2 Detailed Steps - Install Software
step 1. commands ->
step 2. commands ->
step 3. (b) IF you chose cri-o for the cp and worker ->
(which is to follow LAB_3.1 step 5.(b) using CRI-O commands)
step 4. all commandsFor the first master(cp)
Follow the LAB_3.1
steps 6. - 11.
step 13.
root@cp:~# vim /etc/hosts
-ha-proxy k8scp
-cp2
-cp3
-wk
...
step 14. - IF USING CRI-O
root@cp:~# find /home -name kubeadm-crio.yaml
root@cp:~# nano /kubeadm-crio.yaml
nodeRegistration:
criSocket: unix:///var/run/crio/crio.sock
name: k8scp
kind: ClusterConfiguration
kubernetesVersion: 1.21.1
root@cp:~# cp .
step 15. initialze the cp.
root@cp:~# kubeadm init --config=kubeadm-config.yaml --upload-certs \
| tee kubeadm-init.out
[init] Using Kubernetes version: v1.21.1
[preflight] Running pre-flight checks<output_omitted>
step 16. - 17.
For the second master(cp2), the third master(cp3)
Follow the LAB_16.2 Detailed Steps - Join Control Plane Nodes
step 1.
root@cp2/3:~# vim /etc/hosts
-ha-proxy k8scp
-cp2
-cp3
-wk
step 2. or 3.-to-5.
step 6.
root@cp2/3 $ sudo kubeadm join k8scp:6443 \
--token xxxx.. --discovery-token-ca-cert-hash sha256:xxxx.. \
--control-plane --certificate-key xxxx..
step 7.
Thanks again and have a blessed day,
Joseph
Answers
-
Hi @josephkwong,
Both chapters 3 and 16 provide detailed steps to set up the first control-plane node, the worker, then the additional two control-plane nodes and the haproxy. The cri-o installation steps can be found in chapter 3 as well, and referenced whenever necessary for the worker, second and third control-plane nodes. As cri-o installation is much more complex than docker installation, extra care must be taken to ensure all install and config steps are properly executed.
Regards,
-Chris0 -
Thanks Chris. Herein the outcome:
The first master node setup is okay and running. The output is attached.
It FAILED for the second master node 'cp2' to Join Control Plane Nodes. The output is attached.
Please your comments.
Have a great day,
Joseph0 -
Hi @josephkwong,
What podNetwork is used by Calico and the kubead-crio.yaml config file?
What IP range is used by the hypervisor when provisioning VMs?If the podSubnet overlaps the IP range of the VMs, cluster internal traffic will be impacted, causing communication issues between nodes, control-plane pods and client workload pods.
Regards,
-Chris0 -
Hi Chris,
The private IP range used by the hypervisor is 192.168.3.1 to 192.168.3.253. The first master 'cp' node IP is 192.168.3.67.
Welcome to Ubuntu 20.04.3 LTS (GNU/Linux 5.4.0-89-generic x86_64)
- Documentation: https://help.ubuntu.com
- Management: https://landscape.canonical.com
Support: https://ubuntu.com/advantage
System information as of Sat Nov 13 08:03:52 UTC 2021
System load: 0.24 Processes: 252
Usage of /: 17.5% of 30.88GB Users logged in: 0
Memory usage: 16% IPv4 address for ens160: 192.168.3.67
Swap usage: 0% IPv4 address for tunl0: 192.168.74.128
jlab@cp:~$ ip a | grep inet
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
inet 192.168.3.67/24 brd 192.168.3.255 scope global ens160
inet6 fe80::250:56ff:fe02:39b/64 scope link
inet 192.168.74.128/32 scope global tunl0
inet6 fe80::ecee:eeff:feee:eeee/64 scope link
inet6 fe80::ecee:eeff:feee:eeee/64 scope link
inet6 fe80::ecee:eeff:feee:eeee/64 scope linkCalicol:
jlab@cp:/$ kubectl calico get ippools -o wide
NAME CIDR NAT IPIPMODE VXLANMODE DISABLED DISABLEBGPEXPORT SELECTOR
default-ipv4-ippool 192.168.0.0/16 true Always Never false false all()jlab@cp:~$ kubectl get all -n kube-system -o wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
pod/calico-kube-controllers-5d995d45d6-nspnl 1/1 Running 0 39h 192.168.74.129 k8scp
pod/calico-node-gcvds 1/1 Running 0 39h 192.168.3.67 k8scp
pod/coredns-558bd4d5db-bs8qb 1/1 Running 0 40h 192.168.74.131 k8scp
pod/coredns-558bd4d5db-z75dj 1/1 Running 0 40h 192.168.74.130 k8scp
pod/etcd-k8scp 1/1 Running 0 40h 192.168.3.67 k8scp
pod/kube-apiserver-k8scp 1/1 Running 0 40h 192.168.3.67 k8scp
pod/kube-controller-manager-k8scp 1/1 Running 0 40h 192.168.3.67 k8scp
pod/kube-proxy-m8g76 1/1 Running 0 40h 192.168.3.67 k8scp
pod/kube-scheduler-k8scp 1/1 Running 0 40h 192.168.3.67 k8scpPlease attached relevant config and output files.
1. yaml - calico, kubeadm-crio
2. output file - kubeadm-init.out
3. config file - calico-kubeconfig, 100-crio-bridge.conf
4. journalctl file - crio-journalctl.log
5. dns alias host file - hostsThanks again and have a blessed weekend.
Joseph0 -
Hi @josephkwong,
As I suspected, your network subnets overlap, causing major issues with your cluster.
First I would recommend re-building your cluster with distinct networks for nodes and pods - try10.200.0.0/16
as VM/node subnet managed by the hypervisor's DHCP server.Second, I noticed the
kubeadm join
command uses an IP address, as the advertised control-plane endpoint. That makes the HA config impossible to achieve. In order to fix it, edit thekubeadm-crio.yaml
file as follows:1 - for the
InitConfiguration
resource update thenodeRegistration.name
to becp
or the HOSTNAME of your control-plane node.
2 - for theClusterConfiguration
resource add a new propertycontrolPlaneEndpoint: "k8scp:6443"
and double-check the desired value ofkubernetesVersion:
. After theinit
completion, the suggestedjoin
command should displaykubeadm join k8scp:6443 --token abcdef...
As you initialize the cluster and join the first worker node, edit the /etc/hosts files as such:
a) on the control plane node add its Private IP withk8scp
alias.
Example:10.200.0.5 k8scp
b) on the worker node add the Private IP of the control plane node withk8scp
alias, same entry as (a).
Example:10.200.0.5 k8scp
Later, for HA configuration these aliases will be replaced with the ha-proxy Private IP, as instructed in the lab guide.
apiVersion: kubeadm.k8s.io/v1beta2 ... kind: InitConfiguration localAPIEndpoint: bindPort: 6443 nodeRegistration: criSocket: unix:///var/run/crio/crio.sock name: k8scp # <-- EDIT this line per instructions above taints: null --- ... apiVersion: kubeadm.k8s.io/v1beta2 certificatesDir: /etc/kubernetes/pki clusterName: kubernetes controllerManager: {} controlPlaneEndpoint: "k8scp:6443" # <-- ADD this line ... kind: ClusterConfiguration kubernetesVersion: 1.22.1 # < -- EDIT to 1.21.1 if planning a cluster UPGRADE after init + join networking: ... <leave unchanged the rest of the file>
Regards,
-Chris0 -
Hi @chrispokorni, my first question on this exercise is: Will the three new nodes that I have to create use the same network (lfclass) I used for my cp and worker node?
0 -
Hi @maybel,
Yes, the three new instances (2 control plane nodes and 1 haproxy instance) are on the same network as the first two instances (1 control plane and 1 worker nodes).
Regards,
-Chris0
Categories
- All Categories
- 217 LFX Mentorship
- 217 LFX Mentorship: Linux Kernel
- 788 Linux Foundation IT Professional Programs
- 352 Cloud Engineer IT Professional Program
- 177 Advanced Cloud Engineer IT Professional Program
- 82 DevOps Engineer IT Professional Program
- 146 Cloud Native Developer IT Professional Program
- 137 Express Training Courses
- 137 Express Courses - Discussion Forum
- 6.1K Training Courses
- 46 LFC110 Class Forum - Discontinued
- 70 LFC131 Class Forum
- 42 LFD102 Class Forum
- 226 LFD103 Class Forum
- 18 LFD110 Class Forum
- 36 LFD121 Class Forum
- 18 LFD133 Class Forum
- 7 LFD134 Class Forum
- 18 LFD137 Class Forum
- 71 LFD201 Class Forum
- 4 LFD210 Class Forum
- 5 LFD210-CN Class Forum
- 2 LFD213 Class Forum - Discontinued
- 128 LFD232 Class Forum - Discontinued
- 2 LFD233 Class Forum
- 4 LFD237 Class Forum
- 24 LFD254 Class Forum
- 693 LFD259 Class Forum
- 111 LFD272 Class Forum
- 4 LFD272-JP クラス フォーラム
- 12 LFD273 Class Forum
- 144 LFS101 Class Forum
- 1 LFS111 Class Forum
- 3 LFS112 Class Forum
- 2 LFS116 Class Forum
- 4 LFS118 Class Forum
- 4 LFS142 Class Forum
- 5 LFS144 Class Forum
- 4 LFS145 Class Forum
- 2 LFS146 Class Forum
- 3 LFS147 Class Forum
- 1 LFS148 Class Forum
- 15 LFS151 Class Forum
- 2 LFS157 Class Forum
- 25 LFS158 Class Forum
- 7 LFS162 Class Forum
- 2 LFS166 Class Forum
- 4 LFS167 Class Forum
- 3 LFS170 Class Forum
- 2 LFS171 Class Forum
- 3 LFS178 Class Forum
- 3 LFS180 Class Forum
- 2 LFS182 Class Forum
- 5 LFS183 Class Forum
- 31 LFS200 Class Forum
- 737 LFS201 Class Forum - Discontinued
- 3 LFS201-JP クラス フォーラム
- 18 LFS203 Class Forum
- 130 LFS207 Class Forum
- 2 LFS207-DE-Klassenforum
- 1 LFS207-JP クラス フォーラム
- 302 LFS211 Class Forum
- 56 LFS216 Class Forum
- 52 LFS241 Class Forum
- 48 LFS242 Class Forum
- 38 LFS243 Class Forum
- 15 LFS244 Class Forum
- 2 LFS245 Class Forum
- LFS246 Class Forum
- 48 LFS250 Class Forum
- 2 LFS250-JP クラス フォーラム
- 1 LFS251 Class Forum
- 150 LFS253 Class Forum
- 1 LFS254 Class Forum
- 1 LFS255 Class Forum
- 7 LFS256 Class Forum
- 1 LFS257 Class Forum
- 1.2K LFS258 Class Forum
- 10 LFS258-JP クラス フォーラム
- 118 LFS260 Class Forum
- 159 LFS261 Class Forum
- 42 LFS262 Class Forum
- 82 LFS263 Class Forum - Discontinued
- 15 LFS264 Class Forum - Discontinued
- 11 LFS266 Class Forum - Discontinued
- 24 LFS267 Class Forum
- 22 LFS268 Class Forum
- 30 LFS269 Class Forum
- LFS270 Class Forum
- 202 LFS272 Class Forum
- 2 LFS272-JP クラス フォーラム
- 1 LFS274 Class Forum
- 4 LFS281 Class Forum
- 9 LFW111 Class Forum
- 259 LFW211 Class Forum
- 181 LFW212 Class Forum
- 13 SKF100 Class Forum
- 1 SKF200 Class Forum
- 1 SKF201 Class Forum
- 795 Hardware
- 199 Drivers
- 68 I/O Devices
- 37 Monitors
- 102 Multimedia
- 174 Networking
- 91 Printers & Scanners
- 85 Storage
- 758 Linux Distributions
- 82 Debian
- 67 Fedora
- 17 Linux Mint
- 13 Mageia
- 23 openSUSE
- 148 Red Hat Enterprise
- 31 Slackware
- 13 SUSE Enterprise
- 353 Ubuntu
- 468 Linux System Administration
- 39 Cloud Computing
- 71 Command Line/Scripting
- Github systems admin projects
- 93 Linux Security
- 78 Network Management
- 102 System Management
- 47 Web Management
- 63 Mobile Computing
- 18 Android
- 33 Development
- 1.2K New to Linux
- 1K Getting Started with Linux
- 370 Off Topic
- 114 Introductions
- 173 Small Talk
- 22 Study Material
- 805 Programming and Development
- 303 Kernel Development
- 484 Software Development
- 1.8K Software
- 261 Applications
- 183 Command Line
- 3 Compiling/Installing
- 987 Games
- 317 Installation
- 96 All In Program
- 96 All In Forum
Upcoming Training
-
August 20, 2018
Kubernetes Administration (LFS458)
-
August 20, 2018
Linux System Administration (LFS301)
-
August 27, 2018
Open Source Virtualization (LFS462)
-
August 27, 2018
Linux Kernel Debugging and Security (LFD440)