Skip to content

Migration Analysis: Launchpad-Namespaces (Helmfile) to ArgoCD ApplicationSets #1399

@devin-ai-integration

Description

@devin-ai-integration

Migration Analysis: Launchpad-Namespaces (Helmfile) to ArgoCD ApplicationSets

Executive Summary

This issue documents comprehensive research on migrating from launchpad-namespaces' helmfile-based approach to ArgoCD ApplicationSets. The analysis covers architectural differences, migration feasibility, namespace-specific challenges, and recommendations for a phased migration approach.

Current Architecture: Launchpad-Namespaces with Helmfile

Key Characteristics

  1. CUE Schema Generation: Uses CUE (Configure, Unify, Execute) to define schemas in src/schemas/ that generate helmfile configurations
  2. Namespace Organization: Organizes charts into functional namespaces (ethereum, storage, graph, etc.)
  3. Feature Flags: Supports conditional deployment of components via feature flags
  4. Scaling Parameters: Allows configuration of deployment scaling (e.g., number of instances)
  5. Release Channels: Supports both stable and canary release channels
  6. Value Overrides: Flexible configuration with multiple levels of value overrides

Templating & Generation

  • Go Templating: Extensive use of Go templates for dynamic configuration
  • Complex Conditionals: Supports complex conditional logic for feature toggling
  • Label Management: Sophisticated label and annotation management
  • Release Generation: Dynamic generation of releases based on scaling parameters

ArgoCD ApplicationSets Capabilities

Key Characteristics

  1. Generator-based: Uses generators (Git, List, Cluster, etc.) to produce parameters
  2. Template-based: Templates define how Applications are created from parameters
  3. Patch-based: Supports advanced patching for complex configurations
  4. Matrix Combinations: Can combine multiple generators for complex deployment patterns

Templating & Generation

  • Go Templating: Uses Go templates with Sprig functions
  • Custom Functions: Provides additional functions like normalize and slugify
  • Helm Integration: Uses Helm only for templating (helm template), not lifecycle management
  • Value Management: Supports multiple ways to provide values to Helm charts

Namespace-by-Namespace Analysis

1. Sealed-Secrets Namespace

Features:

  • Simple deployment of sealed-secrets controller
  • Single component with simple configuration

Migration Feasibility: Very Easy

  • No complex feature flags or scaling parameters
  • Minimal templating requirements
  • Can serve as a proof of concept for the migration approach

ApplicationSet Implementation:

apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
  name: sealed-secrets
spec:
  generators:
  - list:
      elements:
      - component: sealed-secrets
  template:
    metadata:
      name: 'sealed-secrets'
    spec:
      project: default
      source:
        repoURL: https://charts.bitnami.com/bitnami
        chart: sealed-secrets
        targetRevision: '{{.Values.chartVersion | default "latest"}}'
      destination:
        server: https://kubernetes.default.svc
        namespace: '{{.Values.targetNamespace | default "sealed-secrets"}}'

2. Postgres-Operator Namespace

Features:

  • Simple deployment of postgres-operator
  • Single component with simple configuration

Migration Feasibility: Very Easy

  • No complex features
  • Straightforward templating

3. Storage Namespace

Features:

  • Provides OpenEBS for software-defined storage
  • Supports two storage engines: rawfile and ZFS
  • Uses feature flags for enabling different storage engines

Migration Feasibility: Moderate

  • Easy to Replicate:
    • Basic chart deployment structure
    • Simple feature flags (rawfile, zfs)
    • Namespace configuration
  • Challenging:
    • Storage class configuration which relies on resource-injector

4. Ingress Namespace

Features:

  • Ingress controller
  • Certificate management
  • Resource configuration

Migration Feasibility: Moderate

  • Easy to Replicate:
    • Basic component deployment
    • Simple configuration
  • Challenging:
    • Certificate resource management

5. Monitoring Namespace

Features:

  • Prometheus, Grafana, Loki stack
  • Dashboard configuration
  • Alert configuration

Migration Feasibility: Moderate to Difficult

  • Easy to Replicate:
    • Basic component deployment
    • Simple configuration
  • Challenging:
    • Dashboard configuration
    • Alert configuration

6. Ethereum Namespace

Features:

  • Supports multiple networks (mainnet, holesky, sepolia, hoodi)
  • Complex feature flags (nimbus, lighthouse, proxyd)
  • Scaling parameters for multiple deployments
  • Complex label management

Migration Feasibility: Difficult

  • Easy to Replicate:
    • Network flavor configuration
    • Basic chart deployment
  • Challenging:
    • Complex scaling parameters
    • Dynamic release generation based on scaling
    • Complex label and annotation management
    • JWT authentication between execution and consensus clients

ApplicationSet Implementation Example:

apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
  name: ethereum
spec:
  generators:
  - matrix:
      generators:
      - list:
          elements:
          - flavor: mainnet
            targetNamespace: eth-mainnet
          - flavor: holesky
            targetNamespace: eth-holesky
          - flavor: sepolia
            targetNamespace: eth-sepolia
      - list:
          elements:
          - component: erigon
            layer: execution
          - component: nimbus
            layer: consensus
            feature: nimbus
          - component: lighthouse
            layer: consensus
            feature: lighthouse
          - component: proxyd
            layer: proxy
            feature: proxyd
  template:
    metadata:
      name: 'ethereum-{{flavor}}-{{component}}'
    spec:
      project: default
      source:
        repoURL: https://graphops.github.io/launchpad-charts
        chart: '{{component}}'
        targetRevision: '{{.Values.chartVersion | default "latest"}}'
        helm:
          valueFiles:
          - values/common.yaml
          - values/{{flavor}}/{{component}}.yaml
          values:
            scaling:
              deployments: '{{.Values.scaling.deployments | default 1}}'
            labels:
              app.launchpad.graphops.xyz/layer: '{{layer}}'
              app.launchpad.graphops.xyz/component: '{{component}}'
              app.launchpad.graphops.xyz/network: '{{flavor}}'
      destination:
        server: https://kubernetes.default.svc
        namespace: '{{targetNamespace}}'

7. Graph Namespace

Features:

  • Complex interdependent components
  • Database configuration
  • Indexer configuration with multiple components
  • Subgraph deployment rules

Migration Feasibility: Very Difficult

  • Easy to Replicate:
    • Basic component deployment
  • Challenging:
    • Complex interdependencies between components
    • Indexer configuration with multiple related components
    • Subgraph deployment rules
    • Database configuration

Migration Challenges

  1. Schema Translation: Converting CUE schemas to ApplicationSet templates
  2. Feature Flag Implementation: Implementing feature flags using ApplicationSet generators
  3. Scaling Parameters: Replicating scaling parameters using ApplicationSet generators
  4. Release Channel Management: Managing stable and canary releases in ApplicationSets
  5. Value Override Hierarchy: Maintaining the complex value override hierarchy

Recommended Migration Approach

Phase 1: Proof of Concept

  1. Start with Sealed-Secrets Namespace as the simplest namespace
  2. Create ApplicationSet templates that replicate the helmfile functionality
  3. Test and validate the templates

Phase 2: Simple Namespaces

  1. Migrate Postgres-Operator Namespace
  2. Migrate Storage Namespace with feature flag implementation

Phase 3: Moderate Complexity

  1. Migrate Ingress Namespace
  2. Migrate Monitoring Namespace

Phase 4: Complex Namespaces

  1. Migrate Ethereum Namespace with full scaling and feature flag support
  2. Migrate Graph Namespace with complex interdependencies

Key Migration Strategies

  1. Git Generator with Directory Structure: Use the Git directory generator to create Applications based on namespace directories
  2. Matrix Generator for Feature Flags: Use Matrix generator to combine feature flags with namespace configurations
  3. Template Patch for Complex Configuration: Use templatePatch for complex configurations that can't be expressed in simple templates
  4. Value Management: Use Helm valueFiles and values for managing the configuration hierarchy
  5. Release Channel Implementation: Use Git references or branches to manage stable and canary releases

Conclusion

Migrating from Launchpad-Namespaces with Helmfile to ArgoCD ApplicationSets is feasible but requires significant effort to replicate the complex templating and generation capabilities. The migration should follow a phased approach, starting with the simplest namespaces (sealed-secrets, postgres-operator) and gradually moving to more complex ones (ethereum, graph).

The most challenging aspects will be maintaining the complex conditional logic and value override hierarchy. However, ApplicationSets' Matrix generator and templatePatch capabilities provide powerful tools to address these challenges.

Next Steps

  1. Create a proof of concept with the sealed-secrets namespace
  2. Develop a migration framework that can be reused across namespaces
  3. Document migration patterns for common scenarios (feature flags, scaling, etc.)
  4. Create a migration guide for each namespace
  5. Test thoroughly in a staging environment before production migration

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions