Skip to content

Commit

Permalink
Replace cert copier image (#2116) (#2131)
Browse files Browse the repository at this point in the history
* fix pre-commit

* fix hardcoded imagePullPolicy

* fix naming

* add app labels

* add version tag in daemonset

* fix pre-commit
  • Loading branch information
pgvishnuram committed Feb 14, 2024
1 parent 756a11e commit 0145920
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 4 deletions.
18 changes: 18 additions & 0 deletions templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,21 @@ nginx.ingress.kubernetes.io/auth-url: https://houston.{{ .Values.global.baseDoma
{{ .Values.global.loggingSidecar.image }}
{{- end }}
{{- end }}

{{ define "certCopier.image" -}}
{{- if .Values.global.privateRegistry.enabled -}}
{{ .Values.global.privateRegistry.repository }}/ap-base:{{ .Values.global.privateCaCertsAddToHost.certCopier.tag }}
{{- else -}}
{{ .Values.global.privateCaCertsAddToHost.certCopier.repository }}:{{ .Values.global.privateCaCertsAddToHost.certCopier.tag }}
{{- end }}
{{- end }}

{{/*
Return the proper Docker Image Registry Secret Names
*/}}
{{- define "certCopier.imagePullSecrets" -}}
{{- if and .Values.global.privateRegistry.enabled .Values.global.privateRegistry.secretName }}
imagePullSecrets:
- name: {{ .Values.global.privateRegistry.secretName }}
{{- end -}}
{{- end -}}
7 changes: 5 additions & 2 deletions templates/trust-private-ca-on-all-nodes/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,23 @@ spec:
template:
metadata:
labels:
app: private-ca
tier: platform
component: private-ca
release: {{ .Release.Name }}
version: {{ .Chart.Version }}
spec:
serviceAccountName: {{ .Release.Name }}-private-ca
{{- include "certCopier.imagePullSecrets" . | indent 6 }}
containers:
- name: cert-copy
image: {{ .Values.global.privateCaCertsAddToHost.certCopier.repository }}:{{ .Values.global.privateCaCertsAddToHost.certCopier.tag }}
image: {{ include "certCopier.image" . }}
command:
- "sh"
- "-c"
args:
- "while true; do date; cp -v /private-ca-certs/* /host-trust-store/; sleep 10; done"
imagePullPolicy: IfNotPresent
imagePullPolicy: {{ .Values.global.privateCaCertsAddToHost.certCopier.pullPolicy }}
volumeMounts:
- name: hostcerts
mountPath: /host-trust-store
Expand Down
2 changes: 2 additions & 0 deletions tests/enable_all_features.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ global:
pspEnabled: true
taskUsageMetricsEnabled: True
veleroEnabled: true
privateCaCertsAddToHost:
enabled: true
prometheus-node-exporter:
rbac:
create: true
Expand Down
4 changes: 2 additions & 2 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ global:
enabled: false
hostDirectory: /etc/docker/certs.d
certCopier:
repository: alpine
tag: 3.18
repository: quay.io/astronomer/ap-base
tag: 3.18.4-2
pullPolicy: IfNotPresent
# Global flag to enable to user to enable/disable Astronomer platform
# level Network Policy
Expand Down

0 comments on commit 0145920

Please sign in to comment.