Configure the webhook with a Helm values fileedit

The APM Attacher’s webhook can be installed from a Helm chart. You can provide a custom webhook configuration using a Helm values file. Elastic provides a custom.yaml file as a starting point.

This sample custom.yaml file instruments a pod with the Elastic APM Java agent:

apm:
  secret_token: SuP3RT0K3N 
  namespaces: 
    - default
    - my-name-space-01
    - my-name-space-02
webhookConfig:
  agents:
    java: 
      environment:
        ELASTIC_APM_SERVER_URL: "https://apm-example.com:8200" 
        ELASTIC_APM_ENVIRONMENT: "prod"
        ELASTIC_APM_LOG_LEVEL: "info"

The secret_token for your deployment. Use api_key if using an API key instead.

If you’re using a secret token or API key to secure your deployment, you must list all of the namespaces where you want to auto-instrument pods. The secret token or API key will be stored as Kubernetes Secrets in each namespace.

Fields written here are merged with pre-existing fields in values.yaml

Elastic APM agent environment variables—for example, the APM Server URL, which specifies the URL and port of your APM integration or server.

This sample custom.yaml file instruments a pod with the Elastic APM Node.js agent:

apm:
  secret_token: SuP3RT0K3N 
  namespaces: 
    - default
    - my-name-space-01
    - my-name-space-02
webhookConfig:
  agents:
    nodejs: 
      environment:
        ELASTIC_APM_SERVER_URL: "https://apm-example.com:8200" 
        ELASTIC_APM_ENVIRONMENT: "prod"
        ELASTIC_APM_LOG_LEVEL: "info"

The secret_token for your deployment. Use api_key if using an API key instead.

If you’re using a secret token or API key to secure your deployment, you must list all of the namespaces where you want to auto-instrument pods. The secret token or API key will be stored as Kubernetes Secrets in each namespace.

Fields written here are merged with pre-existing fields in values.yaml

Elastic APM agent environment variables—for example, the APM Server URL, which specifies the URL and port of your APM integration or server.

The examples above assume that you want to use the latest version of the Elastic APM agent. Advanced users may want to pin a version of the agent or provide a custom build. To do this, set your own image, artifact, and environment.*OPTIONS fields. Copy the formatting from values.yaml.

Expiring and rotating API keys will need to update the custom.yaml, upgrade the helm install with the new custom.yaml, and cycle running pods in a similar way to other deployment definition changes.