diff --git a/site/content/en/main/user-guide/customization.md b/site/content/en/main/user-guide/customization.md index 85d07266c..baa22678d 100644 --- a/site/content/en/main/user-guide/customization.md +++ b/site/content/en/main/user-guide/customization.md @@ -32,9 +32,9 @@ You can display warnings in the logs by setting the `PEPR_NODE_WARNINGS` environ ## Customizing Log Format -The log format can be customized by setting the `PINO_TIME_STAMP` environment variable in the `package.json` file or directly on the Watcher or Admission `Deployment`. The default value is a partial JSON timestamp string representation of the time. If set to `iso`, the timestamp is displayed in an ISO format. +The log format can be customized by setting the `PINO_TIME_STAMP` environment variable in the `package.json` file or directly on the Watcher or Admission `Deployment`. The default value is a partial JSON timestamp string representation of the time. If set to `iso`, the timestamp is displayed in an ISO format. -**Caution**: attempting to format time in-process will significantly impact logging performance. +**Caution**: attempting to format time in-process will significantly impact logging performance. ```json { @@ -50,13 +50,13 @@ With ISO: {"level":30,"time":"2024-05-14T14:26:03.788Z","pid":16,"hostname":"pepr-static-test-7f4d54b6cc-9lxm6","method":"GET","url":"/healthz","status":200,"duration":"1 ms"} ``` -Default (without): +Default (without): ```json {"level":30,"time":"1715696764106","pid":16,"hostname":"pepr-static-test-watcher-559d94447f-xkq2h","method":"GET","url":"/healthz","status":200,"duration":"1 ms"} ``` -## Customizing Watch Configuration +## Customizing Watch Configuration The Watch configuration is a part of the Pepr module that allows you to watch for specific resources in the Kubernetes cluster. The Watch configuration can be customized by specific enviroment variables of the Watcher Deployment and can be set in the field in the `package.json` or in the helm `values.yaml` file. @@ -136,5 +136,29 @@ Below are the available configurations through `package.json`. | `alwaysIgnore` | Conditions to always ignore | `{namespaces: []}` | | `includedFiles` | For working with WebAssembly | ["main.wasm", "wasm_exec.js"] | | `env` | Environment variables for the container| `{LOG_LEVEL: "warn"}` | +| `rbac` | Custom RBAC rules | `{"rbac": [{"apiGroups": [""], "resources": [""], "verbs": [""]}]}` | These tables provide a comprehensive overview of the fields available for customization within the Helm overrides and the `package.json` file. Modify these according to your deployment requirements. + +### Example Custom RBAC Rules + +The following example demonstrates how to add custom RBAC rules to the Pepr module. + +```json +{ + "pepr": { + "rbac": [ + { + "apiGroups": ["pepr.dev"], + "resources": ["customresources"], + "verbs": ["get", "list"] + }, + { + "apiGroups": ["apps"], + "resources": ["deployments"], + "verbs": ["create", "delete"] + } + ] + } +} +```