Manually Configure App Agents to Correlate with the Cluster Agent Using Kubernetes1.25 or Higher

The following configuration is required only for Kubernetes 1.25 or higher. If you require to correlate agents with Cluster Agent you must enable auto-instrumentation and set containerAppCorrelationMethod to proxy. This is required for the agents to retrieve the container ID of the application container.

When you enable auto-instrumentation using the proceeding steps, auto-instrumentation does not instrument the application but starts the container metadata server to fetch the container ID.You can choose to ignore specific namespaces by using the nsToExcludeRegex parameter.

The Java Agent depends on the HOSTNAME environment variable, using it as the pod name to query the Cluster Agent. It is important to keep these variables unchanged to accurately extract the container ID.

  1. Upgrade the Cluster Agent to version 23.9 or higher.
  2. Add the following environment variables (env) on the pod on which the application is running:
    • APPDYNAMICS_CONTAINER_NAME : <name of the instrumented container>
    • APPDYNAMICS_CONTAINERINFO_FETCH_SERVICE : 'cluster-metadata-service.<namespace of the cluster agent>:<metadataServerPort(default 9090)>'
    • APPDYNAMICS_POD_NAMESPACE : <namespace of the application pod>
  3. Configure the containerAppCorrelationMethod parameter under the spec section in the configuration file with the value as proxy . For more information about this parameter, see Correlate Application Containers with AppAgents (For Kubernetes version >=1.25)
  4. Edit the configuration file to include the instrumentation method as Env . This enables correlation of application containers with Cluster Agent.
    Note: You must set these properties for manual instrumentation. Applying these properties enable applications to correlate with Cluster Agent for the manual application instrumentation. This does not enable the auto-instrumentation functionality.
    • (In cluster-agent.yaml) instrumentationMethod: None

      Sample cluster-agent.yaml

      apiVersion: cluster.appdynamics.com/v1alpha1
      kind: Clusteragent
      metadata:
      name: k8s-cluster-agent
      namespace: appdynamics
      spec:
      instrumentationMethod: Env
    • (In values.yaml) enabled: true instrumentationConfig

      Sample values.yaml

      deploymentMode: MASTER
      clusterAgent:
      nsToMonitorRegex: .*
      instrumentationConfig:
      enabled: true
      instrumentationMethod: Env

      For more information about enabling auto-instrumentation, see Auto Instrumentation Configuration.