A few months ago, I wrote about my CI setup for my Smokeweb project, and how I had to take a few workarounds to make it work.

And recently, Woodpecker release v3.16.0 fixed a couple of the issues I had. 🎉

If you recall, my main issue was that I couldn’t use Woodpecker’s Service feature. That was due to the fact that I’m using a Ceph RBD StorageClass to provide the pipeline volumes. And those are RWO by nature, meaning they can only be mounted on a single node of my k8s cluster. This, ultimately, meant that if the service for running my test Postgres instance got scheduled on a different node than all of the pipeline steps, there would be a deadlock. The steps won’t be able to start because the pipeline volume is already mounted on the node the Service is running on.

The annoying thing was: I didn’t really need the pipeline volume for the database service. It didn’t need anything from the steps, and also didn’t need the repo itself. But there was no way to disable mounting the pipeline volume to all Services.

That is, until Woodpecker v3.15.0, which contained this PR. It allows disabling the pipeline volume for Services.

Now you might be wondering: If it’s already in 3.15, why did you have to wait for 3.16? That was because I was running my own fork for a little while, as I was waiting for a release with a fix I provided in this PR. I hope you will all forgive me the tooting of my own horn. 😉 I’ve found it quite satisfying to not just fix my own stuff, but also contributing to fixing other people’s stuff.

With that out of the way, here is what my pipeline looked like up to now:

- name: prepare db dir
  image: alpine:3.23.4
  environment:
    PGDATA: *testdb-dir
  backend_options:
    kubernetes:
      <<: *kube-affinity-config
  commands:
    - mkdir $${PGDATA}
    - chmod 0750 $${PGDATA}
- name: ut-db
  image: *db-image
  detach: true
  environment:
    POSTGRES_PASSWORD: 12345
    PGDATA: *testdb-dir
  backend_options:
    kubernetes:
      <<: *kube-affinity-config
  depends_on:
    - prepare db dir

If you’d like some details about this setup, have a look at the post I linked above. I was now able to replace these two pipeline steps with this Service:

services:
  - name: ut-db
    image: *db-image
    environment:
      POSTGRES_PASSWORD: 12345
    backend_options:
      kubernetes:
        workspaceVolume: false

The newly available option here is the backend_options.kubernetes.workspaceVolume. It prevents the pipeline volume from being mounted into the service Pod. I’m also not adding any other volumes here, as the test databases won’t get very big anyway.

It’s always nice to point out that not all software updates enshittify things.

Sadly, another major issue still exists, namely that Woodpecker’s Kubernetes backend only supports a single StorageClass for the entire instance, instead of allowing for e.g. one StorageClass per pipeline or something like that. Still on my list to look into that and see how difficult it would be to implement.