使用Rockey作業系統允許rancher映象報錯iptables is not available on this host解決方法

minseo發表於2024-08-22

參考
https://blog.csdn.net/u011197085/article/details/138143476

  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. 故障現象
    允許Rancher映象時docker不停重啟
    檢視docker日誌有以下報錯資訊
# k3s exited with: exit status 1
# iptables is not available on this host
  1. 原因分析
    沒有載入iptables核心模組
  2. 解決方法
    手動載入模組
# sudo modprobe iptable_nat 
# sudo modprobe iptable_filter

設定到配置檔案

# cat /etc/modules-load.d/modules.conf 
iptable_nat
iptable_filter

重啟

# reboot

相關文章