From 0222a2a634cf385fb8607574121abb668b4baa33 Mon Sep 17 00:00:00 2001 From: Antoine Legrand <2t.antoine@gmail.com> Date: Tue, 31 Dec 2024 12:52:13 +0100 Subject: [PATCH] Add option to skip network plugin installation (#11844) --- .../preinstall/tasks/0040-verify-settings.yml | 11 ++++++++++- roles/network_plugin/meta/main.yml | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/roles/kubernetes/preinstall/tasks/0040-verify-settings.yml b/roles/kubernetes/preinstall/tasks/0040-verify-settings.yml index c50b0b4a298..24d1340d4bb 100644 --- a/roles/kubernetes/preinstall/tasks/0040-verify-settings.yml +++ b/roles/kubernetes/preinstall/tasks/0040-verify-settings.yml @@ -42,11 +42,20 @@ - name: Stop if unknown network plugin assert: - that: kube_network_plugin in ['calico', 'flannel', 'weave', 'cloud', 'cilium', 'cni', 'kube-ovn', 'kube-router', 'macvlan', 'custom_cni'] + that: kube_network_plugin in ['calico', 'flannel', 'weave', 'cloud', 'cilium', 'cni', 'kube-ovn', 'kube-router', 'macvlan', 'custom_cni', 'none'] msg: "{{ kube_network_plugin }} is not supported" when: - kube_network_plugin is defined - not ignore_assert_errors +- name: Warn the user if they are still using `etcd_kubeadm_enabled` + debug: + msg: > + "WARNING! => `kube_network_plugin` is set to `none`. The network configuration will be skipped. + The cluster won't be ready to use, we recommend to select one of the available plugins" + changed_when: true + when: + - kube_network_plugin is defined + - kube_network_plugin == 'none' - name: Stop if unsupported version of Kubernetes assert: diff --git a/roles/network_plugin/meta/main.yml b/roles/network_plugin/meta/main.yml index dd2c3626a27..1f2f99df483 100644 --- a/roles/network_plugin/meta/main.yml +++ b/roles/network_plugin/meta/main.yml @@ -1,6 +1,7 @@ --- dependencies: - role: network_plugin/cni + when: kube_network_plugin != 'none' - role: network_plugin/cilium when: kube_network_plugin == 'cilium' or cilium_deploy_additionally | default(false) | bool