Splunk AppDynamics

Installing Machine Agent in Kubernetes Environment

Sandeep_Poonia
New Member

I have a spring boot application, deployed in AKS. I use Appynamics docker image to inject the agent into JVM via init-container. My company does not have a cluster license, and I'm unsure if or when that would be available. But the Machine Agent and Server Visibility licenses are there. So to capture server stats, I'm trying to configure the machine agent using the sidecar container approach. Below is the snippet of my deployment file

apiVersion: apps/v1
kind: Deployment
metadata:
  ...
spec:
  replicas: 2
  template:
    spec:
      initContainers:
        - name: appd-agent
          command:
            - cp
            - -ra
            - /opt/appdynamics/.
            - /opt/temp
          image: docker.io/appdynamics/java-agent:22.12.0
          imagePullPolicy: IfNotPresent
          resources:
            limits:
              cpu: 200m
              memory: 100M
            requests:
              cpu: 100m
              memory: 50M
          volumeMounts:
            - mountPath: /opt/temp
              name: appd-agent-repo
      containers:
        - name: appd-analytics-agent
          envFrom:
            - configMapRef:
                name: controller-info
          env:
            - name: APPDYNAMICS_AGENT_ACCOUNT_ACCESS_KEY
              valueFrom:
                secretKeyRef:
                  name: my-secrets
                  key: APP_D_AGENT_SECRET
          image: docker.io/appdynamics/machine-agent-analytics:23.1.0
          imagePullPolicy: IfNotPresent
          ports:
            - containerPort: 9090
              protocol: TCP
          readinessProbe:
            exec:
              command:
                - touch
                - /tmp/healthy
          livenessProbe:
            exec:
              command:
                - touch
                - /tmp/healthy
          resources:
            limits:
              cpu: 200m
              memory: 900M
            requests:
              cpu: 100m
              memory: 600M
        - name: my-non-prod-app
          image: xxx.xxx
          imagePullPolicy: Always
          resources:
            requests:
              memory: "2Gi"
              cpu: "1"
            limits:
              memory: "4Gi"
              cpu: "2"
          env:
            - name: JDK_JAVA_OPTIONS
              value: "-javaagent:/opt/temp/javaagent.jar -Djava.net.useSystemProxies=true"
            - name: APPDYNAMICS_AGENT_ACCOUNT_ACCESS_KEY
              valueFrom:
                secretKeyRef:
                  name: my-secrets
                  key: APP_D_AGENT_SECRET
          envFrom:
            - configMapRef:
                name: my-configmap
          ports:
            - containerPort: 8080
          readinessProbe:
            ...
          livenessProbe:
            ...
          volumeMounts:
            - mountPath: /opt/temp
              name: appd-agent-repo
      volumes:
        - name: appd-agent-repo
          emptyDir: { }

---
apiVersion: v1
kind: ConfigMap
data:
  APPDYNAMICS_AGENT_ACCOUNT_NAME: "my-non-prod-account"
  APPDYNAMICS_AGENT_GLOBAL_ACCOUNT_NAME: "my-non-prod-account_#####"
  APPDYNAMICS_AGENT_APPLICATION_NAME: "MyApp Dev"
  APPDYNAMICS_MACHINE_HIERARCHY_PATH: "MyApp"
  APPDYNAMICS_CONTROLLER_HOST_NAME: "my-non-prod-account.saas.appdynamics.com"
  APPDYNAMICS_CONTROLLER_PORT: "443"
  APPDYNAMICS_CONTROLLER_SSL_ENABLED: "true"
  APPDYNAMICS_SIM_ENABLED: "true"
  EVENT_ENDPOINT: "https://analytics.api.appdynamics.com:443"
metadata:
  name: controller-info

 I can see that the machine-agent container gets registered successfully and I can see the machines under Servers.

  • But here I only see the machine agent process, and no other processes
  • Is it capturing the details of its own container only or for the whole pod?

And If  I go to the Tiers & Nodes of my application:

  • There are no details under Servers there.
  • Also, the machine agent status is "Agent not installed" under the Agents tab for each node.

So it looks like the machine agent is not able to detect the nodes of my application or not able to attach to them.

Labels (1)
0 Karma

Christopher_Bo1
Engager

Hi Sandeep,

This is a bit of a 2 part-er... 

Firstly, If you have SIM licenses available, you're golden! As they also apply as the necessary license needed for the cluster agent. With this clarification, I'd say skip this work-around approach you're doing and just install the full cluster agent(s). 

Please refer to the below docs:

https://docs.appdynamics.com/appd/22.x/22.3/en/infrastructure-visibility/monitor-kubernetes-with-the...

After that, if you are not seeing things in the correct places in the controller. Ryan's instruction to submit a support ticket would be the next step.

Thanks,

Christopher

iamryan
Community Manager
Community Manager

Hi @Sandeep.Poonia,

Thanks for asking your question on Community, you may also want to reach out to AppD Support. How do I submit a Support ticket? An FAQ 

0 Karma
Get Updates on the Splunk Community!

Developer Spotlight with William Searle

The Splunk Guy: A Developer’s Path from Web to Cloud William is a Splunk Professional Services Consultant with ...

Major Splunk Upgrade – Prepare your Environment for Splunk 10 Now!

Attention App Developers: Test Your Apps with the Splunk 10.0 Beta and Ensure Compatibility Before the ...

Stay Connected: Your Guide to June Tech Talks, Office Hours, and Webinars!

What are Community Office Hours?Community Office Hours is an interactive 60-minute Zoom series where ...