Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 21 additions & 19 deletions content/en/containers/kubernetes/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,18 @@

### Unprivileged installation

To run an unprivileged installation, add the following `securityContext` to your configuration relative to your desired `<USER_ID>` and `<GROUP ID>`:

- Replace `<USER_ID>` with the UID to run the Datadog Agent. Datadog recommends setting this value to `100` for the preexisting `dd-agent` user [for Datadog Agent v7.48+][26].
- Replace `<GROUP_ID>` with the group ID that owns the Docker or containerd socket.

This sets the `securityContext` at the pod level for the Agent.

{{< tabs >}}
{{% tab "Datadog Operator" %}}
To run an unprivileged installation, add the following to `datadog-agent.yaml`:

{{< highlight yaml "hl_lines=13-18" >}}
{{< highlight yaml "hl_lines=14-19" >}}

Check notice on line 169 in content/en/containers/kubernetes/installation.md

View workflow job for this annotation

GitHub Actions / vale

Datadog.sentencelength

Suggestion: Try to keep your sentence length to 25 words or fewer.
apiVersion: datadoghq.com/v2alpha1
kind: DatadogAgent
metadata:
Expand All @@ -172,18 +179,14 @@
apiSecret:
secretName: datadog-secret
keyName: api-key
agent:
config:
securityContext:
runAsUser: <USER_ID>
supplementalGroups:
- <GROUP_ID>
{{< /highlight >}}

- Replace `<USER_ID>` with the UID to run the Datadog Agent. Datadog recommends [setting this value to 100 since Datadog Agent v7.48+][1].
- Replace `<GROUP_ID>` with the group ID that owns the Docker or containerd socket.

[1]: /data_security/kubernetes/#running-container-as-root-user
override:
nodeAgent:
securityContext:
runAsUser: <USER_ID>
supplementalGroups:
- <GROUP_ID>
{{< /highlight >}}

Then, deploy the Agent:

Expand All @@ -195,19 +198,17 @@
{{% tab "Helm" %}}
To run an unprivileged installation, add the following to your `datadog-values.yaml` file:

{{< highlight yaml "hl_lines=4-7" >}}
{{< highlight yaml "hl_lines=5-8" >}}
datadog:
apiKeyExistingSecret: datadog-secret
clusterName: <CLUSTER_NAME>
site: <DATADOG_SITE>
securityContext:
runAsUser: <USER_ID>
supplementalGroups:
- <GROUP_ID>
runAsUser: <USER_ID>
supplementalGroups:
- <GROUP_ID>
{{< /highlight >}}

- Replace `<USER_ID>` with the UID to run the Datadog Agent.
- Replace `<GROUP_ID>` with the group ID that owns the Docker or containerd socket.

Then, deploy the Agent:

```shell
Expand Down Expand Up @@ -339,3 +340,4 @@
[23]: https://app.datadoghq.com/orchestration/resource/pod
[24]: /infrastructure/containers/orchestrator_explorer
[25]: /infrastructure/containers/kubernetes_resource_utilization
[26]: /data_security/kubernetes/#running-container-as-root-user
Loading