K3SUP Create A Multi-master (HA) Kubernetes Setup With Embedded ETCD

 

K3SUP. Create a multi-master (HA) Kubernetes setup with embedded etcd


1. Contoh nodes


node27 192.168.0.27

node28 192.168.0.28

node29 192.168.0.29

node30 192.168.0.30



2. Semua arahan di di node27 (ini adalah node yang akan jadi nginx reverse proxy)


https://rancher.com/docs/k3s/latest/en/


https://github.com/k3s-io/k3s/releases


3. Periksa latest version (19 Mar 2022) : v1.23.4+k3s1

Bila pasang Rancher 2.6
Error: chart requires kubeVersion: < 1.23.0-0 which is incompatible with Kubernetes v1.23.4+k3s1

Target tukar ke version v1.22.7+k3s1

4. Install k3sup


https://github.com/alexellis/k3sup (baca sepenuhnya)



curl -sLS https://get.k3sup.dev | sh

sudo install k3sup /usr/local/bin/


k3sup --help


=====


5. ssh-copy-id


Login SSH using certs mesti dibuat dulu. Root atau user biasa.

user biasa dengan sudo (ALL) NOPASSWORD


=====


6. Bina cluster k3s dengan k3sup


export SERVER1=192.168.0.28

export SERVER2=192.168.0.29

export SERVER3=192.168.0.30

export USER=root


env


### 6.1 main node

### Buat satu persatu dan periksa status ready dulu


k3sup install \

  --ip $SERVER1 \

  --user $USER \

  --cluster \

  --k3s-version v1.22.7+k3s1


### 6.2


k3sup join \

  --ip $SERVER2 \

  --user $USER \

  --server-user $USER \

  --server-ip $SERVER1 \

  --server \

  --k3s-version v1.22.7+k3s1


### 6.3


k3sup join \

  --ip $SERVER3 \

  --user $USER \

  --server-user $USER \

  --server-ip $SERVER1 \

  --server \

  --k3s-version v1.22.7+k3s1

 

==== Kalau ada error seperti ini, cubalah 2 3 kali.

==== Error: unable to setup agent: Process exited with status 35


====> output setiap kali berjaya.


Saving file to: /root/kubeconfig


# Test your cluster with:

export KUBECONFIG=/root/kubeconfig

kubectl config set-context default

kubectl get node -o wide


[email protected]:~# export KUBECONFIG=/root/kubeconfig

[email protected]:~# kubectl config set-context default

Context "default" modified.

[email protected]:~# kubectl get node -o wide

NAME      STATUS   ROLES                       AGE     VERSION        INTERNAL-IP    EXTERNAL-IP   OS-IMAGE             KERNEL-VERSION      CONTAINER-RUNTIME

node28   Ready    control-plane,etcd,master   9m12s   v1.23.4+k3s1   192.168.0.28   <none>        Ubuntu 20.04.4 LTS   5.4.0-104-generic   containerd://1.5.9-k3s1

node29   Ready    control-plane,etcd,master   6m57s   v1.23.4+k3s1   192.168.0.29   <none>        Ubuntu 20.04.4 LTS   5.4.0-104-generic   containerd://1.5.9-k3s1

node30   Ready    control-plane,etcd,master   55s     v1.23.4+k3s1   192.168.0.30   <none>        Ubuntu 20.04.4 LTS   5.4.0-104-generic   containerd://1.5.9-k3s1


 

  ==========

 

7. Salin kepada semua hosts K3S


Connection to node28 closed.

[email protected]:~# scp /root/kubeconfig [email protected]:/root/kubeconfig

kubeconfig                                                                                                                                                 100% 1055     1.6MB/s   00:00

[email protected]:~# scp /root/kubeconfig [email protected]:/root/kubeconfig

kubeconfig                                                                                                                                                 100% 1055   442.5KB/s   00:00

[email protected]:~# scp /root/kubeconfig [email protected]:/root/kubeconfig

kubeconfig                                                                                                                                                 100% 1055   548.9KB/s   00:00

[email protected]:~# ssh node28

8. Install kubectl

https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/#install-using-native-package-management

kubectl cluster-info

9. Install HELM


https://helm.sh/docs/intro/quickstart/

curl https://baltocdn.com/helm/signing.asc | sudo apt-key add -
sudo apt-get install apt-transport-https --yes
echo "deb https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list
sudo apt-get update
sudo apt-get install helm

helm repo add bitnami https://charts.bitnami.com/bitnami

helm search repo bitnami

Harisfazillah Jamel

Popular Posts

Labels

64bit Activity Adempire advocate Akta Apache ASAS Azam backup backuppc Bash Beowulf Big Data Broadband Budget Centos Cinta Cluster CMS cmsfornerd Company Complain computer Computer Operation Conference Contest Data Centre Operation DBmail Digg Digital Certification Discussion Group Django DNS Docker Domain Duit Online Economy Elastic Stack Elasticsearch ELK email email server English Evangelist Events Family Tree Fedora File System Firefox Foss FOSS.my FreeBSD FTX Gesaan Gluster Gmail Godaddy.com Google Google App GTUG Hacking Hadoop hafnie Harisfazillah Jamel horde HP-UX hwclock IBM ICT Service Delivery and Operation Indonesia Internet Internet Tools Itanium Jabatan IT Negara Jaring Java Javascript Jepun Jiwang Joke Joomla K3S K3Sup Kesihatan Kibana KOSTEM Kubernetes ldap Linux Linux Counter linuxmalaysia Logstash Love Mailman MailScanner Mailwatch Malay Malaysia MAMPU MDeC meetup Melaka Melayu Merdeka Microsoft Migration mirror sites Money Online Monitor MOSC 2010 MOSC2010 mosc2011 MOSC2013 MOSCMY MOSCMY2014 MOSCMY2015 Mozilla MPI MSC Malaysia MSC Malaysia OSCONF MSCOSCONF My Love MyGOSSCON MyMeeting Mypenguin99 mysql Nagios NagiosQL Negaraku nss_ldap ntp OBW2014 Open Office Open Source openldap Openoffice.org OpenStack Opera OS2 OS400 OSCC OSCC MAMPU osdc.my OSS OSS Policy OWASP Parallel Computing People Power Personal Petition PGP PHP Pligg Podman Politik Postfix Postgresql Programming Proxmox Python q1moscmy2015 Questionnaires Research Research tools RPM SASSIAN Sassian 85-89 Sassians 85-89 SCO Security Sekolah Sekolah Alam Shah Shell script Software License Solaris SongketMail SongketMailFilter sourceforge spam spamassassin Spoof Survey SVR4 System Tools Technorati Terjemahan Terminal TMnet Tor Training translation Treasury Malaysia Trend Micro Twitter Ubuntu Unix Virtualization VMS VOIP Wang Web Server Windows Zimbra