您当前的位置: 首页 > 慢生活 > 程序人生 网站首页程序人生
67、Kubernetes - 高可用的 K8S 构建(2)_]
发布时间:2023-02-06 23:08:48编辑:雪饮阅读()
Step1
master01,master02,master03节点都执行
脚本1
#!/bin/bash
cat > kubernetes.conf <<EOF
net.bridge.bridge-nf-call-iptables=1
net.bridge.bridge-nf-call-ip6tables=1
net.ipv4.ip_forward=1
net.ipv4.tcp_tw_recycle=0
vm.swappiness=0
vm.overcommit_memory=1
vm.panic_on_oom=0
fs.inotify.max_user_instances=8192
fs.inotify.max_user_watches=1048576
fs.file-max=52706963
fs.nr_open=52706963
net.ipv6.conf.all.disable_ipv6=1
net.netfilter.nf_conntrack_max=2310720
EOF
cp kubernetes.conf /etc/sysctl.d/kubernetes.conf
sysctl -p /etc/sysctl.d/kubernetes.conf
timedatectl set-timezone Asia/Shanghai
timedatectl set-local-rtc 0
systemctl restart rsyslog crond
systemctl stop postfix && systemctl disable postfix
mkdir /var/log/journal
mkdir /etc/systemd/journald.conf.d
cat > /etc/systemd/journald.conf.d/99-prophet.conf <<EOF
[Journal]
Storage=persistent
Compress=yes
SyncIntervalSec=5m
RateLimitInterval=30s
RateLimitBurst=1000
SystemMaxUse=10G
SystemMaxFileSize=200M
MaxRetentionSec=2week
ForwardToSyslog=no
EOF
systemctl restart systemd-journald
uname -r
cp /etc/default/grub{,.bak}
Step2
master01,master02,master03节点都执行
然后三个节点都在/etc/default/grub配置中如
GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet"
这行的最后quiet后面追加numa=off
则如
GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet numa=off"
Step3
master01,master02,master03节点都执行
脚本2
#!/bin/bash
cp /boot/grub2/grub.cfg{,.bak}
grub2-mkconfig -o /boot/grub2/grub.cfg
然后三个节点都重启
init 6
Step4
脚本3
#!/bin/bash
modprobe br_netfilter
cat > /etc/sysconfig/modules/ipvs.modules <<EOF
modprobe -- ip_vs
modprobe -- ip_vs_rr
modprobe -- ip_vs_wrr
modprobe -- ip_vs_sh
modprobe -- nf_conntrack_ipv4
EOF
chmod 755 /etc/sysconfig/modules/ipvs.modules && bash /etc/sysconfig/modules/ipvs.modules && lsmod | grep -e ip_vs -e nf_conntrack_ipv4
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum update -y && yum install -y docker-ce
然后三节点再次重启
Step5
再次重启结束后如果不是默认内核要替换为默认内容,参考如
grub2-set-default 'CentoS Linux (5.4.225-1.el7.elrepo.x86_64) 7 (Core)'
但我测试却是未必。。。
关键字词:Kubernetes,高可用,K8S,构建
相关文章
- 64、Kubernetes - Helm 及其它功能性组件 - EFK 日志_
- 66、Kubernetes - 高可用的 K8S 构建(1)_]
- 65、Kubernetes - 证书可用年限修改_
- 64、Kubernetes - Helm 及其它功能性组件 - EFK 日志_
- no available release name found问题排查
- 56、Kubernetes - 安全 鉴权(3]
- 53、Kubernetes - 安全 认证
- 23、Kubernetes - 资源清单 - start、stop、相位
- 22、Kubernetes - 资源清单 - 探针
- 21、Kubernetes - 资源清单 - 探针