Skip to main content
You can extend Slurm compute and login node pods with sidecar containers. This page shows you how to attach sidecars to SUNK login and compute pods so you can run auxiliary services alongside Slurm, such as a local DNS cache or a VPN connector. The walkthrough is for cluster administrators who manage SUNK deployments through the Slurm Helm chart, and it covers both the configuration locations for sidecars and two end-to-end examples you can adapt.

How to add a sidecar

The following sections describe where to declare sidecars in the Slurm Helm chart values for login and compute node pods. The chart exposes a containers field on both pod types, along with supporting fields such as volumes and dnsConfig for further customization. The exact location of these configuration changes differs between login and compute pods.

Add a sidecar to a login pod

For login pods, add sidecars under login.containers. The login pod configuration offers the following options:

Add a sidecar to a compute pod

To add sidecars to a compute pod, you must apply the configuration at the node level. Add sidecars under compute.nodes.<nodeType>.containers, where <nodeType> represents a custom name assigned to a specific compute type.
Additional fields are available for configuration. The remaining sections walk through two examples that show how to apply this pattern.

Sidecar example: Knot Resolver

Knot Resolver is a full caching DNS resolver implementation. You can use it as a proxy to CoreDNS or as a direct replacement. This example shows how to use it as a proxy in a sidecar to improve DNS performance for jobs that involve web scraping. The process involves adding a sidecar container and a corresponding ConfigMap, then deploying both to the Kubernetes namespace. Follow these steps in order: define the sidecar in the Helm values, create the ConfigMap that backs it, and then deploy the ConfigMap before rolling out the chart changes.
  1. To add the Knot Resolver sidecar container, adjust the containers, volumes, dnsPolicy, and dnsConfig fields as shown in the following example:
  2. Create the corresponding ConfigMap YAML file knot-resolver-configmap.yaml with the following contents:
    For more kresd.conf configuration examples, see the Knot Resolver GitHub repository.
  3. Deploy the ConfigMap into the slurm namespace before deploying changes for the sidecars, as in the following example. The sidecar container mounts this ConfigMap on startup, so it must exist in the namespace before the compute pods are rolled out.
    If a ConfigMap with the same name already exists in the specified Kubernetes namespace, the apply command updates the existing file with the new configuration. If no such file exists, apply creates one. The -f flag specifies the file name to create or update. In this example, the file to create or update is knot-resolver-configmap.yaml. The -n flag specifies the Kubernetes namespace to create or update the file.

Test the Knot Resolver sidecar

With the sidecar container and its ConfigMap deployed, the next step is to confirm that the resolver is reachable from inside a compute pod and that Slurm itself is still healthy. To test if the DNS server is up and running, run the dig command within a Slurm compute node. First, open a shell in a worker node in the slurmd container. In this example, the worker node is slurm-cpu-epyc-000-002. To update the local package list and install the dnsutils package, which includes the dig command, run:
To check if the DNS resolver is functioning correctly, use the dig command:
If kresd is working, the result resembles the following:
Example dig response
To check that Slurm communications are still working between the controller and compute node, run scontrol ping:

Sidecar example: Tailscale

Tailscale is a VPN service that makes your devices and applications reachable across networks. In this example, you attach your Slurm login node to your Tailscale network through a userspace sidecar so you can reach it from any device on that network. The procedure creates a Tailscale auth key, stores it as a Kubernetes Secret, configures the RBAC the sidecar needs to read that Secret, and registers the sidecar on the login pod through the Helm chart.
This example is also available in Tailscale’s documentation. Clone the Tailscale GitHub repository to get most of the necessary YAML manifests for this example.
  1. Log in to Tailscale’s admin console to create a reusable, ephemeral auth key for the machine. You use this auth key to authenticate the login node against the Tailscale network.
  2. Create a Secret for the TS_AUTHKEY through a YAML manifest, for example ts-secret.yaml. Replace [TS-AUTH-KEY] with the auth key you generated in the previous step.
  3. Add the Secret to the slurm namespace with the following command:
  4. Configure the RBAC surrounding the Secret to allow the sidecar to obtain the Secret. This requires you to edit three files: rolebinding.yaml, role.yaml, and sa.yaml. If you cloned the Tailscale repository, you can find these files under tailscale/docs/k8s. Adjust the values in the files to match the following configuration: sa.yaml:
    sa.yaml
    role.yaml:
    role.yaml
    rolebinding.yaml:
    rolebinding.yaml
  5. Deploy these manifests into the slurm namespace by running the following command:
  6. Edit the login node’s containers field to include the Tailscale sidecar. Set the serviceAccountName to tailscale, and automountServiceAccountToken to true. The following example shows these edits in the charts/slurm/values.yaml manifest:
    charts/slurm/values.yaml
  7. Deploy the sidecar.

Test the Tailscale sidecar

After you deploy the sidecar, the login node should appear in your Tailscale network and be reachable from any other device on that network. From a machine connected to the Tailscale network, you can check that the Slurm login node is now connected and present:
Because you added nginx as a machine to test with, you can also run the following from another machine connected to the same Tailscale network:
Test with curl
If you have ssh configured, you can test that with the following command:
Last modified on May 27, 2026