Mirantis / hmc

Apache License 2.0
22 stars 17 forks source link

Add automated tests for managed clusters upgrades #313

Open DinaBelova opened 2 months ago

DinaBelova commented 2 months ago
eromanova commented 1 week ago

Managed cluster upgrade testing workflow

  1. Deploy standalone managed cluster with N-1 template (templates will be chosen automatically)
  2. Deploy HMC on this cluster
  3. Verify the cluster is healthy
  4. Create the hosted managed cluster with an M-1 template
  5. Upgrade management cluster to the template N
  6. Verify the management cluster is healthy
  7. Upgrade the hosted cluster to the template M
  8. Verify the hosted cluster is healthy

Automated tests for managed cluster upgrades include the following changes in 2A components and e2e testing:

  1. The new label is added upgrade e2e. Adding this label to the PR will trigger the upgrade process for the managed clusters. The source and target templates will be chosen automatically from all the available ClusterTemplateChains depending on the access rules provided in the TemplateManagement object. Subsequently, (as soon as there can be more than a one-to-one match between the source and target template) the test may receive source and target template names as a parameter provided in the PR’s description (separate task).
  2. The hmc-templates helm chart will contain the default ClusterTemplateChain with all the supported cluster templates and their upgrade sequences. The default ClusterTemplateChain can be added to the TemplateManagement spec and the template distribution system will be enabled (templates will be copied to the target namespaces defined in the corresponding accessRule of the TemplateManagement). For details, see https://mirantis.github.io/project-2a-docs/template/main/#template-life-cycle-management. The 2A will not enforce the target namespaces. It’ll be up to the platform lead. In e2e upgrade testing, we’ll add the default access rule to the TemplateManagement spec with the default ClusterTemplateChain and the default namespace as a target namespace.
  3. Managed clusters will be deployed in the default namespace (currently it’s deployed in the system namespace). As a result, we’ll also test the templates’ distribution system.
  4. All the immutable (already released) templates will be placed in a separate folder.
  5. The new cluster templates will be added for testing the upgrades. The managed cluster upgrade testing workflow