Kubenetes pipeline services not working

Issue: Kubenetes pipeline “services” do not work

Documentation states:

Service containers share the same network as your pipeline steps and can be access at the localhost address. In our previous example, the redis container can be accessed from the pipeline at tcp://


Using the redis examples provided here: https://docs.drone.io/pipeline/kubernetes/syntax/services/
results in no connection to the service.
output from connecting container:

redis-cli -h ping
2 Could not connect to Redis at Connection refused

You are able to make the connection via the POD network, but not localhost.

Kubernetes pods usually speaks via a “service” ClusterIP/LoadBalancer, but since services(drone) are only a single container there is no service(kubernetes) being defined.

Doing some troubleshooting I can prove that the port is not accessible via localhost, only via the pod ip

  - name: test
    image: alpine
      - apk add busybox-extras
      - apk add bind-tools
      - sleep 3000

  - name: cache
    image: redis
      - awk '/32 host LOCAL/ { print f } {f=$2}' </proc/net/fib_trie | grep -v '' | uniq > /drone/src/redis.ip

Running the above allows me to exec to the test container(in kubernetes) and run telnet to test tcp connections

/drone/src # cat redis.ip
/drone/src # telnet 6379
/drone/src # telnet localhost 6379
telnet: can't connect to remote host ( Connection refused

Also, I am running drone on a 3 node kubernetes cluster, not minikube. If the worker pods spin up on different nodes in the kube cluster, how does it talk over localhost?


Service containers do work for the Kubernetes runner. Here is the example we use in our integration tests to verify: https://github.com/drone-runners/drone-runner-kube/blob/master/samples/services.yml

The issue in your example is that you are trying to use commands for a service container, which in turn overrides the default entrypoint which prevents redis from starting.

Also please make sure you have installed the Kubernetes runner (drone/drone-runner-kube). Please note that the stable Helm chart does not install the Kubernetes runner, but instead installs an experimental Kubernetes implementation that was deprecated earlier this year.