woodpecker-ci / woodpecker

Woodpecker is a simple, yet powerful CI/CD engine with great extensibility.
https://woodpecker-ci.org
Apache License 2.0
4.29k stars 369 forks source link

Documentation: Kubernetes mounts #4369

Closed greenaar closed 2 days ago

greenaar commented 6 days ago

Clear and concise description of the problem

https://woodpecker-ci.org/docs/next/administration/backends/kubernetes#volumes

Make reference to

    settings:
      mount:
        - "woodpecker-cache"

Which is no longer supported when used with things like command:

Suggested solution

Removing that part, and including a sample PVC like

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: woodpecker-cache
spec:
  storageClassName: "longhorn"
  accessModes:
    - ReadWriteMany
  resources:
    requests:
      storage: 1Gi

Might go well to enhancing this part of the documentation.

Alternative

Alternatively, just removing that settings part and providing a link to the kubernetes docs (https://kubernetes.io/docs/concepts/storage/persistent-volumes/) might serve as well.

Additional context

No response

Validations

zc-devs commented 6 days ago

I'm for the alternative.

pat-s commented 5 days ago

You're referring to a setting of a specific plugin, don't you?

The following syntax

    volumes:
      - woodpecker-cache:/woodpecker/src/cache

is still supported.

And to have woodpecker-cache available in the first place, a PVC must be created externally, yes. Maybe I didn't get the full problem yet?

greenaar commented 5 days ago

The volumes: section is required and supported, and works with a manually created PVC.

The settings noted in the doc did not work under for me under 2.7.3 - they throw Cannot configure both commands and settings when using a simple:

  build:
    image: debian:bookworm
    volumes:
      - woodpecker-cache-claim:/cache
    commands:
      - ls -al /cache

With settings removed and volumes left in place, I was able to confirm the volume mounted and was writeable (and persistent).

This suggests that the mount setting isn't required to make this operate.

pat-s commented 5 days ago

Ah, yes. settings: is a reserved key for plugins and for these one cannot use arbitrary commands anymore.

So yes, the example is a bit unfortunate in that it uses an old drone plugin which combines both (it wouldn't have been needed in the first place). Changing it to a generic step that mounts a volume is a good change.

zc-devs commented 5 days ago

There is no commands in Kubernetes example, nor in meltwater/drone-cache. However, example with generic step is, probably, less confusing.

zc-devs commented 2 days ago

4374

Done? Can be closed?

greenaar commented 2 days ago

Yes, apologies. That's sorted. closing this now.