[stable/jenkins] Ability to specify raw yaml template (#13319)

* Add agent raw pod yaml option

Signed-off-by: Joshua Bussdieker <jbussdieker@gmail.com>

* Update documentation

Signed-off-by: Joshua Bussdieker <jbussdieker@gmail.com>

* Add empty value for readability and editor use

Signed-off-by: Joshua Bussdieker <jbussdieker@gmail.com>

* Allow variable usage in yamlTemplate

Signed-off-by: Joshua Bussdieker <jbussdieker@gmail.com>

* Use html escaping function

Signed-off-by: Joshua Bussdieker <jbussdieker@gmail.com>

* Eliminate leading newline using trim

Signed-off-by: Joshua Bussdieker <jbussdieker@gmail.com>
This commit is contained in:
Joshua Bussdieker
2019-04-26 15:46:22 -07:00
committed by Kubernetes Prow Robot
parent c3c71b60a6
commit 77aaa9a5fc
4 changed files with 17 additions and 1 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
name: jenkins
home: https://jenkins.io/
version: 1.1.9
version: 1.1.10
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
+1
View File
@@ -175,6 +175,7 @@ Some third-party systems, e.g. GitHub, use HTML-formatted data in their payload
| `agent.containerCap` | Maximum number of agent | 10 |
| `agent.podName` | slave Pod base name | Not set |
| `agent.idleMinutes` | Allows the Pod to remain active for reuse | 0 |
| `agent.yamlTemplate` | The raw yaml of a Pod API Object to merge into the agent spec | Not set |
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`.
+3
View File
@@ -116,6 +116,9 @@ data:
<imagePullSecrets/>
{{- end }}
<nodeProperties/>
{{- if .Values.agent.yamlTemplate }}
<yaml>{{ tpl .Values.agent.yamlTemplate . | html | indent 4 | trim }}</yaml>
{{- end }}
<podRetention class="org.csanchez.jenkins.plugins.kubernetes.pod.retention.Default"/>
</org.csanchez.jenkins.plugins.kubernetes.PodTemplate>
{{- end -}}
+12
View File
@@ -356,6 +356,18 @@ agent:
# Allows the Pod to remain active for reuse until the configured number of
# minutes has passed since the last step was executed on it.
idleMinutes: 0
# Raw yaml template for the Pod. For example this allows usage of toleration for agent pods.
# https://github.com/jenkinsci/kubernetes-plugin#using-yaml-to-define-pod-templates
# https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
yamlTemplate:
# yamlTemplate: |-
# apiVersion: v1
# kind: Pod
# spec:
# tolerations:
# - key: "key"
# operator: "Equal"
# value: "value"
persistence:
enabled: true