|
1 | 1 | {{- $imageRepository := .Values.backstage.image.repository | required "The repository name of the image is required (e.g. my-backstage:tag | docker.io/my-backstage:tag) !" -}} |
2 | 2 | {{- $imageTag := .Values.backstage.image.tag | required "The image tag is required (e.g my-backstage:tag | docker.io/my-backstage:tag) !" -}} |
3 | 3 | {{- $installDir := .Values.backstage.installDir -}} |
4 | | -{{- $lightspeed := include "rhdh.lightspeed" . | fromYaml -}} |
5 | | -{{- $lightspeedRuntimeVolumeType := "" -}} |
6 | | -{{- if $lightspeed.enabled -}} |
7 | | -{{- $lightspeedRuntimeVolumeType = include "rhdh.lightspeed.runtimeVolumeType" (dict "volume" $lightspeed.runtimeVolume "path" "global.lightspeed.runtimeVolume") -}} |
8 | | -{{- end -}} |
9 | | -{{- $extraCatalogImages := include "rhdh.catalogIndex.extraImagesEnvValue" . | trim -}} |
10 | 4 | --- |
11 | 5 | apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }} |
12 | 6 | kind: Deployment |
|
45 | 39 | {{- end }} |
46 | 40 | annotations: |
47 | 41 | checksum/app-config: {{ include "common.tplvalues.render" ( dict "value" .Values.backstage.appConfig "context" $) | sha256sum }} |
48 | | - checksum/dynamic-plugins: {{ include "common.tplvalues.render" ( dict "value" (dict "dynamic" .Values.global.dynamic "lightspeed" (dict "enabled" $lightspeed.enabled "plugins" $lightspeed.plugins)) "context" $) | sha256sum }} |
49 | | - {{- if $lightspeed.enabled }} |
50 | | - checksum/lightspeed-configmaps: {{ include "rhdh.lightspeed.configMapsChecksum" (dict "context" $ "lightspeed" $lightspeed) | sha256sum }} |
51 | | - checksum/lightspeed-secret: {{ include "rhdh.lightspeed.secretChecksum" (dict "context" $ "lightspeed" $lightspeed) | sha256sum }} |
52 | | - {{- end }} |
53 | 42 | {{- if .Values.backstage.podAnnotations }} |
54 | 43 | {{- include "common.tplvalues.render" ( dict "value" .Values.backstage.podAnnotations "context" $ ) | nindent 8 }} |
55 | 44 | {{- end }} |
@@ -95,69 +84,10 @@ spec: |
95 | 84 | configMap: |
96 | 85 | name: {{ include "common.names.fullname" . }}-app-config |
97 | 86 | {{- end }} |
98 | | - {{- if $lightspeed.enabled }} |
99 | | - - name: {{ $lightspeed.runtimeVolume.name }} |
100 | | - {{- if eq $lightspeedRuntimeVolumeType "persistentVolumeClaim" }} |
101 | | - persistentVolumeClaim: |
102 | | - {{- include "common.tplvalues.render" ( dict "value" $lightspeed.runtimeVolume.persistentVolumeClaim "context" $ ) | nindent 12 }} |
103 | | - {{- else }} |
104 | | - emptyDir: |
105 | | - {{- include "common.tplvalues.render" ( dict "value" $lightspeed.runtimeVolume.emptyDir "context" $ ) | nindent 12 }} |
106 | | - {{- end }} |
107 | | - - name: {{ $lightspeed.ragVolume.name }} |
108 | | - emptyDir: |
109 | | - {{- include "common.tplvalues.render" ( dict "value" $lightspeed.ragVolume.emptyDir "context" $ ) | nindent 12 }} |
110 | | - {{- range $lightspeed.configMaps }} |
111 | | - - name: {{ include "rhdh.lightspeed.configMapVolumeName" . }} |
112 | | - configMap: |
113 | | - name: {{ include "rhdh.lightspeed.configMapName" (dict "root" $ "configMap" .) }} |
114 | | - optional: {{ default false .optional }} |
115 | | - {{- end }} |
116 | | - {{- end }} |
117 | 87 | {{- include "backstage.renderImagePullSecrets" . | nindent 6 }} |
118 | | - {{- if or .Values.backstage.initContainers $lightspeed.enabled }} |
| 88 | + {{- if .Values.backstage.initContainers }} |
119 | 89 | initContainers: |
120 | | - {{- if .Values.backstage.initContainers }} |
121 | | - {{- range .Values.backstage.initContainers }} |
122 | | - {{- $container := include "common.tplvalues.render" (dict "value" . "context" $) | fromYaml }} |
123 | | - {{- if and $extraCatalogImages (eq (index $container "name") "install-dynamic-plugins") }} |
124 | | - {{- $hasExisting := false }} |
125 | | - {{- range (default list (index $container "env")) }} |
126 | | - {{- if eq (default "" .name) "EXTRA_CATALOG_INDEX_IMAGES" }}{{ $hasExisting = true }}{{ end }} |
127 | | - {{- end }} |
128 | | - {{- if not $hasExisting }} |
129 | | - {{- $_ := set $container "env" (append (default list (index $container "env")) (dict "name" "EXTRA_CATALOG_INDEX_IMAGES" "value" $extraCatalogImages)) }} |
130 | | - {{- end }} |
131 | | - {{- end }} |
132 | | - - {{ $container | toYaml | nindent 10 | trim }} |
133 | | - {{- end }} |
134 | | - {{- end }} |
135 | | - {{- if $lightspeed.enabled }} |
136 | | - - name: {{ $lightspeed.initContainer.name }} |
137 | | - image: {{ include "backstage.image.render" (dict "image" $lightspeed.initContainer.image "global" .Values.global) | quote }} |
138 | | - imagePullPolicy: {{ $lightspeed.initContainer.imagePullPolicy | quote }} |
139 | | - {{- if $lightspeed.initContainer.securityContext }} |
140 | | - securityContext: |
141 | | - {{- include "common.tplvalues.render" (dict "value" $lightspeed.initContainer.securityContext "context" $) | nindent 12 }} |
142 | | - {{- end }} |
143 | | - {{- if $lightspeed.initContainer.command }} |
144 | | - command: {{- include "common.tplvalues.render" (dict "value" $lightspeed.initContainer.command "context" $) | nindent 12 }} |
145 | | - {{- end }} |
146 | | - {{- if $lightspeed.initContainer.args }} |
147 | | - args: {{- include "common.tplvalues.render" (dict "value" $lightspeed.initContainer.args "context" $) | nindent 12 }} |
148 | | - {{- end }} |
149 | | - {{- if $lightspeed.initContainer.env }} |
150 | | - env: {{- include "common.tplvalues.render" (dict "value" $lightspeed.initContainer.env "context" $) | nindent 12 }} |
151 | | - {{- end }} |
152 | | - {{- if $lightspeed.initContainer.resources }} |
153 | | - resources: {{- include "common.tplvalues.render" (dict "value" $lightspeed.initContainer.resources "context" $) | nindent 12 }} |
154 | | - {{- end }} |
155 | | - volumeMounts: |
156 | | - - name: {{ $lightspeed.runtimeVolume.name }} |
157 | | - mountPath: {{ $lightspeed.runtimeVolume.mountPath | quote }} |
158 | | - - name: {{ $lightspeed.ragVolume.name }} |
159 | | - mountPath: {{ $lightspeed.ragVolume.initMountPath | quote }} |
160 | | - {{- end }} |
| 90 | + {{- include "common.tplvalues.render" ( dict "value" .Values.backstage.initContainers "context" $) | nindent 8 }} |
161 | 91 | {{- end }} |
162 | 92 | containers: |
163 | 93 | - name: backstage-backend |
@@ -256,48 +186,6 @@ spec: |
256 | 186 | {{- include "common.tplvalues.render" ( dict "value" .Values.backstage.extraVolumeMounts "context" $ ) | nindent 12 }} |
257 | 187 | {{- end }} |
258 | 188 | {{- end }} |
259 | | - {{- if $lightspeed.enabled }} |
260 | | - - name: {{ $lightspeed.sidecar.name }} |
261 | | - image: {{ include "backstage.image.render" (dict "image" $lightspeed.sidecar.image "global" .Values.global) | quote }} |
262 | | - imagePullPolicy: {{ $lightspeed.sidecar.imagePullPolicy | quote }} |
263 | | - {{- if $lightspeed.sidecar.securityContext }} |
264 | | - securityContext: |
265 | | - {{- include "common.tplvalues.render" (dict "value" $lightspeed.sidecar.securityContext "context" $) | nindent 12 }} |
266 | | - {{- end }} |
267 | | - {{- if $lightspeed.sidecar.command }} |
268 | | - command: {{- include "common.tplvalues.render" (dict "value" $lightspeed.sidecar.command "context" $) | nindent 12 }} |
269 | | - {{- end }} |
270 | | - {{- if $lightspeed.sidecar.args }} |
271 | | - args: {{- include "common.tplvalues.render" (dict "value" $lightspeed.sidecar.args "context" $) | nindent 12 }} |
272 | | - {{- end }} |
273 | | - ports: |
274 | | - - name: {{ $lightspeed.sidecar.portName }} |
275 | | - containerPort: {{ $lightspeed.sidecar.containerPort }} |
276 | | - protocol: TCP |
277 | | - envFrom: |
278 | | - - secretRef: |
279 | | - name: {{ include "rhdh.lightspeed.secretName" (dict "context" $ "lightspeed" $lightspeed) }} |
280 | | - optional: {{ default false $lightspeed.secret.optional }} |
281 | | - {{- if $lightspeed.sidecar.env }} |
282 | | - env: {{- include "common.tplvalues.render" (dict "value" $lightspeed.sidecar.env "context" $) | nindent 12 }} |
283 | | - {{- end }} |
284 | | - {{- if $lightspeed.sidecar.resources }} |
285 | | - resources: {{- include "common.tplvalues.render" (dict "value" $lightspeed.sidecar.resources "context" $) | nindent 12 }} |
286 | | - {{- end }} |
287 | | - volumeMounts: |
288 | | - - name: {{ $lightspeed.runtimeVolume.name }} |
289 | | - mountPath: {{ $lightspeed.runtimeVolume.mountPath | quote }} |
290 | | - - name: {{ $lightspeed.ragVolume.name }} |
291 | | - mountPath: {{ $lightspeed.ragVolume.mountPath | quote }} |
292 | | - {{- range $lightspeed.configMaps }} |
293 | | - - name: {{ include "rhdh.lightspeed.configMapVolumeName" . }} |
294 | | - mountPath: {{ .mountPath | quote }} |
295 | | - {{- if .subPath }} |
296 | | - subPath: {{ .subPath | quote }} |
297 | | - {{- end }} |
298 | | - readOnly: true |
299 | | - {{- end }} |
300 | | - {{- end }} |
301 | 189 | {{- if .Values.backstage.extraContainers }} |
302 | 190 | {{- include "common.tplvalues.render" ( dict "value" .Values.backstage.extraContainers "context" $) | nindent 8 }} |
303 | 191 | {{- end }} |
0 commit comments