linux 问题总结
1、Docker之WARNING: IPv4 forwarding is disabled. Networking will not work.
原因:
是没有开启转发,网桥配置完后,需要开启转发,不然容器启动后,就会没有网络,配置/etc/sysctl.conf,添加net.ipv4.ip_forward=1
配置转发
vim /etc/sysctl.conf
#配置转发
net.ipv4.ip_forward=1
#重启服务,让配置生效
systemctl restart network
#查看是否成功,如果返回为"net.ipv4.ip_forward = 1"则表示成功
sysctl net.ipv4.ip_forward
2、k8s删除pod一直处于terminating状态
删除POD
kubectl delete pod [pod name] --force --grace-period=0 -n [namespace]
删除NAMESPACE
kubectl delete namespace NAMESPACENAME --force --gr、ace-period=0
3、Need to upgrade docker package to 17.06.0+. Docker升级到最新版本
rpm -qa | grep docker
yum remove docker-common-1.13.1-208.git7d71120.el7_9.x86_64 docker-common-1.13.1-208.git7d71120.el7_9.x86_64 docker-client-1.13.1-208.git7d71120.el7_9.x86_64
curl -fsSL https://get.docker.com/ | sh
systemctl restart docker && systemctl enable docker
4、【kubeadm初始化报错】failed to run Kubelet: misconfiguration: kubelet cgroup driver: "cgroupfs" is different from docker cgroup driver: "systemd"
cat > /etc/docker/daemon.json <<EOF
{
"exec-opts": ["native.cgroupdriver=systemd"],
"log-driver": "json-file",
"log-opts": {
"max-size": "100m"
},
"storage-driver": "overlay2",
"storage-opts": [
"overlay2.override_kernel_check=true"
],
"data-root": "/data/docker"
}
EOF
检查 docker info|grep "Cgroup Driver" 是否输出 Cgroup Driver: systemd