Upgrading Anthos private mode

This page explains how to upgrade Anthos private mode.

Upgrading the admin cluster and Management Center

Infrastructure operators can upgrade the admin cluster and Anthos Management Center and its components.

Prepare the environment

  1. Run the following commands to download the new release and set execution permissions:

    cd ~/
    # Download the script which helps download all the latest components
    export VERSION=UPGRADE_VERSION
    
    # Please use official 'INSTALLER_DIGEST' value from https://cloud.google.com/anthos/private-mode/docs/1.8/installing/infrastructure#download
    export INSTALLER_DIGEST=
    export INSTALLER=get-anthos-private-mode-$VERSION.sh
    gsutil cp gs://anthos-private-mode-release/$VERSION/$INSTALLER .
    if [[ -n "$INSTALLER_DIGEST" ]]; then echo "$INSTALLER_DIGEST $INSTALLER" | sha256sum -c; fi && chmod +x $INSTALLER && ./$INSTALLER
    
    # Note: ~/anthos-baremetal-private-mode should point to the new version.
    ls -al anthos-baremetal-private-mode
    cd ~/anthos-baremetal-private-mode
    

    Replace UPGRADE_VERSION with the new version that you want to upgrade to.

  2. Upload the new images into your private registry with the following command. Make sure to use the actl from version UPGRADE_VERSION.

    actl images push --private-registry=${PRIVATE_REGISTRY} \
      --images ~/anthos-baremetal-private-mode
    

    The upload process automatically skips the images that already exist in the registry.

Upgrading the admin cluster

To upgrade the admin cluster, update the admin cluster config file with only the following changes, and then run the actl clusters baremetal upgrade command to complete the upgrade.

  1. In the cluster config admin YAML file, update the version string.

    apiVersion: baremetal.cluster.gke.io/v1
    kind: Cluster
    metadata:
      name: admin
      namespace: cluster-admin
    spec:
      anthosBareMetalVersion: VERSION
    

    Replace VERSION with the new Anthos on bare metal version number.

  2. Run the following command to update the admin cluster. Make sure to use the actl from version UPGRADE_VERSION.

    actl clusters baremetal upgrade admin --kubeconfig=ADMIN_KUBECONFIG
    

The upgrade might take about 15 to 20 minutes to complete, but could take longer depending on the cluster size.

Upgrading Management Center

Infrastructure operators can upgrade Management Center in its entirety or by upgrading individual sub-components.

Option 1: Upgrading the entire Management Center

Infrastructure operators can upgrade all the components in a Management Center, including the Management Center itself.

  1. Check the version of the Management Center to confirm that it is an older version:

    kubectl get AdminOperator admin-operator --kubeconfig=ADMIN_KUBECONFIG
    

    Replace ADMIN_KUBECONFIG with the path of the kubeconfig file for the admin cluster.

  2. Optional: Run the preflight check for upgrade:

    actl platform management-center upgrade --preflight-check-only --kubeconfig=ADMIN_KUBECONFIG
    
  3. Initiate the upgrade (typically takes about 10-15 minutes to complete):

    actl platform management-center upgrade --kubeconfig=ADMIN_KUBECONFIG
    
  4. Check the version of the Management Center to confirm that the version is updated:

    kubectl get AdminOperator admin-operator --kubeconfig=ADMIN_KUBECONFIG
    

Option 2: Upgrading individual components

Infrastructure operators can manage the upgrades of a specific component that runs in the Management Center. As of version 1.8, three components are individually upgradable: the Anthos Config Management operator, the Anthos Service Mesh operator and Anthos on bare metal.

After uploading the images to the container registry, you need to publish the package specifications shipped in the new release. For example, the package specification for Anthos Config Management operator and Anthos Service Mesh operator are available under services/.

  1. Apply the package specification for the new Anthos Config Management operator.

    kubectl apply -f ~/anthos-baremetal-private-mode/services/anthos-config-management/package-spec.yaml \
    --kubeconfig=ADMIN_KUBECONFIG
    
  2. Check the current component status of the Anthos Config Management operator.

    kubectl get adminoperator admin-operator \
      --kubeconfig=ADMIN_KUBECONFIG \
      -ojsonpath='{.status.components[?(@.name=="anthos-config-management")]}'
    

    Assume the command gives the current version of 1.8.X and the current version constraint of <=1.8.X.

    {"name":"anthos-config-management","version":"1.8.X","versionConstraint":"<=1.8.X"}
    
  3. Enable the new version by editing the version constraints in the Admin Operator object.

    kubectl edit AdminOperator admin-operator --kubeconfig=ADMIN_KUBECONFIG
    
  4. In the editor, locate the update policies under spec.updateConfigOverride.policies and increase the component versions accordingly. If spec.updateConfigOverride is omitted or has an empty struct value ({}), add the policy as follows.

    spec:
      updateConfigOverride:
        policies:
        - name: anthos-config-management
          versionConstraint: <=1.8.Y
    

After adding the override, the Management Center rolls out the change to pick up the newer version of the Anthos Config Management operator.

Run the following command to monitor the rollout of the new version, which is expected to change from the former 1.8.X to 1.8.Y.

kubectl get adminoperator admin-operator \
  --kubeconfig=ADMIN_KUBECONFIG \
  -ojsonpath='{.status.components[?(@.name=="anthos-config-management")].version}' \
  --watch

When the rollout is complete, platform administrators can use the new Anthos Config Management operator through the Management Center.

Upgrading user clusters

Platform administrators can update user clusters by using the actl command-line tool, the Management Center, or through the API.

actl

Run the following command to update a user cluster:

actl clusters baremetal upgrade CLUSTER_NAME --kubeconfig ADMIN_KUBECONFIG

Console

  1. In the Management Center console, go to the Dashboard menu.
  2. Click the Upgrades tab to see all available upgrades.
  3. Click View Upgrades for the cluster that you want to upgrade.
  4. Click Upgrade to see the details of the upgrade, such as the version, description, and a link to the release notes.
  5. Click Continue to confirm.
  6. Click Upgrade to start upgrading the cluster.

The entry in the upgrade list shows Upgrade in progress until the upgrade is finished.

API

You can upgrade a user cluster by modifying the version string in the Cluster resource.

  1. Run the following command to edit the Cluster resource for a user cluster.

    kubectl edit cluster CLUSTER_NAME -n cluster-CLUSTER_NAME --kubeconfig=ADMIN_KUBECONFIG
    
  2. Update the version string in spec.anthosBareMetalVersion, and the controllers will work on the upgrades.

    apiVersion: baremetal.cluster.gke.io/v1
    kind: Cluster
    metadata:
      name: CLUSTER_NAME
      namespace: cluster-CLUSTER_NAME
    spec:
      type: user
      anthosBareMetalVersion: VERSION
    

    Replace VERSION with the new Anthos on bare metal version number.