diff --git a/molecule/default/playbook-no-deploy.yml b/molecule/default/playbook-no-deploy.yml index 831b989..9a16a04 100644 --- a/molecule/default/playbook-no-deploy.yml +++ b/molecule/default/playbook-no-deploy.yml @@ -7,6 +7,7 @@ k3s_no_coredns: true k3s_no_traefik: true k3s_no_servicelb: true + k3s_no_flannel: true k3s_no_local_storage: true k3s_default_local_storage_path: false k3s_no_metrics_server: true diff --git a/tasks/build/configure-k3s-cluster.yml b/tasks/build/configure-k3s-cluster.yml index 8022c65..6647e1d 100644 --- a/tasks/build/configure-k3s-cluster.yml +++ b/tasks/build/configure-k3s-cluster.yml @@ -74,4 +74,4 @@ and kubectl_get_nodes_result.stdout.find("NotReady") == -1 retries: 30 delay: 20 - when: k3s_control_node + when: k3s_control_node and not k3s_no_flannel diff --git a/templates/k3s.service.j2 b/templates/k3s.service.j2 index 06fb371..3ea880c 100644 --- a/templates/k3s.service.j2 +++ b/templates/k3s.service.j2 @@ -28,10 +28,10 @@ ExecStart={{ k3s_install_dir }}/k3s --disable-network-policy {% endif %} {% if k3s_no_flannel %} - {% if k3s_release_version is version_compare('1.0.0', '<') %} - --no-flannel - {% else %} + {% if (k3s_release_version | replace('v', '')) is version_compare('1.0.0', '>=') %} --flannel-backend none + {% else %} + --no-flannel {% endif %} {% endif %} {% if k3s_cluster_cidr is defined %}