使用kubevip搭建高可用k3s
source link: https://www.bboy.app/2022/12/19/%E4%BD%BF%E7%94%A8kubevip%E6%90%AD%E5%BB%BA%E9%AB%98%E5%8F%AF%E7%94%A8k3s/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
使用kubevip搭建高可用k3s
2022-12-19 10:50:00 kubernetes
最近把家里的树莓派上的服务全部迁移到了nuc上,然后把k3s重新搭建了一下,k3s的存储从mysql变成了现在的内嵌etcd,正好加个kubevip让k3s实现高可用
首先创建rbac
curl https://kube-vip.io/manifests/rbac.yaml > /var/lib/rancher/k3s/server/manifests/kube-vip-rbac.yaml
之后apply下上面的rbac
接着生成daemonset.yaml
ctr image pull ghcr.bboysoul.cn/kube-vip/kube-vip:v0.4.4
alias kube-vip="ctr run --rm --net-host ghcr.bboysoul.cn/kube-vip/kube-vip:v0.4.4 vip /kube-vip"
kube-vip manifest daemonset --interface ens18 --address 10.10.100.190 --inCluster --taint --controlplane --arp --leaderElection
这里interface要和你master节点的网卡名字保持一致
address就是你高可用的ip地址,其他的参数保持默认
这个时候把你的apiserver地址解析改为你所配置的ip地址就好了
欢迎关注我的博客 www.bboy.app
Have Fun
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK