From de21a400ab4b6933d127af4ca9ba9cba433871e5 Mon Sep 17 00:00:00 2001 From: Avi Huli Date: Thu, 22 Dec 2022 14:28:15 +0200 Subject: [PATCH] Readme namespace selector --- README.md | 23 +++++++++++++++++++ .../chart/reloader/templates/deployment.yaml | 1 - 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6df53c7c..51f25c17 100644 --- a/README.md +++ b/README.md @@ -183,6 +183,23 @@ Reloader can be configured to ignore the resources `secrets` and `configmaps` by `Note`: At one time only one of these resource can be ignored, trying to do it will cause error in Reloader. Workaround for ignoring both resources is by scaling down the reloader pods to `0`. +Reloader can be configured to watch only namespaces labeled with (one or more) labels of your choosing by using the `--namespace-selector` parameter, for example: +``` +--namespace-selector=reloder:enabled,test:true +``` + +Only namespaces labeled like the following namespace YAML will be watched: +```yaml +kind: Namespace +apiVersion: v1 +metadata: + ... + labels: + reloder: enabled + test: true + ... +``` + ### Vanilla kustomize You can also apply the vanilla manifests by running the following command @@ -234,6 +251,12 @@ Reloader can be configured to ignore the resources `secrets` and `configmaps` by `Note`: At one time only one of these resource can be ignored, trying to do it will cause error in helm template compilation. +Reloader can be configured to watch only namespaces labeled with (one or more) labels of your choosing by using the `namespaceSelector` parameter + +| Parameter | Description | Type | +| ---------------- | -------------------------------------------------------------- | ------- | +| namespaceSelector | list of comma separated key:value namespace | string | + You can also set the log format of Reloader to json by setting `logFormat` to `json` in values.yaml and apply the chart You can enable to scrape Reloader's Prometheus metrics by setting `serviceMonitor.enabled` or `podMonitor.enabled` to `true` in values.yaml file. Service monitor will be removed in future releases of reloader in favour of Pod monitor. diff --git a/deployments/kubernetes/chart/reloader/templates/deployment.yaml b/deployments/kubernetes/chart/reloader/templates/deployment.yaml index 103e0dee..786f16de 100644 --- a/deployments/kubernetes/chart/reloader/templates/deployment.yaml +++ b/deployments/kubernetes/chart/reloader/templates/deployment.yaml @@ -159,7 +159,6 @@ spec: {{- if .Values.reloader.namespaceSelector }} - "--namespace-selector={{ .Values.reloader.namespaceSelector }}" {{- end }} - {{- if .Values.reloader.custom_annotations }} {{- if .Values.reloader.custom_annotations.configmap }} - "--configmap-annotation"