woodpecker icon indicating copy to clipboard operation
woodpecker copied to clipboard

K8S backend new behavior when storage rwx is `false`

Open eliasscosta opened this issue 1 year ago • 0 comments

Clear and concise description of the problem

When we run a service step or use the depends_on (run parallel steps) and a storage RWX is set to false, sometimes pipelines get stuck when the steps (pods) run in another node.

We get the error to mount the volumes.

  Warning  FailedMount     	19s	kubelet              	Unable to attach or mount volumes: unmounted volumes=[wp-01hmhhfewr9cwqsj2q4v440rwa-0-default], unattached volumes=[aws-iam-token wp-01hmhhfewr9cwqsj2q4v440rwa-0-default 

This is expected because of the way Kubernetes works.

Suggested solution

My suggested solution is to add a PodAffinity in the podSpec configuration when the storage RWX is false it will force it to run the in the same node.

Alternative

Another solution is to set the pods to use emptyDir volumes.

Additional context

No response

Validations

  • [X] Checked that the feature isn't part of the next version already [https://woodpecker-ci.org/faq#which-version-of-woodpecker-should-i-use]
  • [X] Read the docs.
  • [X] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

eliasscosta avatar Feb 07 '24 11:02 eliasscosta