From 2f97acdcc45c70ee2fa022fdeb27b68a0f7e458b Mon Sep 17 00:00:00 2001 From: Michal Zegan Date: Mon, 3 Jun 2019 14:58:20 +0200 Subject: Add etcd group support to rke role Etcd cluster is now placed in members of kubernetes-etcd group instead of kubernetes-node. Due to defaults, it means infra is the only etcd by default. Change-Id: Iae05a42442849e4a248d73c2d78f5e2b0eae7255 Issue-ID: OOM-1778 Signed-off-by: Michal Zegan --- ansible/roles/rke/molecule/default/molecule.yml | 1 + ansible/roles/rke/molecule/default/tests/test_etcd.py | 13 +++++++++++++ ansible/roles/rke/molecule/default/tests/test_nodes.py | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 ansible/roles/rke/molecule/default/tests/test_etcd.py (limited to 'ansible/roles/rke/molecule') 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 -- cgit 1.2.3-korg