CentOS 8.2 对k8s基础环境配置( 四 )

完成后就可以重启服务器
reboot重启完成 , 在查看 ipvs 的配置效果
lsmod | grep --color=auto -e ip_vs -e nf_conntrack二、报错1 域名解析不了ping: baidu.com: Name or service not known
0curl: (6) Could not resolve host: mirrors.aliyun.com
解决
[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-ens160...GATEWAY="192.168.192.2" # 修改网关地址IPV6_PRIVACY="no"# 域名解析 , 网关也要对DNS1=114.114.114.114DNS2=8.8.8.8重启
[root@localhost software]# nmcli c reload ens160[root@localhost software]# nmcli c up ens160[root@localhost yum.repos.d]# ping baidu.comPING baidu.com (110.242.68.66) 56(84) bytes of data.64 bytes from 110.242.68.66 (110.242.68.66): icmp_seq=1 ttl=128 time=24.0 ms64 bytes from 110.242.68.66 (110.242.68.66): icmp_seq=2 ttl=128 time=26.5 ms^C--- baidu.com ping statistics ---2 packets transmitted, 2 received, 0% packet loss, time 4msrtt min/avg/max/mdev = 24.005/25.233/26.462/1.238 ms2 yum 安装出错[root@localhost yum.repos.d]# yum -y install epel-releaseCentOS-8 - AppStream81B/s |38B00:00Error: Failed to download metadata for repo 'AppStream': Cannot prepare internal mirrorlist: No URLs in mirrorlist解决
如果仍然需要运行旧CentOS 8 , 可以在/etc/yum.repos中更新repos.d使用vault.centos.org代替mirror.centos.org
修改下面两个文件
cd /etc/yum.repos.dvi CentOS-Base.repovi CentOS-AppStream.repoCentOS-BaseOS.repo的内容修改为
[baseos]name=CentOS Linux $releasever - BaseOS#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=BaseOS&infra=$infra#baseurl=http://mirror.centos.org/$contentdir/$releasever/BaseOS/$basearch/os/baseurl=https://vault.centos.org/centos/$releasever/BaseOS/$basearch/os/gpgcheck=1enabled=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficialCentOS-AppStream.repo的内容修改为
[appstream]name=CentOS Linux $releasever - AppStream#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=AppStream&infra=$infra#baseurl=http://mirror.centos.org/$contentdir/$releasever/AppStream/$basearch/os/baseurl=https://vault.centos.org/centos/$releasever/AppStream/$basearch/os/gpgcheck=1enabled=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial再执行yum -y install epel-release命令 , 发现成功了!!
三、安装 k8sCentOS 8.2 安装 kubernetes-1.25.1:https://www.cnblogs.com/huaxiayuyi/p/16794583.html
【CentOS 8.2 对k8s基础环境配置】

经验总结扩展阅读