k8s部署升级内核
k8s部署必须升级内核版本到4.4以上。本次升级是直接升级到5.4
下载rpm包(时间会很长)
https://elrepo.org/linux/kernel/el7/x86_64/RPMS/kernel-lt-5.4.238-1.el7.elrepo.x86_64.rpm
https://elrepo.org/linux/kernel/el7/x86_64/RPMS/kernel-lt-devel-5.4.238-1.el7.elrepo.x86_64.rpm
yum install kernel-lt-5.4.238-1.el7.elrepo.x86_64.rpm kernel-lt-devel-5.4.238-1.el7.elrepo.x86_64.rpm -y
#查看可用内核
sudo awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg
调整默认内核启动
[root@k8s-master03 rlr]# sudo awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg
0 : CentOS Linux (5.4.238-1.el7.elrepo.x86_64) 7 (Core)
1 : CentOS Linux (5.19.8-1.el7.elrepo.x86_64) 7 (Core)
2 : CentOS Linux (3.10.0-1160.el7.x86_64) 7 (Core)
3 : CentOS Linux (0-rescue-2e792d43c7b643c8972cb602cd3f12f6) 7 (Core)
# 调整默认内核
grub2-set-default "CentOS Linux (5.4.238-1.el7.elrepo.x86_64) 7 (Core)"
# 重启
reboot
然后重启,可以看到内核升级完成