synthetics-private-location

by Datadog

Helm chartv1.3.0App 1.76.0Verified publisherOfficial

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 set multiContainer.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, on dns.ports (default 53 UDP/TCP).
  • All other traffic is allowed, except the blocked ranges: defaultBlockedIPRanges when enableDefaultBlockedIpRanges is true, plus blockedIPRanges.
  • On Kubernetes >= 1.25 the DNS ports reach only dns.to, and the CNI must support NetworkPolicy endPort. ICMP (ping / traceroute) and DNS tests to resolvers outside dns.to / allowedIPRanges then do not work. On older Kubernetes versions DNS to other resolvers is not blocked.
  • allowedIPRanges are exceptions inside the blocked ranges, on all ports.
  • additionalEgress adds 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:

ContainerUIDConfigurable
worker501 (group 501)Yes, with securityContext.runAsUser / securityContext.runAsGroup
deno-executor502No
browser-pool65534No
traceroute-server65534No
pod fsGroup502Yes, 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 example MustRunAsRange with uidRangeMin: 501 and uidRangeMax: 65534)
  • fsGroup and supplementalGroups: 502, or the podSecurityContext.fsGroup you set
  • the NET_RAW capability when multiContainer.tracerouteServer.enabled is 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

KeyTypeDefaultDescription
affinityobject{}Allows to specify affinity for Datadog Synthetics Private Location PODs
allowCriticalInfraRequestsboolfalseLet 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.
commonLabelsobject{}Labels to apply to all resources
configConfigMapstring""Config Map that stores the configuration of the private location worker for the deployment
configFilestring"{}"JSON string containing the configuration of the private location worker
configSecretstring""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.
dnsConfigobject{}DNS Config to set to the Datadog Synthetics Private Location PODs
dnsPolicystring"ClusterFirst"DNS Policy to set to the Datadog Synthetics Private Location PODs
enableStatusProbesboolfalseEnable both liveness and readiness probes (minimal private location image version required: 1.12.0)
envlist[]Set environment variables
envFromlist[]Set environment variables from configMaps and/or secrets
extraVolumeMountslist[]Optionally specify extra list of additional volumeMounts for container
extraVolumeslist[]Optionally specify extra list of additional volumes to mount into the pod
fullnameOverridestring""Override the full qualified app name
hostAliaseslist[]Add entries to Datadog Synthetics Private Location PODs' /etc/hosts
image.pullPolicystring"IfNotPresent"Define the pullPolicy for Datadog Synthetics Private Location image
image.repositorystring"gcr.io/datadoghq/synthetics-private-location-worker"Repository to use for Datadog Synthetics Private Location image
image.tagstring"1.76.0"Define the Datadog Synthetics Private Location version to use
imagePullSecretslist[]Datadog Synthetics Private Location repository pullSecret (ex: specify docker registry credentials)
multiContainer.browserPool.adminTokenSecret.keystring"token"Key containing the admin token in the existing Secret. Restart the Deployment after rotating the token.
multiContainer.browserPool.adminTokenSecret.namestring""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.maxBrowserIdleMsint300000Reclaim a browser after this long without a request from the worker. Not a cap on test duration.
multiContainer.browserPool.maxConcurrentint20Concurrent 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.resourcesobject{"limits":{"cpu":"2","memory":"6Gi"},"requests":{"cpu":"2","memory":"6Gi"}}Resource requests/limits for the browser-pool container
multiContainer.browserPool.shmSizeLimitstring"2Gi"Size of the in-memory /dev/shm volume. The runtime default (64Mi) crashes renderers on heavier pages.
multiContainer.denoExecutor.maxConcurrentint10Concurrent deno run processes per replica. Past it the worker retries the run.
multiContainer.denoExecutor.resourcesobject{"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.enabledboolfalseRun 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.additionalEgresslist[]Additional standard NetworkPolicy egress rules, for example access to an upstream proxy. These exceptions take precedence over blocked ranges.
multiContainer.networkPolicy.allowedIPRangesobject{"IPv4":[],"IPv6":[]}CIDRs that stay reachable even when inside a blocked range
multiContainer.networkPolicy.blockedIPRangesobject{"IPv4":[],"IPv6":[]}Additional CIDRs to block, added to defaultBlockedIPRanges
multiContainer.networkPolicy.createbooltrueCreate 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.criticalInfraIPRangesobject{"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.defaultBlockedIPRangesobject`{"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.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartsynthetics-private-location is pinned at v1.3.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. 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