Skip to content

Offline Upgrade of Middleware - Kafka Module

This page explains how to install or upgrade the middleware - kafka module after downloading it from the Download Center.

Info

The term mcamel used in the following commands or scripts is an internal development codename for the middleware module.

Loading Images from the Installation Package

You can load the images using one of the following methods. It is recommended to use chart-syncer to sync the images to your image repository when it is available, as it is more efficient and convenient.

Syncing Images to Image Repository using chart-syncer

  1. Create load-image.yaml file.

    Note

    All parameters in this YAML file are required. You need to have a private image repository and modify the relevant configuration.

    If you already have a chart repo installed in your environment, chart-syncer also supports exporting the chart as a tgz file.

    load-image.yaml
    source:
      intermediateBundlesPath: mcamel-offline # The relative path to execute the charts-syncer command, not the relative path between this YAML file and the offline package
    target:
      containerRegistry: 10.16.10.111 # Change this to your image repository URL
      containerRepository: release.daocloud.io/mcamel # Change this to your image repository
      repo:
        kind: HARBOR # It can also be any other supported Helm Chart repository type
        url: http://10.16.10.111/chartrepo/release.daocloud.io # Change this to the chart repo URL
        auth:
          username: "admin" # Your image repository username
          password: "Harbor12345" # Your image repository password
      containers:
        auth:
          username: "admin" # Your image repository username
          password: "Harbor12345" # Your image repository password
    

    If you don't have a chart repo installed in your environment, chart-syncer also supports exporting the chart as a tgz file and storing it in the specified path.

    load-image.yaml
    source:
      intermediateBundlesPath: mcamel-offline # The relative path to execute the charts-syncer command, not the relative path between this YAML file and the offline package
    target:
      containerRegistry: 10.16.10.111 # Change this to your image repository URL
      containerRepository: release.daocloud.io/mcamel # Change this to your image repository
      repo:
        kind: LOCAL
        path: ./local-repo # Local path to the chart
      containers:
        auth:
          username: "admin" # Your image repository username
          password: "Harbor12345" # Your image repository password
    
  2. Run the command to sync the images.

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

Directly Loading with Docker or containerd

Unpack and load the image files.

  1. Extract the tar archive.

    tar -xvf mcamel-kafka_0.8.1_amd64.tar
    cd mcamel-kafka_0.8.1_amd64
    tar -xvf mcamel-kafka_0.8.1.bundle.tar
    

    After successful extraction, you will get 3 files:

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

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

Note

Docker or containerd image loading operation needs to be performed on each node. After loading, tag the images to match the registry and repository used during installation.

Upgrade

There are two ways to perform the upgrade. You can choose the corresponding upgrade method based on the preconditions:

  1. Check if the helm repository exists.

    helm repo list | grep kafka
    

    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 helm repository.

    helm repo add mcamel-kafka http://{harbor url}/chartrepo/{project}
    
  3. Update the helm repository.

    helm repo update mcamel/mcamel-kafka # If the helm version is too low and it fails, try executing __helm update repo__ 
    
  4. Select the version you want to install (recommended to install the latest version).

    helm search repo mcamel/mcamel-kafka --versions
    
    [root@master ~]# helm search repo mcamel/mcamel-kafka --versions
    NAME                            CHART VERSION   APP VERSION     DESCRIPTION               
    mcamel/mcamel-kafka     0.8.1           0.8.1           A Helm chart for Kubernetes
    ...
    
  5. Back up the --set parameters.

    Before upgrading to a new version, it is recommended to execute the following command to back up the --set parameters of the old version.

    helm get values mcamel-kafka -n mcamel-system -o yaml > mcamel-kafka.yaml
    
  6. Run helm upgrade .

    Before upgrading, it is recommended to update the global.imageRegistry field in the mcamel-kafka.yaml file with the current image repository address.

    export imageRegistry={your_image_repository}
    
    helm upgrade mcamel-kafka mcamel/mcamel-kafka \
      -n mcamel-system \
      -f ./mcamel-kafka.yaml \
      --set global.imageRegistry=$imageRegistry \
      --version 0.8.1
    
  1. Back up the --set parameters.

    Before upgrading to a new version, it is recommended to execute the following command to back up the --set parameters of the old version.

    helm get values mcamel-kafka -n mcamel-system -o yaml > mcamel-kafka.yaml
    
  2. Run helm upgrade .

    Before upgrading, it is recommended to update the bak.yaml file by replacing global.imageRegistry with your current image repository address.

    export imageRegistry={your_image_repository}
    
    helm upgrade mcamel-kafka . \
      -n mcamel-system \
      -f ./mcamel-kafka.yaml \
      --set global.imageRegistry=${imageRegistry} \
      --set console_image.registry=${imageRegistry} \ 
      --set operator_image.registry=${imageRegistry}
    

Comments