Best Practices to Configure Agents in Kubernetes
This page describes best practices to use when configuring App Server Agents in a Kubernetes environment and manually instrumenting applications using init containers or a Dockerfile.
You can configure App Server Agents in Kubernetes using environment variables. Depending on the use case, you have three options to set environment variables:
- Use ConfigMaps to Configure the App Server Agent
- Use Secrets for the Controller Access Key
- Set Application-Specific Configuration in the Deployment Spec
See the language-specific container installation page to implement these best practices:
Gather Login Credentials
To access Splunk AppDynamics, you need your login credentials and the URL from where you can access your organization's Splunk AppDynamics Controllers. If you do not have this information, contact your Splunk AppDynamics administrator.
Use ConfigMaps to Configure the App Server Agent
When instrumenting a container running in Kubernetes, each App Server Agent requires that you set environment variables to configure:
- Connection parameters
- Application metadata
- Agent behavior
You can use ConfigMaps to store an application's environment variables in a Kubernetes object within the scope of a namespace. ConfigMaps are an optimal twelve-factormethod used to manage agent configuration shared across multiple Kubernetes applications within a namespace.
Controller credentials configuration is stored in a single ConfigMap, and shared with each application in the namespace that reports to that Controller. If you use multiple Controllers across different environments, such as development, test, and production, you can store different ConfigMaps in the namespaces associated with those environments.
Use Secrets for the Controller Access Key
The Controller access key is another configuration that you can pass to App Server Agents
as an environment variable. Sensitive data is stored in a Kubernetes namespace using a
Secret, rather than a ConfigMap
. You can use Kubernetes Secrets to obfuscate values
rather than manipulate them in plaintext.
Set Application-Specific Configuration in the Deployment Spec
The Splunk AppDynamics Controller application tier name identifies a service that reports under a particular Splunk AppDynamics application. An application tier name is an example of agent configuration that is different for each Kubernetes application but typically does not vary across environments and namespaces. Application-specific configuration, similar to the tier name, is easier to define in the Kubernetes deployment spec directly.
Verify the Environment Variables
After you set the agent environment variables, you can verify that they were added to your application. To verify the environment variables: