K3s highly available deployment
Note: # the resistance that affects the high availability of K3s is the unification of certificates for all master nodes. The solution is to successfully deploy a master node and then copy the certificate generated by the node to other master nodes, including token, and use etcd as the database environment description: # operating system: centos8 1905#k3s version: v0.9.1#etcd version: v3.4.The etcd server IP:192.168.30.50192.168.30.51 192.168.30.52 # installation directory: / apps/ business # server node IP:192.168.30.50192.168.30.51192.168.30.52 node node 192.168.30.53 Vip node: 192.168.30.5roomk3s cluster domain name: cluster.local# K3s api interface domain name: api.k3s.tyong.com# K3s cluster-cidr:10.48.0.0/12# K3s service-cidr:10.64.0.0/16#k3s cluster-dns:10.64.0.2 binary preparation: # all nodes # download etcd binary wget https://github.com/etcd-io/etcd/releases/download/v3. 4.1/etcd-v3.4.1-linux-amd64.tar.gz# unzips the binary file tar-xvf etcd-v3.4.1-linux-amd64.tar.gz# to create the etcd running directory mkdir-p / apps/etcd/ {bin Conf,ssl Data} # copy binary to run directory cd etcd-v3.4.1-linux-amd64mv mv etcd* / apps/etcd/bin# download K3Swget https://github.com/rancher/k3s/releases/download/v0.9.1/k3s# executable permission chmod + x k3s# copy K3s to run directory mv K3s / usr/local/bin/# create soft chain easy to use cd/ usr/local/bin/ln-sf K3s kubectlln-sf K3s crictlln -sf K3s ctr# is used to modifying vi ~ / .bashrcalias docker='k3s crictl'. ~ / .bashrc make simple optimization to the system # set system.confcat > > / etc/systemd/system.conf / etc/sysctl.confcat > > / etc/sysctl.conf > / etc/security/limits.conf