1. hostname 和 DNS 的解析规则不匹配导致报错,原因是 hostname 和 DNS 的解析规则不匹配, 不能有除-. 之外的特殊字符存在。注意是主机名hostname,不可有-或者.

    nodeRegistration.name: Invalid value: "vm_0_14_centos": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 	'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')
    

    执行hostname命令查看hostname

    hostname
    VM_0_14_centos
    

    执行hostnamectl set-hostname <主机名>命令更改主机名,<主机名>可自定义,例如:

    hostnamectl set-hostname centos7
    

    如果修改hostname后报主机名找不到,可以直接修改/etc/hosts文件将hostname的解析地址加上去

  2. ip_forward not set to 1 错误

    [ERROR FileContent--proc-sys-net-ipv4-ip_forward]: /proc/sys/net/ipv4/ip_forward contents are not set to 1
    

    ip_forwardip转发设置为1即可,执行下面的命令

    echo 1 > /proc/sys/net/ipv4/ip_forward
    

  1. Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?docker服务未启动,执行下面的命令
    systemctl daemon-reload
    service docker restart
    systemctl enable docker.service
    service docker status
    

原文: k8s 安装部署报错解决方法

Logo

开源、云原生的融合云平台

更多推荐