From af9ca5a039d7853c8c34f5d1a8aae8cdf9f25a7c Mon Sep 17 00:00:00 2001 From: janiskemper <63146658+janiskemper@users.noreply.github.com> Date: Fri, 24 Sep 2021 10:18:44 +0200 Subject: [PATCH] feat: including option to scope manager to namespace (#51) --- README.md | 6 ++++++ main.go | 2 ++ 2 files changed, 8 insertions(+) diff --git a/README.md b/README.md index 2f2c163..f37b34f 100644 --- a/README.md +++ b/README.md @@ -81,3 +81,9 @@ Usage example: `./manager [--global-flags] mode [--mode-flags]` | :--- | :--- | :---: | | **rulesFilePath** | Path to the file with converted Oathkeeper rules | `/etc/config/access-rules.json` | +### Environment variables + +| Name | Description | Default values | +| :--- | :--- | :---: | +| **NAMESPACE** | Namespace option to scope Oathkeeper maester to one namespace only - useful for running several instances in one cluster. Defaults to "" which means that there is no namespace scope. | `` | + diff --git a/main.go b/main.go index 864951f..000b880 100644 --- a/main.go +++ b/main.go @@ -94,6 +94,8 @@ func main() { Scheme: scheme, MetricsBindAddress: metricsAddr, LeaderElection: enableLeaderElection, + // Defaults to "" which means all namespaces + Namespace: os.Getenv("NAMESPACE"), }) if err != nil { setupLog.Error(err, "unable to start manager")