Build the Cluster Agent Container Image

This page describes how to build a custom Cluster Agent container image or use an officially released pre-built images and store it to an internal registry.

This procedure is required when you:

  • Require to build custom Cluster Agent container image
  • Require to use the pre-built Cluster Agent Image from DockerHub, or the RedHat Container Registry, and store it in the internal registry.

Otherwise, you can directly pull and use the pre-built Cluster Agent Container Images on the Splunk AppDynamics DockerHub repository or Splunk AppDynamics RedHat registry in the cluster-agent.yaml values.yaml

This example uses the pre-built Cluster Agent Image 21.12.0 published to DockerHub:

Yaml
apiVersion: cluster.appdynamics.com/v1alpha1
kind: Clusteragent
metadata:
name: k8s-cluster-agent
namespace: appdynamics
spec:
controllerUrl: "http://<account>.saas.appdynamics.com"
account: "<account-name>"
appName: "Cluster1"
image: docker.io/appdynamics/cluster-agent:21.12.0
values.yaml
deploymentMode: PRIMARY
installclusteragent: true
installInfraviz: false
# Docker images
imageInfo:
agentImage: docker.io/appdynamics/cluster-agent
agentTag: 21.12.0
operatorImage: docker.io/appdynamics/cluster-agent-operator
operatorTag:21.12.0
imagePullPolicy: Always
machineAgentImage: docker.io/appdynamics/machine-agent-analytics
machineAgentTag:21.9.0
machineAgentWinTag:21.9.0-win-ltsc2019
netVizImage: docker.io/appdynamics/machine-agent-netviz

Build the Custom Cluster Agent Image

The download packages from the Download Portal include files you need to build and deploy the Cluster Agent container image.

Depending on the base Image that was used to build the Cluster Agent Image, there are two package types available on the portal:

  • Alpine Linux-based
  • Rhel Linux-based (recommended for OpenShift cluster only)

The directory structure of the download packages for the Alpine and Rhel Linux is:

Alpine Linux AMD
cluster-agent
├── cluster-agent-operator.yaml
├── appdynamics-operator-alpine-linux-amd64-21.12.0-88
├── cluster-agent-operator-openshift-1.15-or-less.yaml
├── cluster-agent-operator-openshift.yaml
├── cluster-agent.yaml
├── infraviz.yaml
├── infraviz-pod-security-policy.yaml
├── infraviz-security-context-constraint-openshift.yaml
├── README-alpine.md
└── docker
├── cluster-agent.zip
├── Dockerfile
├── LICENSE
└── start-appdynamics
└── helm-charts
├── Chart.yaml
├── README.md
├── crds
├── templates
└── values.yaml
Alpine Linux ARM
cluster-agent
├── cluster-agent-operator.yaml
├── appdynamics-operator-alpine-linux-arm64-21.12.0-88
├── cluster-agent-operator-openshift-1.15-or-less.yaml
├── cluster-agent-operator-openshift.yaml
├── cluster-agent.yaml
├── infraviz.yaml
├── infraviz-pod-security-policy.yaml
├── infraviz-security-context-constraint-openshift.yaml
├── README-alpine.md
└── docker
├── cluster-agent.zip
├── Dockerfile
├── LICENSE
└── start-appdynamics
└── helm-charts
├── Chart.yaml
├── README.md
├── crds
├── templates
└── values.yaml
Rhel Linux ubi8
cluster-agent
├── cluster-agent-operator.yaml
├── appdynamics-operator-rhel-linux-amd64-21.12.0-88
├── cluster-agent-operator-openshift-1.15-or-less.yaml
├── cluster-agent-operator-openshift.yaml
├── cluster-agent.yaml
├── infraviz.yaml
├── infraviz-pod-security-policy.yaml
├── infraviz-security-context-constraint-openshift.yaml
├── README-rhel.md
└── docker
├── cluster-agent.zip
├── Dockerfile-rhel
├── LICENSE
└── start-appdynamics
└── helm-charts
├── Chart.yaml
├── README.md
├── crds
├── templates
└── values.yaml

Build the Custom Cluster Agent Image

  1. Change directories into the docker

    $ cd docker
  2. Build and tag a docker

    Alpine Linux
    $ docker build -t <registryname>/<accountname>/cluster-agent:<Agent-version> --build-arg version=<alpine-version> .
    Rhel Linux ubi8
    $ docker build -t <registryname>/<accountname>/cluster-agent:<Agent-version> -f Dockerfile-rhel .
    Note: To use a specific Alpine Image version, specify the version using --build-arg version=<alpine-version>. If you do not specify an image version, then the build command takes the latest Alpine image version automatically.

    For example, to build and tag the image version 21.12.0 using the latest alpine version on Docker Hub registry for the account name johndoe:

    Alpine Linux
    $ docker build -t docker.io/johndoe/cluster-agent:21.12.0 .
    Rhel Linux ubi8
    $ docker build -t docker.io/johndoe/cluster-agent:21.12.0 -f Dockerfile-rhel .
  3. When the build is successful, verify that the image appears in your local Docker repository.

  4. Push the image:

    $ docker push <registryname>/<accountname>/cluster-agent:<Agent-version>

    For example, pushing the image version 21.12.0 to Docker Hub registry for the account name Johndoe :

    $ docker push docker.io/johndoe/cluster-agent:21.12.0

Use Pre-Built Splunk AppDynamics Operator Image

You can also use pre-built Alpine-based or Rhel-based Splunk AppDynamics Operator images to an internal registry.

Alpine Operator Image

You can use the pre-built Alpine-based Splunk AppDynamics Operator image from the DockerHub account.

  1. Log in to your Docker Hub account:
    $ docker login docker.io -u <your-username> -p <your-password>
  2. Pull the image:For example, to pull the Alpine-based Splunk AppDynamics Operator image version 21.12.0:
    $ docker pull docker.io/appdynamics/cluster-agent-operator:<Operator_Version>
    $ docker pull docker.io/appdynamics/cluster-agent-operator:21.12.0
To push this image to the internal registry or accounts:
  1. Rename the image:For example:
    $ docker tag docker.io/appdynamics/cluster-agent-operator:<Operator_Version> <registryname>/<accountname>/cluster-agent-operator:<Operator_Version>
    $ docker tag docker.io/appdynamics/cluster-agent-operator:21.12.0 docker.io/johndoe/cluster-agent-operator:21.12.0
  2. Push the image:For example, to push the image version 21.12.0 to the Docker Hub registry for the account name Johndoe:
    $ docker push <registryname>/<accountname>/cluster-agent-operator:<Operator_Version>
    $ docker push docker.io/johndoe/cluster-agent-operator:21.12.0

    See RHELOperator Image

Configure the Image in Cluster Agent YAML Specification

Make sure to reference the image in the cluster-agent.yaml spec:

apiVersion: cluster.appdynamics.com/v1alpha1
kind: Clusteragent
metadata:
name: k8s-cluster-agent
namespace: appdynamics
spec:
controllerUrl: "http://<account>.saas.appdynamics.com"
account: "<account-name>"
appName: "Cluster1"
image: <registryname>/<username>/cluster-agent:<Agent-version>

For assistance, contact Customer Support.