Use CNI to assign kube_pods_subnet for calico

Now calico can be deployed if there are other existing pools
and not confuse IPAM and end up with pods in the wrong pools.
This commit is contained in:
Matthew Mosesohn
2018-02-21 18:16:32 +03:00
parent bfe196236f
commit 87f33a4644
4 changed files with 6 additions and 15 deletions

View File

@@ -138,14 +138,6 @@
calico_pools: "{{ calico_pools_raw.stdout | from_json }}"
run_once: true
- name: Calico | Check if calico pool is properly configured
fail:
msg: 'Only one network pool must be configured and it must be the subnet {{ kube_pods_subnet }}.
Please erase calico configuration and run the playbook again ("etcdctl rm --recursive /calico/v1/ipam/v4/pool")'
when: ( calico_pools['node']['nodes'] | length > 1 and not calico_ignore_extra_pools ) or
( not calico_pools['node']['nodes'][0]['key'] | search(".*{{ kube_pods_subnet | ipaddr('network') }}.*") )
run_once: true
- name: Calico | Set global as_num
command: "{{ bin_dir}}/calicoctl config set asNumber {{ global_as_num }}"
run_once: true