Browse Source

fix --etcd-servers-overrides invalid (#3470)

pull/3532/head
刘旭 6 years ago
committed by k8s-ci-robot
parent
commit
cf4dd645a7
2 changed files with 7 additions and 3 deletions
  1. 2
      roles/kubernetes/master/templates/manifests/kube-apiserver.manifest.j2
  2. 8
      roles/kubespray-defaults/defaults/main.yaml

2
roles/kubernetes/master/templates/manifests/kube-apiserver.manifest.j2

@ -41,7 +41,7 @@ spec:
- --advertise-address={{ ip | default(ansible_default_ipv4.address) }}
- --etcd-servers={{ etcd_access_addresses }}
{% if etcd_events_cluster_enabled %}
- --etcd-servers-overrides=/events#{{ etcd_events_access_addresses }}
- --etcd-servers-overrides=/events#{{ etcd_events_access_addresses_semicolon }}
{% endif %}
{% if kube_version | version_compare('v1.9', '<') %}
- --etcd-quorum-read=true

8
roles/kubespray-defaults/defaults/main.yaml

@ -425,10 +425,14 @@ etcd_access_addresses: |-
{% for item in groups['etcd'] -%}
https://{{ hostvars[item]['access_ip'] | default(hostvars[item]['ip'] | default(hostvars[item]['ansible_default_ipv4']['address'])) }}:2379{% if not loop.last %},{% endif %}
{%- endfor %}
etcd_events_access_addresses: |-
etcd_events_access_addresses_list: |-
[
{% for item in groups['etcd'] -%}
https://{{ hostvars[item]['access_ip'] | default(hostvars[item]['ip'] | default(hostvars[item]['ansible_default_ipv4']['address'])) }}:2381{% if not loop.last %},{% endif %}
'https://{{ hostvars[item]['access_ip'] | default(hostvars[item]['ip'] | default(hostvars[item]['ansible_default_ipv4']['address'])) }}:2381'{% if not loop.last %},{% endif %}
{%- endfor %}
]
etcd_events_access_addresses: "{{etcd_events_access_addresses_list | join(',')}}"
etcd_events_access_addresses_semicolon: "{{etcd_events_access_addresses_list | join(';')}}"
# user should set etcd_member_name in inventory/mycluster/hosts.ini
etcd_member_name: |-
{% for host in groups['etcd'] %}

Loading…
Cancel
Save