|
1 | 1 | {{- include "isPrometheusConfigValid" . }} |
2 | 2 | {{- include "kubeRBACProxyBearerTokenCheck" . }} |
| 3 | +{{ include "opencost.caCertsSecretConfig.check" . }} |
3 | 4 | apiVersion: apps/v1 |
4 | 5 | kind: Deployment |
5 | 6 | metadata: |
@@ -50,20 +51,44 @@ spec: |
50 | 51 | {{- with.Values.opencost.topologySpreadConstraints }} |
51 | 52 | topologySpreadConstraints: {{- toYaml . | nindent 8 }} |
52 | 53 | {{- end }} |
53 | | - {{- if (and .Values.plugins.enabled .Values.plugins.install.enabled )}} |
54 | 54 | initContainers: |
| 55 | + {{- if (and .Values.plugins.enabled .Values.plugins.install.enabled ) }} |
55 | 56 | - name: plugin-installer |
56 | 57 | image: {{ .Values.plugins.install.fullImageName }} |
57 | 58 | command: ["sh", "/install/install_plugins.sh"] |
58 | | - {{- with .Values.plugins.install.securityContext }} |
| 59 | + {{- with .Values.plugins.install.securityContext }} |
59 | 60 | securityContext: {{- toYaml . | nindent 12 }} |
60 | | - {{- end }} |
| 61 | + {{- end }} |
61 | 62 | volumeMounts: |
62 | 63 | - name: install-script |
63 | 64 | mountPath: /install |
64 | 65 | - name: plugins-dir |
65 | 66 | mountPath: {{ .Values.plugins.folder }} |
66 | | - {{- end }} |
| 67 | + {{- end }} |
| 68 | + {{- if .Values.opencost.updateCaTrust.enabled }} |
| 69 | + - name: update-ca-trust |
| 70 | + image: {{ include "opencost.fullImageName" . }} |
| 71 | + imagePullPolicy: {{ .Values.opencost.exporter.image.pullPolicy }} |
| 72 | + {{- with .Values.opencost.updateCaTrust.securityContext }} |
| 73 | + securityContext: {{- toYaml . | nindent 12 }} |
| 74 | + {{- end }} |
| 75 | + {{- with .Values.opencost.updateCaTrust.resources }} |
| 76 | + resources: |
| 77 | + {{- toYaml . | nindent 12 }} |
| 78 | + {{- end }} |
| 79 | + command: |
| 80 | + - 'sh' |
| 81 | + - '-c' |
| 82 | + - > |
| 83 | + mkdir -p /etc/ssl/certs; |
| 84 | + update-ca-certificates; |
| 85 | + volumeMounts: |
| 86 | + - name: ca-certs-secret |
| 87 | + mountPath: "/usr/local/share/ca-certificates" |
| 88 | + - name: ssl-path |
| 89 | + mountPath: "/etc/ssl/certs" |
| 90 | + readOnly: false |
| 91 | + {{- end}} |
67 | 92 | containers: |
68 | 93 | - name: {{ include "opencost.fullname" . }} |
69 | 94 | image: {{ include "opencost.fullImageName" . }} |
@@ -281,7 +306,7 @@ spec: |
281 | 306 | - name: {{ $key }} |
282 | 307 | value: {{ $value | quote }} |
283 | 308 | {{- end }} |
284 | | - {{- if or .Values.plugins.enabled .Values.opencost.exporter.persistence.enabled .Values.opencost.exporter.extraVolumeMounts .Values.opencost.customPricing.enabled .Values.opencost.cloudIntegrationSecret}} |
| 309 | + {{- if or .Values.plugins.enabled .Values.opencost.exporter.persistence.enabled .Values.opencost.exporter.extraVolumeMounts .Values.opencost.customPricing.enabled .Values.opencost.cloudIntegrationSecret .Values.opencost.updateCaTrust.enabled}} |
285 | 310 | volumeMounts: |
286 | 311 | {{- if .Values.plugins.enabled }} |
287 | 312 | - mountPath: /opt/opencost/plugin |
@@ -315,6 +340,13 @@ spec: |
315 | 340 | - name: cloud-integration |
316 | 341 | mountPath: /var/configs/cloud-integration |
317 | 342 | {{- end }} |
| 343 | + {{- if .Values.opencost.updateCaTrust.enabled }} |
| 344 | + - name: ca-certs-secret |
| 345 | + mountPath: "/usr/local/share/ca-certificates" |
| 346 | + - name: ssl-path |
| 347 | + mountPath: "/etc/ssl/certs" |
| 348 | + readOnly: false |
| 349 | + {{- end }} |
318 | 350 | {{- with .Values.opencost.exporter.extraVolumeMounts }} |
319 | 351 | {{- toYaml . | nindent 12 }} |
320 | 352 | {{- end }} |
@@ -412,7 +444,7 @@ spec: |
412 | 444 | {{- toYaml . | nindent 12 }} |
413 | 445 | {{- end }} |
414 | 446 | {{- end }} |
415 | | - {{- if or .Values.plugins.enabled .Values.opencost.exporter.persistence.enabled .Values.extraVolumes .Values.opencost.customPricing.enabled .Values.opencost.cloudIntegrationSecret .Values.opencost.ui.enabled }} |
| 447 | + {{- if or .Values.plugins.enabled .Values.opencost.exporter.persistence.enabled .Values.extraVolumes .Values.opencost.customPricing.enabled .Values.opencost.cloudIntegrationSecret .Values.opencost.ui.enabled .Values.opencost.updateCaTrust.enabled }} |
416 | 448 | volumes: |
417 | 449 | {{- if .Values.plugins.enabled }} |
418 | 450 | {{- if .Values.plugins.install.enabled}} |
@@ -461,6 +493,19 @@ spec: |
461 | 493 | emptyDir: {} |
462 | 494 | {{- end }} |
463 | 495 | {{- end }} |
| 496 | + {{- if .Values.opencost.updateCaTrust.enabled }} |
| 497 | + - name: ca-certs-secret |
| 498 | + {{- if .Values.opencost.updateCaTrust.caCertsSecret }} |
| 499 | + secret: |
| 500 | + defaultMode: 420 |
| 501 | + secretName: {{ .Values.opencost.updateCaTrust.caCertsSecret }} |
| 502 | + {{- else }} |
| 503 | + configMap: |
| 504 | + name: {{ .Values.opencost.updateCaTrust.caCertsConfig }} |
| 505 | + {{- end }} |
| 506 | + - name: ssl-path |
| 507 | + emptyDir: {} |
| 508 | + {{- end }} |
464 | 509 | {{- with .Values.extraVolumes }} |
465 | 510 | {{- toYaml . | nindent 8 }} |
466 | 511 | {{- end }} |
|
0 commit comments