private-action-runner
by Datadog
Datadog Private Action Runner
About this chart
Datadog Private Action Runner
Overview
This Helm Chart deploys the Datadog Private Action Runner inside a Kubernetes cluster. The Private Action Runner enables you to:
- Execute private actions from Datadog Workflow Automation
- Run App Builder actions
- Interact with resources in your Kubernetes cluster
- Connect to internal services that aren't accessible from the public internet
Prerequisites
Before installing the chart, ensure you have:
- Kubernetes cluster running
kubectlCLI installed and configured to access your clusterhelmCLI installed- Appropriate permissions in your Kubernetes environment to create resources like Deployments, Services, and RBAC objects
Installation
Add the Datadog Helm Repository
helm repo add datadog https://helm.datadoghq.com
helm repo update
Create a Private Action Runner in Datadog
- Go to the Private Action Runner tab in your Datadog account
- Click "New Private Action Runner"
- Configure your runner and select the list of actions you want to enable
- Select "Kubernetes" as the deployment method
- Note the config that gets printed in your terminal (URN, privateKey, baseUrl, actionsAllowlist, etc.)
Install the Chart
Create a values.yaml file with your runner configuration (see the examples/values.yaml for a complete example):
runner:
config:
urn: "YOUR_RUNNER_URN"
privateKey: "YOUR_RUNNER_PRIVATE_KEY"
Install the chart:
helm install <RELEASE_NAME> datadog/private-action-runner -f values.yaml
Verify the Installation
Check that the runner pod is running:
kubectl get pods -l app.kubernetes.io/instance=<RELEASE-NAME>
Upgrading
Upgrading from 0.x to 1.0.0
Important: Version 1.0.0 introduces breaking changes to the values.yaml structure. If you're upgrading from version 0.x, please follow the dedicated upgrade UPGRADING.md guide.
General Upgrade Process
To upgrade to the latest version:
helm repo update
helm upgrade <RELEASE_NAME> datadog/private-action-runner -f values.yaml
Usage
Using Connection Credentials
To use private actions that require credentials:
- Configure connection credentials in your
values.yamlfile - Update your Helm release:
helm upgrade <RELEASE_NAME> datadog/private-action-runner -f values.yaml
- Create the connection in Datadog
Using Kubernetes Actions
To enable Kubernetes actions:
- Go to the Workflow connections page
- Create a new connection, select your private action runner, and use Service account authentication
- Enable the actions you want in your
values.yamlfile:
runner:
kubernetesActions:
pods: ["get", "list"]
deployments: ["get", "list", "create", "update"]
- Pick the appropriate role type for your runner. The
roleTypedetermines the permissions granted to the runner in your Kubernetes cluster.
- Role: Grants permissions only in the namespace where the runner is deployed.
- ClusterRole: Grants permissions across the entire cluster.
Example configuration:
runner:
roleType: "Role"
- Update your Helm release
helm upgrade <RELEASE_NAME> datadog/private-action-runner -f values.yaml
Going Further
- Learn more about Kubernetes RBAC
- Deploy several runners with different permissions for different teams or environments
- Learn more about Private actions
OpenShift Deployment
Enabling Security Context Constraints
When deploying on OpenShift, you need to configure Security Context Constraints (SCC) to ensure the runner pods have the necessary permissions to function properly.
Enable the creation of a custom SCC by setting the following in your values.yaml:
runner:
podSecurity:
securityContextConstraints:
create: true
Configuration Example
Here's a complete example for deploying on OpenShift:
runner:
config:
urn: "YOUR_RUNNER_URN"
privateKey: "YOUR_RUNNER_PRIVATE_KEY"
# Enable SCC creation for OpenShift
podSecurity:
securityContextConstraints:
create: true
# Configure security settings as needed
privileged: false
# Adjust capabilities if required by your use case
capabilities: []
# Required dropped capabilities (can be customized)
requiredDropCapabilities:
- KILL
- MKNOD
- SETUID
- SETGID
# SELinux context configuration
seLinuxContext:
type: MustRunAs
# Allowed volume types
volumes:
- configMap
- csi
- downwardAPI
- emptyDir
- ephemeral
- persistentVolumeClaim
- projected
- secret
Deploy on OpenShift
Once you have configured your values.yaml file with the OpenShift-specific settings, install the chart:
helm install <RELEASE_NAME> datadog/private-action-runner -f values.yaml
The chart will automatically create a SecurityContextConstraints resource that allows the Private Action Runner pods to run with the necessary permissions while maintaining security best practices.
You can access the SecurityContextConstraints resource by running:
kubectl get scc private-action-runner-scc -o yaml
Advanced Configuration
Using Kubernetes Secrets for Runner Identity
For enhanced security, you can store the runner's identity (URN and private key) in a Kubernetes secret instead of in the values.yaml file:
# Create a secret with runner's private key and urn
kubectl create secret generic runner-identity \
--from-literal RUNNER_URN=YOUR_RUNNER_URN \
--from-literal RUNNER_PRIVATE_KEY=YOUR_RUNNER_PRIVATE_KEY
# Alternatively, store only the private key in the secret
kubectl create secret generic <secret-name> \
--from-literal RUNNER_PRIVATE_KEY=YOUR_RUNNER_PRIVATE_KEY
Then reference this secret in your values.yaml:
runner:
runnerIdentitySecret: "runner-identity"
config:
# When using runnerIdentitySecret, you can omit these values
# urn: "YOUR_RUNNER_URN" # Only needed if not in the secret
# privateKey: "YOUR_RUNNER_PRIVATE_KEY"
Using Kubernetes Secrets for Credentials
You can also store connection credentials in Kubernetes secrets:
# Create a secret with multiple credential files
kubectl create secret generic action-credentials \
--from-literal jenkins_token.json='{"auth_type": "Token Auth", "credentials": [{"tokenName": "username", "tokenValue": "USERNAME"}, {"tokenName": "token", "tokenValue": "TOKEN"}, {"tokenName": "domain", "tokenValue": "DOMAIN" }]}' \
--from-literal gitlab_token.json='{"auth_type": "Token Auth", "credentials": [{"tokenName": "baseURL", "tokenValue": "GITLAB_BASE_URL"}, {"tokenName": "gitlabApiToken", "tokenValue": "GITLAB_API_TOKEN"}]}'
# Or create separate secrets for different services
kubectl create secret generic jenkins-credentials \
--from-literal jenkins_token.json='{"auth_type": "Token Auth", "credentials": [{"tokenName": "username", "tokenValue": "USERNAME"}, {"tokenName": "token", "tokenValue": "TOKEN"}, {"tokenName": "domain", "tokenValue": "DOMAIN" }]}'
Reference these secrets in your values.yaml:
runner:
credentialSecrets:
# Mount all files from the secret at /etc/dd-action-runner/config/credentials/gitlab/
- secretName: gitlab-credentials
directoryName: "gitlab"
# Mount files in a subdirectory at /etc/dd-action-runner/config/credentials/jenkins/
- secretName: jenkins-credentials
directoryName: "jenkins"
Using Custom Scripts
The Run Predefined Script Action can run inline commands by creating a script configuration file, but it can also run more advanced custom scripts. The Private Action Runner supports custom scripts via the runner.scriptFiles parameter. Scripts are mounted in /home/scriptuser/ directory.
Example
runner:
credentialFiles:
- fileName: "script.yaml"
data: |
schemaId: script-credentials-v1
runPredefinedScript:
echoInBash:
command: ["bash", "/home/scriptuser/hello-from-bash.sh"]
scriptFiles:
- fileName: "hello-from-bash.sh"
data: |
#!/bin/bash
echo "Hello World from bash!"
Architecture
The Private Action Runner Helm chart deploys the following components:
- Deployment: Runs the Private Action Runner container
- Service: Exposes the runner's HTTP endpoint for health checks and App Builder mode
- ServiceAccount: Identity used by the runner to interact with the Kubernetes API
- Role/ClusterRole: Defines permissions for the runner to perform Kubernetes actions
- RoleBinding/ClusterRoleBinding: Associates the ServiceAccount with the Role/ClusterRole
- Secret: Stores the runner configuration and credentials
Troubleshooting
-
Check if the pod is running:
kubectl get pods -l app.kubernetes.io/instance=<RELEASE-NAME> -
Check the pod logs for connection issues:
kubectl logs -l app.kubernetes.io/instance=<RELEASE-NAME> -
Verify that the URN and private key are correct in your values.yaml or secret
Connection Credential Issues
If actions requiring credentials fail:
-
Verify that your credential files are properly formatted
-
Check that the credentials are mounted correctly in the pod:
kubectl exec <pod-name> -- ls /etc/dd-action-runner/config/credentials/ ## Depending on how you pass the credentials they might appear in a different directory kubectl exec <pod-name> -- ls /etc/dd-action-runner/config -
Check the pod logs for credential-related errors
Values
| Key | Type | Default | Description |
|---|---|---|---|
| $schema | string | "./values.schema.json" | Schema for the values file, enables support in Jetbrains IDEs. You should probably use https://raw.githubusercontent.com/DataDog/helm-charts/refs/heads/main/charts/private-action-runner/values.schema.json. |
| deployment | object | {"metadata":{"annotations":{},"labels":{}}} | Deployment configuration |
| deployment.metadata.annotations | object | {} | Annotations to add to the deployment metadata |
| deployment.metadata.labels | object | {} | Labels to add to the deployment metadata |
| fullnameOverride | string | "" | Override the full qualified app name |
| image | object | {"pullPolicy":"IfNotPresent","repository":"gcr.io/datadoghq/private-action-runner","tag":"v1.22.2"} | Current Datadog Private Action Runner image |
| imagePullSecrets | list | [] | Datadog Private Action Runner repository pullSecret (ex: specify docker registry credentials) |
| nameOverride | string | "" | Override name of app |
| runner.affinity | object | {} | Kubernetes affinity settings for the runner pods |
| runner.config | object | {"actionsAllowlist":[],"allowIMDSEndpoint":false,"ddBaseURL":"https://app.datadoghq.com","httpTimeoutSeconds":30,"modes":["workflowAutomation","appBuilder"],"port":9016,"privateKey":"CHANGE_ME_PRIVATE_KEY_FROM_CONFIG","tags":[],"taskTimeoutSeconds":0,"urn":"CHANGE_ME_URN_FROM_CONFIG"} | Configuration for the Datadog Private Action Runner |
| runner.config.actionsAllowlist | list | [] | List of actions that the Datadog Private Action Runner is allowed to execute |
| runner.config.allowIMDSEndpoint | bool | false | Whether to allow the runner to access IDM services endpoint |
| runner.config.ddBaseURL | string | "https://app.datadoghq.com" | Datadog site URL. See https://docs.datadoghq.com/getting_started/site/#access-the-datadog-site |
| runner.config.httpTimeoutSeconds | int | 30 | Global http client timeout for http based actions. |
| runner.config.modes | list | ["workflowAutomation","appBuilder"] | Modes that the runner can run in |
| runner.config.port | int | 9016 | Port for HTTP server liveness checks and App Builder mode |
| runner.config.privateKey | string | "CHANGE_ME_PRIVATE_KEY_FROM_CONFIG" | The runner's privateKey from the enrollment page |
| runner.config.tags | list | [] | List of tags to be added to metrics and logs published by the runner. The tags must be specified in a 'key:value' format. |
| runner.config.taskTimeoutSeconds | int | 0 | Global timeout for task executions. Use 0 for no timeout. |
| runner.config.urn | string | "CHANGE_ME_URN_FROM_CONFIG" | The runner's URN from the enrollment page |
| runner.configDirectory | string | "/etc/dd-action-runner/config" | The directory containing the Datadog Private Action Runner configuration |
| runner.credentialFiles | list | [] | List of credential files to be used by the Datadog Private Action Runner |
| runner.credentialSecrets | list | [] | References to kubernetes secrets that contain credentials to be used by the Datadog Private Action Runner |
| runner.customCaCert | object | {"configMapName":""} | Custom CA certificate configuration for trusting internal/private CAs |
| runner.customCaCert.configMapName | string | "" | Name of a ConfigMap containing the PEM-encoded CA certificate(s) |
| runner.env | list | [] | Environment variables to be passed to the Datado |
Deploy private-action-runner with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has private-action-runner 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 chartprivate-action-runner is pinned at v1.31.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