ToB企服应用市场:ToB评测及商务社交产业平台
标题:
京东云开发者|IoT运维 - 如何部署一套高可用K8S集群
[打印本页]
作者:
东湖之滨
时间:
2022-11-4 02:23
标题:
京东云开发者|IoT运维 - 如何部署一套高可用K8S集群
环境
准备工作
配置ansible(deploy 主机执行)
# ssh-keygen
# for i in 192.168.3.{21..28}; do ssh-copy-id -i ~/.ssh/id_rsa.pub $i; done
复制代码
[root@deploy ~]# cat /etc/ansible/hosts
[etcd]
192.168.3.21
192.168.3.22
192.168.3.23
[k8s-master]
192.168.3.24
192.168.3.25
192.168.3.26
[k8s-worker]
192.168.3.27
192.168.3.28
[k8s:children]
k8s-master
k8s-worker
复制代码
优化主机配置
关闭防火墙和selinux
# ansible all -m shell -a "systemctl stop firewalld && systemctl disable firewalld"
# ansible all -m shell -a "sed -i 's/^SELINUX=.*/SELINUX=disabled/g' /etc/selinux/config"
复制代码
修改limit
关闭交换分区
# swapoff -a
# ansible k8s -m shell -a "yes | cp /etc/fstab /etc/fstab_bak"
# ansible k8s -m shell -a "cat /etc/fstab_bak | grep -v swap > /etc/fstab"
# ansible k8s -m shell -a "echo vm.swappiness = 0 >> /etc/sysctl.d/k8s.conf"
# ansible k8s -m shell -a "sysctl -p /etc/sysctl.d/k8s.conf"
复制代码
配置ipvs
[code]# cat /root/ipvs.sh #!/bin/bashyum -y install ipvsadm ipset####创建ipvs脚本 cat > /etc/sysconfig/modules/ipvs.modules /etc/sysctl.d/k8s.conf
欢迎光临 ToB企服应用市场:ToB评测及商务社交产业平台 (https://dis.qidao123.com/)
Powered by Discuz! X3.4