Kubernetes集群离线部署

参考

[https://www.kubernetes.org.cn/5025.html](https://www.kubernetes.org.cn/5025.html)

参考文档中的问题

在部署flannal网络,etcd注册网段时

  • 原文
[root@elasticsearch02 cfg]# /k8s/etcd/bin/etcdctl --ca-file=/k8s/etcd/ssl/ca.pem --cert-file=/k8s/etcd/ssl/server.pem --key-file=/k8s/etcd/ssl/server-key.pem --endpoints="https://10.2.8.44:2379,https://10.2.8.65:2379,https://10.2.8.34:2379"  set /k8s/network/config  '{ "Network": "10.254.0.0/16", "Backend": {"Type": "vxlan"}}'
{ "Network": "10.254.0.0/16", "Backend": {"Type": "vxlan"}}
  • flanneld 当前版本 (v0.10.0) 不支持 etcd v3,故使用 etcd v2 API 写入配置 key 和网段数据,但etcd默认使用v3的API,故需修改为
[root@cn7180 bin]# ETCDCTL_API=2 /k8s/etcd/bin/etcdctl --ca-file=/k8s/etcd/ssl/ca.pem --cert-file=/k8s/etcd/ssl/server.pem --key-file=/k8s/etcd/ssl/server-key.pem --endpoints="http://172.29.122.34:2379,http://172.29.122.35:2379,http://172.29.122.36:2379"  set /k8s/network/config  '{ "Network": "10.254.0.0/16", "Backend": {"Type": "vxlan"}}'
{ "Network": "10.254.0.0/16", "Backend": {"Type": "vxlan"}}

验证

root@ubuntu:/home/ubuntu/harbor# kubectl get nodes
NAME              STATUS   ROLES    AGE   VERSION
192.168.207.130   Ready       32h   v1.13.1
192.168.207.131   Ready       32h   v1.13.1

你可能感兴趣的:(Kubernetes集群离线部署)