cloud-ark / kubeplus

Kubernetes Operator for multi-instance multi-tenancy
https://cloudark.io/
Apache License 2.0
662 stars 81 forks source link

Bulk upgrade test case #1230

Closed devdattakulkarni closed 3 months ago

devdattakulkarni commented 6 months ago

Application upgrade feature works as follows: When the Helm chart in a ResourceComposition is updated, all the running application instances get updated. We should add a test case for this scenario

devdattakulkarni commented 6 months ago

Check https://github.com/cloud-ark/kubeplus/blob/master/examples/multitenancy/managed-service/appday2ops/steps.txt got an example.

devdattakulkarni commented 5 months ago

High-level steps:

  1. Follow the structure of https://github.com/cloud-ark/kubeplus/blob/master/tests/tests.py#L80 for creating the test. Use relative paths to refer to the ResourceComposition file and tenant yaml.
  2. Name the test "test_application_upgrage"
  3. You can assume that kubectl plugins are installed and PATH is updated appropriately.
  4. Add a check to see if the CRD is installed, before creating the tenant instance. Currently, this check is missing in the example steps.
  5. In the test, we won't be able to perform manual verification. For port-forward, we will have to use Python Kubernetes client. See https://github.com/kubernetes-client/python/blob/release-9.0/kubernetes/docs/CoreV1Api.md#connect_get_namespaced_pod_portforward
  6. For curl, use Python requests module to make REST API calls.

In order to use Kubernetes Python client, add requirements.txt to the tests folder. Update the README to document the step of running pip install before executing the tests.

devdattakulkarni commented 3 months ago

Completed.