mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-03-18 01:17:38 -02:30
choose between gce and aws cloud providers
This commit is contained in:
@@ -46,6 +46,11 @@
|
||||
owner: kube
|
||||
when: ansible_service_mgr in ["sysvinit","upstart"]
|
||||
|
||||
- name: check cloud_provider value
|
||||
fail:
|
||||
msg: "If set the 'cloud_provider' var must be set eithe to 'gce' or 'aws'"
|
||||
when: cloud_provider is defined and cloud_provider not in ['gce', 'aws']
|
||||
|
||||
- name: Create cni directories
|
||||
file:
|
||||
path: "{{ item }}"
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
---
|
||||
# Enables Internet connectivity from containers
|
||||
nat_outgoing: true
|
||||
# cloud_provider: no
|
||||
|
||||
# cloud_provider can only be set to 'gce' or 'aws'
|
||||
# cloud_provider:
|
||||
|
||||
@@ -51,19 +51,19 @@
|
||||
- name: Calico | Configure calico network pool
|
||||
command: "{{ bin_dir }}/calicoctl pool add {{ kube_pods_subnet }}"
|
||||
run_once: true
|
||||
when: calico_conf.status == 404 and (cloud_provider is not defined or cloud_provider != True)
|
||||
when: calico_conf.status == 404 and cloud_provider is not defined
|
||||
and not nat_outgoing|default(false) or
|
||||
(nat_outgoing|default(false) and peer_with_router|default(false))
|
||||
|
||||
- name: Calico | Configure calico network pool for cloud
|
||||
command: "{{ bin_dir }}/calicoctl pool add {{ kube_pods_subnet }} --ipip --nat-outgoing"
|
||||
run_once: true
|
||||
when: calico_conf.status == 404 and cloud_provider is defined and cloud_provider == True
|
||||
when: calico_conf.status == 404 and cloud_provider is defined
|
||||
|
||||
- name: Calico | Configure calico network pool with nat outgoing
|
||||
command: "{{ bin_dir}}/calicoctl pool add {{ kube_pods_subnet }} --nat-outgoing"
|
||||
run_once: true
|
||||
when: calico_conf.status == 404 and (cloud_provider is not defined or cloud_provider != True)
|
||||
when: calico_conf.status == 404 and cloud_provider is not defined
|
||||
and nat_outgoing|default(false) and not peer_with_router|default(false)
|
||||
|
||||
- name: Calico | Get calico configuration from etcd
|
||||
|
||||
Reference in New Issue
Block a user