Skip to content

Commit 81987e4

Browse files
committed
[bitnami/grafana-operator] Revert #14181 and #14103
Signed-off-by: Miguel Ruiz <miruiz@vmware.com>
1 parent c02304b commit 81987e4

File tree

6 files changed

+180
-22
lines changed

6 files changed

+180
-22
lines changed

bitnami/grafana-operator/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ name: grafana-operator
2424
sources:
2525
- https://github.com/grafana-operator/grafana-operator
2626
- https://github.com/bitnami/containers/tree/main/bitnami/grafana-operator
27-
version: 2.7.14
27+
version: 2.7.15

bitnami/grafana-operator/crds/grafanas.integreatly.org.yaml

-7
Original file line numberDiff line numberDiff line change
@@ -3261,13 +3261,6 @@ spec:
32613261
required:
32623262
- enabled
32633263
type: object
3264-
initContainers:
3265-
items:
3266-
description: A single application container that you want to run within a pod.
3267-
required:
3268-
- name
3269-
type: object
3270-
type: array
32713264
labels:
32723265
additionalProperties:
32733266
type: string

bitnami/grafana-operator/templates/grafana.yaml

-3
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,6 @@ spec:
6969
{{- end }}
7070
{{- $imagePullSecrets | nindent 4 }}
7171
{{- end }}
72-
{{- if .Values.grafana.initContainers }}
73-
initContainers: {{- include "common.tplvalues.render" (dict "value" .Values.grafana.initContainers "context" $) | nindent 4 }}
74-
{{- end }}
7572
{{- if .Values.grafana.sidecars }}
7673
containers:
7774
{{- include "common.tplvalues.render" ( dict "value" .Values.grafana.sidecars "context" $) | nindent 4 }}

bitnami/grafana-operator/values.yaml

-11
Original file line numberDiff line numberDiff line change
@@ -804,17 +804,6 @@ grafana:
804804
## @param grafana.extraVolumeMounts Optionally specify extra list of additional volumeMounts for the grafana container(s)
805805
##
806806
extraVolumeMounts: []
807-
## @param grafana.initContainers [array] Add additional init containers to the grafana pods
808-
## e.g:
809-
## initContainers:
810-
## - name: your-image-name
811-
## image: your-image
812-
## imagePullPolicy: Always
813-
## ports:
814-
## - name: portname
815-
## containerPort: 1234
816-
##
817-
initContainers: []
818807
## @param grafana.sidecars Add additional sidecar containers to the grafana pod(s)
819808
## e.g:
820809
## sidecars:

bitnami/jenkins/templates/deployment.yaml

+107
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ spec:
124124
value: {{ .Values.service.ports.http | quote }}
125125
- name: JENKINS_EXTERNAL_HTTPS_PORT_NUMBER
126126
value: {{ .Values.service.ports.https | quote }}
127+
- name: JENKINS_PLUGINS_LATEST
128+
value: {{ ternary "true" "false" .Values.latestPlugins }}
129+
- name: JENKINS_PLUGINS_LATEST_SPECIFIED
130+
value: {{ ternary "true" "false" .Values.latestSpecifiedPlugins }}
127131
{{- if .Values.javaOpts }}
128132
- name: JAVA_OPTS
129133
value: {{ .Values.javaOpts | join " " | quote }}
@@ -190,9 +194,72 @@ spec:
190194
volumeMounts:
191195
- name: jenkins-data
192196
mountPath: /bitnami/jenkins
197+
{{- if or .Values.plugins .Values.extraPlugins}}
198+
- name: jenkins-plugins
199+
mountPath: /opt/bitnami/jenkins/config/plugins.txt
200+
subPath: plugins.txt
201+
{{- end }}
202+
{{- if .Values.initScripts }}
203+
- name: custom-init-scripts
204+
mountPath: /docker-entrypoint-initdb.d/
205+
{{- end }}
206+
{{- if .Values.initHookScripts }}
207+
- name: jenkins-init-hook-scripts
208+
mountPath: /bitnami/jenkins/init.groovy.d/
209+
{{- end }}
193210
{{- if .Values.extraVolumeMounts }}
194211
{{- include "common.tplvalues.render" (dict "value" .Values.extraVolumeMounts "context" $) | nindent 12 }}
195212
{{- end }}
213+
{{- if .Values.configAsCode.enabled }}
214+
- name: reload-configuration-as-code
215+
image: {{ include "jenkins.image" . }}
216+
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
217+
{{- if .Values.containerSecurityContext.enabled }}
218+
securityContext: {{- omit .Values.containerSecurityContext "enabled" | toYaml | nindent 12 }}
219+
{{- end }}
220+
{{- if .Values.configAsCode.autoReload.command }}
221+
command: {{- include "common.tplvalues.render" (dict "value" .Values.command "context" $) | nindent 12 }}
222+
{{- else }}
223+
command:
224+
- /bin/bash
225+
{{- end }}
226+
{{- if .Values.configAsCode.autoReload.args }}
227+
args: {{- include "common.tplvalues.render" (dict "value" .Values.args "context" $) | nindent 12 }}
228+
{{- else }}
229+
args:
230+
- -ec
231+
- |
232+
# Read the ServiceAccount bearer token
233+
TOKEN=$(cat ${SERVICEACCOUNT}/token)
234+
# Reference the internal certificate authority (CA)
235+
CACERT=${SERVICEACCOUNT}/ca.crt
236+
237+
while true; do
238+
# Explore the API with TOKEN
239+
curl --cacert "${CACERT}" -H "Authorization: Bearer ${TOKEN}" -H "Accept: application/json" "${APISERVER}/api/v1/namespaces/${NAMESPACE}/configmaps/${CONFIGMAP_NAME}" | jq -r '.data'
240+
241+
if ; then
242+
if ! retry_while "curl http://localhost:{{ .Values.containerPorts.http }}/reload-configuration-as-code/?casc-reload-token=$(POD_NAME)" "{{ .Values.configAsCode.autoReload.reqRetries | int }}" "10"; then
243+
error "Jenkins is not accessible"
244+
fi
245+
246+
fi
247+
sleep {{ default "60" .Values.configAsCode.autoReload.interval }}
248+
done
249+
{{- end }}
250+
{{- if .Values.controller.sidecars.configAutoReload.envFrom }}
251+
envFrom:
252+
{{ (tpl (toYaml .Values.controller.sidecars.configAutoReload.envFrom) .) | indent 12 }}
253+
{{- end }}
254+
env:
255+
- name: POD_NAME
256+
valueFrom:
257+
fieldRef:
258+
fieldPath: metadata.name
259+
volumeMounts:
260+
- name: jenkins-data
261+
mountPath: /bitnami/jenkins/
262+
{{- end}}
196263
{{- if .Values.sidecars }}
197264
{{- include "common.tplvalues.render" ( dict "value" .Values.sidecars "context" $) | nindent 8 }}
198265
{{- end }}
@@ -204,6 +271,46 @@ spec:
204271
{{- else }}
205272
emptyDir: {}
206273
{{- end }}
274+
{{- if or .Values.plugins .Values.extraPlugins}}
275+
- name: jenkins-config
276+
configMap:
277+
name: {{ template "common.names.fullname" . }}
278+
{{- end }}
279+
{{- if or .Values.initScripts .Values.initScriptsCM .Values.initScriptsSecret }}
280+
- name: custom-init-scripts
281+
projected:
282+
sources:
283+
{{- if .Values.initScripts }}
284+
- configMap:
285+
name: {{ template "jenkins.initScripts" . }}
286+
{{- end }}
287+
{{- if .Values.initScriptsCM }}
288+
- configMap:
289+
name: {{ template ".Values.initScriptsCM" . }}
290+
{{- end }}
291+
{{- if .Values.initScriptsSecret }}
292+
- secret:
293+
secretName: {{ template ".Values.initScriptsSecret" . }}
294+
defaultMode: 0755
295+
{{- end }}
296+
{{- end }}
297+
{{- if or .Values.initHookScripts .Values.initHookScriptsCM .Values.initHookScriptsSecret }}
298+
- name: jenkins-init-hook-scripts
299+
projected:
300+
sources:
301+
{{- if .Values.initHookScripts }}
302+
- configMap:
303+
name: {{ template "jenkins.initHookScripts" . }}
304+
{{- if .Values.initHookScriptsCM }}
305+
- configMap:
306+
name: {{ template ".Values.initHookScriptsCM" . }}
307+
{{- end }}
308+
{{- if .Values.initHookScriptsSecret }}
309+
- secret:
310+
secretName: {{ template ".Values.initHookScriptsSecret" . }}
311+
defaultMode: 0755
312+
{{- end }}
313+
{{- end }}
207314
{{- if .Values.extraVolumes }}
208315
{{- include "common.tplvalues.render" (dict "value" .Values.extraVolumes "context" $) | nindent 8 }}
209316
{{- end }}

bitnami/jenkins/values.yaml

+72
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,78 @@ extraEnvVarsCM: ""
131131
##
132132
extraEnvVarsSecret: ""
133133

134+
## @param plugins List of plugins to be installed during Jenkins first boot
135+
##
136+
plugins:
137+
- kubernetes:3734.v562b_b_a_627ea_c
138+
- workflow-aggregator:590.v6a_d052e5a_a_b_5
139+
- git:4.13.0
140+
- configuration-as-code:1569.vb_72405b_80249
141+
## @param List of plugins to install in addition to those listed in
142+
##
143+
extraPlugins: []
144+
## @param Set to true to download the latest version of all dependencies, even if the version(s) of the requested plugin(s) are not the latest.
145+
##
146+
latestPlugins: true
147+
## @param Set to true download the latest dependencies of any plugin that is requested to have the latest version.
148+
##
149+
latestSpecifiedPlugins: false
150+
151+
## @param initScripts Dictionary of scripts to be mounted at `/docker-entrypoint-initdb.d`. Evaluated as a template. Allows .sh and .groovy formats.
152+
## These scripts will only be executed during the container first startup.
153+
## For example:
154+
## initScripts:
155+
## my_init_script.sh: |
156+
## #!/bin/sh
157+
## echo "Do something."
158+
##
159+
initScripts: {}
160+
## @param initScriptsCM ConfigMap containing the `/docker-entrypoint-initdb.d` scripts. Evaluated as a template.
161+
##
162+
initScriptsCM: ""
163+
## @param initScriptsSecret Secret containing `/docker-entrypoint-initdb.d` scripts to be executed at initialization time that contain sensitive data. Evaluated as a template.
164+
##
165+
initScriptsSecret: ""
166+
167+
## @param initHookScripts Dictionary of scripts to be mounted at `$JENKINS_HOME/init.groovy.d`. Evaluated as a template. Allows .sh and .groovy formats.
168+
## These init scripts will executed each time Jenkins is .
169+
##
170+
## For example:
171+
## initHookScripts:
172+
## my_script.groovy: |
173+
## println "Hello World"
174+
##
175+
initHookScripts: {}
176+
## @param initHookScriptsCM ConfigMap containing the `$JENKINS_HOME/init.groovy.d` scripts. Evaluated as a template.
177+
##
178+
initHookScriptsCM: ""
179+
## @param initHookScriptsSecret Secret containing `$JENKINS_HOME/init.groovy.d` scripts to be executed at initialization time that contain sensitive data. Evaluated as a template.
180+
##
181+
initHookScriptsSecret: ""
182+
183+
## @section Jenkins Configuration as Code plugin
184+
##
185+
186+
configAsCode:
187+
enabled: true
188+
189+
autoReload:
190+
enabled: true
191+
## Bitnami Kubectl image
192+
## ref: https://hub.docker.com/r/bitnami/kubectl/tags/
193+
## @param configAsCode.autoReload.image.registry Init container auto-discovery image registry
194+
## @param configAsCode.autoReload.image.repository Init container auto-discovery image repository
195+
## @param configAsCode.autoReload.image.tag Init container auto-discovery image tag (immutable tags are recommended)
196+
## @param configAsCode.autoReload.image.digest Init container auto-discovery image digest in the way sha256:aa.... Please note this parameter, if set, will override the tag
197+
## @param configAsCode.autoReload.image.pullPolicy Init container auto-discovery image pull policy
198+
## @param configAsCode.autoReload.image.pullSecrets Init container auto-discovery image pull secrets
199+
##
200+
image:
201+
registry: docker.io
202+
repository: bitnami/kubectl
203+
tag: 1.25.5-debian-11-r0
204+
digest: ""
205+
134206
## @section Jenkins deployment parameters
135207

136208
## @param updateStrategy.type Jenkins deployment strategy type

0 commit comments

Comments
 (0)