elastic / elastic/elastic-agent

elastic-agent helm chart ability to override securityContext runAs values

Open
#11,987 1 comment 0 reactions 0 assignees View on GitHub
Team:Elastic-Agent-Control-Plane
Dominant language
Go
Stars
275
Forks
264
Avg merge
1d 23h
Merged PRs (30d)
312

Description

**Describe the enhancement:**
In the https://github.com/elastic/elastic-agent/blob/main/deploy/helm/elastic-agent/templates/agent/_helpers.tpl template, there is code to set the securityContext.runAsUser and runAsGroup to 1000 if agent.unprivileged is true and to 0 if it is false. There does not seem to be the ability to add a securityContext object to the preset and specify our own unprivileged values. Our company has a mandated range and 1000 is not in that range. Suggesting to check if securityContext exists in the preset. If so, and unprivileged is true, use the values if they exist in that securityContext object; otherwise use 1000.

**Describe a specific use case for the enhancement or feature:**
We need to set the runAsUser/runAsGroup to values that are valid for our organization. 1000 is not valid, needs to be in a range of 1001430000 to 1001439999.

**What is the definition of done?**
The _helpers.tpl template allows explicit overrides of securityContext.runAsUser and securityContext.runAsGroup.

Contributor guide

Open the contributing guide

Research direction

Start in deploy/helm/elastic-agent/templates/agent/_helpers.tpl and review how the preset is overridden through values.yaml. Add explicit securityContext.runAsUser and securityContext.runAsGroup values to a preset, then verify that the resulting deployment honors them instead of the defaults when unprivileged mode is enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
helm
Domain
devops
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.