Merge pull request #3355 from wwt/rr-v3

Uses etcdv3 for calico 3 rr_v4 resources
pull/3363/head
k8s-ci-robot 2018-09-19 22:35:02 -07:00 committed by GitHub
commit 3a65c66a3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 24 additions and 2 deletions

View File

@ -47,19 +47,41 @@
notify: restart calico-rr
- name: Calico-rr | Configure route reflector
command: |-
{{ bin_dir }}/etcdctl \
--endpoints={{ etcd_access_addresses }} \
put /calico/bgp/v1/rr_v4/{{ rr_ip }} \
'{
"ip": "{{ rr_ip }}",
"cluster_id": "{{ cluster_id }}"
}'
environment:
ETCDCTL_API: 3
ETCDCTL_CERT: "{{ etcd_cert_dir }}/admin-{{ groups['etcd'][0] }}.pem"
ETCDCTL_KEY: "{{ etcd_cert_dir }}/admin-{{ groups['etcd'][0] }}-key.pem"
retries: 4
delay: "{{ retry_stagger | random + 3 }}"
delegate_to: "{{groups['etcd'][0]}}"
when:
- calico_version | version_compare("v3.0.0", ">=")
- name: Calico-rr | Configure route reflector (legacy)
command: |-
{{ bin_dir }}/etcdctl \
--peers={{ etcd_access_addresses }} \
--cert-file {{ etcd_cert_dir }}/admin-{{ groups['etcd'][0] }}.pem \
--key-file {{ etcd_cert_dir }}/admin-{{ groups['etcd'][0] }}-key.pem \
set /calico/bgp/v1/rr_v4/{{ rr_ip }} \
'{
"ip": "{{ rr_ip }}",
"cluster_id": "{{ cluster_id }}"
}'
environment:
ETCDCTL_CERT_FILE: "{{ etcd_cert_dir }}/admin-{{ groups['etcd'][0] }}.pem"
ETCDCTL_KEY_FILE: "{{ etcd_cert_dir }}/admin-{{ groups['etcd'][0] }}-key.pem"
retries: 4
delay: "{{ retry_stagger | random + 3 }}"
delegate_to: "{{groups['etcd'][0]}}"
when:
- calico_version | version_compare("v3.0.0", "<")
- meta: flush_handlers