On this page:
The following example shows how to build and run the Standalone Machine Agent in a Kubernetes environment to monitor the performance of your containerized applications. You might want to modify this example to suit your requirements.
- Update the Controller to 4.4.3 or higher if you have not already done so.
- Set up an App Server Agent in each pod on the node where you plan to install the Machine Agent.
- Create a clean directory with the following files:
- Dockerfile: Contains the instructions to build the Docker image of Machine Agent.
- machine-agent.zip: Download the Standalone Machine Agent Bundle version 4.4.3 or higher from https://download.appdynamics.com/. For this example, use the 64-bit Linux ZIP version of the installer. Rename the ZIP file to
machine-agent.zipand extract the files.
start-appdynamics.sh: Contains the instructions to start the Machine Agent in the container.
- Log in to the host where your Kubernetes master node is running.
Build the Docker image for the Machine Agent and tag it:
For more information and details on how to configure and run the Standalone Machine Agent using Docker, see Configuring Docker Visibility.
- Make this image available across your nodes.
- Prepare the YAML file to create the Daemonset to deploy the Standalone Machine Agent. Ensure that you include the following:
- Controller Properties. See Connecting to the Controller.
- Cluster Role and Cluster Role Binding to provide the Machine Agent with necessary permissions on the Kubernetes API Server.
- Volume mounts to enable the Machine Agent running inside the container to monitor host metrics and containers.
Deploy Machine Agent across your nodes by running the following:
Register each container ID as the unique host ID if multiple containers are running in the pod. For more information, see Register Container ID as the Host ID.
Connecting to the Controller
Specify the following properties in the DaemonSet, which enable the Machine Agent to connect to the Controller:
- APPDYNAMICS_CONTROLLER_HOST_NAME: The hostname or the IP address of the AppDynamics Controller. This is the same host that you use to access the AppDynamics browser-based user interface.
- APPDYNAMICS_CONTROLLER_PORT: The HTTP(S) port of the AppDynamics Controller. This is the same port that you use to access the AppDynamics browser-based user interface. AppDynamics SaaS Controller users should always set this property to 443.
- APPDYNAMICS_CONTROLLER_SSL_ENABLED: Specifies whether the agent should use SSL (HTTPS) to connect to the Controller. If SSL is enabled, set the Controller Port property to the HTTPS port of the Controller. AppDynamics SaaS Controller users should always set this property to 443.
- APPDYNAMICS_AGENT_ACCOUNT_NAME: The account name used to authenticate with the Controller. If you are using the AppDynamics SaaS Controller, the account name is provided in the Welcome email sent by AppDynamics.
- APPDYNAMICS_AGENT_ACCOUNT_ACCESS_KEY: The account access key used to authenticate with the Controller. This key is generated at installation time and can be found by viewing the license information in the Controller Settings.
- APPDYNAMICS_SIM_ENABLED: Enable Server Visibility on the Standalone Machine Agent.
- APPDYNAMICS_DOCKER_ENABLED: Enable Docker Visibility on the Machine Agent.
Sample Docker File
Here is an example Docker file to build an image of Machine Agent:
Here is an example YAML file to run Machine Agent as Daemonset across your Kubernetes nodes: