1.错误描述

[root@k8s centos]# kubeadm init
I1205 06:44:01.459391   12097 version.go:94] could not fetch a Kubernetes version from the internet: unable to get URL "https://dl.k8s.io/release/stable-1.txt": Get https://dl.k8s.io/release/stable-1.txt: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
I1205 06:44:01.459549   12097 version.go:95] falling back to the local client version: v1.13.0
[init] Using Kubernetes version: v1.13.0
[preflight] Running pre-flight checks
        [WARNING Service-Docker]: docker service is not enabled, please run 'systemctl enable docker.service'
        [WARNING Hostname]: hostname "k8s.novalocal" could not be reached
        [WARNING Hostname]: hostname "k8s.novalocal": lookup k8s.novalocal on 10.32.148.99:53: no such host
        [WARNING Service-Kubelet]: kubelet service is not enabled, please run 'systemctl enable kubelet.service'
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 contents are not set to 1
[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`

在这里插入图片描述

2. 错误

a. 概述,

这里面有很多错误信息, 有的可以按照提示信息进行更改, 有的需要特殊解决

b. 网络设置
  • 错误内容
    /proc/sys/net/bridge/bridge-nf-call-iptables contents are not set to 1
  • 解决方法:
echo 1 > /proc/sys/net/bridge/bridge-nf-call-iptables
c. Enable docker
  • 告警内容:
    [WARNING Service-Docker]: docker service is not enabled, please run 'systemctl enable docker.service'
  • 解决方法
    按照提示, 运行 systemctl enable docker.service
    在这里插入图片描述
d. hostname的问题
  • 告警内容
[WARNING Hostname]: hostname "k8s.novalocal" could not be reached
[WARNING Hostname]: hostname "k8s.novalocal": lookup k8s.novalocal on 10.32.148.99:53: no such host
  • 解决方法
    • 命令更改主机名
hostnamectl set-hostname k8s

在这里插入图片描述

    • 更改/etc/hostname
echo k8s > /etc/hostname

在这里插入图片描述
– 更改/etc/hosts, 在后面追加主机名
在这里插入图片描述

e. Enable kubelet
  • 告警内容:
    [WARNING Service-Kubelet]: kubelet service is not enabled, please run 'systemctl enable kubelet.service'
  • Solution
    按照提示,运行 systemctl enable kubelet.service
f. 禁用SELinux, 用于启动docker服务.
  • i. 报错信息
    在通过systemctl start docker.service进行启动docker服务的时候, 发现无法启动成功, 然后通过journalctl -xe进行查看, 如果发现下面的内容,则需要禁用SELinux配置.
    Error starting daemon: SELinux is not supported with the overlay2 graph driver on this kernel. Either boot into a newer kernel or disable selinux in docker (--selinux-enabled=false)
    在这里插入图片描述
  • ii. Solution
    更改/etc/selinux/config文件, 将SELINUX的值更改为disabled. 然后reboot后再试.
    在这里插入图片描述

3. 再次配置master

在这里插入图片描述

Logo

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

更多推荐