synthetics-private-location
by Datadog
Datadog Synthetics Private Location
About this chart
Datadog Synthetics Private Location
Datadog is a hosted infrastructure monitoring platform. This chart adds a Datadog Synthetics Private Location Deployment. For more information about synthetics monitoring with Datadog, please refer to the Datadog documentation website.
How to use Datadog Helm repository
You need to add this repository to your Helm repositories:
helm repo add datadog https://helm.datadoghq.com
helm repo update
Quick start
To install the chart with the release name <RELEASE_NAME>, retrieve your Private Location configuration file from your Synthetics Private Location settings page and save it under config.json then run:
helm install <RELEASE_NAME> datadog/synthetics-private-location --set-file configFile=config.json
Multi-container deployment
Set multiContainer.enabled=true to run the worker, deno-executor, browser-pool and traceroute-server as separate containers in one pod, without sudo, NET_ADMIN or privilege escalation. This works on clusters that enforce allowPrivilegeEscalation: false and readOnlyRootFilesystem: true.
This mode requires a private location image version >= 1.75.0.
Create the browser-pool admin token Secret in the release namespace before installing. openssl rand -hex 32 generates 32 random bytes:
kubectl -n <NAMESPACE> create secret generic pl-browser-pool \
--from-literal=token="$(openssl rand -hex 32)"
Then install the chart with the same Secret name:
helm install <RELEASE_NAME> datadog/synthetics-private-location \
--namespace <NAMESPACE> \
--set-file configFile=config.json \
--set image.tag=1.75.0 \
--set multiContainer.enabled=true \
--set multiContainer.browserPool.adminTokenSecret.name=pl-browser-pool \
--set 'multiContainer.networkPolicy.dns.to[0].namespaceSelector.matchLabels.kubernetes\.io/metadata\.name=kube-system' \
--set 'multiContainer.networkPolicy.dns.to[0].podSelector.matchLabels.k8s-app=kube-dns'
On clusters that enforce the restricted Pod Security Standard, set multiContainer.tracerouteServer.enabled=false. Traceroute features are then not available.
Firewall Changes
The worker cannot apply its iptables firewall in this mode, so multiContainer.networkPolicy.create defaults to true:
true(default): the chart creates an egress NetworkPolicy that blocks reserved ranges. You must setmultiContainer.networkPolicy.dns.to. This requires a CNI that enforces NetworkPolicies.false: the chart creates no policy. You are responsible for egress enforcement.
How the policy decides:
- DNS goes to
dns.to, ondns.ports(default 53 UDP/TCP). - All other traffic is allowed, except the blocked ranges:
defaultBlockedIPRangeswhenenableDefaultBlockedIpRangesis true, plusblockedIPRanges. - On Kubernetes >= 1.25 the DNS ports reach only
dns.to, and the CNI must support NetworkPolicyendPort. ICMP (ping / traceroute) and DNS tests to resolvers outsidedns.to/allowedIPRangesthen do not work. On older Kubernetes versions DNS to other resolvers is not blocked. allowedIPRangesare exceptions inside the blocked ranges, on all ports.additionalEgressadds raw NetworkPolicy rules, for example to open an exception on one port only.
Example 1: block private ranges, with exceptions.
multiContainer:
# ...
networkPolicy:
create: true
dns:
to:
# Cluster DNS. Check that these labels match your cluster.
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: kube-system
podSelector:
matchLabels:
k8s-app: kube-dns
enableDefaultBlockedIpRanges: true # Blocks private and reserved ranges (default)
blockedIPRanges:
IPv4:
- 1.2.3.4 # Example public IP to also block. A bare IP means /32.
allowedIPRanges:
IPv4:
- 10.1.2.0/24 # Internal subnet inside the blocked 10.0.0.0/8, all ports
additionalEgress:
# Upstream proxy. Only this port is opened.
- to:
- ipBlock:
cidr: 10.20.30.40/32
ports:
- protocol: TCP
port: 3128
Example 2: allow only specific destinations.
multiContainer:
# ...
networkPolicy:
create: true
dns:
to:
- ipBlock:
cidr: 169.254.20.10/32 # NodeLocal DNS. Use your resolver address.
blockedIPRanges:
IPv4:
- 0.0.0.0/0 # Block everything. The chart then drops the allow-all rule.
IPv6:
- ::/0
allowedIPRanges:
IPv4:
- 203.0.113.0/24 # Then allow only these. Add the Datadog ranges for your site.
The worker must still reach Datadog. Also allow the Datadog IP ranges for your site, or send traffic through a proxy with additionalEgress.
OpenShift
Set multiContainer.podSecurity.securityContextConstraints.create=true to create the SCC the pod needs. This requires cluster-admin permissions.
helm install <RELEASE_NAME> datadog/synthetics-private-location \
--set-file configFile=config.json \
--set image.tag=1.75.0 \
--set multiContainer.browserPool.adminTokenSecret.name=pl-browser-pool \
--set 'multiContainer.networkPolicy.dns.to[0].namespaceSelector.matchLabels.kubernetes\.io/metadata\.name=openshift-dns' \
--set 'multiContainer.networkPolicy.dns.to[0].podSelector.matchLabels.dns\.operator\.openshift\.io/daemonset-dns=default' \
--set-json 'multiContainer.networkPolicy.dns.ports=[{"port":5353,"protocol":"UDP"},{"port":5353,"protocol":"TCP"}]' \
--set multiContainer.enabled=true \
--set multiContainer.podSecurity.securityContextConstraints.create=true
The pod runs each container with a fixed non-root UID:
| Container | UID | Configurable |
|---|---|---|
| worker | 501 (group 501) | Yes, with securityContext.runAsUser / securityContext.runAsGroup |
| deno-executor | 502 | No |
| browser-pool | 65534 | No |
| traceroute-server | 65534 | No |
pod fsGroup | 502 | Yes, with podSecurityContext.fsGroup |
podSecurityContext.runAsUser has no effect because every container sets its own runAsUser.
The default restricted-v2 SCC does not work with this layout. It only allows UIDs from the project range (for example 1000680000/10000), and the deno-executor and browser-pool UIDs cannot be moved into it. Use the chart SCC, or a custom SCC that allows:
runAsUser: 501, 502 and 65534 (for exampleMustRunAsRangewithuidRangeMin: 501anduidRangeMax: 65534)fsGroupandsupplementalGroups: 502, or thepodSecurityContext.fsGroupyou set- the
NET_RAWcapability whenmultiContainer.tracerouteServer.enabledis true
OpenShift DNS pods listen on port 5353, so set dns.ports to 5353 when the NetworkPolicy is created.
multiContainer:
networkPolicy:
create: true
dns:
to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: openshift-dns
podSelector:
matchLabels:
dns.operator.openshift.io/daemonset-dns: default
ports:
- port: 5353
protocol: UDP
- port: 5353
protocol: TCP
Values
| Key | Type | Default | Description |
|---|---|---|---|
| affinity | object | {} | Allows to specify affinity for Datadog Synthetics Private Location PODs |
| allowCriticalInfraRequests | bool | false | Let tests reach critical infrastructure: Vault, Consul, Nomad, the Kubernetes API, kubelet, etcd and Docker Engine. The worker blocks these requests by default (minimal private location image version required: 1.77.0). Sets DATADOG_ALLOW_CRITICAL_INFRA_REQUESTS on the worker, which overrides allowCriticalInfraRequests in the configuration file. In multi-container mode, false also blocks multiContainer.networkPolicy.criticalInfraIPRanges in the NetworkPolicy. |
| commonLabels | object | {} | Labels to apply to all resources |
| configConfigMap | string | "" | Config Map that stores the configuration of the private location worker for the deployment |
| configFile | string | "{}" | JSON string containing the configuration of the private location worker |
| configSecret | string | "" | Name of the secret that stores the configuration of the private location worker for the deployment. Use it only if you want to manage the secret outside of the Helm chart as using configFile will create a secret. The data inside the secret needs to have the key synthetics-check-runner.json. |
| dnsConfig | object | {} | DNS Config to set to the Datadog Synthetics Private Location PODs |
| dnsPolicy | string | "ClusterFirst" | DNS Policy to set to the Datadog Synthetics Private Location PODs |
| enableStatusProbes | bool | false | Enable both liveness and readiness probes (minimal private location image version required: 1.12.0) |
| env | list | [] | Set environment variables |
| envFrom | list | [] | Set environment variables from configMaps and/or secrets |
| extraVolumeMounts | list | [] | Optionally specify extra list of additional volumeMounts for container |
| extraVolumes | list | [] | Optionally specify extra list of additional volumes to mount into the pod |
| fullnameOverride | string | "" | Override the full qualified app name |
| hostAliases | list | [] | Add entries to Datadog Synthetics Private Location PODs' /etc/hosts |
| image.pullPolicy | string | "IfNotPresent" | Define the pullPolicy for Datadog Synthetics Private Location image |
| image.repository | string | "gcr.io/datadoghq/synthetics-private-location-worker" | Repository to use for Datadog Synthetics Private Location image |
| image.tag | string | "1.76.0" | Define the Datadog Synthetics Private Location version to use |
| imagePullSecrets | list | [] | Datadog Synthetics Private Location repository pullSecret (ex: specify docker registry credentials) |
| multiContainer.browserPool.adminTokenSecret.key | string | "token" | Key containing the admin token in the existing Secret. Restart the Deployment after rotating the token. |
| multiContainer.browserPool.adminTokenSecret.name | string | "" | Required in multi-container mode. Existing Secret containing a cryptographically random browser-pool admin token (at least 32 random bytes), shared by the worker and browser-pool. Created and rotated outside this chart. |
| multiContainer.browserPool.maxBrowserIdleMs | int | 300000 | Reclaim a browser after this long without a request from the worker. Not a cap on test duration. |
| multiContainer.browserPool.maxConcurrent | int | 20 | Concurrent browsers per replica. Past it the worker waits for a slot. Keep it at about twice the worker concurrency (default 10) and size browserPool.resources to match. |
| multiContainer.browserPool.resources | object | {"limits":{"cpu":"2","memory":"6Gi"},"requests":{"cpu":"2","memory":"6Gi"}} | Resource requests/limits for the browser-pool container |
| multiContainer.browserPool.shmSizeLimit | string | "2Gi" | Size of the in-memory /dev/shm volume. The runtime default (64Mi) crashes renderers on heavier pages. |
| multiContainer.denoExecutor.maxConcurrent | int | 10 | Concurrent deno run processes per replica. Past it the worker retries the run. |
| multiContainer.denoExecutor.resources | object | {"limits":{"cpu":"200m","memory":"1Gi"},"requests":{"cpu":"200m","memory":"1Gi"}} | Resource requests/limits for the deno-executor container. Each JS-using test step uses ~30-50Mi. |
| multiContainer.enabled | bool | false | Run the worker, deno-executor, browser-pool and traceroute-server as separate containers in one pod, none using sudo, NET_ADMIN or allowPrivilegeEscalation. Requires a private location image version >= 1.75.0. podSecurityContext applies to the pod and securityContext to the worker container, merged over hardened defaults. |
| multiContainer.networkPolicy.additionalEgress | list | [] | Additional standard NetworkPolicy egress rules, for example access to an upstream proxy. These exceptions take precedence over blocked ranges. |
| multiContainer.networkPolicy.allowedIPRanges | object | {"IPv4":[],"IPv6":[]} | CIDRs that stay reachable even when inside a blocked range |
| multiContainer.networkPolicy.blockedIPRanges | object | {"IPv4":[],"IPv6":[]} | Additional CIDRs to block, added to defaultBlockedIPRanges |
| multiContainer.networkPolicy.create | bool | true | Create a pod-wide egress NetworkPolicy in multi-container mode. Set false to create none and leave egress enforcement to the operator. Requires a CNI that enforces NetworkPolicies. Other policies can broaden access; ICMP filtering is CNI-dependent. |
| multiContainer.networkPolicy.criticalInfraIPRanges | object | {"IPv4":[],"IPv6":[]} | CIDRs blocked when allowCriticalInfraRequests is false, added to the blocked ranges. Add the addresses of your Vault servers, Kubernetes API server or cloud metadata (for example 169.254.169.254/32). A NetworkPolicy cannot deny, so allowedIPRanges, dns.to and additionalEgress can still grant access to them. The worker's own block, by request path, headers and the in-cluster API server address, takes precedence over every allowed range. |
| multiContainer.networkPolicy.defaultBlockedIPRanges | object | `{"IPv4":["0.0.0.0/8","10.0.0.0/8","100.64.0.0/10","127.0.0.0/8","169.254.0.0/16","172.16.0.0/12","192.0.0.0/24","192.0.0.0/29","192.0.0.8/32","192.0.0.9/32","192.0.0.10/32","192.0.0.170/32","192.0.0.171/32","192.0.2.0/24","192.31.196.0/24","192.52.1 |
Deploy synthetics-private-location with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has synthetics-private-location on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartsynthetics-private-location is pinned at v1.3.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply