feat(kubernetes): allow setting cluster name in in-cluster mode (#7695)

This commit is contained in:
Sergio Garcia
2025-05-12 06:28:04 -04:00
committed by César Arroba
parent a01ff0f7cc
commit b3b88ebd68
5 changed files with 84 additions and 4 deletions
+16
View File
@@ -20,3 +20,19 @@ kubectl logs prowler-XXXXX --namespace prowler-ns
???+ note
By default, `prowler` will scan all namespaces in your active Kubernetes context. Use the [`--namespace`](https://docs.prowler.com/projects/prowler-open-source/en/latest/tutorials/kubernetes/namespace/) flag to specify the namespace(s) to be scanned.
???+ tip "Identifying the cluster in reports"
When running in in-cluster mode, the Kubernetes API does not expose the actual cluster name by default.
To uniquely identify the cluster in logs and reports, you can:
- Use the `--cluster-name` flag to manually set the cluster name:
```bash
prowler -p kubernetes --cluster-name production-cluster
```
- Or set the `CLUSTER_NAME` environment variable:
```yaml
env:
- name: CLUSTER_NAME
value: production-cluster
```