Public | Automated Build

Last pushed: a year ago
Short Description
Kubernetes AppDynamics agent example using Java Tomcat
Full Description


Example Tomcat based app with AppDynamics Java agent installed.

This example shows how to add an AppDynamics Java agent to a Java Kubernetes container

This example uses the standard tomcat:8.0 image

Inside Docker, the command to run this would be:

docker run -it --rm -p 8888:8080 tomcat:8.0

Servlet sample pages can be browsed from: http://localhost:8888/examples/servlets/

This example uses the following features:

  • AppAgent mounted as Kubernetes Volumes
  • Uses kubernetes API to set unique_host_id to be equal to the Node ID (This will then match the Node ID used with the Machine Agent)
  • Uses environment variables defined in the .yaml file to start the application

Todo items:

Steps to get this running

Download AppServerAgent

From, choose Java agent, and download the agent you want.

Create a Kubernetes volume to contain the AppDynamics agent binary. Modify the definition in pod-kubjavaex.yaml for this.

Extract the app agent into this volume. The pod-kubjavaex.yaml is setup for mounting a local folder.

Create Docker Image

Clone this repository, and create a docker image.

For Google Repository:

docker build -t$PROJECT_ID/kubjavaex:latest .

gcloud docker push$PROJECT_ID/kubjavaex:latest

Enter AppDynamics config into pod_kubjavaex.yaml

Edit pod_kubjavaex.yaml to place config values. Use for guidance.

Docker Pull Command
Source Repository