|
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 -}} |
4 | 10 | --- |
5 | 11 | apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }} |
6 | 12 | kind: Deployment |
|
39 | 45 | {{- end }} |
40 | 46 | annotations: |
41 | 47 | 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 }} |
42 | 53 | {{- if .Values.backstage.podAnnotations }} |
43 | 54 | {{- include "common.tplvalues.render" ( dict "value" .Values.backstage.podAnnotations "context" $ ) | nindent 8 }} |
44 | 55 | {{- end }} |
@@ -84,10 +95,69 @@ spec: |
84 | 95 | configMap: |
85 | 96 | name: {{ include "common.names.fullname" . }}-app-config |
86 | 97 | {{- 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 }} |
87 | 117 | {{- include "backstage.renderImagePullSecrets" . | nindent 6 }} |
88 | | - {{- if .Values.backstage.initContainers }} |
| 118 | + {{- if or .Values.backstage.initContainers $lightspeed.enabled }} |
89 | 119 | initContainers: |
90 | | - {{- include "common.tplvalues.render" ( dict "value" .Values.backstage.initContainers "context" $) | nindent 8 }} |
| 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 }} |
91 | 161 | {{- end }} |
92 | 162 | containers: |
93 | 163 | - name: backstage-backend |
@@ -186,6 +256,48 @@ spec: |
186 | 256 | {{- include "common.tplvalues.render" ( dict "value" .Values.backstage.extraVolumeMounts "context" $ ) | nindent 12 }} |
187 | 257 | {{- end }} |
188 | 258 | {{- 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 }} |
189 | 301 | {{- if .Values.backstage.extraContainers }} |
190 | 302 | {{- include "common.tplvalues.render" ( dict "value" .Values.backstage.extraContainers "context" $) | nindent 8 }} |
191 | 303 | {{- end }} |
0 commit comments