From bfda3c8cf99fc56cb65519a673f3b8a6209deb0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Valen=C3=A7a?= Date: Sun, 4 Feb 2024 17:34:36 +0000 Subject: [PATCH] Provides an Override to the WATCH_NAMESPACE env variable. (#923) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: João Valença --- chart/jenkins-operator/templates/operator.yaml | 2 ++ chart/jenkins-operator/values.yaml | 4 ++++ .../Getting Started/latest/installing-the-operator.md | 8 +++++--- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/chart/jenkins-operator/templates/operator.yaml b/chart/jenkins-operator/templates/operator.yaml index 917dc9e1..967d2264 100644 --- a/chart/jenkins-operator/templates/operator.yaml +++ b/chart/jenkins-operator/templates/operator.yaml @@ -57,6 +57,8 @@ spec: - name: WATCH_NAMESPACE {{- if .Values.jenkins.enabled }} value: {{ .Values.jenkins.namespace }} + {{- else if .Values.operator.watchNamespace }} + value: {{ .Values.operator.watchNamespace }} {{- else }} valueFrom: fieldRef: diff --git a/chart/jenkins-operator/values.yaml b/chart/jenkins-operator/values.yaml index 62d955af..c39e32eb 100644 --- a/chart/jenkins-operator/values.yaml +++ b/chart/jenkins-operator/values.yaml @@ -308,6 +308,10 @@ operator: # fullnameOverride overrides the deployment name fullnameOverride: "" + # Select a different namespace to look for the Jenkins CR and deploy Jenkins in. Defaults to the same namespace as + # the operator. + # watchNamespace: "jenkins-namespace" + resources: {} nodeSelector: {} tolerations: [] diff --git a/website/content/en/docs/Getting Started/latest/installing-the-operator.md b/website/content/en/docs/Getting Started/latest/installing-the-operator.md index 9289c6e6..16c0ee42 100644 --- a/website/content/en/docs/Getting Started/latest/installing-the-operator.md +++ b/website/content/en/docs/Getting Started/latest/installing-the-operator.md @@ -127,11 +127,13 @@ Name of resource. The pod name will be jenkins-<name> (name w namespace -default +"" -Namespace the resources will be deployed to. It's not recommended to use default namespace. -Create new namespace for jenkins (e.g. kubectl create -n jenkins) +Namespace the resources will be deployed to. If omitted, the resources will be deployed to the same namespace as the operator. +It's not recommended to use default namespace. Create new namespace for jenkins (e.g. kubectl create -n jenkins). + +Note: If the Jenkins instance is disabled, this property will be ignored. Use the `operator.watchNamespace` property instead.