Skip to content

Commit

Permalink
Add documentation for setting kubernetes labels and annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
dominic-p authored May 6, 2024
1 parent dc6280f commit 36606d3
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions docs/docs/30-administration/22-backends/40-kubernetes.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,23 @@ backend_options:
AppArmor syntax follows [KEP-24](https://github.com/kubernetes/enhancements/blob/fddcbb9cbf3df39ded03bad71228265ac6e5215f/keps/sig-node/24-apparmor/README.md).
:::

### Annotations and labels

You can specify arbitrary `meta.annotations` and `meta.labels` to be set on the Pod definition for a given workflow step using the following configuration:

```yaml
backend_options:
kubernetes:
annotations:
workflow-group: alpha
io.kubernetes.cri-o.Devices: /dev/fuse
labels:
environment: ci
app.kubernetes.io/name: builder
```

In order to enable this configuration, you need to add the appropriate environment variables to the agent config as shown below.

## Tips and tricks

### CRI-O
Expand Down Expand Up @@ -260,3 +277,15 @@ Determines if containers must be required to run as non-root users.
> Default: empty

Secret names to pull images from private repositories. See, how to [Pull an Image from a Private Registry](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/).

### `WOODPECKER_BACKEND_K8S_POD_LABELS_ALLOW_FROM_STEP`

> Default: `false`

Determines if additional Pod labels can be defined from a step's backend options.

### `WOODPECKER_BACKEND_K8S_POD_ANNOTATIONS_ALLOW_FROM_STEP`

> Default: `false`

Determines if Pod annotations can be defined from a step's backend options.

0 comments on commit 36606d3

Please sign in to comment.