Skip to content

Commit

Permalink
修复calicoctl配置;修复calico/node 跑在LB 主节点时使用IP地址错误
Browse files Browse the repository at this point in the history
  • Loading branch information
gjmzj committed Aug 14, 2018
1 parent 3475121 commit e1e4524
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions docs/op/change_k8s_network.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- WARNNING:重新安装k8s网络插件会短暂中断已有运行在k8s上的服务
- 请在熟悉kubeasz的安装流程和k8s网络插件安装流程的基础上谨慎操作
- 如果k8s集群已经运行庞大业务pod,重装网络插件时会引起所有pod的删除、重建,短时间内将给apiserver带来压力,可能引起master节点夯住
- 确保没有裸pod 运行(因为最后需要删除所有pod 重建,裸pod 不会重建),即所有pod 都是由 deploy/daemonset/statefulset 等创建;

## 替换流程

Expand Down
2 changes: 1 addition & 1 deletion roles/calico/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ FELIX_LOG_LVL: "warning"

# 设置 calico-node使用的host IP,bgp邻居通过该地址建立,可手工指定也可以自动发现
#IP_AUTODETECTION_METHOD: "interface=eth0"
IP_AUTODETECTION_METHOD: "can-reach={{ MASTER_IP }}"
IP_AUTODETECTION_METHOD: "can-reach={{ groups.deploy[0] }}"

# 镜像版本
calico_node_ver: "v3.1.3"
Expand Down
8 changes: 4 additions & 4 deletions roles/calico/templates/calicoctl.cfg.j2
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apiVersion: v1
kind: calicoApiConfig
apiVersion: projectcalico.org/v3
kind: CalicoAPIConfig
metadata:
spec:
datastoreType: "etcdv2"
datastoreType: "etcdv3"
etcdEndpoints: {{ ETCD_ENDPOINTS }}
etcdKeyFile: /etc/calico/ssl/calico-key.pem
etcdCertFile: /etc/calico/ssl/calico.pem
etcdCACertFile: /etc/calico/ssl/ca.pem
etcdCACertFile: {{ ca_dir }}/ca.pem

0 comments on commit e1e4524

Please sign in to comment.