This page describes how to upgrade the Cluster Agent using:

  • Kubernetes CLI, or 
  • Cluster Agent Helm Chart

To install, see Install the Cluster Agent.

  • From Cluster Agent 23.2 onwards you must download the latest bundle and use only the packaged YAML files.
  • When you upgrade from Cluster Agent <23.2 to Cluster Agent >=23.2, the instrumented pods will restart.

Upgrade the Cluster Agent Using Kubernetes CLI

  1. Download the target version of the Cluster Agent bundle from the AppDynamics Downloads portal.
  2. Unzip the bundle and cd to the unzipped folder:

    unzip appdynamics-cluster-agent-alpine-linux-<version>.zip
    cd appdynamics-cluster-agent-alpine-linux-<version>
    BASH
  3. Update the cluster-agent.yaml to include any previously applied configuration.

  4. Update the image tag to add the version of the downloaded Cluster Agent bundle (for example, 21.12.0):

    apiVersion: cluster.appdynamics.com/v1alpha1
    kind: Clusteragent
    metadata:
      name: k8s-cluster-agent
      namespace: appdynamics
    spec:
      appName: "<app-name>"
      controllerUrl: "http://<appdynamics-controller-host>:8080"
      account: "<account-name>"
      # docker image info
      image: "docker.io/appdynamics/cluster-agent:21.12.0"
      serviceAccountName: appdynamics-cluster-agent
    YML
  5. Delete and re-create the Operator and Cluster Agent.

    kubectl delete -f cluster-agent.yaml
    kubectl delete -f cluster-agent-operator.yaml
    kubectl create -f cluster-agent-operator.yaml
    kubectl create -f cluster-agent.yaml
    CODE

Upgrade the Cluster Agent Using the Helm Chart

The latest Cluster Agent Helm Chart is available at appdynamics-charts/cluster-agent. Before you can upgrade to the latest Cluster Agent, you must first uninstall the existing Helm Chart and then re-install it. 

  1. Use helm get and helm show to determine if an upgrade is required to install the most recent Cluster Agent images from appdynamics-charts/cluster-agent:

    # which images are currently installed by my release?
    helm get all "<my-cluster-agent-helm-release>" -n appdynamics | grep -E 'agentTag|operatorTag'
      agentTag: 21.12.0
      operatorTag: 21.12.0
    
    # which images are available to install?
    helm show values appdynamics-charts/cluster-agent | grep -E 'agentTag|operatorTag'
      agentTag: 21.12.0
      operatorTag: 21.12.0
    BASH
  2. To perform the upgrade, uninstall and re-install the Cluster Agent Helm Chart using the same namespace from the previous installation:


    1. Uninstall existing helm chart.

      helm uninstall "<cluster-agent-helm-release>" --namespace appdynamics
      CODE
    2. Delete all the previously installed CustomResourceDefinition (CRDs) related to AppDynamics Agent by using these commands:

      kubectl get crd | grep appdynamics
      kubectl delete crd clusteragents.cluster.appdynamics.com
      kubectl delete crd infravizs.cluster.appdynamics.com
      CODE
    3. Install Cluster Agent helm chart by using the same namespace.

      helm install -f ./ca1-values.yaml "<my-cluster-agent-helm-release>" appdynamics-charts/cluster-agent --namespace=appdynamics 
      CODE