kubernetes 1.9安装中遇到的错误

执行kubeadm init命令

[root@devops-kubernetes ~]# kubeadm init --kubernetes-version=v1.9.0 --pod-network-cidr=10.244.0.0/16

如果遇到一下错误表示需要配置本机的hosts映射,hosts映射用本机名称映射本机ip
同时在命令后面加上 –ignore-preflight-errors=Swap

[root@devops-kubernetes ~]# 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

你可能感兴趣的:(kubernetes 1.9安装中遇到的错误)