1.設置ip
# vi /etc/sysconfig/network-scripts/ifcfg-ens32
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
#IPV6INIT=yes
#IPV6_AUTOCONF=yes
#IPV6_DEFROUTE=yes
#IPV6_FAILURE_FATAL=no
#IPV6_ADDR_GEN_MODE=eui64
NAME=ens192
DEVICE=ens192
ONBOOT=yes
IPADDR=192.168.1.31
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
DNS1=114.114.114.114
DNS2=8.8.8.8# 關閉網卡
ifdown ens32# 啟動網卡
ifup ens32#重啟網卡
#1、重新載??下配置?件
nmcli c reload#2、重啟?卡(三個命令都可)
nmcli c up ens32
2.參數優化
#添加訪問互聯路由
cat > /etc/resolv.conf <<EOF
nameserver 114.114.114.114
nameserver 223.5.5.5
nameserver 8.8.8.8
EOFcat /etc/resolv.confcat > /etc/security/limits.conf << EOF
# 進程數量
* soft nproc 1000000
* hard nprot 1000000# 打開文件數
* soft nofile 1000000
* hard nofile 1000000
EOF# 手動使配置生效
ulimit -SHn 1000000#查看配置
ulimit -n#加載包
yum makecacheyum -y install lrzsz tar sshpasshostnamectl set-hostname k8s-01cat > /etc/hosts << EOF
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6192.168.1.220 k8s-01
192.168.1.221 k8s-02
192.168.1.222 k8s-03
192.168.1.223 k8s-04
192.168.1.224 k8s-05
EOFcat /etc/hosts# CentOS 7 開機不自動啟動防火墻
systemctl disable firewalld.service# 關閉防火墻
systemctl stop firewalld.service
setenforce 0#清空所有規則:
sudo iptables -F#查看當前規則
sudo iptables -L
3.部署腳本
k8s_install_new_openeuler.sh
#!/bin/bash
# auther: boge
# descriptions: the shell scripts will use ansible to deploy K8S at binary for siample
# github: https://github.com/easzlab/kubeasz
#########################################################################
# 此腳本安裝過的操作系統 CentOS/RedHat 7, Ubuntu 16.04/18.04/20.04/22.04, openEuler-22.03(LTS-SP3)
#########################################################################echo "記得先把數據盤掛載弄好,已經弄好直接回車,否則ctrl+c終止腳本.(Remember to mount the data disk first, and press Enter directly, otherwise ctrl+c terminates the script.)"
read -p "" xxxxxx
# 傳參檢測
[ $# -ne 7 ] && echo -e "Usage: $0 rootpasswd netnum nethosts cri cni k8s-cluster-name\nExample: bash $0 rootPassword 10.0.1 201\ 202\ 203\ 204 [containerd|docker] [calico|flannel|cilium] boge.com test-cn\n" && exit 11 # 變量定義
export release=3.6.4
export k8s_ver=v1.30.1
rootpasswd=$1
netnum=$2
nethosts=$3
cri=$4
cni=$5
domainName=$6
clustername=$7
if ls -1v ./kubeasz*.tar.gz &>/dev/null;then software_packet="$(ls -1v ./kubeasz*.tar.gz )";else software_packet="";fi
pwd="/etc/kubeasz"# deploy機器升級軟件庫
if cat /etc/redhat-release &>/dev/null;thenyum update -y
elif cat /etc/openEuler-release &>/dev/null;thenyum update -yyum install bash-completion sshpass tar -yif [ -f /usr/share/bash-completion/bash_completion ]; then. /usr/share/bash-completion/bash_completionecho "source /usr/share/bash-completion/bash_completion" >> ~/.bashrcfisystemctl stop firewalld.servicesystemctl disable firewalld.service
elseapt-get update && apt-get upgrade -y && apt-get dist-upgrade -y[ $? -ne 0 ] && apt-get -yf install
fi# deploy機器檢測python環境
if ! cat /etc/openEuler-release &>/dev/null;thenpython2 -V &>/dev/nullif [ $? -ne 0 ];thenif cat /etc/redhat-release &>/dev/null;thenyum install gcc openssl-devel bzip2-devel [ -f Python-2.7.16.tgz ] || wget https://www.python.org/ftp/python/2.7.16/Python-2.7.16.tgztar xzf Python-2.7.16.tgzcd Python-2.7.16./configure --enable-optimizationsmake altinstallln -s /usr/bin/python2.7 /usr/bin/pythoncd -elseapt-get install -y python2.7 && ln -s /usr/bin/python2.7 /usr/bin/pythonfifi
fipython3 -V &>/dev/null
if [ $? -ne 0 ];thenif cat /etc/redhat-release &>/dev/null;thenyum install python3 -ywhich iptables || yum install iptables -yelif cat /etc/openEuler-release &>/dev/null;thenyum install python3 -ywhich iptables || yum install iptables -yelseapt-get install -y python3which iptables || apt-get install iptables -yfi
fi# deploy機器設置pip安裝加速源
if `echo $clustername |grep -iwE cn &>/dev/null`; then
mkdir ~/.pip
cat > ~/.pip/pip.conf <<CB
[global]
index-url = https://mirrors.aliyun.com/pypi/simple
[install]
trusted-host=mirrors.aliyun.comCB
fi# deploy機器安裝相應軟件包
if cat /etc/openEuler-release &>/dev/null;thenpip3 install --no-cache-dir ansible netaddr
elsewhich python || ln -svf `which python2.7` /usr/bin/pythonif cat /etc/redhat-release &>/dev/null;thenyum install git epel-release python-pip sshpass -y[ -f ./get-pip.py ] && python ./get-pip.py || {wget https://bootstrap.pypa.io/pip/2.7/get-pip.py && python get-pip.py}elseif grep -Ew '20.04|22.04' /etc/issue &>/dev/null;then apt-get install sshpass -y;else apt-get install python-pip sshpass -y;fi[ -f ./get-pip.py ] && python ./get-pip.py || {wget https://bootstrap.pypa.io/pip/2.7/get-pip.py && python get-pip.py}fipython -m pip install --upgrade "pip < 21.0"which pip || ln -svf `which pip` /usr/bin/pippip -Vpip install setuptools -Upip install --no-cache-dir ansible netaddr
fi# 在deploy機器做其他node的ssh免密操作
for host in `echo "${nethosts}"`
doecho "============ ${netnum}.${host} ===========";if [[ ${USER} == 'root' ]];then[ ! -f /${USER}/.ssh/id_rsa ] &&\ssh-keygen -t rsa -P '' -f /${USER}/.ssh/id_rsaelse[ ! -f /home/${USER}/.ssh/id_rsa ] &&\ssh-keygen -t rsa -P '' -f /home/${USER}/.ssh/id_rsafisshpass -p ${rootpasswd} ssh-copy-id -o StrictHostKeyChecking=no ${USER}@${netnum}.${host}if cat /etc/redhat-release &>/dev/null;thenssh -o StrictHostKeyChecking=no ${USER}@${netnum}.${host} "yum update -y"elif cat /etc/openEuler-release &>/dev/null;thenssh -o StrictHostKeyChecking=no ${USER}@${netnum}.${host} "yum update -y"elsessh -o StrictHostKeyChecking=no ${USER}@${netnum}.${host} "apt-get update && apt-get upgrade -y && apt-get dist-upgrade -y"[ $? -ne 0 ] && ssh -o StrictHostKeyChecking=no ${USER}@${netnum}.${host} "apt-get -yf install"fi
done# deploy機器下載k8s二進制安裝腳本(注:這里下載可能會因網絡原因失敗,可以多嘗試運行該腳本幾次)if [[ ${software_packet} == '' ]];thenif [[ ! -f ./ezdown ]];thencurl -C- -fLO --retry 3 https://github.com/easzlab/kubeasz/releases/download/${release}/ezdownfi# 使用工具腳本下載sed -ri "s+^(K8S_BIN_VER=).*$+\1${k8s_ver}+g" ezdownchmod +x ./ezdown# ubuntu_22 to download package of Ubuntu 22.04./ezdown -D && ./ezdown -P ubuntu_22if [[ ${cni} == "cilium" ]];then ./ezdown -X cilium;fi
elsetar xvf ${software_packet} -C /etc/sed -ri "s+^(K8S_BIN_VER=).*$+\1${k8s_ver}+g" ${pwd}/ezdownchmod +x ${pwd}/{ezctl,ezdown}chmod +x ./ezdown./ezdown -D # 離線安裝 docker,檢查本地文件,正常會提示所有文件已經下載完成,并上傳到本地私有鏡像倉庫./ezdown -S # 啟動 kubeasz 容器
fi# 初始化一個名為$clustername的k8s集群配置CLUSTER_NAME="$clustername"
${pwd}/ezctl new ${CLUSTER_NAME}
if [[ $? -ne 0 ]];thenecho "cluster name [${CLUSTER_NAME}] was exist in ${pwd}/clusters/${CLUSTER_NAME}."exit 1
fiif [[ ${software_packet} != '' ]];then# 設置參數,啟用離線安裝# 離線安裝文檔:https://github.com/easzlab/kubeasz/blob/3.6.2/docs/setup/offline_install.mdsed -i 's/^INSTALL_SOURCE.*$/INSTALL_SOURCE: "offline"/g' ${pwd}/clusters/${CLUSTER_NAME}/config.yml
fi# to check ansible service
ansible all -m ping#---------------------------------------------------------------------------------------------------#修改二進制安裝腳本配置 config.ymlsed -ri "s+^(CLUSTER_NAME:).*$+\1 \"${CLUSTER_NAME}\"+g" ${pwd}/clusters/${CLUSTER_NAME}/config.yml## k8s上日志及容器數據存獨立磁盤步驟(參考阿里云的)mkdir -p /var/lib/container/{kubelet,docker,nfs_dir} /var/lib/{kubelet,docker} /nfs_dir## 不用fdisk分區,直接格式化數據盤 mkfs.ext4 /dev/vdb,按下面添加到fstab后,再mount -a刷新掛載(blkid /dev/sdx)
## cat /etc/fstab
# UUID=105fa8ff-bacd-491f-a6d0-f99865afc3d6 / ext4 defaults 1 1
# /dev/vdb /var/lib/container/ ext4 defaults 0 0
# /var/lib/container/kubelet /var/lib/kubelet none defaults,bind 0 0
# /var/lib/container/docker /var/lib/docker none defaults,bind 0 0
# /var/lib/container/nfs_dir /nfs_dir none defaults,bind 0 0## tree -L 1 /var/lib/container
# /var/lib/container
# ├── docker
# ├── kubelet
# └── lost+found# docker data dir
DOCKER_STORAGE_DIR="/var/lib/container/docker"
sed -ri "s+^(STORAGE_DIR:).*$+STORAGE_DIR: \"${DOCKER_STORAGE_DIR}\"+g" ${pwd}/clusters/${CLUSTER_NAME}/config.yml
# containerd data dir
CONTAINERD_STORAGE_DIR="/var/lib/container/containerd"
sed -ri "s+^(STORAGE_DIR:).*$+STORAGE_DIR: \"${CONTAINERD_STORAGE_DIR}\"+g" ${pwd}/clusters/${CLUSTER_NAME}/config.yml
# kubelet logs dir
KUBELET_ROOT_DIR="/var/lib/container/kubelet"
sed -ri "s+^(KUBELET_ROOT_DIR:).*$+KUBELET_ROOT_DIR: \"${KUBELET_ROOT_DIR}\"+g" ${pwd}/clusters/${CLUSTER_NAME}/config.yml
if [[ $clustername != 'aws' ]]; then# docker aliyun repoREG_MIRRORS="https://pqbap4ya.mirror.aliyuncs.com"sed -ri "s+^REG_MIRRORS:.*$+REG_MIRRORS: \'[\"${REG_MIRRORS}\"]\'+g" ${pwd}/clusters/${CLUSTER_NAME}/config.yml
fi
# [docker]信任的HTTP倉庫
sed -ri "s+127.0.0.1/8+${netnum}.0/24+g" ${pwd}/clusters/${CLUSTER_NAME}/config.yml
# disable dashboard auto install
sed -ri "s+^(dashboard_install:).*$+\1 \"no\"+g" ${pwd}/clusters/${CLUSTER_NAME}/config.yml# 融合配置準備(按示例部署命令這里會生成testk8s.boge.com這個域名,部署腳本會基于這個域名簽證書,優勢是后面訪問kube-apiserver,可以基于此域名解析任意IP來訪問,靈活性更高)
CLUSEER_WEBSITE="${CLUSTER_NAME}k8s.${domainName}"
lb_num=$(grep -wn '^MASTER_CERT_HOSTS:' ${pwd}/clusters/${CLUSTER_NAME}/config.yml |awk -F: '{print $1}')
lb_num1=$(expr ${lb_num} + 1)
lb_num2=$(expr ${lb_num} + 2)
sed -ri "${lb_num1}s+.*$+ - "${CLUSEER_WEBSITE}"+g" ${pwd}/clusters/${CLUSTER_NAME}/config.yml
sed -ri "${lb_num2}s+(.*)$+#\1+g" ${pwd}/clusters/${CLUSTER_NAME}/config.yml# node節點最大pod 數
MAX_PODS="120"
sed -ri "s+^(MAX_PODS:).*$+\1 ${MAX_PODS}+g" ${pwd}/clusters/${CLUSTER_NAME}/config.yml# calico 自建機房都在二層網絡可以設置 CALICO_IPV4POOL_IPIP=“off”,以提高網絡性能; 公有云上VPC在三層網絡,需設置CALICO_IPV4POOL_IPIP: "Always"開啟ipip隧道
#sed -ri "s+^(CALICO_IPV4POOL_IPIP:).*$+\1 \"off\"+g" ${pwd}/clusters/${CLUSTER_NAME}/config.yml# 修改二進制安裝腳本配置 hosts
# clean old ip
sed -ri '/192.168.1.1/d' ${pwd}/clusters/${CLUSTER_NAME}/hosts
sed -ri '/192.168.1.2/d' ${pwd}/clusters/${CLUSTER_NAME}/hosts
sed -ri '/192.168.1.3/d' ${pwd}/clusters/${CLUSTER_NAME}/hosts
sed -ri '/192.168.1.4/d' ${pwd}/clusters/${CLUSTER_NAME}/hosts
sed -ri '/192.168.1.5/d' ${pwd}/clusters/${CLUSTER_NAME}/hosts# 輸入準備創建ETCD集群的主機位
echo "enter etcd hosts here (example: 203 202 201) ↓"
read -p "" ipnums
for ipnum in `echo ${ipnums}`
doecho $netnum.$ipnumsed -i "/\[etcd/a $netnum.$ipnum" ${pwd}/clusters/${CLUSTER_NAME}/hosts
done# 輸入準備創建KUBE-MASTER集群的主機位
echo "enter kube-master hosts here (example: 202 201) ↓"
read -p "" ipnums
for ipnum in `echo ${ipnums}`
doecho $netnum.$ipnumsed -i "/\[kube_master/a $netnum.$ipnum" ${pwd}/clusters/${CLUSTER_NAME}/hosts
done# 輸入準備創建KUBE-NODE集群的主機位
echo "enter kube-node hosts here (example: 204 203) ↓"
read -p "" ipnums
for ipnum in `echo ${ipnums}`
doecho $netnum.$ipnumsed -i "/\[kube_node/a $netnum.$ipnum" ${pwd}/clusters/${CLUSTER_NAME}/hosts
done# 配置容器運行時CNI
case ${cni} inflannel)sed -ri "s+^CLUSTER_NETWORK=.*$+CLUSTER_NETWORK=\"${cni}\"+g" ${pwd}/clusters/${CLUSTER_NAME}/hosts;;calico)sed -ri "s+^CLUSTER_NETWORK=.*$+CLUSTER_NETWORK=\"${cni}\"+g" ${pwd}/clusters/${CLUSTER_NAME}/hosts;;cilium)sed -ri "s+^CLUSTER_NETWORK=.*$+CLUSTER_NETWORK=\"${cni}\"+g" ${pwd}/clusters/${CLUSTER_NAME}/hosts;;*)echo "cni need be flannel or calico or cilium."exit 11
esac# 配置K8S的ETCD數據備份的定時任務
# https://github.com/easzlab/kubeasz/blob/master/docs/op/cluster_restore.md
if cat /etc/redhat-release &>/dev/null;thenif ! grep -w '94.backup.yml' /var/spool/cron/root &>/dev/null;then echo "00 00 * * * /usr/local/bin/ansible-playbook -i /etc/kubeasz/clusters/${CLUSTER_NAME}/hosts -e @/etc/kubeasz/clusters/${CLUSTER_NAME}/config.yml /etc/kubeasz/playbooks/94.backup.yml &> /dev/null; find /etc/kubeasz/clusters/${CLUSTER_NAME}/backup/ -type f -name '*.db' -mtime +3|xargs rm -f" >> /var/spool/cron/root;else echo exists ;fichown root.crontab /var/spool/cron/rootchmod 600 /var/spool/cron/rootrm -f /var/run/cron.rebootservice crond restart
elif cat /etc/openEuler-release &>/dev/null;thenif ! grep -w '94.backup.yml' /var/spool/cron/root &>/dev/null;then echo "00 00 * * * /usr/local/bin/ansible-playbook -i /etc/kubeasz/clusters/${CLUSTER_NAME}/hosts -e @/etc/kubeasz/clusters/${CLUSTER_NAME}/config.yml /etc/kubeasz/playbooks/94.backup.yml &> /dev/null; find /etc/kubeasz/clusters/${CLUSTER_NAME}/backup/ -type f -name '*.db' -mtime +3|xargs rm -f" >> /var/spool/cron/root;else echo exists ;fichown root.crontab /var/spool/cron/rootchmod 600 /var/spool/cron/rootrm -f /var/run/cron.rebootservice crond restart
elseif ! grep -w '94.backup.yml' /var/spool/cron/crontabs/root &>/dev/null;then echo "00 00 * * * /usr/local/bin/ansible-playbook -i /etc/kubeasz/clusters/${CLUSTER_NAME}/hosts -e @/etc/kubeasz/clusters/${CLUSTER_NAME}/config.yml /etc/kubeasz/playbooks/94.backup.yml &> /dev/null; find /etc/kubeasz/clusters/${CLUSTER_NAME}/backup/ -type f -name '*.db' -mtime +3|xargs rm -f" >> /var/spool/cron/crontabs/root;else echo exists ;fichown root.crontab /var/spool/cron/crontabs/rootchmod 600 /var/spool/cron/crontabs/rootrm -f /var/run/crond.rebootservice cron restart
fi#---------------------------------------------------------------------------------------------------
# 準備開始安裝了
rm -rf ${pwd}/{dockerfiles,docs,.gitignore,pics,dockerfiles} &&\
find ${pwd}/ -name '*.md'|xargs rm -f
read -p "Enter to continue deploy k8s to all nodes >>>" YesNobbb# now start deploy k8s cluster
cd ${pwd}/# to prepare CA/certs & kubeconfig & other system settings
${pwd}/ezctl setup ${CLUSTER_NAME} 01
sleep 1
# to setup the etcd cluster
${pwd}/ezctl setup ${CLUSTER_NAME} 02
sleep 1
# to setup the container runtime(docker or containerd)
case ${cri} incontainerd)sed -ri "s+^CONTAINER_RUNTIME=.*$+CONTAINER_RUNTIME=\"${cri}\"+g" ${pwd}/clusters/${CLUSTER_NAME}/hosts${pwd}/ezctl setup ${CLUSTER_NAME} 03;;docker)sed -ri "s+^CONTAINER_RUNTIME=.*$+CONTAINER_RUNTIME=\"${cri}\"+g" ${pwd}/clusters/${CLUSTER_NAME}/hosts${pwd}/ezctl setup ${CLUSTER_NAME} 03;;*)echo "cri need be containerd or docker."exit 11
esac
sleep 1
# to setup the master nodes
${pwd}/ezctl setup ${CLUSTER_NAME} 04
sleep 1
# to setup the worker nodes
${pwd}/ezctl setup ${CLUSTER_NAME} 05
sleep 1
# to setup the network plugin(flannel、calico...)
${pwd}/ezctl setup ${CLUSTER_NAME} 06
sleep 1
# to setup other useful plugins(metrics-server、coredns...)
${pwd}/ezctl setup ${CLUSTER_NAME} 07
sleep 1k8s_bin_path='/opt/kube/bin'echo "------------------------- k8s version list ---------------------------"
${k8s_bin_path}/kubectl version
echo
echo "------------------------- All Healthy status check -------------------"
${k8s_bin_path}/kubectl get componentstatus
echo
echo "------------------------- k8s cluster info list ----------------------"
${k8s_bin_path}/kubectl cluster-info
echo
echo "------------------------- k8s all nodes list -------------------------"
${k8s_bin_path}/kubectl get node -o wide
echo
echo "------------------------- k8s all-namespaces's pods list ------------"
${k8s_bin_path}/kubectl get pod --all-namespaces
echo
echo "------------------------- k8s all-namespaces's service network ------"
${k8s_bin_path}/kubectl get svc --all-namespaces
echo
echo "------------------------- k8s welcome for you -----------------------"
echo# you can use k alias kubectl to siample
echo "alias k=kubectl && complete -F __start_kubectl k" >> ~/.bashrc# get dashboard url
${k8s_bin_path}/kubectl cluster-info|grep dashboard|awk '{print $NF}'|tee -a /root/k8s_results# get login token
${k8s_bin_path}/kubectl -n kube-system describe secret $(${k8s_bin_path}/kubectl -n kube-system get secret | grep admin-user | awk '{print $1}')|grep 'token:'|awk '{print $NF}'|tee -a /root/k8s_results
echo
echo "you can look again dashboard and token info at >>> /root/k8s_results <<<"
echo ">>>>>>>>>>>>>>>>> You need to excute command [ reboot ] to restart all nodes <<<<<<<<<<<<<<<<<<<<"
4.部署k8s
bash k8s_install_new_openeuler.sh password 192.168.1 220\ 221\ 222\ 223\ 224 containerd calico boge.com test-cn
5.下載國內鏡像包v1.30.1
docker pull registry.cn-hangzhou.aliyuncs.com/rwit/kubeasz-k8s-bin:v1.30.1
docker pull registry.cn-hangzhou.aliyuncs.com/rwit/pause:3.9
docker pull registry.cn-hangzhou.aliyuncs.com/rwit/cni:v3.26.4
docker pull registry.cn-hangzhou.aliyuncs.com/rwit/node:v3.26.4
docker pull registry.cn-hangzhou.aliyuncs.com/rwit/kubeasz:3.6.4
docker pull registry.cn-hangzhou.aliyuncs.com/rwit/coredns:1.11.1
docker pull registry.cn-hangzhou.aliyuncs.com/rwit/kubeasz-ext-bin:1.10.1
docker pull registry.cn-hangzhou.aliyuncs.com/rwit/kubeasz-sys-pkg:1.0.1_ubuntu_22
docker pull registry.cn-hangzhou.aliyuncs.com/rwit/k8s-dns-node-cache:1.22.28
docker pull registry.cn-hangzhou.aliyuncs.com/rwit/dashboard:v2.7.0
docker pull registry.cn-hangzhou.aliyuncs.com/rwit/metrics-scraper:v1.0.8
docker pull registry.cn-hangzhou.aliyuncs.com/rwit/metrics-server:v0.7.1
docker pull registry.cn-hangzhou.aliyuncs.com/rwit/kube-controllers:v3.26.4
docker pull registry.cn-hangzhou.aliyuncs.com/rwit/kubeasz:3.6.4docker tag registry.cn-hangzhou.aliyuncs.com/rwit/pause:3.9 easzlab/pause:3.9
docker tag registry.cn-hangzhou.aliyuncs.com/rwit/cni:v3.26.4 calico/cni:v3.26.4
docker tag registry.cn-hangzhou.aliyuncs.com/rwit/node:v3.26.4 calico/node:v3.26.4
docker tag registry.cn-hangzhou.aliyuncs.com/rwit/kubeasz:3.6.4 easzlab/kubeasz:3.6.4
docker tag registry.cn-hangzhou.aliyuncs.com/rwit/coredns:1.11.1 coredns/coredns:1.11.1
docker tag registry.cn-hangzhou.aliyuncs.com/rwit/kubeasz-ext-bin:1.10.1 easzlab/kubeasz-ext-bin:1.10.1
docker tag registry.cn-hangzhou.aliyuncs.com/rwit/kubeasz-sys-pkg:1.0.1_ubuntu_22 docker.io/easzlab/kubeasz-sys-pkg:1.0.1_ubuntu_22
docker tag registry.cn-hangzhou.aliyuncs.com/rwit/kubeasz-k8s-bin:v1.30.1 easzlab/kubeasz-k8s-bin:v1.30.1
docker tag registry.cn-hangzhou.aliyuncs.com/rwit/k8s-dns-node-cache:1.22.28 easzlab/k8s-dns-node-cache:1.22.28
docker tag registry.cn-hangzhou.aliyuncs.com/rwit/dashboard:v2.7.0 kubernetesui/dashboard:v2.7.0
docker tag registry.cn-hangzhou.aliyuncs.com/rwit/metrics-scraper:v1.0.8 kubernetesui/metrics-scraper:v1.0.8
docker tag registry.cn-hangzhou.aliyuncs.com/rwit/metrics-server:v0.7.1 easzlab/metrics-server:v0.7.1
docker tag registry.cn-hangzhou.aliyuncs.com/rwit/kube-controllers:v3.26.4 calico/kube-controllers:v3.26.4
docker tag registry.cn-hangzhou.aliyuncs.com/rwit/kube-controllers:v3.26.4 easzlab.io.local:5000/calico/kube-controllers:v3.26.4# 刪除鏡像
docker images | grep registry.cn-hangzhou.aliyuncs.com | awk '{print $1 ":" $2}' | xargs docker rmi
6.重置集群
/etc/kubeasz/ezctl destroy test-cnrm -rf /etc/kubeasz/clusters/test-cn#重置機器后,克隆機器,批量部署機器(國外網絡無法訪問,如果批量部署會報錯)
bash k8s_install_new_openeuler.sh password 192.168.1 220\ 221\ 222\ 223\ 224 containerd calico boge.com test-cn
參考視頻:
【在openEuler 22.03 (LTS-SP3)歐拉Linux發行版操作系統上使用二進制安裝生產級別的v1.30.1版本Kubernetes(K8S)集群】https://www.bilibili.com/video/BV1pi421v7fP?p=8&vd_source=2d34fd2352ae451c4f6d4cb20707e169