For the complete documentation index, see llms.txt. This page is also available as Markdown.

Delegate 3.x FAQs

Frequently asked questions about Delegate 3.x

This article addresses some frequently asked questions about Delegate 3.x.

How do I update system certificates in non-root Delegate 3.x images?

Build a custom delegate image that installs certificates as root during the Docker build, use a Kubernetes init container with root permissions, set SSL_CERT_FILE / CURL_CA_BUNDLE environment variables pointing to a mounted CA bundle, or configure individual tools (curl --cacert, git config http.sslCAInfo) to reference the certificate directly.

When running Delegate 3.x in non-root container images, updating the Java truststore works correctly, but system certificate updates require root permissions. This limitation affects command-line utilities like curl and wget when connecting to services with custom certificate authorities.

Delegate 3.x containers run as a non-root user (UID 1001) for security. While the delegate process can load custom certificates into its Java truststore using the HARNESS_CERTS_DIR environment variable, system-level certificate stores cannot be updated at runtime without root permissions.

Option 1: Build custom image (preferred)

Build a custom delegate image where certificates are installed as root during the Docker build, then switch to the non-root user before the build completes. This is the preferred approach by Harness.

Create a Dockerfile based on the Delegate 3.x image:

FROM harness/delegate:<version>  # Replace <version> with your target delegate version

# Switch back to root temporarily <a href="#switch-back-to-root-temporarily" id="switch-back-to-root-temporarily"></a>
USER 0

# Copy your custom CA certificates <a href="#copy-your-custom-ca-certificates" id="copy-your-custom-ca-certificates"></a>
COPY custom-ca.crt /etc/pki/ca-trust/source/anchors/

# Update system trust store (requires root) <a href="#update-system-trust-store-requires-root" id="update-system-trust-store-requires-root"></a>
RUN update-ca-trust

# Switch back to non-root user <a href="#switch-back-to-non-root-user" id="switch-back-to-non-root-user"></a>
USER 1001

Build and push your custom image:

Update your delegate deployment to use the custom image.

Option 2: Init container with root permissions

Use a Kubernetes init container with root permissions to install certificates before the delegate container starts. This approach provides easier certificate rotation without rebuilding images.

Create a ConfigMap or Secret with your CA certificates:

Add an init container to your delegate deployment:

Option 3: Environment variable override

Point system tools to a custom CA bundle using environment variables. This approach works well for supporting specific tools like curl, wget, Python, and Node.js that respect standard certificate environment variables.

Mount your CA certificates using a ConfigMap or Secret, then set environment variables in your delegate deployment:

Option 4: Direct tool configuration

Configure individual tools to use custom CA certificates through their native configuration mechanisms. This approach works well when you only need custom certificates for specific commands.

Configure curl to use a custom CA certificate:

Configure git to use a custom CA certificate:

Configure Python requests to use a custom CA certificate:

Go to Configure Custom Certificates and mTLS to configure Java truststore settings for delegate-to-Harness communication.

Last updated

Was this helpful?