From e50862d1b3c18e901b506111a514303e9cd7563a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20S=C3=A9guillon?= Date: Mon, 11 Oct 2021 14:13:37 +0200 Subject: [PATCH] Update requirements and usage in README --- README.rst | 58 ++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 48 insertions(+), 10 deletions(-) diff --git a/README.rst b/README.rst index 8fb03f4..c12fd06 100644 --- a/README.rst +++ b/README.rst @@ -17,27 +17,65 @@ Molecule KubeVirt Plugin :target: LICENSE :alt: Repository License -Molecule KubeVirt Plugin is designed to allow use [KubeVirt](https://kubevirt.io/) containers for provisioning test resources. +Molecule KubeVirt Plugin is designed to allow use of KubeVirt_ containers for provisioning test resources. **Very alpha version - All configuration fields and behaviours may be subject to breaking changes** -.. _usage: +.. _`KubeVirt`: https://kubevirt.io + +Scope +===== + +Molecule-kubevirt enables running ansible roles tests in a kubernetes cluster. Usage ===== -Ansible molecule-kubevirt runners require: +To use this plugin, you'll need to set the ``driver`` and ``platform`` +variables in your ``molecule.yml``. Here's a simple example using a home made centos docker image for KubeVirt: + +.. code-block:: yaml + + driver: + name: kubevirt + platforms: + - name: instance + image: quay.io/jseguillon/kubevirt-images:centos-7-x86_64-genericcloud-2009 + +This driver also requires molecule to access Kubernetes API. See test-rolebinding_ file. + +.. _`test-rolebinding`: /tools/test-rolebinding.yaml + + +Installation +============ + +Ansible +------- + +This driver supports Ansible 2, 3 and 4. + +Ansible 2 requires install of comunity.kubevirt plus strict python requirements pinning: + +.. code-block:: shell + + ansible-galaxy install git+https://github.com/ansible-collections/community.general.git + python3 -m pip install openshift==0.11.2 kubernetes==11.0.0 + +**No depedency required for Ansible >= 3** + + +KubeVirt +-------- + +Get access to a Kubernetes cluster then install KubeVirt for `kind `_ or `minkube `_ or `cloud providers `_ -- ansible-galaxy collection install community.general -- ansible-galaxy collection install community.crypto -- ansible-galaxy collection install community.kubernetes.git -Also need access to a Kubernetes cluster, via user kubeconfig or ServiceAccount. Minimum authorizations: +Demo +==== -- ClusterRole [`kubevirt.io:edit`](https://kubevirt.io/user-guide/#/installation/authorization?id=kubevirt-default-rbac-clusterroles) -- POST and EGT on Services +Testing nginx ansible role with KubeVirt, via github actions: `jseguillon/ansible-role-nginx `_ -.. _get-involved: Get Involved ============