diff --git a/enforcer/templates/enforcer-daemonset.yaml b/enforcer/templates/enforcer-daemonset.yaml index fc8f0d6d..7c0ba60b 100644 --- a/enforcer/templates/enforcer-daemonset.yaml +++ b/enforcer/templates/enforcer-daemonset.yaml @@ -56,9 +56,19 @@ spec: priorityClassName: {{ template "priorityClass" . }} {{- end }} serviceAccount: {{ template "agentServiceAccount" . }} + {{- if .Values.enforcer.imageCredentials.imagePullSecrets }} + imagePullSecrets: + - name: {{- .Values.enforcer.imageCredentials.imagePullSecrets.secretName }} + {{- end }} containers: - name: enforcer + {{- if and .Values.enforcer.imageCredentials.repositoryUriPrefix .Values.enforcer.image.repository .Values.enforcer.image.tag }} + image: "{{ .Values.enforcer.imageCredentials.repositoryUriPrefix }}/{{ .Values.enforcer.image.repository }}:{{ .Values.enforcer.image.tag }}" + {{- else if .Values.enforcer.imageCredentials.repositoryUriPrefix }} + image: "{{ .Values.enforcer.imageCredentials.repositoryUriPrefix }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}" + {{- else }} image: "{{ .Values.global.imageCredentials.repositoryUriPrefix }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}" + {{- end }} imagePullPolicy: "{{ .Values.image.pullPolicy }}" securityContext: {{- toYaml .Values.securityContext | nindent 10 }} diff --git a/enforcer/templates/enforcer-windows-daemonset.yaml b/enforcer/templates/enforcer-windows-daemonset.yaml index 9505fee5..49c0308d 100644 --- a/enforcer/templates/enforcer-windows-daemonset.yaml +++ b/enforcer/templates/enforcer-windows-daemonset.yaml @@ -45,9 +45,17 @@ spec: priorityClassName: {{ template "priorityClass" . }} {{- end }} serviceAccount: {{ template "agentServiceAccount" . }} + {{- if .Values.windowsEnforcer.imageCredentials.imagePullSecrets }} + imagePullSecrets: + - name: {{- .Values.windowsEnforcer.imageCredentials.imagePullSecrets.secretName }} + {{- end }} containers: - name: aqua-windows-enforcer + {{- if .Values.windowsEnforcer.imageCredentials.repositoryUriPrefix }} + image: "{{ .Values.windowsEnforcer.imageCredentials.repositoryUriPrefix }}/{{ .Values.windowsEnforcer.image.repository }}:{{ .Values.windowsEnforcer.image.tag }}" + {{- else }} image: "{{ .Values.global.imageCredentials.repositoryUriPrefix }}/{{ .Values.windowsEnforcer.image.repository }}:{{ .Values.windowsEnforcer.image.tag }}" + {{- end }} imagePullPolicy: "{{ .Values.windowsEnforcer.image.pullPolicy }}" securityContext: {{- toYaml .Values.windowsEnforcer.securityContext | nindent 10 }} diff --git a/kube-enforcer/templates/kube-enforcer-deployment.yaml b/kube-enforcer/templates/kube-enforcer-deployment.yaml index 33b26eb4..d5676992 100644 --- a/kube-enforcer/templates/kube-enforcer-deployment.yaml +++ b/kube-enforcer/templates/kube-enforcer-deployment.yaml @@ -49,13 +49,21 @@ spec: priorityClassName: {{ template "priorityClass" . }} {{- end }} serviceAccountName: {{ template "serviceAccount" . }} + {{- if .Values.imageCredentials.imagePullSecrets }} + imagePullSecrets: + - name: {{- .Values.imageCredentials.imagePullSecrets.secretName }} + {{- end }} containers: - name: kube-enforcer {{- with .Values.container_securityContext }} securityContext: {{ toYaml . | indent 12 }} {{- end }} + {{- if .Values.imageCredentials.repositoryUriPrefix }} + image: "{{ .Values.imageCredentials.repositoryUriPrefix }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}" + {{- else }} image: "{{ .Values.global.imageCredentials.repositoryUriPrefix }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}" + {{- end }} imagePullPolicy: "{{ .Values.image.pullPolicy }}" {{- if .Values.vaultSecret.enabled }} command: ["/bin/sh"] @@ -123,7 +131,11 @@ spec: {{- end }} {{- if .Values.kubeEnforcerAdvance.enable }} - name: envoy + {{- if .Values.kubeEnforcerAdvance.imageCredentials.repositoryUriPrefix }} + image: "{{ .Values.kubeEnforcerAdvance.imageCredentials.repositoryUriPrefix }}/{{ .Values.kubeEnforcerAdvance.envoy.image.repository }}:{{ .Values.kubeEnforcerAdvance.envoy.image.tag }}" + {{- else }} image: "{{ .Values.global.imageCredentials.repositoryUriPrefix }}/{{ .Values.kubeEnforcerAdvance.envoy.image.repository }}:{{ .Values.kubeEnforcerAdvance.envoy.image.tag }}" + {{- end }} imagePullPolicy: "{{ .Values.kubeEnforcerAdvance.envoy.image.pullPolicy }}" command: ["/bin/sh", "-c", "cp /etc/envoy/cds.yaml /etc/aquasec/envoy/cds.yaml && touch /etc/aquasec/envoy/ca-certificates.crt && envoy -c /etc/envoy/envoy.yaml"] ports: