Download PDF
Download page Install the Cluster Agent with the Kubernetes CLI.
Install the Cluster Agent with the Kubernetes CLI
This page describes how to install the Cluster Agent using the Kubernetes CLI which is an alternative to Install the Cluster Agent with Helm Charts.
Requirements
Before you begin, verify that you have:
- installed kubectl >= 1.16
- met the requirements described here: Cluster Agent Requirements and Supported Environments
- the Cluster Agent and AppDynamics Operator images. To create a custom Cluster Agent image, see Cluster Agent Container Image and to create a custom operator image, see Cisco AppDynamics Operator Container Image.
Installation Procedure
If you have not already installed the
metrics-server, then install it. See https://github.com/kubernetes-sigs/metrics-server for the most recent installation instructions.kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yamlCODEDownload the Kubernetes or OpenShift Cluster Agent bundle from the Download portal, unzip the contents of the bundle to the current directory:
unzip appdynamics-cluster-agent-alpine-linux-<version>.zipCODECreate a
namespaceforappdynamicsin your cluster:kubectl create namespace appdynamicsCODEInstall the Cluster Agent Operator using the correct Kubernetes and OpenShift version (where applicable):
kubectl create -f cluster-agent-operator.yamlCODEkubectl create -f cluster-agent-operator-openshift.yamlCODEkubectl create -f cluster-agent-operator-openshift-1.15-or-less.yamlCODEYou can also install Cluster Agent Operator from OpenShift OperatorHub in your OpenShift cluster.
Based on the Account Access Key for the Controller, create the Controller Access Key Secret that the Cluster Agent reports to:
kubectl -n appdynamics create secret generic cluster-agent-secret --from-literal=controller-key=<access-key>CODEEdit
cluster-agent.yamlto set the Splunk AppDynamics Controller details for the Cluster Agent to report to.
a. Set thensToMonitorRegexoption to include the namespaces you want to monitor.
b. Set the image tag to the version you are installing. Refer to Docker Hub for the latest version of the image tag.
For additional configuration tasks, such as, proxy support, or pull secrets, see Configure the Cluster Agent.This example assumes the use of the pre-built Cluster Agent image on Docker Hub. See Cluster Agent Container Image to build your own image.
apiVersion: cluster.appdynamics.com/v1alpha1 kind: Clusteragent metadata: name: k8s-cluster-agent namespace: appdynamics spec: appName: "dev-cluster" controllerUrl: "http://mycontroller.com:8080" account: "my-account" # docker image info where, <version> is the image tag version that you are installing image: "docker.io/appdynamics/cluster-agent:<version>" serviceAccountName: appdynamics-cluster-agent nsToMonitorRegex: namespace1|namespace2 stdoutLogging: "true"YML- (Optional) If you require multiple Cluster Agents to monitor a single cluster, set up Target Allocator. In the
cluster-agent.yamlfile, enable target allocator with the number of Cluster Agent replicas to enable the operator to create Cluster Agent replicas. See Target Allocator.cluster-agent.yaml
… spec: … appName: "my-cluster" nsToMonitorRegex: ".*" instrumentationMethod: "None" containerAppCorrelationMethod: "none" targetAllocator: enabled: true # false if autoScaling is enabled clusterAgentReplicas: 3 autoScaling: enabled: false #false by default replicaProfile: Default maxClusterAgentReplicas: 12 scaleDown: stabilizationWindowSeconds: 86400 #In Seconds podConfig: imagePullPolicy: Always imagePullSecret: ecr-secret priorityClassName: high-priority serviceAccountName: appdynamics-target-allocator nodeSelector:{} tolerations:[] resources: limits: cpu: 500m memory: 500Mi requests: cpu: 200m memory: 200Mi labels:{} securityContext:{}YML Install the Cluster Agent:
kubectl create -f cluster-agent.yamlCODE
See Validate the Cluster Agent Installation to validate and troubleshoot the installation. Once the install is validated, see Container Installation Options for options to install App Server Agents in applications in the cluster.