elastic / elastic/apm

[Fleet integration] Kubernetes startup attach via MutatingAdmissionWebhook

Open
#385 0 comments 0 reactions 0 assignees View on GitHub
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.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.