Skip to content
Snippets Groups Projects
Commit d20d5e64 authored by Alexander Block's avatar Alexander Block
Browse files

Add pseudo network plugin called "cloud" to use cloud provider for network

Allow to let the cloud provider configure proper routing for nodes.
parent 33585fa6
No related branches found
No related tags found
No related merge requests found
...@@ -79,6 +79,7 @@ etcd_multiaccess: true ...@@ -79,6 +79,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.
......
...@@ -27,6 +27,11 @@ spec: ...@@ -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:
......
...@@ -27,6 +27,8 @@ KUBELET_ARGS="--kubeconfig={{ kube_config_dir}}/kubelet.kubeconfig --require-kub ...@@ -27,6 +27,8 @@ KUBELET_ARGS="--kubeconfig={{ kube_config_dir}}/kubelet.kubeconfig --require-kub
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" %}
KUBELET_NETWORK_PLUGIN="--hairpin-mode=promiscuous-bridge --network-plugin=kubenet"
{% 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"
......
---
- 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: ...@@ -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'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment