To deploy the Cluster Agent using the AppDynamics Operator, you need a:

  • Cluster Agent Docker Image
  • Secret that contains the Controller access key

You should create a secret when deploying the AppDynamics Operator to Red Hat OpenShift because it provides the starting configuration for the Cluster Agent.

Create a Controller Access Key Secret

To create a secret with a Controller access key:

$ oc -n appdynamics create secret generic cluster-agent-secret --from-literal=controller-key="<access-key>"
CODE

Create Secret to Pull the Cluster Agent from your Docker Repository

(Optional) If you are using a Docker repository that requires access credentials, create a secret to pull the Docker image from the private repository:

$ oc -n appdynamics create secret docker-registry regcred --docker-server=https://index.docker.io/v1 --docker-username=<docker-username> --docker-password=<docker-password> --docker-email=unused
CODE

Then, link the secret to the desired service account:

$ oc -n appdynamics secrets link appdynamics-operator regcred --for=pull 
TEXT

 (Optional) Specify this secret in your cluster-agent.yaml file using imagePullSecrets and name property:

apiVersion: 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: "<your-docker-registry>/appdynamics/cluster-agent:tag"
  imagePullSecrets:
    name: "regcred"
CODE

Deploy the Cluster Agent 

Start the Cluster Agent and point it to the desired Controller. Deploy the Cluster Agent using the AppDynamics Operator:

$ oc create -f cluster-agent.yaml
CODE

Example output:

clusteragent.appdynamics.com/k8s-cluster-agent created
CODE

Stop the Cluster Agent 

Stop the Cluster Agent pod: 

$ oc delete -f cluster-agent.yaml
CODE