blob: c9fdbcb3fc1463723738f75e0a1969d0f7bd098e [file] [log] [blame]
Giorgi Lekveishvili35982662024-04-05 13:05:40 +04001{{- $root := . }}
2{{- if .Values.controller.sidecars.configAutoReload.enabled }}
3{{- range $key, $val := .Values.controller.JCasC.configScripts }}
4{{- if $val }}
5---
6apiVersion: v1
7kind: ConfigMap
8metadata:
9 name: {{ template "jenkins.casc.configName" (list (printf "config-%s" $key) $ )}}
10 namespace: {{ template "jenkins.namespace" $root }}
11 labels:
gio20157e82026-07-22 13:10:48 +040012 {{- include "jenkins.labels" $root | nindent 4 }}
Giorgi Lekveishvili35982662024-04-05 13:05:40 +040013 {{ template "jenkins.fullname" $root }}-jenkins-config: "true"
gio20157e82026-07-22 13:10:48 +040014{{- if $root.Values.controller.JCasC.configMapAnnotations }}
15 annotations:
16{{ toYaml $root.Values.controller.JCasC.configMapAnnotations | indent 4 }}
17{{- end }}
Giorgi Lekveishvili35982662024-04-05 13:05:40 +040018data:
19 {{ $key }}.yaml: |-
20{{ tpl $val $| indent 4 }}
21{{- end }}
22{{- end }}
23{{- if .Values.controller.JCasC.defaultConfig }}
24---
25apiVersion: v1
26kind: ConfigMap
27metadata:
28 name: {{ template "jenkins.casc.configName" (list "jcasc-config" $ )}}
29 namespace: {{ template "jenkins.namespace" $root }}
30 labels:
gio20157e82026-07-22 13:10:48 +040031 {{- include "jenkins.labels" $root | nindent 4 }}
32 {{ template "jenkins.fullname" $root }}-jenkins-config: "true"
33{{- if $root.Values.controller.JCasC.configMapAnnotations }}
34 annotations:
35{{ toYaml $root.Values.controller.JCasC.configMapAnnotations | indent 4 }}
36{{- end }}
37data:
38 jcasc-default-config.yaml: |-
39 {{- include "jenkins.casc.defaults" . | nindent 4 }}
40{{- end}}
41{{- $configScripts := toYaml .Values.controller.JCasC.configScripts }}
42{{- if and .Values.controller.JCasC.securityRealm (not (contains "securityRealm:" $configScripts)) (not .Values.controller.JCasC.defaultConfig) }}
43---
44apiVersion: v1
45kind: ConfigMap
46metadata:
47 name: {{ template "jenkins.casc.configName" (list "config-securityrealm" $ )}}
48 namespace: {{ template "jenkins.namespace" $root }}
49 labels:
Giorgi Lekveishvili35982662024-04-05 13:05:40 +040050 "app.kubernetes.io/name": {{ template "jenkins.name" $root}}
51 {{- if .Values.renderHelmLabels }}
gio20157e82026-07-22 13:10:48 +040052 "helm.sh/chart": "{{ $root.Chart.Name }}-{{ $root.Chart.Version | replace "+" "_" }}"
Giorgi Lekveishvili35982662024-04-05 13:05:40 +040053 {{- end }}
54 "app.kubernetes.io/managed-by": "{{ $.Release.Service }}"
55 "app.kubernetes.io/instance": "{{ $.Release.Name }}"
56 "app.kubernetes.io/component": "{{ $.Values.controller.componentName }}"
57 {{ template "jenkins.fullname" $root }}-jenkins-config: "true"
gio20157e82026-07-22 13:10:48 +040058{{- if $root.Values.controller.JCasC.configMapAnnotations }}
59 annotations:
60{{ toYaml $root.Values.controller.JCasC.configMapAnnotations | indent 4 }}
61{{- end }}
Giorgi Lekveishvili35982662024-04-05 13:05:40 +040062data:
gio20157e82026-07-22 13:10:48 +040063 securityrealm.yaml: |-
64 jenkins:
65 securityRealm:
66 {{- tpl .Values.controller.JCasC.securityRealm . | nindent 8 }}
67{{- end }}
68{{- if and .Values.controller.JCasC.authorizationStrategy (not (contains "authorizationStrategy:" $configScripts)) (not .Values.controller.JCasC.defaultConfig) }}
69---
70apiVersion: v1
71kind: ConfigMap
72metadata:
73 name: {{ template "jenkins.casc.configName" (list "config-authorizationstrategy" $ )}}
74 namespace: {{ template "jenkins.namespace" $root }}
75 labels:
76 "app.kubernetes.io/name": {{ template "jenkins.name" $root}}
77 {{- if .Values.renderHelmLabels }}
78 "helm.sh/chart": "{{ $root.Chart.Name }}-{{ $root.Chart.Version | replace "+" "_" }}"
79 {{- end }}
80 "app.kubernetes.io/managed-by": "{{ $.Release.Service }}"
81 "app.kubernetes.io/instance": "{{ $.Release.Name }}"
82 "app.kubernetes.io/component": "{{ $.Values.controller.componentName }}"
83 {{ template "jenkins.fullname" $root }}-jenkins-config: "true"
84{{- if $root.Values.controller.JCasC.configMapAnnotations }}
85 annotations:
86{{ toYaml $root.Values.controller.JCasC.configMapAnnotations | indent 4 }}
87{{- end }}
88data:
89 authorizationstrategy.yaml: |-
90 jenkins:
91 authorizationStrategy:
92 {{- tpl .Values.controller.JCasC.authorizationStrategy . | nindent 8 }}
93{{- end }}
Giorgi Lekveishvili35982662024-04-05 13:05:40 +040094{{- end }}