From 1e3742172ef6cff360ff2747b35ba21bed688c98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Valen=C3=A7a?= Date: Fri, 27 Oct 2023 16:22:11 +0100 Subject: [PATCH 1/3] Provides an Override to the WATCH_NAMESPACE env variable. In case the Jenkins instance is disabled, this commit allows us to pick a different namespace for the deployment by configuring the operator object instead of the jenkins object. --- chart/jenkins-operator/templates/operator.yaml | 2 ++ .../Getting Started/latest/installing-the-operator.md | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/chart/jenkins-operator/templates/operator.yaml b/chart/jenkins-operator/templates/operator.yaml index 917dc9e1a..967d22645 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/website/content/en/docs/Getting Started/latest/installing-the-operator.md b/website/content/en/docs/Getting Started/latest/installing-the-operator.md index 9289c6e63..79d33715b 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 propery will be ignored. Use the `operator.watchNamespace` property instead. From a2b24ee6179b4ec398cb7d26f94460770b57f997 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Valen=C3=A7a?= Date: Mon, 30 Oct 2023 15:12:49 +0000 Subject: [PATCH 2/3] Fix typo on word 'property' --- .../en/docs/Getting Started/latest/installing-the-operator.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 79d33715b..16c0ee428 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 @@ -133,7 +133,7 @@ Name of resource. The pod name will be jenkins-<name> (name w 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 propery will be ignored. Use the `operator.watchNamespace` property instead. +Note: If the Jenkins instance is disabled, this property will be ignored. Use the `operator.watchNamespace` property instead. From 19d936d44bf2fd81710edd335dc056d1c7a286aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Valen=C3=A7a?= Date: Mon, 13 Nov 2023 08:28:16 +0000 Subject: [PATCH 3/3] Add new property to the values file --- chart/jenkins-operator/values.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/chart/jenkins-operator/values.yaml b/chart/jenkins-operator/values.yaml index 995bf272e..4ead10668 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: []