Skip to content

Commit

Permalink
Add a way to deploy cilium alongside another CNI
Browse files Browse the repository at this point in the history
Signed-off-by: Arthur Outhenin-Chalandre <[email protected]>
  • Loading branch information
MrFreezeex committed Jul 6, 2020
1 parent 57eefdd commit b01903b
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
6 changes: 3 additions & 3 deletions roles/download/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ downloads:
- k8s-cluster

cilium:
enabled: "{{ kube_network_plugin == 'cilium' }}"
enabled: "{{ kube_network_plugin == 'cilium' or cilium_deploy_additionally | default(false) | bool }}"
container: true
repo: "{{ cilium_image_repo }}"
tag: "{{ cilium_image_tag }}"
Expand All @@ -686,7 +686,7 @@ downloads:
- k8s-cluster

cilium_init:
enabled: "{{ kube_network_plugin == 'cilium' }}"
enabled: "{{ kube_network_plugin == 'cilium' or cilium_deploy_additionally | default(false) | bool }}"
container: true
repo: "{{ cilium_init_image_repo }}"
tag: "{{ cilium_init_image_tag }}"
Expand All @@ -695,7 +695,7 @@ downloads:
- k8s-cluster

cilium_operator:
enabled: "{{ kube_network_plugin == 'cilium' }}"
enabled: "{{ kube_network_plugin == 'cilium' or cilium_deploy_additionally | default(false) | bool }}"
container: true
repo: "{{ cilium_operator_image_repo }}"
tag: "{{ cilium_operator_image_tag }}"
Expand Down
2 changes: 1 addition & 1 deletion roles/kubernetes-apps/network_plugin/meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
dependencies:
- role: kubernetes-apps/network_plugin/cilium
when: kube_network_plugin == 'cilium'
when: kube_network_plugin == 'cilium' or cilium_deploy_additionally | default(false) | bool
tags:
- cilium

Expand Down
2 changes: 1 addition & 1 deletion roles/kubernetes/preinstall/tasks/0020-verify-settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
assert:
that: ansible_kernel.split('-')[0] is version('4.8', '>=')
when:
- kube_network_plugin == 'cilium'
- kube_network_plugin == 'cilium' or cilium_deploy_additionally | default(false) | bool
- not ignore_assert_errors

- name: Stop if bad hostname
Expand Down
4 changes: 4 additions & 0 deletions roles/network_plugin/cilium/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,7 @@ cilium_monitor_aggregation: medium
cilium_preallocate_bpf_maps: false
cilium_tofqdns_enable_poller: false
cilium_enable_legacy_services: false

# Deploy cilium even if kube_network_plugin is not cilium.
# This enables to deploy cilium alongside another CNI to replace kube-proxy.
cilium_deploy_additionally: false
2 changes: 1 addition & 1 deletion roles/network_plugin/meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
dependencies:
- role: network_plugin/cilium
when: kube_network_plugin == 'cilium'
when: kube_network_plugin == 'cilium' or cilium_deploy_additionally | default(false) | bool
tags:
- cilium

Expand Down

0 comments on commit b01903b

Please sign in to comment.