tests

command
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

README

test migration

This tool is used to test migration of a cluster from Vintage MC to CAPI MC. It is not intended to be used for production migration. It is used to test the migration process and to find issues in the migration process.

Expect it to run for long time, the cluster creation itself can take around 20-40 minutes and the migration can also be around 30 minutes.

During the run the test tool will ask you for certain input, its either confirmation to proceed to the next stage or to input a 2FA code for AWS credentials. Also be ready to check your browser for dex login.

The tool does following steps:

  • opsctl login into vintage MC
  • use kubectl gs template to generate manifests for vintage cluster version v20.0.0
  • apply manifests to vintage MC
  • wait until the created cluster is created and ready
  • - it is your time to apply any changes to the cluster to test if they work with the migration process
  • execute the migration process covered by the CLI tool
  • wait until the cluster is migrated
  • - you can check if the changes were migrated correctly
  • last step is cleanup of the cluster, it will remove cluster resources from CAPI MC and Vintage MC which will clean all AWS resources
 #: ./tests/tests -h
Usage of ./tests/tests:
  -aws-region string
        AWS region where the cluster will be created (default "eu-central-1")
  -cluster-name string
        Name of the cluster to migrate, if left empty, name will be auto-generated
  -cluster-organization string
        Organization of the cluster (default "capa-migration-testing")
  -enable-notifications
        Enable notifications via desktop notifications and terminal bell sound. Terminal bell sound must be enabled in your terminal. Notification are sent when the app needs an input.
  -kubeconfig string
        Paths to a kubeconfig. Only required if out-of-cluster.
  -mc-capi string
        Name of the CAPI management cluster (default "gazelle")
  -mc-vintage string
        Name of the vintage management cluster, if you change MC make sure --aws-region is also set right (default "garfish")
Requirements
  • all requirements from the main README.md
  • opsctl installed and configured and in available in $PATH
  • kubectl gs installed and configured and in available $PATH
  • for Vintage MC use garfish, for CAPI MC use gazelle, in some special cases you can use golem as well
Recommendation
  • use a dedicated kubeconfig for testing to ensure valid kubeconfigs and non-expired SSO tokens
export KUBECONFIG=$(mktemp)
chmod 600 $KUBECONFIG
examples how to run the tool
# simple test, will create a cluster with random name in gauss MC and migrate it to golem MC
./tests

# simple test, will create a cluster with specific name in gauss MC and migrate it to golem MC
./tests -cluster-name=xyz123
Cleanup in case of failure

if the tool fails during the migration process, you can cleanup the cluster with the following command

export MC_VINTAGE=garfish
export MC_CAPI=gazelle
export CLUSTER_NAME=xyz123
kubectl delete -f ./${CLUSTER_NAME}-cluster.yaml --context=gs-${MC_VINTAGE} --wait=false
kubectl delete -f ./${CLUSTER_NAME}-cluster-vintage.yaml --context=gs-${MC_CAPI} --wait=false

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL