From ca8e59fa8548ee564e580717c7f6eb0b58fed883 Mon Sep 17 00:00:00 2001
From: Arthur Outhenin-Chalandre <arthur@cri.epita.fr>
Date: Tue, 18 Aug 2020 09:39:42 +0200
Subject: [PATCH] Add new cilium options for native routing (#6519)

Signed-off-by: Arthur Outhenin-Chalandre <arthur@cri.epita.fr>
---
 roles/network_plugin/cilium/defaults/main.yml            | 9 +++++++++
 .../network_plugin/cilium/templates/cilium-config.yml.j2 | 3 +++
 2 files changed, 12 insertions(+)

diff --git a/roles/network_plugin/cilium/defaults/main.yml b/roles/network_plugin/cilium/defaults/main.yml
index 270fffee0..bdf7a346a 100755
--- a/roles/network_plugin/cilium/defaults/main.yml
+++ b/roles/network_plugin/cilium/defaults/main.yml
@@ -40,3 +40,12 @@ 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
+
+# Auto direct nodes routes can be used to advertise pods routes in your cluster
+# without any tunelling (with `cilium_tunnel_mode` sets to `disabled`).
+# This works only if you have a L2 connectivity between all your nodes.
+# You wil also have to specify the variable `cilium_native_routing_cidr` to
+# make this work. Please refer to the cilium documentation for more
+# information about this kind of setups.
+cilium_auto_direct_node_routes: false
+cilium_native_routing_cidr: ""
diff --git a/roles/network_plugin/cilium/templates/cilium-config.yml.j2 b/roles/network_plugin/cilium/templates/cilium-config.yml.j2
index 1b4811d3d..462ee6d25 100644
--- a/roles/network_plugin/cilium/templates/cilium-config.yml.j2
+++ b/roles/network_plugin/cilium/templates/cilium-config.yml.j2
@@ -142,3 +142,6 @@ data:
   enable-legacy-services: "{{cilium_enable_legacy_services}}"
 
   kube-proxy-replacement: "{{ cilium_kube_proxy_replacement }}"
+
+  native-routing-cidr: "{{ cilium_native_routing_cidr }}"
+  auto-direct-node-routes: "{{ cilium_auto_direct_node_routes }}"
-- 
GitLab