From a1c9c3dfe4c4e4fb03de7975e6a9f46dcb3c168e Mon Sep 17 00:00:00 2001 From: Micash <70768913+micash545@users.noreply.github.com> Date: Tue, 9 Jan 2024 08:28:35 +0100 Subject: [PATCH] Make k8s backend configuration docs in the same format as others (#3081) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com> Co-authored-by: Patrick Schratz --- .../22-backends/40-kubernetes.md | 92 ++++++++++--------- 1 file changed, 47 insertions(+), 45 deletions(-) diff --git a/docs/docs/30-administration/22-backends/40-kubernetes.md b/docs/docs/30-administration/22-backends/40-kubernetes.md index f4e19a7b1..d2e5cc37a 100644 --- a/docs/docs/30-administration/22-backends/40-kubernetes.md +++ b/docs/docs/30-administration/22-backends/40-kubernetes.md @@ -1,55 +1,11 @@ --- -toc_max_heading_level: 3 +toc_max_heading_level: 2 --- # Kubernetes backend The kubernetes backend executes steps inside standalone pods. A temporary PVC is created for the lifetime of the pipeline to transfer files between steps. -## General Configuration - -These env vars can be set in the `env:` sections of both `server` and `agent`. -They do not need to be set for both but only for the part to which it is relevant to. - -```yaml -server: - env: - WOODPECKER_SESSION_EXPIRES: "300h" - [...] - -agent: - env: - [...] -``` - -- `WOODPECKER_BACKEND_K8S_NAMESPACE` (default: `woodpecker`) - - The namespace to create worker pods in. - -- `WOODPECKER_BACKEND_K8S_VOLUME_SIZE` (default: `10G`) - - The volume size of the pipeline volume. - -- `WOODPECKER_BACKEND_K8S_STORAGE_CLASS` (default: empty) - - The storage class to use for the pipeline volume. - -- `WOODPECKER_BACKEND_K8S_STORAGE_RWX` (default: `true`) - - Determines if `RWX` should be used for the pipeline volume's [access mode](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes). If false, `RWO` is used instead. - -- `WOODPECKER_BACKEND_K8S_POD_LABELS` (default: empty) - - Additional labels to apply to worker pods. Must be a YAML object, e.g. `{"example.com/test-label":"test-value"}`. - -- `WOODPECKER_BACKEND_K8S_POD_ANNOTATIONS` (default: empty) - - Additional annotations to apply to worker pods. Must be a YAML object, e.g. `{"example.com/test-annotation":"test-value"}`. - -- `WOODPECKER_BACKEND_K8S_SECCTX_NONROOT` (default: `false`) - - Determines if containers must be required to run as non-root users. - ## Job specific configuration ### Resources @@ -213,3 +169,49 @@ workspace: ``` See [this issue](https://github.com/woodpecker-ci/woodpecker/issues/2510) for more details. + +## Configuration + +These env vars can be set in the `env:` sections of the agent. + +### `WOODPECKER_BACKEND_K8S_NAMESPACE` + +> Default: `woodpecker` + +The namespace to create worker pods in. + +### `WOODPECKER_BACKEND_K8S_VOLUME_SIZE` + +> Default: `10G` + +The volume size of the pipeline volume. + +### `WOODPECKER_BACKEND_K8S_STORAGE_CLASS` + +> Default: empty + +The storage class to use for the pipeline volume. + +### `WOODPECKER_BACKEND_K8S_STORAGE_RWX` + +> Default: `true` + +Determines if `RWX` should be used for the pipeline volume's [access mode](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes). If false, `RWO` is used instead. + +### `WOODPECKER_BACKEND_K8S_POD_LABELS` + +> Default: empty + +Additional labels to apply to worker pods. Must be a YAML object, e.g. `{"example.com/test-label":"test-value"}`. + +### `WOODPECKER_BACKEND_K8S_POD_ANNOTATIONS` + +> Default: empty + +Additional annotations to apply to worker pods. Must be a YAML object, e.g. `{"example.com/test-annotation":"test-value"}`. + +### `WOODPECKER_BACKEND_K8S_SECCTX_NONROOT` + +> Default: `false` + +Determines if containers must be required to run as non-root users.