From d4eecac1086046bd4d20eaf6fbd66423f4aa26f9 Mon Sep 17 00:00:00 2001
From: Emil <emil.vanneback@elastisys.com>
Date: Tue, 2 Mar 2021 10:03:19 +0100
Subject: [PATCH] add option to use calico with azure when using calico in
 vxlan (#7300)

---
 roles/kubernetes/preinstall/tasks/0020-verify-settings.yml | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/roles/kubernetes/preinstall/tasks/0020-verify-settings.yml b/roles/kubernetes/preinstall/tasks/0020-verify-settings.yml
index 03be745f7..fe18b23fe 100644
--- a/roles/kubernetes/preinstall/tasks/0020-verify-settings.yml
+++ b/roles/kubernetes/preinstall/tasks/0020-verify-settings.yml
@@ -38,10 +38,13 @@
 
 - name: Stop if incompatible network plugin and cloudprovider
   assert:
-    that: kube_network_plugin != 'calico'
-    msg: "Azure and Calico are not compatible. See https://github.com/projectcalico/calicoctl/issues/949 for details."
+    that:
+      - calico_ipip_mode == 'Never'
+      - calico_vxlan_mode in ['Always', 'CrossSubnet']
+    msg: "When using cloud_provider azure and network_plugin calico calico_ipip_mode must be 'Never' and calico_vxlan_mode 'Always' or 'CrossSubnet'"
   when:
     - cloud_provider is defined and cloud_provider == 'azure'
+    - kube_network_plugin == 'calico'
     - not ignore_assert_errors
 
 - name: Stop if unsupported version of Kubernetes
-- 
GitLab