Giter VIP home page Giter VIP logo

mta's Introduction

mta (Migrate to Argo CD)

The mta cli will export Flux components to Argo CD consumable CRs. This can be used in order to help migrating from Flux to Argo CD. This is in the "proof of concept" phase and we make no guarantees.

Installation

Install the mta binary from the releases page in your $PATH.

There is shell completion for convenience.

NOTE it's probably zsh on a Mac

mta completion bash

Quickstart

Here's a video which explains how to use 'mta' to export Flux components to Argo CD consumable CRs.

Introduction to 'mta' - Migrate from Flux to Argo CD

Below are some examples

Manual Migration

NOTE: See the Flux Documentation for more information about Flux.

After downloading the binary, you can scan your system for HelmReleases and Kustomizations. Example:

$ mta scan 
┌───────────────┬─────────────┬─────────────┬─────────────────────────────────────────────────────────────────┐
│ KIND          │ NAME        │ NAMESPACE   │ STATUS                                                          │
├───────────────┼─────────────┼─────────────┼─────────────────────────────────────────────────────────────────┤
│ HelmRelease   │ podinfo     │ flux-system │ Release reconciliation succeeded                                │
│ HelmRelease   │ sample      │ flux-system │ Release reconciliation succeeded                                │
├───────────────┼─────────────┼─────────────┼─────────────────────────────────────────────────────────────────┤
│ Kustomization │ flux-system │ flux-system │ Applied revision: main/f35c47113103d67b20859a2301fa5c88a8f7c6c9 │
└───────────────┴─────────────┴─────────────┴─────────────────────────────────────────────────────────────────┘

You can then, migrate them over; for example to migrate the HelmRelease called sample (in my above example), you can do:

$ mta helmrelease --name sample

You'll see the Argo CD Application that will be created:

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: sample
  namespace: argocd
spec:
  destination:
    namespace: quarkus
    server: https://kubernetes.default.svc
  project: default
  source:
    chart: quarkus
    helm:
      values: |
        build:
          enabled: false
        deploy:
          route:
            enabled: false
        image:
          name: quay.io/ablock/gitops-helm-quarkus
    repoURL: https://redhat-developer.github.io/redhat-helm-charts
    targetRevision: 0.0.3
  syncPolicy:
    automated:
      prune: true
      selfHeal: true
    syncOptions:
    - CreateNamespace=true
    - Validate=false

You can pipe this into kubectl apply or you can have mta do it for you

NOTE You'll have to install Argo CD before running this command

$ mta helmrelease --name sample --confirm-migrate

The same can be done for Kustomizations, example:

NOTE Kustomizations, because of the nature of how they are setup, are migrated via an ApplicationSet

$ mta kustomization --name flux-system --confirm-migrate

By default, the ApplicationSet created from the Kustomiation will exclude the flux-system directory. You can exclude other directories that have Flux specific Kubernetes objects by passing the --exclude-dirs option.

$ mta kustomization --name flux-system --exclude-dirs flux-system-extras --confirm-migrate

NOTE To exclude more directories, you an pass a comma separated list to --exclude-dirs. Example: --exclude-dirs foo,bar,bazz. You can also pass --exclude-dirs to the scan command as well.

Auto Migration

You can have the scan subcommand automatically migrate everything for you

‼️ NOTE This option also deletes Flux from the system. Use with caution

$ mta scan --auto-migrate

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.