cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Abhi.Bajaj
AppDynamics Team

Having the flexibility to use different AccessKey for different applications you auto-instrument with Cluster Agent is essential.

This flexibility was introduced with the latest versions of the Cluster agent.

Follow these steps:

  1. Un-instrument your application.
  2. Create a new secret with the accessKey with the below command:
    kubectl -n appdynamics create secret generic <secret-name> --from-literal=<custom-Controller-key-name>=<key-value>​
  3. In this command <key-value> will be your AccessKey. For example:
    kubectl -n appdynamics create secret generic abhi-java-apps --from-literal=controller-key=xxxxx-fb91-4dfc-895a-xxxxx​
  4. I modified my yaml and in the specific instrumentationRule section I added:
    - namespaceRegex: abhi-java-apps
          language: java
          matchString: tomcat-app-abhi-non-root
          appNameLabel: app
          runAsUser: 1001
          runAsGroup: 1001
          customSecretName: abhi-java-apps
          customSecretKey: controller-key
          imageInfo:
            image: "docker.io/appdynamics/java-agent:latest"
            agentMountPath: /opt/appdynamics
            imagePullPolicy: Always​
  5. customSecretName is the secret name and customSecretKey is the Key for that secret. After this, I re-instrumented my application, and in the Cluster agent logs I confirmed
    [INFO]: 2024-08-19 14:45:09 - deploymenthandler.go:262 - custom secretName is %s  and is %s %!(EXTRA string=abhi-java-apps, string=controller-key)​
  6. Also, when I exec inside the application pod and grepped for env | grep -i Access, i confirmed that this AccessKey is used:
    wso2carb@tomcat-app-abhi-non-root-5d558dddf4-rllzc:/usr/local/tomcat/webapps$ env | grep -i Access
    APPDYNAMICS_AGENT_ACCOUNT_ACCESS_KEY=xxxxx-fb91-4dfc-895a-xxxxx
    JAVA_TOOL_OPTIONS=-Xmx512m -Dappdynamics.agent.accountAccessKey=xxxxx-fb91-4dfc-895a-xxxxx -Dappdynamics.agent.reuse.nodeName=true -Dappdynamics.socket.collection.bci.enable=true -javaagent:/opt/appdynamics-java/javaagent.jar​

Additional Resources

 

 

Version history
Last update:
‎08-19-2024 10:37 AM
Updated by:
Join Us On December 10
Learn how Splunk and AppDynamics are redefining observability


Register Now!

Observe and Explore
Dive into our Community Blog for the Latest Insights and Updates!


Read the blog here