본문 바로가기

Cloud/Kubernetes

kubectl init 시 proc-sys-net-bridge-bridge-nf-call-iptables 에러

Init시 가끔 나타나는 에러가 있다.

root@v1-1:~# vi /etc/sysctl.conf 
root@v1-1:~# kubeadm init --config=kubeadm-config.yaml --upload-certs
[init] Using Kubernetes version: v1.15.3
[preflight] Running pre-flight checks
	[WARNING SystemVerification]: this Docker version is not on the list of validated versions: 19.03.2. Latest validated version: 18.09
error execution phase preflight: [preflight] Some fatal errors occurred:
	[ERROR FileContent--proc-sys-net-bridge-bridge-nf-call-iptables]: /proc/sys/net/bridge/bridge-nf-call-iptables does not exist
[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`

이 때에 /proc/sys/net ~ 어쩌고에 echo를 통해 값을 넣어줘도 아래와 같이 나타난다.

root@v1-1:~# echo '1' > /proc/sys/net/bridge/bridge-nf-call-iptables
-bash: /proc/sys/net/bridge/bridge-nf-call-iptables: No such file or directory

그 때엔 modeprobe를 명령어 사용 이후 하면 된다.

root@v1-1:~# modprobe br_netfilter
root@v1-1:~# 
root@v1-1:~# echo 1 > /proc/sys/net/bridge/bridge-nf-call-iptables

이후 다시 init 하면 정상적으로 된다.

root@v1-1:~# kubeadm init --config=kubeadm-config.yaml --upload-certs
[init] Using Kubernetes version: v1.15.3
[preflight] Running pre-flight checks
	[WARNING SystemVerification]: this Docker version is not on the list of validated versions: 19.03.2. Latest validated version: 18.09
[preflight] Pulling images required for setting up a Kubernetes cluster
[preflight] This might take a minute or two, depending on the speed of your internet connection
[preflight] You can also perform this action in beforehand using 'kubeadm config images pull'
[kubelet-start] Writing kubelet environment file with flags to file "/var/lib/kubelet/kubeadm-flags.env"
[kubelet-start] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml"
[kubelet-start] Activating the kubelet service