注意tke对环境的要求不止如此 其他的配置可以在装机时设置 具体看官方文档
难点是在某位置加入两个 参数
sed -i 's/quiet/& net.ifnames=0 biosdevname=0/' /etc/default/grub
还有就是grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg在有的linux版本上应该替换成
grub2-mkconfig -o /boot/grub2/grub.cfg
下面是脚本
#这是一个安装腾讯云TKE时 给集群一键配置的脚本 一键修改网卡名 关防火墙 打开时间同步
#!/bin/bash
echo "=============在20内请输入网卡原来的NAME======================"
nmcli connection show
read -t 20 -p "Enter name in 20 seconds " NAME
#判断是否输入参数
if [ ! $NAME ]
then
echo Not Enough Arguement!
exit;
fi
echo "===================修改网卡名========================"
#CARD_PATH = /etc/default/grub
sed -i 's/quiet/& net.ifnames=0 biosdevname=0/' /etc/default/grub
grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg
nmcli connection modify $NAME connection.interface-name eth0
echo "===================打开时间同步============================"
yum install -y chrony
systemctl enable chronyd && systemctl start chronyd
echo "===================关闭防火墙============================"
systemctl stop firewalld && systemctl disable firewalld
echo "===================selinux============================"
setenforce 0
sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config