Skip to content

Commit 92aa38c

Browse files
authored
[jenkins] Add option to configure extra volumes and init containers (#35)
Signed-off-by: Reinhard Nägele <[email protected]>
1 parent 338be55 commit 92aa38c

File tree

5 files changed

+30
-1
lines changed

5 files changed

+30
-1
lines changed

charts/jenkins/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v1
22
name: jenkins
33
description: The leading open source automation server
4-
version: 1.1.0
4+
version: 1.2.0
55
appVersion: 2.164.3
66
home: https://jenkins.io/
77
icon: https://wiki.jenkins-ci.org/download/attachments/2916393/logo.png

charts/jenkins/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ Parameter | Description | Default
4545
`image.tag` | The Jenkins image tag | `2.164.3-alpine`
4646
`image.pullPolicy` | The Jenkins image pull policy | `IfNotPresent`
4747
`imagePullSecrets` | Image pull secrets | `[]`
48+
`extraInitContainers` | Additional init containers. Passed through the `tpl` function and thus to be configured as string | `""`
49+
`extraVolumeMounts` | Add additional volumes mounts. Passed through the `tpl` function and thus to be configured as string | `""`
50+
`extraVolumes` | Add additional volumes. Passed through the `tpl` function and thus to be configured as string | `""`
4851
`podAnnotations` | Annotations for the Jenkins pod | `{}`
4952
`javaOpts` | `JAVA_OPTS` for the Jenkins process | `-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -XX:MaxRAMFraction=2 -XshowSettings:vm`
5053
`extraEnv` | Allows the specification of additional environment variables for Jenkins. Passed through the `tpl` function and thus to be configured as string | `""`

charts/jenkins/ci/k8s-values.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,5 +142,15 @@ k8sCredentials:
142142
sdf fdsf dsf fdsfsfsdf sf sd
143143
sdf fsf dsfsf sdfs fsdf f
144144
145+
extraInitContainers: |
146+
- name: jenkins-extra-init
147+
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
148+
imagePullPolicy: {{ .Values.image.pullPolicy }}
149+
command:
150+
- "sh"
151+
args:
152+
- "-c"
153+
- "echo 'Hello from extra init container!'"
154+
145155
test:
146156
enabled: true

charts/jenkins/templates/deployment.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ spec:
4848
resources:
4949
{{- toYaml . | nindent 12 }}
5050
{{- end }}
51+
{{- with .Values.extraInitContainers }}
52+
{{- tpl . $ | nindent 8 }}
53+
{{- end }}
5154
containers:
5255
- name: jenkins-master
5356
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
@@ -91,6 +94,9 @@ spec:
9194
mountPath: /casc-secrets
9295
readOnly: true
9396
{{- end }}
97+
{{- with .Values.extraVolumeMounts }}
98+
{{- tpl . $ | nindent 12 }}
99+
{{- end }}
94100
{{- with .Values.resources }}
95101
resources:
96102
{{- toYaml . | nindent 12 }}
@@ -141,3 +147,6 @@ spec:
141147
configMap:
142148
name: {{ include "jenkins.fullname" $ }}-{{ include "jenkins.configmapSuffix" . }}
143149
{{- end }}
150+
{{- with .Values.extraVolumes }}
151+
{{- tpl . $ | nindent 8 }}
152+
{{- end }}

charts/jenkins/values.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ image:
99
imagePullSecrets: []
1010
# - my-pull-secret
1111

12+
## Additional init containers, e. g. for providing custom themes
13+
extraInitContainers: |
14+
1215
# Annotations for the Jenkins pod
1316
podAnnotations: {}
1417

@@ -81,6 +84,10 @@ serviceAccount:
8184
# # If not set and create is true, a name is generated using the fullname template
8285
# name: "bar-account"
8386

87+
## Add additional volumes and mounts
88+
extraVolumes: |
89+
extraVolumeMounts: |
90+
8491
rbac:
8592
master:
8693
# Specifies whether RBAC resources should be created

0 commit comments

Comments
 (0)