Skip to content

add service #10822

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

add service #10822

wants to merge 2 commits into from

Conversation

fixeasy
Copy link
Contributor

@fixeasy fixeasy commented Jul 31, 2025

Add Kubernetes Service for Dagger Engine

Context

We operate a large-scale software factory supporting key business units (DSM/DSI).
To enhance our CI capabilities and accelerate delivery, we are deploying Dagger as our new CI solution.

Our setup:

  • Dagger runs as a DaemonSet in Kubernetes
  • Shared Dagger modules live in GitLab
  • Projects use these modules via GitLab CI pipelines

This aims to provide a scalable and reliable CI platform aligned with our business objectives.

Current Limitation

The current Helm chart exposes Dagger only via a NodePort configured directly on the pods (DaemonSet or StatefulSet).
As a result, each CI pipeline must explicitly target a specific node IP, for example:

_EXPERIMENTAL_DAGGER_RUNNER_HOST: "tcp://<node_IP>:<dagger-port>"

This approach:

  • Strongly couples the CI to the cluster's topology
  • Prevents load distribution across nodes
  • Reduces resilience, e.g., if the targeted node is restarted

✅ Solution

This PR introduces:

  • A Kubernetes Service to expose the dagger-engine pod :
_EXPERIMENTAL_DAGGER_RUNNER_HOST: "tcp://dagger-engine-service.dagger.svc.cluster.local:<dagger-port>"
  • Session affinity (sessionAffinity: ClientIP) to ensure that all requests from a pipeline are routed to the same pod, maintaining execution consistency.

Changes

  • Added engine.service.* configuration in values.yaml
  • Created new Helm template: engine-service.yaml
  • Added app: label to pods so the Service selector can match them
  • Modified pod templates to skip hostPort configuration if service.enabled is true

Goal

This change enables a more scalable, resilient, and Kubernetes-native integration of Dagger, and removes the need to target specific nodes from the CI.

fixeasy added 2 commits July 31, 2025 14:59
Signed-off-by: Mehdi KADAR <mehdi71.kadar@gmail.com>
Signed-off-by: Mehdi KADAR <mehdi71.kadar@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant