Skip to content

Offline upgrade global management module

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

Info

ghippo appearing in the commands or scripts below is the internally developed code name for the global management module.

Synchronize image to the container registry

First, synchronize the image to the specified container registry through chart-syncer.

  1. Create load-image.yaml

    Note

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

    If the current environment has installed a chart repo, chart-syncer also supports exporting the chart as a tgz file.

    load-image.yaml
    source:
      intermediateBundlesPath: ghippo-offline # (1)
    target:
      containerRegistry: 10.16.10.111 # (2)
      containerRepository: release.daocloud.io/ghippo # (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" # (6)
          password: "Harbor12345" # (7)
    
    1. Path relative to where the charts-syncer command is executed, not relative to this YAML file and the offline package
    2. Change to your image repository URL
    3. Change to your image repository
    4. Can also be any other supported Helm Chart repository type
    5. Change to the chart repo URL
    6. Your image repository username
    7. Your image repository password

    If the current environment does not have a chart repo installed, chart-syncer also supports exporting the chart as a tgz file and storing it in a specified path.

    load-image.yaml
    source:
      intermediateBundlesPath: ghippo-offline # (1)
    target:
      containerRegistry: 10.16.10.111 # (2)
      containerRepository: release.daocloud.io/ghippo # (3)
      repo:
        kind: LOCAL
        path: ./local-repo # (4)
      containers:
        auth:
          username: "admin" # (5)
          password: "Harbor12345" # (6)
    
    1. Path relative to where the charts-syncer command is executed, not relative to this YAML file and the offline package
    2. Change to your image repository URL
    3. Change to your image repository
    4. Local path of the chart
    5. Your image repository username
    6. Your image repository password
  2. Run the synchronous image command.

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

Load image file

Unzip and load the image file.

  1. Unzip the tar archive.

    tar xvf ghippo.bundle.tar
    

    After successful decompression, you will get 3 files:

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

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

Note

After the loading is complete, the tag image is required to keep the Registry and Repository consistent with the installation.

upgrade

There are two ways to upgrade. You can choose the corresponding upgrade plan according to the pre-operations:

Note

When upgrading from v0.11.x (or lower) to v0.12.0 (or higher), you need to change all keycloak keys in bak.yaml to keycloakx.

Replace the key:

bak.yaml
USER-SUPPLIED VALUES:
keycloak:
    ...

with:

bak.yaml
USER-SUPPLIED VALUES:
keycloakx:
    ...

Note

When upgrading from v0.15.x (or lower) to v0.16.0 (or higher) versions, the database connection parameters need to be modified.

Here is an example of modifying the database connection parameters:

bak.yaml
USER-SUPPLIED VALUES:
global:
  database:
    host: 127.0.0.1
    port: 3306
    apiserver:
      dbname: ghippo
      password: passowrd
      user: ghippo
    keycloakx:
      dbname: keycloak
      password: passowrd
      user: keycloak
  auditDatabase:
    auditserver:
      dbname: audit
      password: passowrd
      user: audit
    host: 127.0.0.1
    port: 3306

Change it to:

bak.yaml
USER-SUPPLIED VALUES:
global:
  storage:
    ghippo:
    - 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
    audit:
    - driver: mysql
      accessType: readwrite
      dsn: {global.auditDatabase.auditserver.user}:{global.auditDatabase.auditserver.password}@tcp({global.auditDatabase.host}:{global.auditDatabase.port})/{global.auditDatabase.auditserver.dbname}?charset=utf8mb4&multiStatements=true&parseTime=true
    keycloak:
    - driver: mysql
      accessType: readwrite
      dsn: {global.database.keycloakx.user}:{global.database.keycloakx.password}@tcp({global.database.host}:{global.database.port})/{global.database.keycloakx.dbname}?charset=utf8mb4
  1. Check whether the global management helm repository exists.

    helm repo list | grep ghippo
    

    If the returned result is empty or as prompted, proceed to the next step; otherwise, skip the next step.

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

    helm repo add ghippo http://{harbor url}/chartrepo/{project}
    
  3. Update the globally managed helm repository.

    helm repo update ghippo # (1) 
    
    1. If the helm version is too low, it will fail. If it fails, please try to run helm update repo
  4. Select the version of Global Management you want to install (the latest version is recommended).

    helm search repo ghippo/ghippo --versions
    
    [root@master ~]# helm search repo ghippo/ghippo --versions
    NAME CHART VERSION APP VERSION DESCRIPTION
    ghippo/ghippo 0.9.0 v0.9.0 A Helm chart for GHippo
    ...
    
  5. Back up the --set parameter.

    Before upgrading the global management version, it is recommended that you run the following command to back up the --set parameter of the old version.

    helm get values ​​ghippo -n ghippo-system -o yaml > bak.yaml
    
  6. Run helm upgrade .

    Before upgrading, it is recommended that you override the global.imageRegistry field in bak.yaml to the address of the currently used container registry.

    export imageRegistry={your image registry}
    
    helm upgrade ghippo ghippo/ghippo \
      -n ghippo-system \
      -f ./bak.yaml \
      --set global.imageRegistry=$imageRegistry \
      --version 0.9.0
    
  1. Back up the --set parameter.

    Before upgrading the global management version, it is recommended that you run the following command to back up the --set parameter of the old version.

    helm get values ​​ghippo -n ghippo-system -o yaml > bak.yaml
    
  2. Update ghippo crds

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

    Before upgrading, it is recommended that you overwrite global.imageRegistry in bak.yaml to the address of the current container registry.

    export imageRegistry={your-container-registry}
    
    helm upgrade ghippo . \
      -n ghippo-system \
      -f ./bak.yaml \
      --set global.imageRegistry=$imageRegistry
    

Comments