Add lb k8s ha guide and fixed install script
This commit is contained in:
parent
ac0197af58
commit
18a2935104
108
LB-K8S-HA.md
Normal file
108
LB-K8S-HA.md
Normal file
@ -0,0 +1,108 @@
|
||||
# Setup and Configuration k8s multiple master (HA)
|
||||
|
||||
- Keepalived
|
||||
- HAProxy
|
||||
- Kubernetes
|
||||
|
||||
### Keepalived
|
||||
|
||||
- Install and start service
|
||||
|
||||
```shell
|
||||
sudo apt-get install keepalived -y
|
||||
sudo systemctl enable keepalived
|
||||
sudo systemctl start keepalived
|
||||
```
|
||||
|
||||
- Configuration for master nodes
|
||||
- k8s-master-1 `/etc/keepalived/keepalived.conf`
|
||||
|
||||
```config
|
||||
global_defs {
|
||||
notification_email {
|
||||
sysadmin@cubetiqhost.net
|
||||
support@cubetiqhost.net
|
||||
}
|
||||
notification_email_from k8s-master-1@cubetiqhost.net
|
||||
smtp_server localhost
|
||||
smtp_connect_timeout 30
|
||||
}
|
||||
|
||||
vrrp_instance VI_1 {
|
||||
state MASTER
|
||||
interface ens18
|
||||
virtual_router_id 101
|
||||
priority 101
|
||||
advert_int 1
|
||||
authentication {
|
||||
auth_type PASS
|
||||
auth_pass 1111
|
||||
}
|
||||
virtual_ipaddress {
|
||||
192.168.0.10
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
- k8s-master-2 (BACKUP) `/etc/keepalived/keepalived.conf`
|
||||
|
||||
```config
|
||||
global_defs {
|
||||
notification_email {
|
||||
sysadmin@cubetiqhost.net
|
||||
support@cubetiqhost.net
|
||||
}
|
||||
notification_email_from k8s-master-2@cubetiqhost.net
|
||||
smtp_server localhost
|
||||
smtp_connect_timeout 30
|
||||
}
|
||||
|
||||
vrrp_instance VI_1 {
|
||||
state BACKUP
|
||||
interface ens18
|
||||
virtual_router_id 101
|
||||
priority 100
|
||||
advert_int 1
|
||||
authentication {
|
||||
auth_type PASS
|
||||
auth_pass 1111
|
||||
}
|
||||
virtual_ipaddress {
|
||||
192.168.0.10
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
- k8s-master-3 (BACKUP) `/etc/keepalived/keepalived.conf`
|
||||
|
||||
```config
|
||||
global_defs {
|
||||
notification_email {
|
||||
sysadmin@cubetiqhost.net
|
||||
support@cubetiqhost.net
|
||||
}
|
||||
notification_email_from k8s-master-3@cubetiqhost.net
|
||||
smtp_server localhost
|
||||
smtp_connect_timeout 30
|
||||
}
|
||||
|
||||
vrrp_instance VI_1 {
|
||||
state BACKUP
|
||||
interface ens18
|
||||
virtual_router_id 101
|
||||
priority 100
|
||||
advert_int 1
|
||||
authentication {
|
||||
auth_type PASS
|
||||
auth_pass 1111
|
||||
}
|
||||
virtual_ipaddress {
|
||||
192.168.0.10
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
- Restart all nodes for keepalived service
|
||||
```shell
|
||||
sudo systemctl restart keepalived
|
||||
```
|
@ -2,7 +2,7 @@
|
||||
|
||||
#### Quick install for kubernetes cluster for worker node
|
||||
```shell
|
||||
curl -s -L https://raw.githubusercontent.com/sombochea/kubernetes-installation/main/kube-cluster-worker-install.sh?v=182012102021 | bash
|
||||
curl -s -L https://raw.githubusercontent.com/sombochea/kubernetes-installation/main/kube-cluster-worker-install.sh?v=121020215 | bash
|
||||
```
|
||||
|
||||
### 1. Download kubectl
|
||||
|
@ -62,8 +62,7 @@ kubeadm version
|
||||
|
||||
echo "Downloading and setup docker, containerd and tools..."
|
||||
sudo swapoff -a
|
||||
wget https://sh.osa.cubetiqs.com/docker-setup.sh
|
||||
bash docker-setup.sh
|
||||
curl -s -L https://sh.osa.cubetiqs.com/docker-setup.sh | bash
|
||||
sudo systemctl start docker
|
||||
sudo systemctl enable docker
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user