Kubernetes环境搭建之 FAQ for nodes

1.在执行下面添加node命令时, 出现下面的截图

kubeadm join 192.168.1.104:6443 --token 8cglur.h4iscdcgzmerrz4y --discovery-token-ca-cert-hash sha256:b86075b9079b21878b75fc7e18be29939605dfac66da58b6a2d216898bb9218e

裴星宙(DanielPei) Kubernetes 环境搭建之FAQ for nodes
主要错误信息为

        [WARNING Hostname]: hostname "k8s-daniel-2.novalocal" could not be reached
        [WARNING Hostname]: hostname "k8s-daniel-2.novalocal": lookup k8s-daniel-2.novalocal on 10.32.148.99:53: no such host
        [WARNING Service-Kubelet]: kubelet service is not enabled, please run 'systemctl enable kubelet.service'
[preflight] Some fatal errors occurred:
        [ERROR CRI]: container runtime is not running: output: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
, error: exit status 1
        [ERROR Service-Docker]: docker service is not active, please run 'systemctl start docker.service'
        [ERROR FileContent--proc-sys-net-bridge-bridge-nf-call-iptables]: /proc/sys/net/bridge/bridge-nf-call-iptables does not exist
        [ERROR FileContent--proc-sys-net-ipv4-ip_forward]: /proc/sys/net/ipv4/ip_forward contents are not set to 1
        [ERROR SystemVerification]: failed to get docker info: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`

  • 问题解决
    – hostnamectl set-hostname k8s-daniel-1
    – systemctl start docker.service
    – echo 1 >/proc/sys/net/ipv4/ip_forward
    – echo 1 > /proc/sys/net/bridge/bridge-nf-call-iptables
    – systemctl enable docker.service
    – systemctl enable kubelet.service
    – kubeadm join 192.168.1.104:6443 --token 8cglur.h4iscdcgzmerrz4y --discovery-token-ca-cert-hash sha256:b86075b9079b21878b75fc7e18be29939605dfac66da58b6a2d216898bb9218e

2.无法连接到master 6443端口

  • a. 在执行kubeadm join时,遇到下面的问题
    裴星宙(DanielPei) Kubernetes 环境搭建之FAQ for nodes
  • b. solution
    • 检查master是否有防火墙, 如果有防火墙, 关闭防火墙
systemctl stop firewalld.service
systemctl disable firewalld.service
firewall-cmd --state
systemctl status firewalld.servic
    • 重启kubelet服务
systemctl restart kubelet
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值