app-migration-cli

command module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: Apache-2.0 Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

app-migration-cli

This tool migrates apps from one MC to another. It's coupled to the vintage -> capi migration tool.

Running this script dumps apps.application.giantswarm.io Objects and their related config (configmap and/or secrets) to disk. Mentioned config will be renamed and put in a different namespace (capi way).

In a second stage, these objects are reapplied to a new MC.

✈ Rundown

Parts of the script must run in advance of the CAPI Migration, others are scheduled after a successfull infrastructure migration.

  1. preflight - readonly checks if a migration is possible; not neccessary to run

    • validate access to both mcs
    • check WC condition/health (only "Created" is allowed)
    • ...
  2. prepare - writing all resources to disk

    • filtering certain default/non-migratable apps
    • writing all apps to disk
    • writing all dependend cm/secrets to disk
    • converting vintage apps,cm/secrets locations to capi org-namespace
  1. apply - applying the resources to the new MC
    • checking if certain default resources are available
    • applying the dumped resources to the new MC

Recomendation to run the tool

  • To ensure there are no interference with kubeconfigs that the tool uses, create a new temporary file for kubeconfig.
❯❯❯ export KUBECONFIG=$(mktemp)
                                <sourceMC>  <destMC> <WC Name> <Org Namespace>
❯❯❯ ./app-migration-cli prepare -s gaia     -d golem -n ulli30 -o org-ulli
Connected to gs-gaia, k8s server version v1.24.17
Connected to gs-golem, k8s server version v1.24.16
Finalizer set on NS: gaia-ulli30
Scheduled 1 non-default apps for migration

# apps, cm, secrets written to disk in yaml; Namespace reorganization already included
❯❯❯ ll ulli30-apps.yaml
.rw-r-----  5.0k ull  16 Jan 10:53  ulli30-apps.yaml

❯❯❯ ./capi-migration-cli --mc-capi golem --mc-vintage gaia --cluster-namespace org-ulli --cluster-name ulli30
[...]
Deleted vintage ulli30 node pool ASG.
Finished migrating cluster ulli30 to CAPI infrastructure

❯❯❯ ./app-migration-cli apply -s gaia -d golem -n ulli30 -f ulli30-apps.yaml -o org-ulli
Connected to gs-gaia, k8s server version v1.24.17
Connected to gs-golem, k8s server version v1.24.16

All prerequistes are found on the new MC for app migration
Applying all non-default APP CRs to MC
All non-default apps applied successfully.

Notes

  • currently only working for vintage
  • currently only working for aws based clusters

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
pkg

Jump to

Keyboard shortcuts

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