Skip to content

michaelenglert/appdynamics-operator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AppDynamics Operator

AppDynamics Operator simplifies the configuration and lifecycle management of the AppDynamics ClusterAgent and the AppDynamics Machine Agent on different Kubernetes distributions and OpenShift. The Operator encapsulates key operational knowledge on how to configure and upgrade the ClusterAgent and the Machine Agent. It knows, for example, which configuration changes are benign and do not require restart of the ClusterAgent, which minimizes unnecesary load on the cluster API server.

The Operator is implemented using OperatorSDK and uses Kubernetes API to maintain the desired state of the custom resources that represent the ClusterAgent and the Machine Agent. When the Operator is deployed, it creates custom resource definitions (CRDs) for 2 custom resources:

  • clusteragent, which represents the ClusterAgent.
  • infraviz, which represents the Machine Agent bundled with netviz and analytics.

This level of abstraction further simplifies the management of monitoring and imstrumentation and ensures granular security policy of the ClusterAgent and the Machine Agent.

Operator deployment

Create namespace for the operator and the ClusterAgent

  • Create namespace for AppDynamics components

    • Kubernetes kubectl create namespace appdynamics
    • OpenShift oc new-project appdynamics --description="AppDynamics Infrastructure"
  • Create Secret cluster-agent-secret (deploy/cluster-agent/cluster-agent-secret.yaml).

    • The "api-user" key with the AppDynamics user account information is required. It needs to be in the following format <username>@<account>:<password>, e.g. user@customer1:123.
    • The "controller-key" is required for the deployments of the infraviz custom resource (The Machine Agent). It is the access key to the AppDynamics controller, which can be obtained from the controller UI. For clusteragent deployments this key is optional.
    • The "event-key" is optional. It is only used by the clusteragent resource. This value represents an Event API key, which allows posting resource snapshots to the event analytics. If not specified, it will be automatically generated by the ClusterAgent
kubectl -n appdynamics create secret generic cluster-agent-secret \
--from-literal=api-user="" \
--from-literal=controller-key="" \
--from-literal=event-key="" \
  • Update the image reference in the Operator deployment spec (deploy/cluster-agent-operator.yaml), if necessary.

The default is "docker.io/appdynamics/cluster-agent-operator:latest".

  • Deploy the ClusterAgent
kubectl create -f deploy/cluster-agent-operator.yaml
  • On OpenShift
oc create -f deploy/cluster-agent-operator-openshift.yaml

Images

By default "docker.io/appdynamics/cluster-agent-operator:latest" is used.

AppDynamics images are also available from Red Hat Container Catalog.

To enable pulling, create a secret in the ClusterAgent namespace. In this example, namespace appdynamics is used and appdynamics-operator account is linked to the secret.

$ oc -n appdynamics create secret docker-registry redhat-connect 
--docker-server=registry.connect.redhat.com 
--docker-username=REDHAT_CONNECT_USERNAME 
--docker-password=REDHAT_CONNECT_PASSWORD --docker-email=unused
$ oc -n appdynamics secrets link appdynamics-operator redhat-connect 
--for=pull 

ClusterAgent deployment

The clusteragent is the custom resource that the Operator works with to deploy an instance of the ClusterAgent. When a clusteragent spec is provided, the Operator will create a single replica deployment and the necessary additional resources (a configMap and a service) to support the ClusterAgent.

Here is an example of a minimalistic spec of the ClusterAgent custom resource:

apiVersion: appdynamics.com/v1alpha1
kind: Clusteragent
metadata:
  name: K8s-Cluster-Agent
spec:
  controllerUrl: "<protocol>://&