Skip to content

Commit

Permalink
Replace cert copier image (#2116)
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 7, 2024
1 parent c2e0cb6 commit 193da85
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 6 deletions.
18 changes: 18 additions & 0 deletions templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,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 -}}
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,28 @@ spec:
template:
metadata:
labels:
app: containerd-private-ca
tier: platform
component: containerd-private-ca
release: {{ .Release.Name }}
version: {{ .Chart.Version }}
annotations:
checksum/configmap: {{ include (print $.Template.BasePath "/trust-private-ca-on-all-nodes/containerd-ca-update-script.yaml") . | sha256sum }}
spec:
{{- if .Values.global.privateCaCertsAddToHost.containerdnodeAffinitys }}
affinity:
{{ toYaml .Values.global.privateCaCertsAddToHost.containerdnodeAffinitys | indent 8 }}
{{ end }}
{{- include "certCopier.imagePullSecrets" . | indent 6 }}
containers:
- name: cert-copy-and-toml-update
image: {{ .Values.global.privateCaCertsAddToHost.certCopier.repository }}:{{ .Values.global.privateCaCertsAddToHost.certCopier.tag }}
image: {{ include "certCopier.image" . }}
command:
- "sh"
- "-c"
args:
- sh /cert-copy-and-toml-update.sh
imagePullPolicy: IfNotPresent
imagePullPolicy: {{ .Values.global.privateCaCertsAddToHost.certCopier.pullPolicy }}
securityContext:
runAsUser: 0
privileged: true
Expand Down
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
3 changes: 3 additions & 0 deletions tests/enable_all_features.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ global:
pspEnabled: true
taskUsageMetricsEnabled: True
veleroEnabled: true
privateCaCertsAddToHost:
enabled: true
addToContainerd: 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 @@ -25,8 +25,8 @@ global:
containerdConfigToml: ~
containerdnodeAffinitys: []
certCopier:
repository: alpine
tag: 3.18
repository: quay.io/astronomer/ap-base
tag: 3.18.5
pullPolicy: IfNotPresent
# Global flag to enable to user to enable/disable Astronomer platform
# level Network Policy
Expand Down

0 comments on commit 193da85

Please sign in to comment.