## Motivation Currently helm acceptance tests are tightly coupled with the kind cluster provisioning, there is no easy to way to run tests against any custom kubernetes/openshift cluster. This proposal helps to address this issue. This addresses following issues - 1. https://issues.redhat.com/browse/APPSVC-586 2. https://issues.redhat.com/browse/APPSVC-587 3. https://issues.redhat.com/browse/APPSVC-588 ## Architecture Overview ![](https://i.imgur.com/3WPn1la.png) ## CSV Input data provider Acceptance tests would accept input csv either from command line argument or can read directly from the repo. We can use robot datadriver to make use of this: https://pypi.org/project/robotframework-csvlib > clusters.csv sample > | Provisioner | Metadata | | ------------------ | ------------------ | Kind | `{ "version": 1.5.0 }` | Kind | `{ "version": 1.6.0 }` | Kind | `{ "version": 1.7.0 }` | Kubeconfig | `{"path": "/home/fsociety/.kube/config"}` ## Cluster provisioner Interface to define cluster provisioner. # Interface to provision clusters interface provisioner { # pass metadata from csv data initialize(metadata) startCluster() getKubeconfig() *path deleteCluster() # post cluster configurations postCreateCluster() } 1. *initialize(metadata) -* Implementation of this would help configuring cluster setup before starting up/creating new cluster. 2. *startCluster() -* This should start the cluster. 3. *getkubeConfig() -* This should return absolute path to kubeconfig file path. 4. *postCreateCluster() -* This can be used to setup cluster resources after post cluster creation. (one of the usage of this would be setting up persistance volume required to run the tests) **Possible cluster provisioners** *KindProvisioner* *CustomKubeconfigProvisioner* *MinikubeProvisioner* **ClusterProvisionerFactory** This component would return defined provisioner instance based on the input (eg. kind, kubeconfig). ## Test run 1. Test reads cluster provisioner and metadata from the csv row. 2. Cluster provisioner factory would return the provisioner instance based on the specified key. 3. provisioner instance would create cluster if required and then will give access to `kubeconfig`. 4. Test should use `kubeconfig` for all consecutive helm commands. ## How to run tests We should able to pass list of clusters csv file mentioned in the above format. `make acceptance -input clusters.csv`