当前位置:首页 > Web开发 > 正文

rs 副本扩容:kubectl get deploykubectl scale --replicas=3 deploy/

2024-03-31 Web开发

标签:

kubernetes的的私有货仓vmware harbor的配置

标签(空格分隔断绝分手): kubernetes系列

一. 系统环境的配置

二. vmware harbor 的安置测试

三. 颁布一个测试nginx

一:系统初始化 1.1 系统主机名 192.168.100.11 node01.flyfish 192.168.100.12 node02.flyfish 192.168.100.13 node03.flyfish 192.168.100.14 node04.flyfish 192.168.100.15 node05.flyfish 192.168.100.16 node06.flyfish

技术图片

1.2 封锁firewalld 清空iptables 与 selinux 法则 系统节点全部执行: systemctl stop firewalld && systemctl disable firewalld && yum -y install iptables-services && systemctl start iptables && systemctl enable iptables && iptables -F && service iptables save 封锁 SELINUX swapoff -a && sed -i ‘/ swap / s/^\(.*\)$/#\1/g‘ /etc/fstab setenforce 0 && sed -i ‘s/^SELINUX=.*/SELINUX=disabled/‘ /etc/selinux/config

技术图片

技术图片

1.3 安置 依赖包 全部节点安置 yum install -y conntrack ntpdate ntp ipvsadm ipset jq iptables curl sysstat libseccomp wget vim net-tools git

技术图片

技术图片

1.4 升级调解内核参数,对付 K8S 所有节点都执行 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 # 禁止使用 swap 空间,只有当系统 OOM 时才允许使用它 vm.overcommit_memory=1 # 不查抄物理内存是否够用 vm.panic_on_oom=0 # 开启 OOM 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

技术图片

技术图片

1.5 调解系统时区 # 设置系统时区为 中国/上海 timedatectl set-timezone Asia/Shanghai # 将当前的 UTC 时间写入硬件时钟 timedatectl set-local-rtc 0 # 重启依赖于系统时间的处事 systemctl restart rsyslog && systemctl restart crond

###1.6 封锁系统不需要处事

systemctl stop postfix && systemctl disable postfix

技术图片

###1.7 设置 rsyslogd 和 systemd journald

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 # 最大占用空间 10G SystemMaxUse=10G # 单日志文件最大 200M SystemMaxFileSize=200M # 日志生存时间 2 周 MaxRetentionSec=2week # 不将日志转发到 syslog ForwardToSyslog=no EOF systemctl restart systemd-journald

技术图片

1.7 升级系统内核为 4.44 CentOS 7.x 系统自带的 3.10.x 内核存在一些 Bugs,导致运行的 Docker、Kubernetes 不不变,例如: rpm -Uvh rpm -Uvh # 安置完成后查抄 /boot/grub2/grub.cfg 中对应内核 menuentry 中是否包罗 initrd16 配置,如果没有,再安置 一次! yum --enablerepo=elrepo-kernel install -y kernel-lt # 设置开机重新内核启动 grub2-set-default "CentOS Linux (4.4.182-1.el7.elrepo.x86_64) 7 (Core)" reboot # 重启后安置内核源文件 yum --enablerepo=elrepo-kernel install kernel-lt-devel-$(uname -r) kernel-lt-headers-$(uname -r)

温馨提示: 本文由Jm博客推荐,转载请保留链接: https://www.jmwww.net/file/web/31565.html