#I installed dagger on all k8s nodes, gitlab runners are not finding it

1 messages · Page 1 of 1 (latest)

queen phoenix
#

How do the runners find it? Do the runners need a configmap with the url?

#

Should the helm chart have created a service?

tulip jackal
#

Hey Kraq, until someone else who has more exp with the K8s install, just wondering if you've covered the example section for K8s on the integrations documentation? https://docs.dagger.io/integrations/kubernetes#example

This shows the kubectl query being used to select the dagger namespace and grab an engine from the daemonset, this value is used to export a value, so the Dagger CLI in one of the runners knows which dagger engine to connect to

This section covers different strategies for deploying Dagger on a Kubernetes cluster.

smoky folio
#

In my k8s environment, I have a service that uses Terraform to start the container which needs to communicate with Dagger (it's not a runner, but another kind of service). In the Terraform file, I have this to create an environment variable in the container:

      env {
        name  = "_EXPERIMENTAL_DAGGER_RUNNER_HOST"
        value = "unix:///var/run/buildkit/buildkitd.sock"
      }

Of course, you could use a config-map and envFrom in a yaml manifest to do the same.

Looking at the docs, the socket usage above seems to be an older version of connection to Dagger. Maybe it will work for you too? To be honest, I've never heard of kube-pod:// URIs before.

#

I'd also suggest the kube-pod solution is the lesser good way to connect to Dagger, as pod-names can vary, whereas the unix socket won't. You just have to make sure either the daemons are running on all nodes, or you use tolerations/ taints to start your runner/ Dagger client pods on the nodes running Dagger. I only have Dagger running on one node for experimentation purposes, so my Dagger client pod must be also started on that Node.

#

I haven't used Dagger in some time, yet I've been upgrading to the latest versions. I hope the unix socket will still work.

queen phoenix
#

Thanks I'll try this out.. I have dagger running on each node. I've never used a unix socket for pod-to-pod. It makes sense though if you have to get the one running on the same node. With a service you could hook up to any pod on another node.

queen phoenix
#

I re-read the integrations/kubernetes example. The pod-host url looks like a 1 time "see it work" type example. Not a CI working example?

#

I tried the unix socket but got connection errors..
In my cluster I have 9 nodes and i have 9 dagger engines running: