From bb0ffbfa041c1c5673d78bd4ff6d7a1ce65eaaee Mon Sep 17 00:00:00 2001 From: Amir Raminfar Date: Tue, 18 Feb 2025 12:20:38 -0800 Subject: [PATCH] chore: updates docs --- docs/guide/k8s.md | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/docs/guide/k8s.md b/docs/guide/k8s.md index 2668f63e..f1216012 100644 --- a/docs/guide/k8s.md +++ b/docs/guide/k8s.md @@ -107,7 +107,9 @@ kubectl top pod For now this is required to use Dozzle in Kubernetes. -## Default Namespace +## Namespaces and Filters + +### Namespaces By default, Dozzle will monitor all namespaces in the cluster. If you want to restrict Dozzle to a specific namespace, you can set the `DOZZLE_NAMESPACE` environment variable to the name of the namespace. @@ -138,3 +140,35 @@ spec: - name: DOZZLE_NAMESPACE value: "default" ``` + +### Labels and Filters + +`DOZZLE_FILTER` behave similarlty to Docker filters. You can limit the scope of Dozzle using the `DOZZLE_FILTER` environment variable. For example, to scope only to `env=prod`: + +```yaml +apiVersion: apps/v1 +kind: Deployment +metadata: + name: dozzle +spec: + replicas: 1 + selector: + matchLabels: + app: dozzle + template: + metadata: + labels: + app: dozzle + spec: + serviceAccountName: pod-viewer + containers: + - name: dozzle + image: amir20/dozzle:latest + ports: + - containerPort: 8080 + env: + - name: DOZZLE_MODE + value: "k8s" + - name: DOZZLE_FILTER + value: "env=prod" +```