canonical / cluster-api-bootstrap-provider-microk8s

This project offers a cluster API bootstrap provider controller that manages the node provision of a MicroK8s cluster.
https://microk8s.io
21 stars 14 forks source link

Add e2e tests for in-place upgrades #65

Closed sachinkumarsingh092 closed 1 year ago

sachinkumarsingh092 commented 1 year ago

Summary

Added e2e tests for inPlace upgrades. Also did some refactoring to make it easy if and when we want different tests for different upgrade strategies.

ktsakalozos commented 1 year ago

Thank you for this work @sachinkumarsingh092 . These e2e tests are run during a release, therefore we want to have both upgrade strategies to be checked. I saw you have introduced a env variable through which we can select the upgrade strategy. Could have a separate test to upgrade a non-HA cluster? Maybe a subtest test could work.

sachinkumarsingh092 commented 1 year ago

Yeah, making a new subtest is very easy now with all the refactoring. I thought about making a new test for in-place and having 2 tests for Rollout and in-place separately. But after having already executed one of the tests, say rollout upgrades, the cluster is now in a new version. Unless we are sure that an even newer version exists, this can break the in-place upgrade tests. We have these options to now test in-place upgrades:

  1. Downgrade the cluster to the previous version before in-place tests.
  2. Make a new cluster entirely with the older version before in-place tests.
  3. Hardcode the versions for the 3 consecutive available versions. Ex 1.24 -> 1.25 (rollouts) then 1.25 -> 1.26 (in-place).
  4. Along the lines you suggested, create a few nodes and upgrade them separately.

WDYT?

ktsakalozos commented 1 year ago

2. Make a new cluster entirely with the older version before in-place tests.

I would suggest we create a new cluster, with less nodes (eg 1 CP, 1 worker)

ktsakalozos commented 1 year ago

LGTM +1