Merge pull request #708 from vwfs/cloud_network
Add support for cloud-provider based networking
This commit is contained in:
commit
29874baf8a
6 changed files with 26 additions and 0 deletions
|
@ -101,6 +101,7 @@ etcd_multiaccess: true
|
||||||
loadbalancer_apiserver_localhost: true
|
loadbalancer_apiserver_localhost: true
|
||||||
|
|
||||||
# Choose network plugin (calico, weave or flannel)
|
# Choose network plugin (calico, weave or flannel)
|
||||||
|
# Can also be set to 'cloud', which lets the cloud provider setup appropriate routing
|
||||||
kube_network_plugin: flannel
|
kube_network_plugin: flannel
|
||||||
|
|
||||||
# Kubernetes internal network for services, unused block of space.
|
# Kubernetes internal network for services, unused block of space.
|
||||||
|
@ -171,6 +172,7 @@ dns_server: "{{ kube_service_addresses|ipaddr('net')|ipaddr(2)|ipaddr('address')
|
||||||
#azure_subnet_name:
|
#azure_subnet_name:
|
||||||
#azure_security_group_name:
|
#azure_security_group_name:
|
||||||
#azure_vnet_name:
|
#azure_vnet_name:
|
||||||
|
#azure_route_table_name:
|
||||||
|
|
||||||
|
|
||||||
## Set these proxy values in order to update docker daemon to use proxies
|
## Set these proxy values in order to update docker daemon to use proxies
|
||||||
|
|
|
@ -27,6 +27,11 @@ spec:
|
||||||
- --cloud-config={{ kube_config_dir }}/cloud_config
|
- --cloud-config={{ kube_config_dir }}/cloud_config
|
||||||
{% elif cloud_provider is defined and cloud_provider == "aws" %}
|
{% elif cloud_provider is defined and cloud_provider == "aws" %}
|
||||||
- --cloud-provider={{cloud_provider}}
|
- --cloud-provider={{cloud_provider}}
|
||||||
|
{% endif %}
|
||||||
|
{% if kube_network_plugin is defined and kube_network_plugin == 'cloud' %}
|
||||||
|
- --allocate-node-cidrs=true
|
||||||
|
- --configure-cloud-routes=true
|
||||||
|
- --cluster-cidr={{ kube_pods_subnet }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
httpGet:
|
httpGet:
|
||||||
|
|
|
@ -31,6 +31,9 @@ KUBELET_ARGS="{{ kubelet_args }}"
|
||||||
KUBELET_NETWORK_PLUGIN="--network-plugin=cni --network-plugin-dir=/etc/cni/net.d"
|
KUBELET_NETWORK_PLUGIN="--network-plugin=cni --network-plugin-dir=/etc/cni/net.d"
|
||||||
{% elif kube_network_plugin is defined and kube_network_plugin == "weave" %}
|
{% elif kube_network_plugin is defined and kube_network_plugin == "weave" %}
|
||||||
DOCKER_SOCKET="--docker-endpoint=unix:/var/run/weave/weave.sock"
|
DOCKER_SOCKET="--docker-endpoint=unix:/var/run/weave/weave.sock"
|
||||||
|
{% elif kube_network_plugin is defined and kube_network_plugin == "cloud" %}
|
||||||
|
# Please note that --reconcile-cidr is deprecated and a no-op in Kubernetes 1.5 but still required in 1.4
|
||||||
|
KUBELET_NETWORK_PLUGIN="--hairpin-mode=promiscuous-bridge --network-plugin=kubenet --reconcile-cidr=true"
|
||||||
{% endif %}
|
{% endif %}
|
||||||
# Should this cluster be allowed to run privileged docker containers
|
# Should this cluster be allowed to run privileged docker containers
|
||||||
KUBE_ALLOW_PRIV="--allow-privileged=true"
|
KUBE_ALLOW_PRIV="--allow-privileged=true"
|
||||||
|
|
|
@ -44,4 +44,9 @@
|
||||||
msg: "azure_vnet_name is missing"
|
msg: "azure_vnet_name is missing"
|
||||||
when: azure_vnet_name is not defined or azure_vnet_name == ""
|
when: azure_vnet_name is not defined or azure_vnet_name == ""
|
||||||
|
|
||||||
|
- name: check azure_route_table_name value
|
||||||
|
fail:
|
||||||
|
msg: "azure_route_table_name is missing"
|
||||||
|
when: azure_route_table_name is not defined or azure_route_table_name == ""
|
||||||
|
|
||||||
|
|
||||||
|
|
9
roles/network_plugin/cloud/tasks/main.yml
Normal file
9
roles/network_plugin/cloud/tasks/main.yml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
---
|
||||||
|
|
||||||
|
- name: Cloud | Copy cni plugins from hyperkube
|
||||||
|
command: "/usr/bin/docker run --rm -v /opt/cni/bin:/cnibindir {{ hyperkube_image_repo }}:{{ hyperkube_image_tag }} /bin/cp -r /opt/cni/bin/. /cnibindir/"
|
||||||
|
register: cni_task_result
|
||||||
|
until: cni_task_result.rc == 0
|
||||||
|
retries: 4
|
||||||
|
delay: "{{ retry_stagger | random + 3 }}"
|
||||||
|
changed_when: false
|
|
@ -12,3 +12,5 @@ dependencies:
|
||||||
- role: network_plugin/canal
|
- role: network_plugin/canal
|
||||||
when: kube_network_plugin == 'canal'
|
when: kube_network_plugin == 'canal'
|
||||||
tags: canal
|
tags: canal
|
||||||
|
- role: network_plugin/cloud
|
||||||
|
when: kube_network_plugin == 'cloud'
|
||||||
|
|
Loading…
Reference in a new issue