Helm Charts 4x to 5x Migration

CHT 4.x to 5.x Helm Charts Migration Guide

Overview

This guide covers the migration of Kubernetes based CHT 4.x deployments using the legacy Helm charts to the new charts introduced in CHT 5.x. The new Helm chart require updates to your values.yaml file.

Before starting be sure you have a git clone of the CHT Core repository and that you have updated it with git pull origin to ensure you have the latest changes locally.

Migration Steps

Step 1: Prepare Migration Values File

  1. Export the values from your existing 4.x deployment into the migration-5x-values.yaml file:

    helm get values <your-release-name> --namespace <your-namespace> > migration-5x-values.yaml
  2. Be sure all booleans are unquoted by running these two sed commands which will correct them in the migration-5x-values.yaml file:

    sed -i 's/: "false"/: false/g' migration-5x-values.yaml
    sed -i 's/: "true"/: true/g' migration-5x-values.yaml
  3. Update the migration-5x-values.yaml file to be compliant with 5.x deployment requirements:

    # Change field names - keep the same true/false value from your 4.x deployment
    # Use true for multi-node deployments, false for single-node deployments
    couchdb:
      clusteredCouchEnabled: false  # was: clusteredCouch_enabled: false
    
    # For most migrations, use false. Use true for pre-created volumes for provisioning
    couchdb_data:
      preExistingDataAvailable: false  # Keep using dynamic storage provisioning  
    
    # Add required API service configuration
    api:
      service:
        type: ClusterIP
    
    # Update image versions to 5.x
    chtversion: 5.0.0
    cht_image_tag: 5.0.0
  4. Depending on the hosting environment, make a final edit to migration-5x-values.yaml file:

couchdb:
  persistent_disk:
    size: <size>  # Set appropriate size for your needs
ebs:
  preExistingEBSVolumeSize: <size>  # Set appropriate size for your needs
couchdb:
  storage_class: local-path  # was: "local-storage"

Step 2: Perform the Migration

  1. Upgrade the helm deployment form same directory as migration-5x-values.yaml. As well, update /path/to/cht-core to be the location where CHT Core repo is checked out:

    helm upgrade <your-release-name> /path/to/cht-core/scripts/build/helm \
      -f migration-5x-values.yaml \
      --namespace <your-namespace>
  2. Monitor the upgrade:

    helm status <your-release-name> --namespace <your-namespace>
    kubectl get pods--namespace <your-namespace>

Step 3: Verify Migration Success

  1. Check pod status:

    kubectl get pods -n <your-namespace>
  2. Verify new 5.x components:

    # Look for the new couchdb-nouveau component
    kubectl get pods --namespace <your-namespace> | grep nouveau
  3. Test data integrity

  4. Test application access

Best Practices

  1. Test First: Always test migrations in a non-production environment
  2. Backup Data: Ensure complete data backup before migration
  3. Monitor Closely: Watch deployment logs and metrics during migration
  4. Document Changes: Keep track of any custom configurations
  5. Plan Downtime: Schedule migrations during maintenance windows

Breaking Changes Reference

Change TypeOld (4.x)New (5.x)PlatformImpact
Field RenameclusteredCouch_enabledcouchdb.clusteredCouchEnabledAllCritical
Field Renamelocal.diskPathlocal_storage.preExistingDiskPath-1AllCritical
New Field-api.service.type: ClusterIPAllCritical
Storage ConfigDefault sizescouchdb.couchdb_node_storage_size requiredAllCritical
Storage ConfigDefault sizescouchdb.persistent_disk.size requiredGKECritical
Storage ConfigDefault sizesebs.preExistingEBSVolumeSize requiredEKSCritical
Storage Classlocal-storagelocal-pathK3s-K3dMinor
StructureFlat configNested couchdb configurationAllMedium

Getting Help

If you encounter issues during migration:

  1. Check the CHT Documentation
  2. Review the CHT Forum
  3. Open an issue in the CHT Core Repository
Last updated on

Did this documentation help you ?