1. 程式人生 > >kubernetes 1.9安裝中遇到的錯誤

kubernetes 1.9安裝中遇到的錯誤

執行kubeadm init命令

[[email protected]-kubernetes ~]# kubeadm init --kubernetes-version=v1.9.0 --pod-network-cidr=10.244.0.0/16

如果遇到一下錯誤表示需要配置本機的hosts對映,hosts對映用本機名稱對映本機ip
同時在命令後面加上 –ignore-preflight-errors=Swap

[[email protected] ~]# kubeadm init --kubernetes-version=v1.9.0 --pod-network-cidr=10.244.0.0/16
[init] Using Kubernetes version: v1.9.0 [init] Using Authorization modes: [Node RBAC] [preflight] Running pre-flight checks. [WARNING Hostname]: hostname "devops-kubernetes" could not be reached [WARNING Hostname]: hostname "devops-kubernetes" lookup devops-kubernetes on 202.96.209.133:53: no such host [WARNING FileExisting-crictl]: crictl not
found in system path [preflight] Some fatal errors occurred: [ERROR Swap]: running with swap on is not supported. Please disable swap [preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`

出現下面的錯誤,需要刪除/etc/kubernetes下面的manifests資料夾然後重新init

[ERROR DirAvailable--etc-kubernetes-manifests]: /etc/kubernetes/manifests is not empty