Alauda Container Platform Registry Upgrade Guide

TOC

Prerequisites

  1. Administrator privileges for the Alauda Container Platform.
  2. The old plugin refers to versions of Alauda Container Platform v4.1 (inclusive) and earlier.
  3. The new plugin refers to versions of Alauda Container Platform v4.2 (inclusive) and later.

Overview

This document provides instructions for upgrading the Old Plugin to New Plugin. Due to the name of cluster plugin change, manual intervention is required based on storage type.

Upgrade Steps

Environment Check and Preprocessing

Old Plugin Not Installed

If the old plugin was never installed, you just need to clean up the old plugin from [Marketplace/Cluster Plugins]:

# Execute in Global cluster
kubectl delete moduleplugins internal-docker-registry
kubectl get moduleconfig -l cpaas.io/module-name=internal-docker-registry -o name | xargs kubectl delete

Old Plugin Installed

If the old plugin is installed in any cluster, follow the migration procedure based on your storage type.

S3 Storage Migration

Characteristics: Automatic data migration, no manual operation needed

Procedure:

  1. Backup Old Plugin Configuration: (Execute in workload cluster where the old plugin is installed)
    kubectl get clusterplugininstances internal-docker-registry -o yaml > backup-clusterplugininstances.yaml
  2. Uninstall Old Plugin: (Execute in Global cluster)
    # Replace <CLUSTER-NAME> with actual cluster name which has the plugin installed
    kubectl get moduleinfo -l cpaas.io/cluster-name=<CLUSTER-NAME>,cpaas.io/module-name=internal-docker-registry -o name | xargs kubectl delete
  3. Install New Plugin (Execute in workload cluster where the plugin will be installed)
  • Edit backup file backup-clusterplugininstances.yaml, replace all internal-docker-registry with image-registry
  • Apply new configuration:
    kubectl apply -f backup-clusterplugininstances.yaml
  1. Cleanup Old Plugin From [Marketplace/Cluster Plugins]: (Execute in Global cluster)
    kubectl delete moduleplugins internal-docker-registry
    kubectl get moduleconfig -l cpaas.io/module-name=internal-docker-registry -o name | xargs kubectl delete

NFS Storage Migration

Characteristics: Manual PV retention and reclaim policy modification required.

Procedure:

  1. Record PV Information: (Execute in workload cluster where the old plugin is installed)
    OLD_PV=$(kubectl get pvc internal-docker-registry -n cpaas-system -o jsonpath='{.spec.volumeName}')
    echo "Old PV Name: $OLD_PV"
  2. Modify PV Reclaim Policy: (Execute in workload cluster where the old plugin is installed)
    kubectl patch pv $OLD_PV -p '{"spec":{"persistentVolumeReclaimPolicy":"Retain"}}'
  3. Backup Old Plugin Configuration (Same as S3 Step 1)
  4. Uninstall Old Plugin (Same as S3 Step 2)
  5. Release PV Binding: (Execute in workload cluster where the old plugin is installed)
    kubectl patch pv $OLD_PV -p '{"spec":{"claimRef":null}}'
  6. Install New Plugin (Important: You must set the config.persistence.volumeName for the new plugin to retain the old data)
  • Edit configuration file backup-clusterplugininstances.yaml, set config.persistence.volumeName: <OLD_PV>
  • Apply configuration (Same as S3 Step 3)
  1. Cleanup Old Plugin From [Marketplace/Cluster Plugins] (Same as S3 Step 4)

Local Storage Migration

Characteristics: Manual data copy required

Procedure:

  1. Backup Old Plugin Configuration (Same as S3 Step 1)
  2. Uninstall Old Plugin (Same as S3 Step 2)
  3. Install New Plugin (Same as S3 Step 3)
  4. Data Migration:
  • ssh login to old plugin Pod node, copy data from old directory to new directory with all file permissions:
    sudo cp -a /cpaas/internal-docker-registry/* /cpaas/image-registry/
  1. Cleanup Old Plugin From [Marketplace/Cluster Plugins] (Same as S3 Step 4)