Skip to content

Offline Upgrade of Operations Management Module

This page provides instructions on how to install or upgrade the Operations Management module after downloading it from the Download Center.

Info

The term gmagpie used in the following commands or scripts refers to the internal development codename for the Operations Management module.

Loading Image from the Installation Package

You can load the image using either of the following methods. It is recommended to choose the chart-syncer method when an image repository already exists in the environment, as it is more efficient and convenient.

Synchronizing Images to Image Repository using chart-syncer

  1. Create load-image.yaml .

    Note

    All parameters in this YAML file are mandatory. You need a private image repository and modify the relevant configurations accordingly.

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

    load-image.yaml
    source:
      intermediateBundlesPath: gmagpie-offline # Use the relative path to run the `charts-syncer` command, not the relative path
    target:
      containerRegistry: 10.16.10.111 # Modify it to your image repository URL.
      containerRepository: release.daocloud.io/gmagpie # Modify it to your image repository.
      repo:
        kind: HARBOR # It can also be any other supported Helm Chart repository category.
        url: http://10.16.10.111/chartrepo/release.daocloud.io # Modify it 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 a chart repo is not installed in the current environment, chart-syncer also supports exporting the chart as a tgz file and storing it in the specified path.

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

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

Loading directly with Docker or containerd

Unpack and load the image file.

  1. Unpack the tar archive.

    tar xvf gmagpie.bundle.tar
    

    After a successful unpacking, you will obtain 3 files:

    • hints.yaml
    • images.tar
    • original-chart
  2. Load the image from the local source into 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 is complete, it is necessary to tag the image to keep the Registry and Repository consistent with the installation.

Upgrade

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

Note

When upgrading from v0.1.x (or lower) to v0.2.0 (or higher), database connection parameters need to be modified.

Example of modifying database connection parameters:

bak.yaml
USER-SUPPLIED VALUES:
global:
  database:
    host: 127.0.0.1
    port: 3306
    dbname: gmagpie
    password: passowrd
    user: gmagpie

Modified to:

bak.yaml
USER-SUPPLIED VALUES:
global:
  storage:
    gmagpie:
    - driver: mysql
      accessType: readwrite
      dsn: {global.database.apiserver.user}:{global.database.apiserver.password}@tcp({global.database.host}:{global.database.port})/{global.database.apiserver.dbname}?charset=utf8mb4&multiStatements=true&parseTime=true
  1. Check if the Operations Management Helm repository exists.

    helm repo list | grep gmagpie
    

    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 Operations Management Helm repository.

    helm repo add gmagpie http://{harbor url}/chartrepo/{project}
    
  3. Update the Operations Management Helm repository.

    helm repo update gmagpie # (1)
    
    1. If the Helm version is too low, it may result in failure. If this happens, please try executing helm update repo .
  4. Choose the version of Operations Management that you would like to install (it is recommended to install the latest version).

    helm search repo gmagpie/gmagpie --versions
    
    [root@master ~]# helm search repo gmagpie/gmagpie --versions
    NAME                   CHART VERSION  APP VERSION  DESCRIPTION
    gmagpie/gmagpie  0.3.0          v0.3.0       A Helm chart for GHippo
    ...
    
  5. Back up the --set parameters.

    Before upgrading the Operations Management version, it is recommended to run the following command to back up the --set parameters of the old version.

    helm get values gmagpie -n gmagpie-system -o yaml > bak.yaml
    
  6. Update Gmagpie CRD.

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

    Before upgrading, it is recommended to replace the global.imageRegistry field in the bak.yaml file with the address of the image repository you are currently using.

    export imageRegistry={your-registry}
    
    helm upgrade gmagpie gmagpie/gmagpie \
      -n gmagpie-system \
      -f ./bak.yaml \
      --set global.imageRegistry=$imageRegistry \
      --version 0.3.0
    
  1. Back up the --set parameters.

    Before upgrading the Operations Management version, it is recommended to run the following command to back up the --set parameters of the old version.

    helm get values gmagpie -n gmagpie-system -o yaml > bak.yaml
    
  2. Update the Gmagpie CRD.

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

    It is recommended to replace the global.imageRegistry field in the bak.yaml file with the address of the image repository you are currently using before performing the upgrade.

    export imageRegistry={你的镜像仓库}
    
    helm upgrade gmagpie . \
      -n gmagpie-system \
      -f ./bak.yaml \
      --set global.imageRegistry=$imageRegistry
    

Comments