Kubernetes腾讯云部署不能创建vpc


#1
  • Choerodon平台版本: 0.6.0

  • 遇到问题的执行步骤:
    文档中的 ali-vpc 应该是阿里云独有的吧,在腾讯云上执行kubectl apply -f kube-flannel-aliyun.yml
    后,状态如下

kube-flannel-8gsld                          0/1       CrashLoopBackOff    20         1h
kube-flannel-8xztq                          0/1       CrashLoopBackOff    20         1h
kube-flannel-ds-bhnvb                       0/1       CrashLoopBackOff    12         40m
kube-flannel-ds-dtbn2                       0/1       CrashLoopBackOff    12         40m
kube-flannel-ds-dzbmk                       0/1       CrashLoopBackOff    8          40m
kube-flannel-ds-hpqj8                       0/1       CrashLoopBackOff    12         40m
kube-flannel-ds-w89q6                       0/1       CrashLoopBackOff    12         40m
kube-flannel-g5p5r                          0/1       CrashLoopBackOff    20         1h
kube-flannel-sscls                          0/1       CrashLoopBackOff    20         1h
kube-flannel-tthc8                          1/1       Running             0          1h

查看对应日志后发现有两种报错

I0611 10:49:46.592264       1 kube.go:283] Starting kube subnet manager
I0611 10:49:47.592395       1 kube.go:137] Node controller sync successful
I0611 10:49:47.592420       1 main.go:235] Created subnet manager: Kubernetes Subnet Manager - prod3
I0611 10:49:47.592425       1 main.go:238] Installing signal handlers
I0611 10:49:47.592502       1 main.go:348] Found network config - Backend type: ali-vpc
I0611 10:49:47.592552       1 alivpc.go:62] Unmarshal Configure : { }
E0611 10:52:17.593664       1 main.go:280] Error registering network: Get http://100.100.100.200/latest/meta-data/region-id: dial tcp 100.100.100.200:80: i/o timeout
I0611 10:52:17.593706       1 main.go:328] Stopping shutdownHandler...
I0611 11:15:51.110947       1 kube.go:283] Starting kube subnet manager
I0611 11:15:52.111066       1 kube.go:137] Node controller sync successful
I0611 11:15:52.111092       1 main.go:235] Created subnet manager: Kubernetes Subnet Manager - prod-calculate2
I0611 11:15:52.111097       1 main.go:238] Installing signal handlers
I0611 11:15:52.111155       1 main.go:348] Found network config - Backend type: ali-vpc
I0611 11:15:52.111234       1 alivpc.go:62] Unmarshal Configure : { }
E0611 11:15:52.111301       1 main.go:280] Error registering network: failed to acquire lease: node "prod-calculate2" pod cidr not assigned
I0611 11:15:52.111322       1 main.go:328] Stopping shutdownHandler...

但是get node,显示状态正常

[root@VM_0_17_centos kubeadm-ansible]# kubectl get no
NAME              STATUS    ROLES     AGE       VERSION
prod-calculate1   Ready     <none>    1h        v1.10.12
prod-calculate2   Ready     <none>    1h        v1.10.12
prod1             Ready     <none>    1h        v1.10.12
prod2             Ready     <none>    1h        v1.10.12
prod3             Ready     master    1h        v1.10.12

执行curl "http://ip/healthz" 返回结果为ok

在master节点执行测试时,仅以下两个正常,其他的测试都会卡住,没有报错也没有结果

  • node节点访问公网
  • node节点上通过Service Cluster IP访问

在Work节点执行测试时,仅 node节点访问公网正常

[root@VM_0_16_centos ~]# kubectl get svc default-http-backend -n kube-system
error: the server doesn't have a resource type "svc"
[root@VM_0_16_centos ~]# kubectl run curl-test \
>     -it --quiet --rm --restart=Never \
>     --image='registry.cn-hangzhou.aliyuncs.com/choerodon-tools/network-and-cluster-perfermance-test:0.1.0' \
>     -- bash -c "sleep 3; curls choerodon.io"
The connection to the server localhost:8080 was refused - did you specify the right host or port?

以上,请问应该如何处理

  • CentOS 7.6
  • 腾讯云
  • 一Master 4*32 四Work
  • 报错日志:

  • 原因分析:

    推测是vpc问题

  • 疑问:

    提出您对于遇到和解决该问题时的疑问


#2

如果腾讯云没有相关插件 请按照私有云模式部署。


#3

问题已解决
腾讯云使用私有云安装
腾讯云的 CentOS 默认不开启ip跟踪功能,可以通过执行lsmod |grep conntrack检查,如果未开启,需要执行modprobe ip_conntrack命令开启
另外需要手动安装flannel 插件

yum install flannel -y