fix:当node多网卡时可以设置参数使flannel/calico正常运行

pull/317/head
gjmzj 2018-08-30 21:08:56 +08:00
parent a86bd89181
commit 6c8b3d64f4
4 changed files with 11 additions and 0 deletions

View File

@ -1,5 +1,8 @@
# 部分calico相关配置更全配置可以去roles/calico/templates/calico.yaml.j2自定义
# 如果 node 节点有多块网卡,请设置 true
NODE_WITH_MULTIPLE_NETWORKS: "false"
# etcd 集群服务地址列表, 根据etcd组成员自动生成
TMP_ENDPOINTS: "{% for h in groups['etcd'] %}https://{{ h }}:2379,{% endfor %}"
ETCD_ENDPOINTS: "{{ TMP_ENDPOINTS.rstrip(',') }}"

View File

@ -328,10 +328,12 @@ spec:
- name: ENABLED_CONTROLLERS
value: policy,profile,workloadendpoint,node
# if hosts have multiple net interfaces, set following two ENVs
{% if NODE_WITH_MULTIPLE_NETWORKS == 'true' %}
- name: KUBERNETES_SERVICE_HOST
value: "{{ MASTER_IP }}"
- name: KUBERNETES_SERVICE_PORT
value: "{{ KUBE_APISERVER.split(':')[2] }}"
{% end if %}
volumeMounts:
# Mount in the etcd TLS secrets.
- mountPath: /calico-secrets

View File

@ -1,5 +1,8 @@
# 部分flannel配置详见roles/flannel/templates/kube-flannel.yaml.j2
# 如果 node 节点有多块网卡,请设置 true
NODE_WITH_MULTIPLE_NETWORKS: "false"
# 设置flannel 后端
#FLANNEL_BACKEND: "host-gw"
FLANNEL_BACKEND: "vxlan"

View File

@ -143,11 +143,14 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
# if hosts have multiple net interfaces, set following two ENVs
{% if NODE_WITH_MULTIPLE_NETWORKS == 'true' %}
- name: KUBERNETES_SERVICE_HOST
value: "{{ MASTER_IP }}"
#value: "{{ KUBE_APISERVER.split(':')[1].lstrip('/') }}"
- name: KUBERNETES_SERVICE_PORT
value: "{{ KUBE_APISERVER.split(':')[2] }}"
{% end if %}
volumeMounts:
- name: run
mountPath: /run