Skip to content

Offline Upgrade Container Registry Module

This page explains how to install or upgrade the container registry module after downloading it from the Download Center.

Info

The word kangaroo appearing in the following commands or scripts is the internal development code name of the container registry module.

Load Images from the Installation Package

You can load the images in one of the following two ways. When a container registry exists in the environment, it is recommended to choose the chart-syncer to synchronize the images to the container registry, as this method is more efficient and convenient.

Synchronize Images to the Container Registry using chart-syncer

  1. Create load-image.yaml

    Note

    All parameters in this YAML file are mandatory. You need a private container registry and modify the relevant configurations.

    If the current environment has an installed chart repo, and chart-syncer also supports exporting the chart as a tgz file, refer to the following YAML:

    load-image.yaml
    source:
      intermediateBundlesPath: kangaroo-offline # (1)!
    target:
      containerRegistry: 10.16.10.111 # (2)!
      containerRepository: release.daocloud.io/kangaroo # (3)!
      repo:
        kind: HARBOR # (4)!
        url: http://10.16.10.111/chartrepo/release.daocloud.io # (5)!
        auth:
          username: "admin" # (6)!
          password: "Harbor12345" # (7)!
      containers:
        auth:
          username: "admin" # (8)!
          password: "Harbor12345" # (9)!
    
    1. Go to the relative path where the charts-syncer command is running, instead of the relative path between this YAML file and the offline package.
    2. Modify it to your container registry URL.
    3. Modify it to your container registry.
    4. It can also be any other supported Helm Chart repository category.
    5. Modify it to the chart repo URL.
    6. Your container registry username.
    7. Your container registry password.
    8. Your container registry username.
    9. Your container registry password.

    If the chart repo is not installed in the current environment, and chart-syncer supports exporting the chart as a tgz file and storing it in the specified path, refer to the following YAML:

    load-image.yaml
    source:
      intermediateBundlesPath: kangaroo-offline # (1)!
    target:
      containerRegistry: 10.16.10.111 # (2)!
      containerRepository: release.daocloud.io/kangaroo # (3)!
      repo:
        kind: LOCAL
        path: ./local-repo # (4)!
      containers:
        auth:
          username: "admin" # (5)!
          password: "Harbor12345" # (6)!
    
    1. Provide the relative path to run the charts-syncer command, instead of the relative path between this YAML file and the offline package.
    2. Change it to your container registry URL.
    3. Change it to your container registry.
    4. Local path of the chart.
    5. Your container registry username.
    6. Your container registry password.
  2. Run the command to synchronize images.

    charts-syncer sync --config load-image.yaml
    

Directly load with Docker or containerd

Extract and load the image files.

  1. Extract the tar compressed package.

    tar xvf kangaroo.bundle.tar
    

    After successful extraction, you will get 3 files:

    • hints.yaml
    • images.tar
    • original-chart
  2. Load the images from local to Docker or containerd.

    docker load -i images.tar
    
    ctr -n k8s.io image import images.tar
    

Note

Each node needs to perform the image loading operation with Docker or containerd. After loading, the image needs to be tagged to keep the Registry, Repository consistent with the installation.

Upgrade

There are two ways to upgrade. You can choose the proper upgrade method based on the prerequisite steps:

  1. Check if the global helm repository exists.

    helm repo list | grep kangaroo
    

    If the result is empty or shows the following prompt, proceed to the next step; otherwise, skip the next step.

    Error: no repositories to show
    
  2. Add the global helm repository.

    helm repo add kangaroo http://{harbor url}/chartrepo/{project}
    
  3. Update the global helm repository.

    helm repo update kangaroo # (1)!
    
    1. If the helm version is too low, it may fail. If it fails, try to run helm update repo.
  4. Select the container registry version you want to install (it is recommended to install the latest version).

    helm search repo kangaroo/kangaroo --versions
    
    [root@master ~]# helm search repo kangaroo/kangaroo --versions
    NAME                   CHART VERSION  APP VERSION  DESCRIPTION
    kangaroo/kangaroo  0.9.0          v0.9.0       A Helm chart for Kangaroo
    ...
    
  5. Backup the --set parameters.

    Before upgrading the container registry version, it is recommended to run the following command to backup the --set parameters of the old version.

    helm get values kangaroo -n kangaroo-system -o yaml > bak.yaml
    
  6. Check the version update records. If there are updates to CRDs, update the kangaroo CRDs.

    helm pull kangaroo/kangaroo --version 0.9.0 && tar -zxf kangaroo-0.9.0.tgz
    kubectl apply -f kangaroo/crds
    
  7. Run helm upgrade.

    Before upgrading, it is recommended to replace the global.imageRegistry field in bak.yaml with the current container registry address.

    export imageRegistry={your_registry}
    
    helm upgrade kangaroo kangaroo/kangaroo \
      -n kangaroo-system \
      -f ./bak.yaml \
      --set global.imageRegistry=$imageRegistry
      --version 0.9.0
    
  1. Back up the --set parameters.

    Before upgrading the container registry version, it is recommended to run the following command to backup the --set parameters of the old version.

    helm get values kangaroo -n kangaroo-system -o yaml > bak.yaml
    
  2. Check the version update records. If there are updates to CRDs, update the kangaroo CRDs.

    kubectl apply -f ./crds
    
  3. Run helm upgrade.

    Before upgrading, it is recommended to replace the global.imageRegistry field in bak.yaml with the current container registry address.

    export imageRegistry={your_registry}
    
    helm upgrade kangaroo . \
      -n kangaroo-system \
      -f ./bak.yaml \
      --set global.imageRegistry=$imageRegistry
    

Comments