Kubernetes问题总结

问题一: 防火墙,没有关闭,所以安装时,一定要检查仔细

问题二:centos7添加bridge-nf-call-ip6tables出现No such file or directory

解决:

解决方法:
[root@localhost ~]# modprobe br_netfilter
[root@localhost ~]# ls /proc/sys/net/bridge
bridge-nf-call-arptables bridge-nf-filter-pppoe-tagged
bridge-nf-call-ip6tables bridge-nf-filter-vlan-tagged
bridge-nf-call-iptables bridge-nf-pass-vlan-input-dev
 
[root@localhost ~]# sysctl -p
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1

问题三:unable to fetch the kubeadm-config ConfigMap: failed to get config map: Unauthorized

# [preflight] Running pre-flight checks
#         [WARNING SystemVerification]: this Docker version is not on the list of validated versions: 18.04.0-ce. Latest validated version: 18.06
#         [WARNING Hostname]: hostname "szy-k8s-node1" could not be reached
#         [WARNING Hostname]: hostname "szy-k8s-node1": lookup szy-k8s-node1 on 10.10.10.21:53: server misbehaving
# [discovery] Trying to connect to API Server "10.10.31.202:6443"
# [discovery] Created cluster-info discovery client, requesting info from "https://10.10.31.202:6443"
# [discovery] Requesting info from "https://10.10.31.202:6443" again to validate TLS against the pinned public key
# [discovery] Cluster info signature and contents are valid and TLS certificate validates against pinned roots, will use API Server "10.10.31.202:6443"
# [discovery] Successfully established connection with API Server "10.10.31.202:6443"
# [join] Reading configuration from the cluster...
# [join] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -oyaml'
# unable to fetch the kubeadm-config ConfigMap: failed to get config map: Unauthorized
 # kubeadm  token create
 # kubeadm token list

解决办法是: token过期了,24小时内有效果的,所以可以重新生成token

#重新生成token
[root@test01 /]# kubeadm  token create
u7w3un.e781f1n6sq0ocfmo

[root@test01 /]# kubeadm token list
TOKEN                     TTL         EXPIRES                     USAGES                   DESCRIPTION                                                EXTRA GROUPS
jjcku9.1o65bpdk4oqhj9g8   19h         2018-12-11T16:05:11+08:00   authentication,signing                                                        system:bootstrappers:kubeadm:default-node-token
spxuf3.2rikngiu4k8gfk98      2018-12-08T16:53:12+08:00   authentication,signing   The default bootstrap token generated by 'kubeadm init'.   system:bootstrappers:kubeadm:default-node-token
u7w3un.e781f1n6sq0ocfmo   23h         2018-12-11T20:58:32+08:00   authentication,signing                                                        system:bootstrappers:kubeadm:default-node-token

问题四:在所有kubernetes节点上设置kubelet使用systemd,让dockerd与kubelet保持一致,否则会启动报错

    默认kubelet使用的cgroup-driver=systemd,改为cgroup-driver=systemd 

在这里插入代码片

#配置Cgroup
DOCKER_CGROUPS=$(docker info | grep 'Cgroup' | cut -d' ' -f3)
echo $DOCKER_CGROUPS
cat > /etc/sysconfig/kubelet <

 

 

 

 

 

 

 

 

 

你可能感兴趣的:(Kubernetes)