[Fleet integration] Kubernetes startup attach via MutatingAdmissionWebhook
- Dominant language
- Gherkin
- Stars
- 427
- Forks
- 125
- PR merge metrics
- No merged PRs in 30d
Description
Supported agents: Java, .NET, Node.js
For Kubernetes, we can provide users with a seamless onboarding experience experience that does not require any code or configuration changes.
Kubernetes has the concept of [MutatingAdmissionWebhooks](https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/). This allows to change the configuration of pods before they are started. APM Server could provide a webhook endpoint that receives the pod configuration as a yml file and modify it to add the language-specific startup attach environment variable (`JAVA_TOOL_OPTIONS`/ `DOTNET_STARTUP_HOOKS` / `NODE_OPTIONS`), `ELASTIC_APM_SERVER_URL`, `ELASTIC_APM_API_KEY` (from Kubernetes secrets).
The binaries of the agents can be placed into a shared volume so the pods have access to them.
By default, all agents will be added to all pods as there is no harm in setting NODE_OPTIONS on a MySql or Java pod, for example. Optionally, users can define include/exclude rules to control which agent should be attached to which pod, based on the existence or absence of particular labels, for example.
Depends on #382 #383 #384
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.