From 32ff2f34386d9a4dbcec82e331498820d003c63f Mon Sep 17 00:00:00 2001 From: Torsten Walter Date: Fri, 5 Apr 2019 11:57:18 +0200 Subject: [PATCH] [helm/jenkins] Support multiple Jenkins instances in same namespace (#12748) * use release name as part of CasC confimap label Signed-off-by: Torsten Walter * rename jcasc_config.yaml to jcasc-config.yaml All other ressources use dashes as separators instead of underscores. Renamed the file to harmonize file names. Signed-off-by: Torsten Walter * prefix config map with release name Having the release name as prefix istead suffix makes it easier to sort config maps for multiple releases e.g.: ``` $ kubectl get configmap NAME DATA AGE jenkins1 6 43m jenkins1-jenkins-config-welcome-message 1 43m jenkins1-tests 1 43m jenkins2 6 34m jenkins2-jenkins-config-welcome-message 1 34m jenkins2-tests 1 34m ``` Signed-off-by: Torsten Walter * bumped char version Signed-off-by: Torsten Walter --- stable/jenkins/Chart.yaml | 2 +- .../jenkins/templates/{jcasc_config.yaml => jcasc-config.yaml} | 3 ++- stable/jenkins/templates/jenkins-master-deployment.yaml | 2 +- stable/jenkins/values.yaml | 2 -- 4 files changed, 4 insertions(+), 5 deletions(-) rename stable/jenkins/templates/{jcasc_config.yaml => jcasc-config.yaml} (81%) diff --git a/stable/jenkins/Chart.yaml b/stable/jenkins/Chart.yaml index 3164c265c0..6df136496d 100755 --- a/stable/jenkins/Chart.yaml +++ b/stable/jenkins/Chart.yaml @@ -1,6 +1,6 @@ name: jenkins home: https://jenkins.io/ -version: 0.36.5 +version: 0.37.0 appVersion: lts description: Open source continuous integration server. It supports multiple SCM tools including CVS, Subversion and Git. It can execute Apache Ant and Apache Maven-based diff --git a/stable/jenkins/templates/jcasc_config.yaml b/stable/jenkins/templates/jcasc-config.yaml similarity index 81% rename from stable/jenkins/templates/jcasc_config.yaml rename to stable/jenkins/templates/jcasc-config.yaml index 13a8850c14..f0f776354f 100644 --- a/stable/jenkins/templates/jcasc_config.yaml +++ b/stable/jenkins/templates/jcasc-config.yaml @@ -5,8 +5,9 @@ apiVersion: v1 kind: ConfigMap metadata: - name: jenkins-config-{{ template "jenkins.fullname" $root }}-{{ $key }} + name: {{ template "jenkins.fullname" $root }}-jenkins-config-{{ $key }} labels: + {{ template "jenkins.fullname" $root }}-jenkins-config: "true" {{ $.Values.Master.Sidecars.configAutoReload.label | default "jenkins_config" }}: "true" release: {{ $root.Release.Name }} chart: "{{ $root.Chart.Name }}-{{ $root.Chart.Version }}" diff --git a/stable/jenkins/templates/jenkins-master-deployment.yaml b/stable/jenkins/templates/jenkins-master-deployment.yaml index 0e77a08a42..058958baae 100644 --- a/stable/jenkins/templates/jenkins-master-deployment.yaml +++ b/stable/jenkins/templates/jenkins-master-deployment.yaml @@ -272,7 +272,7 @@ spec: - name: JENKINSRELOADCONFIG value: "true" - name: LABEL - value: "{{ .Values.Master.Sidecars.configAutoReload.label }}" + value: "{{ template "jenkins.fullname" . }}-jenkins-config" - name: FOLDER value: "{{ .Values.Master.Sidecars.configAutoReload.folder }}" - name: NAMESPACE diff --git a/stable/jenkins/values.yaml b/stable/jenkins/values.yaml index 33788d3c6e..7be6e93d6f 100644 --- a/stable/jenkins/values.yaml +++ b/stable/jenkins/values.yaml @@ -205,8 +205,6 @@ Master: # accessible via SSH from outside of the pod. Note if you use non-root pod privileges (RunAsUser & FsGroup), # this must be > 1024: sshTcpPort: 1044 - # label that the configmaps with dashboards are marked with: - label: jenkins_config # folder in the pod that should hold the collected dashboards: folder: /var/jenkins_home/casc_configs # If specified, the sidecar will search for dashboard config-maps inside this namespace.