summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ansible/roles/rke/molecule/default/molecule.yml1
-rw-r--r--ansible/roles/rke/molecule/default/tests/test_etcd.py13
-rw-r--r--ansible/roles/rke/molecule/default/tests/test_nodes.py2
-rw-r--r--ansible/roles/rke/templates/cluster.yml.j22
4 files changed, 17 insertions, 1 deletions
diff --git a/ansible/roles/rke/molecule/default/molecule.yml b/ansible/roles/rke/molecule/default/molecule.yml
index 444a7519..6ae613a9 100644
--- a/ansible/roles/rke/molecule/default/molecule.yml
+++ b/ansible/roles/rke/molecule/default/molecule.yml
@@ -19,6 +19,7 @@ platforms:
container: docker
groups:
- infrastructure
+ - kubernetes-etcd
- kubernetes-control-plane
- kubernetes
networks:
diff --git a/ansible/roles/rke/molecule/default/tests/test_etcd.py b/ansible/roles/rke/molecule/default/tests/test_etcd.py
new file mode 100644
index 00000000..0f4b6f12
--- /dev/null
+++ b/ansible/roles/rke/molecule/default/tests/test_etcd.py
@@ -0,0 +1,13 @@
+import os
+import pytest
+
+import testinfra.utils.ansible_runner
+
+testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
+ os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('kubernetes-etcd')
+
+
+@pytest.mark.parametrize('container_name', [
+ 'etcd'])
+def test_container_running(host, container_name):
+ assert host.docker(container_name).is_running
diff --git a/ansible/roles/rke/molecule/default/tests/test_nodes.py b/ansible/roles/rke/molecule/default/tests/test_nodes.py
index fcc5e7e6..60413018 100644
--- a/ansible/roles/rke/molecule/default/tests/test_nodes.py
+++ b/ansible/roles/rke/molecule/default/tests/test_nodes.py
@@ -8,6 +8,6 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
@pytest.mark.parametrize('container_name', [
- 'etcd', 'kubelet', 'kube-proxy'])
+ 'kubelet', 'kube-proxy'])
def test_container_running(host, container_name):
assert host.docker(container_name).is_running
diff --git a/ansible/roles/rke/templates/cluster.yml.j2 b/ansible/roles/rke/templates/cluster.yml.j2
index f28cff80..2012ab92 100644
--- a/ansible/roles/rke/templates/cluster.yml.j2
+++ b/ansible/roles/rke/templates/cluster.yml.j2
@@ -9,6 +9,8 @@ nodes:
{% endif %}
{% if node in groups['kubernetes-node'] %}
- worker
+{% endif %}
+{% if node in groups['kubernetes-etcd'] %}
- etcd
{% endif %}
hostname_override: ""