Jump to contentJump to page navigation: previous page [access key p]/next page [access key n]
documentation.suse.com / SUSE Edge Documentation / Components Used / System Upgrade Controller

19 System Upgrade Controller

See the System Upgrade Controller documentation.

The System Upgrade Controller (SUC) aims to provide a general-purpose, Kubernetes-native upgrade controller (for nodes). It introduces a new CRD, the Plan, for defining any and all of your upgrade policies/requirements. A Plan is an outstanding intent to mutate nodes in your cluster.

19.1 How does SUSE Edge use System Upgrade Controller?

SUC is used to assist in the various Day 2 operations that need to be executed in order to upgrade management/downstream clusters from one Edge platform version to another. Day 2 operations are defined in the form of SUC Plans. Based on the these plans, SUC deploys workloads on each node that executes the respective Day 2 operations.

19.2 Installing the System Upgrade Controller

We recommend that you install SUC through Fleet (Chapter 6, Fleet) located in the suse-edge/fleet-examples repository.

Note
Note

The resources offered by the suse-edge/fleet-examples repository must always be used from a valid fleet-examples release. To determine which release you need to use, refer to the Release Notes (Section 36.1, “Abstract”).

If you are unable to use Fleet (Chapter 6, Fleet) for the installation of SUC, you can install it through Rancher’s Helm chart repository, or incorporate the Rancher’s Helm chart in your own third-party GitOps workflow.

This section covers:

19.2.1 System Upgrade Controller Fleet installation

Using Fleet there are two possible resources that can be used to deploy SUC:

19.2.1.1 System Upgrade Controller installation - GitRepo

Note
Note

This process can also be done through the Rancher UI, if such is available. For more information, see Accessing Fleet in the Rancher UI.

In your management cluster:

  1. Determine on which clusters you want to deploy SUC. This is done by deploying the SUC GitRepo in the correct Fleet workspace inside your management cluster. By default, Fleet has two workspaces:

    • fleet-local - for resources that need to be deployed on the management cluster.

    • fleet-default - for resources that need to be deployed on downstream clusters.

      For more information on Fleet workspaces, see the upstream documentation.

  2. Deploy the GitRepo resource:

    • To deploy SUC on your management cluster:

      kubectl apply -n fleet-local -f - <<EOF
      apiVersion: fleet.cattle.io/v1alpha1
      kind: GitRepo
      metadata:
        name: system-upgrade-controller
      spec:
        revision: release-3.1.0
        paths:
        - fleets/day2/system-upgrade-controller
        repo: https://github.com/suse-edge/fleet-examples.git
      EOF
    • To deploy SUC on your downstream clusters:

      Note
      Note

      Before deploying the resource below, you must provide a valid targets configuration, so that Fleet knows on which downstream clusters to deploy your resource. For information on how to map to downstream clusters, see Mapping to Downstream Clusters.

      kubectl apply -n fleet-default -f - <<EOF
      apiVersion: fleet.cattle.io/v1alpha1
      kind: GitRepo
      metadata:
        name: system-upgrade-controller
      spec:
        revision: release-3.1.0
        paths:
        - fleets/day2/system-upgrade-controller
        repo: https://github.com/suse-edge/fleet-examples.git
        targets:
        - clusterSelector: CHANGEME
        # Example matching all clusters:
        # targets:
        # - clusterSelector: {}
      EOF
  3. Validate that the GitRepo is deployed:

    # Namespace will vary based on where you want to deploy SUC
    kubectl get gitrepo system-upgrade-controller -n <fleet-local/fleet-default>
    
    NAME                        REPO                                              COMMIT          BUNDLEDEPLOYMENTS-READY   STATUS
    system-upgrade-controller   https://github.com/suse-edge/fleet-examples.git   release-3.1.0   1/1
  4. Validate the System Upgrade Controller deployment:

    kubectl get deployment system-upgrade-controller -n cattle-system
    NAME                        READY   UP-TO-DATE   AVAILABLE   AGE
    system-upgrade-controller   1/1     1            1           2m20s

19.2.1.2 System Upgrade Controller installation - Bundle

This section illustrates how to build and deploy a Bundle resource from a standard Fleet configuration using the fleet-cli.

  1. On a machine with network access download the fleet-cli:

    Note
    Note

    Make sure that the version of the fleet-cli you download matches the version of Fleet that has been deployed on your cluster.

    • For Mac users there is a fleet-cli Homebrew Formulae.

    • For Linux and Windows users the binaries are present as assets to each Fleet release.

      • Linux AMD:

        curl -L -o fleet-cli https://github.com/rancher/fleet/releases/download/<FLEET_VERSION>/fleet-linux-amd64
      • Linux ARM:

        curl -L -o fleet-cli https://github.com/rancher/fleet/releases/download/<FLEET_VERSION>/fleet-linux-arm64
  2. Make fleet-cli executable:

    chmod +x fleet-cli
  3. Clone the suse-edge/fleet-examples release that you wish to use:

    git clone -b release-3.1.0 https://github.com/suse-edge/fleet-examples.git
  4. Navigate to the SUC fleet, located in the fleet-examples repo:

    cd fleet-examples/fleets/day2/system-upgrade-controller
  5. Determine on which clusters you want to deploy SUC. This is done by deploying the SUC Bundle in the correct Fleet workspace inside your management cluster. By default, Fleet has two workspaces:

    • fleet-local - for resources that need to be deployed on the management cluster.

    • fleet-default - for resources that need to be deployed on downstream clusters.

      For more information on Fleet workspaces, see the upstream documentation.

  6. If you intend to deploy SUC only on downstream clusters, create a targets.yaml file that matches the specific clusters:

    cat > targets.yaml <<EOF
    targets:
    - clusterSelector: CHANGEME
    EOF

    For information on how to map to downstream clusters, see Mapping to Downstream Clusters

  7. Proceed to building the Bundle:

    Note
    Note

    Make sure you did not download the fleet-cli in the fleet-examples/fleets/day2/system-upgrade-controller directory, otherwise it will be packaged with the Bundle, which is not advised.

    • To deploy SUC on your management cluster, execute:

      fleet-cli apply --compress -n fleet-local -o - system-upgrade-controller . > system-upgrade-controller-bundle.yaml
    • To deploy SUC on your downstream clusters, execute:

      fleet-cli apply --compress --targets-file=targets.yaml -n fleet-default -o - system-upgrade-controller . > system-upgrade-controller-bundle.yaml

      For more information about this process, see Convert a Helm Chart into a Bundle.

      For more information about the fleet-cli apply command, see fleet apply.

  8. Transfer the system-upgrade-controller-bundle.yaml bundle to your management cluster machine:

    scp system-upgrade-controller-bundle.yaml <machine-address>:<filesystem-path>
  9. On your management cluster, deploy the system-upgrade-controller-bundle.yaml Bundle:

    kubectl apply -f system-upgrade-controller-bundle.yaml
  10. On your management cluster, validate that the Bundle is deployed:

    # Namespace will vary based on where you want to deploy SUC
    kubectl get bundle system-upgrade-controller -n <fleet-local/fleet-default>
    
    NAME                        BUNDLEDEPLOYMENTS-READY   STATUS
    system-upgrade-controller   1/1
  11. Based on the Fleet workspace that you deployed your Bundle to, navigate to the cluster and validate the SUC deployment:

    Note
    Note

    SUC is always deployed in the cattle-system namespace.

    kubectl get deployment system-upgrade-controller -n cattle-system
    NAME                        READY   UP-TO-DATE   AVAILABLE   AGE
    system-upgrade-controller   1/1     1            1           111s

19.2.2 System Upgrade Controller Helm installation

  1. Add the Rancher chart repository:

    helm repo add rancher-charts https://charts.rancher.io/
  2. Deploy the SUC chart:

    helm install system-upgrade-controller rancher-charts/system-upgrade-controller --version 104.0.0+up0.7.0 --set global.cattle.psp.enabled=false -n cattle-system --create-namespace

    This will install SUC 0.13.4 version which is needed by the Edge 3.1 platform.

  3. Validate the SUC deployment:

    kubectl get deployment system-upgrade-controller -n cattle-system
    NAME                        READY   UP-TO-DATE   AVAILABLE   AGE
    system-upgrade-controller   1/1     1            1           37s

19.3 Monitoring System Upgrade Controller Plans

SUC Plans can be viewed in the following ways:

Important
Important

Pods deployed for SUC Plans are kept alive 15 minutes after a successful execution. After that they are removed by the corresponding Job that created them. To have access to the Pod’s logs after this time period, you should enable logging for your cluster. For information on how to do this in Rancher, see Rancher Integration with Logging Services.

19.3.1 Monitoring System Upgrade Controller Plans - Rancher UI

To check Pod logs for the specific SUC plan:

  1. In the upper left corner, ☰ → <your-cluster-name>

  2. Select Workloads → Pods

  3. Select the Only User Namespaces drop down menu and add the cattle-system namespace

  4. In the Pod filter bar, write the name for your SUC Plan Pod. The name will be in the following template format: apply-<plan_name>-on-<node_name>

    Note
    Note

    There may be both Completed and Unknown Pods for a specific SUC Plan. This is expected and happens due to the nature of some of the upgrades.

  5. Select the pod that you want to review the logs of and navigate to ⋮ → View Logs

19.3.2 Monitoring System Upgrade Controller Plans - Manual

Note
Note

The below steps assume that kubectl has been configured to connect to the cluster where the SUC Plans have been deployed to.

  1. List deployed SUC Plans:

    kubectl get plans -n cattle-system
  2. Get Pod for SUC Plan:

    kubectl get pods -l upgrade.cattle.io/plan=<plan_name> -n cattle-system
    Note
    Note

    There may be both Completed and Unknown Pods for a specific SUC Plan. This is expected and happens due to the nature of some of the upgrades.

  3. Get logs for the Pod:

    kubectl logs <pod_name> -n cattle-system