参考

  1. 环境查看
# cat /etc/redhat-release 
Rocky Linux release 9.3 (Blue Onyx)
# uname -a
Linux Rocky9K8SMaster003021 5.14.0-362.18.1.el9_3.0.1.x86_64 #1 SMP PREEMPT_DYNAMIC Sun Feb 11 13:49:23 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
  • 1.
  • 2.
  • 3.
  • 4.
  1. 故障现象
    允许Rancher镜像时docker不停重启
    查看docker日志有以下报错信息
# k3s exited with: exit status 1
# iptables is not available on this host
  • 1.
  • 2.
  1. 原因分析
    没有加载iptables内核模块
  2. 解决方法
    手动加载模块
# sudo modprobe iptable_nat 
# sudo modprobe iptable_filter
  • 1.
  • 2.

设置到配置文件

# cat /etc/modules-load.d/modules.conf 
iptable_nat
iptable_filter
  • 1.
  • 2.
  • 3.

重启

# reboot
  • 1.