From 359d0db386fb0c10110bc4a21bdf11c199c90ca2 Mon Sep 17 00:00:00 2001 From: Bosmak Date: Sat, 12 Oct 2019 11:16:38 -0300 Subject: [PATCH] [stable/jenkins] Removed some warnings and added tpl to master.slaveKubernetesNamespace variable (#17914) * Modifying the script to behave in the same way it did on v1.6.0. Signed-off-by: Gustavo Bosmak * Update init script to configure ssh key correctly. Signed-off-by: Gustavo Bosmak * Allows helm template on master.slaveKubernetesNamespace Signed-off-by: Gustavo Bosmak * Defined sensible default to variables to silence some invalid warnings. Signed-off-by: Gustavo Bosmak * Bumping Version, Update Changelog. Signed-off-by: Gustavo Bosmak --- stable/jenkins/CHANGELOG.md | 12 ++++++++++++ stable/jenkins/Chart.yaml | 2 +- stable/jenkins/README.md | 14 +++++++------- stable/jenkins/templates/_helpers.tpl | 2 +- stable/jenkins/values.yaml | 14 +++++++------- 5 files changed, 28 insertions(+), 16 deletions(-) diff --git a/stable/jenkins/CHANGELOG.md b/stable/jenkins/CHANGELOG.md index 52dd48e386..da0fbddb35 100644 --- a/stable/jenkins/CHANGELOG.md +++ b/stable/jenkins/CHANGELOG.md @@ -6,6 +6,18 @@ numbering uses [semantic versioning](http://semver.org). NOTE: The change log until version 1.5.7 is auto generated based on git commits. Those include a reference to the git commit to be able to get more details. +## 1.7.6 + +Updated `master.slaveKubernetesNamespace` to parse helm templates. +Defined an sensible empty value to the following variables, to silence invalid warnings: + - master.extraPorts + - master.scriptApproval + - master.initScripts + - master.JCasC.configScripts + - master.sidecars.other + - agent.envVars + - agent.volumes + ## 1.7.5 Fixed an issue where the JCasC won't run if JCasC auto-reload is enabled [issue #17135](https://github.com/helm/charts/issues/17135) diff --git a/stable/jenkins/Chart.yaml b/stable/jenkins/Chart.yaml index c4155e923c..77352f212a 100755 --- a/stable/jenkins/Chart.yaml +++ b/stable/jenkins/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 name: jenkins home: https://jenkins.io/ -version: 1.7.5 +version: 1.7.6 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/README.md b/stable/jenkins/README.md index d9f54e43be..3789e4eb0a 100644 --- a/stable/jenkins/README.md +++ b/stable/jenkins/README.md @@ -110,7 +110,7 @@ The following tables list the configurable parameters of the Jenkins chart and t | `master.loadBalancerSourceRanges` | Allowed inbound IP addresses | `0.0.0.0/0` | | `master.loadBalancerIP` | Optional fixed external IP | Not set | | `master.jmxPort` | Open a port, for JMX stats | Not set | -| `master.extraPorts` | Open extra ports, for other uses | Not set | +| `master.extraPorts` | Open extra ports, for other uses | `[]` | | `master.overwriteConfig` | Replace init scripts and config w/ ConfigMap on boot | `false` | | `master.ingress.enabled` | Enables ingress | `false` | | `master.ingress.apiVersion` | Ingress API version | `extensions/v1beta1` | @@ -132,13 +132,13 @@ The following tables list the configurable parameters of the Jenkins chart and t | `master.jenkinsUrlProtocol` | Set protocol for JenkinsLocationConfiguration.xml | Set to `https` if `Master.ingress.tls`, `http` otherwise | | `master.JCasC.enabled` | Wheter Jenkins Configuration as Code is enabled or not | `false` | | `master.JCasC.defaultConfig` | Enables default Jenkins configuration via configuration as code plugin | `false` | -| `master.JCasC.configScripts` | List of Jenkins Config as Code scripts | | +| `master.JCasC.configScripts` | List of Jenkins Config as Code scripts | `{}` | | `master.enableXmlConfig` | enables configuration done via XML files | `false` | | `master.sidecars.configAutoReload` | Jenkins Config as Code auto-reload settings | | | `master.sidecars.configAutoReload.enabled` | Jenkins Config as Code auto-reload settings (Attention: rbac needs to be enabled otherwise the sidecar can't read the config map) | `false` | | `master.sidecars.configAutoReload.image` | Image which triggers the reload | `shadwell/k8s-sidecar:0.0.2` | -| `master.sidecars.others` | Configures additional sidecar container(s) for Jenkins master | `{}` | -| `master.initScripts` | List of Jenkins init scripts | Not set | +| `master.sidecars.other` | Configures additional sidecar container(s) for Jenkins master | `[]` | +| `master.initScripts` | List of Jenkins init scripts | `[]` | | `master.credentialsXmlSecret` | Kubernetes secret that contains a 'credentials.xml' file | Not set | | `master.secretsFilesSecret` | Kubernetes secret that contains 'secrets' files | Not set | | `master.jobs` | Jenkins XML job configs | `{}` | @@ -146,7 +146,7 @@ The following tables list the configurable parameters of the Jenkins chart and t | `master.installPlugins` | List of Jenkins plugins to install. If you don't want to install plugins set it to `[]` | `kubernetes:1.18.2 workflow-aggregator:2.6 credentials-binding:1.19 git:3.11.0 workflow-job:2.33` | | `master.overwritePlugins` | Overwrite installed plugins on start.| `false` | | `master.enableRawHtmlMarkupFormatter` | Enable HTML parsing using (see below) | false | -| `master.scriptApproval` | List of groovy functions to approve | Not set | +| `master.scriptApproval` | List of groovy functions to approve | `[]` | | `master.nodeSelector` | Node labels for pod assignment | `{}` | | `master.affinity` | Affinity settings | `{}` | | `master.tolerations` | Toleration labels for pod assignment | `[]` | @@ -190,8 +190,8 @@ Some third-party systems, e.g. GitHub, use HTML-formatted data in their payload | `agent.tag` | Agent image tag | `3.27-1` | | `agent.privileged` | Agent privileged container | `false` | | `agent.resources` | Resources allocation (Requests and Limits) | `{requests: {cpu: 512m, memory: 512Mi}, limits: {cpu: 512m, memory: 512Mi}}`| -| `agent.volumes` | Additional volumes | `nil` | -| `agent.envVars` | Environment variables for the agent Pod | Not set | +| `agent.volumes` | Additional volumes | `[]` | +| `agent.envVars` | Environment variables for the agent Pod | `[]` | | `agent.command` | Executed command when side container starts | Not set | | `agent.args` | Arguments passed to executed command | Not set | | `agent.sideContainerName` | Side container name in agent | jnlp | diff --git a/stable/jenkins/templates/_helpers.tpl b/stable/jenkins/templates/_helpers.tpl index 9c9aab1dd0..e3f3f8b4f6 100644 --- a/stable/jenkins/templates/_helpers.tpl +++ b/stable/jenkins/templates/_helpers.tpl @@ -19,7 +19,7 @@ Allow the release namespace to be overridden for multi-namespace deployments in {{- define "jenkins.master.slaveKubernetesNamespace" -}} {{- if .Values.master.slaveKubernetesNamespace -}} - {{- .Values.master.slaveKubernetesNamespace -}} + {{- tpl .Values.master.slaveKubernetesNamespace . -}} {{- else -}} {{- if .Values.namespaceOverride -}} {{- .Values.namespaceOverride -}} diff --git a/stable/jenkins/values.yaml b/stable/jenkins/values.yaml index 847343f46b..2762ba239f 100644 --- a/stable/jenkins/values.yaml +++ b/stable/jenkins/values.yaml @@ -155,7 +155,7 @@ master: # -Dcom.sun.management.jmxremote.ssl=false # jmxPort: 4000 # Optionally configure other ports to expose in the master container - extraPorts: + extraPorts: [] # - name: BuildInfoProxy # port: 9000 @@ -173,11 +173,11 @@ master: # The plugin is not installed by default, please update master.installPlugins. enableRawHtmlMarkupFormatter: false # Used to approve a list of groovy functions in pipelines used the script-security plugin. Can be viewed under /scriptApproval - scriptApproval: + scriptApproval: [] # - "method groovy.json.JsonSlurperClassic parseText java.lang.String" # - "new groovy.json.JsonSlurperClassic" # List of groovy init scripts to be executed during Jenkins master start - initScripts: + initScripts: [] # - | # print 'adding global pipeline libraries, register properties, bootstrap jobs...' # Kubernetes secret that contains a 'credentials.xml' for Jenkins @@ -205,7 +205,7 @@ master: # it's only used when plugin version is <=1.18 for later version the # configuration as code support plugin is no longer needed supportPluginVersion: "1.18" - configScripts: + configScripts: {} # welcome-message: | # jenkins: # systemMessage: Welcome to our CI\CD server. This Jenkins is configured and managed 'as code'. @@ -247,7 +247,7 @@ master: # searchNamespace: # Allows you to inject additional/other sidecars - other: + other: [] ## The example below runs the client for https://smee.io as sidecar container next to Jenkins, ## that allows to trigger build behind a secure firewall. ## https://jenkins.io/blog/2019/01/07/webhook-firewalls/#triggering-builds-with-webhooks-behind-a-secure-firewall @@ -382,10 +382,10 @@ agent: # Configure the attributes as they appear in the corresponding Java class for that type # https://github.com/jenkinsci/kubernetes-plugin/tree/master/src/main/java/org/csanchez/jenkins/plugins/kubernetes/volumes # Pod-wide ennvironment, these vars are visible to any container in the agent pod - envVars: + envVars: [] # - name: PATH # value: /usr/local/bin - volumes: + volumes: [] # - type: Secret # secretName: mysecret # mountPath: /var/myapp/mysecret