Skip to content

Commit

Permalink
Configure security contexts (#55)
Browse files Browse the repository at this point in the history
* allow pod security contexts to be configured in values.yaml
* bump chart version
* fix value type on postgres extraEnvs

Signed-off-by: Brady Todhunter <[email protected]>
  • Loading branch information
Btodhunter authored Aug 22, 2020
1 parent 5176701 commit df6c450
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 20 deletions.
2 changes: 1 addition & 1 deletion stable/anchore-engine/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: anchore-engine
version: 1.8.0
version: 1.8.1
appVersion: 0.8.0
description: Anchore container analysis and policy evaluation engine service
keywords:
Expand Down
2 changes: 1 addition & 1 deletion stable/anchore-engine/charts/postgresql/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,4 @@ podAnnotations: {}
# strategy: {}

# Define custom environment variables to pass to the image here
extraEnv: {}
extraEnv: []
5 changes: 3 additions & 2 deletions stable/anchore-engine/templates/analyzer_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ spec:
{{ toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.anchoreGlobal.securityContext }}
securityContext:
runAsUser: 1000
runAsGroup: 1000
{{ toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.anchoreEnterpriseGlobal.enabled }}
imagePullSecrets:
- name: {{ .Values.anchoreEnterpriseGlobal.imagePullSecretName }}
Expand Down
5 changes: 3 additions & 2 deletions stable/anchore-engine/templates/api_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ spec:
{{ toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.anchoreGlobal.securityContext }}
securityContext:
runAsUser: 1000
runAsGroup: 1000
{{ toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.anchoreEnterpriseGlobal.enabled }}
imagePullSecrets:
- name: {{ .Values.anchoreEnterpriseGlobal.imagePullSecretName }}
Expand Down
5 changes: 3 additions & 2 deletions stable/anchore-engine/templates/catalog_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ spec:
{{ toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.anchoreGlobal.securityContext }}
securityContext:
runAsUser: 1000
runAsGroup: 1000
{{ toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.anchoreEnterpriseGlobal.enabled }}
imagePullSecrets:
- name: {{ .Values.anchoreEnterpriseGlobal.imagePullSecretName }}
Expand Down
5 changes: 3 additions & 2 deletions stable/anchore-engine/templates/engine_upgrade_job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ spec:
app.kubernetes.io/instance: {{ .Release.Name | quote }}
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
spec:
{{- with .Values.anchoreGlobal.securityContext }}
securityContext:
runAsUser: 1000
runAsGroup: 1000
{{ toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.anchoreEnterpriseGlobal.enabled }}
imagePullSecrets:
- name: {{ .Values.anchoreEnterpriseGlobal.imagePullSecretName }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ spec:
{{ toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.anchoreGlobal.securityContext }}
securityContext:
runAsUser: 1000
runAsGroup: 1000
{{ toYaml . | nindent 8 }}
{{- end }}
imagePullSecrets:
- name: {{ .Values.anchoreEnterpriseGlobal.imagePullSecretName }}
containers:
Expand Down
5 changes: 3 additions & 2 deletions stable/anchore-engine/templates/enterprise_ui_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@ spec:
{{ toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.anchoreGlobal.securityContext }}
securityContext:
runAsUser: 1000
runAsGroup: 1000
{{ toYaml . | nindent 8 }}
{{- end }}
imagePullSecrets:
- name: {{ .Values.anchoreEnterpriseGlobal.imagePullSecretName }}
containers:
Expand Down
5 changes: 3 additions & 2 deletions stable/anchore-engine/templates/enterprise_upgrade_job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ spec:
app.kubernetes.io/instance: {{ .Release.Name | quote }}
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
spec:
{{- with .Values.anchoreGlobal.securityContext }}
securityContext:
runAsUser: 1000
runAsGroup: 1000
{{ toYaml . | nindent 8 }}
{{- end }}
imagePullSecrets:
- name: {{ .Values.anchoreEnterpriseGlobal.imagePullSecretName }}
restartPolicy: Never
Expand Down
5 changes: 3 additions & 2 deletions stable/anchore-engine/templates/policy_engine_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ spec:
{{ toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.anchoreGlobal.securityContext }}
securityContext:
runAsUser: 1000
runAsGroup: 1000
{{ toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.anchoreEnterpriseGlobal.enabled }}
imagePullSecrets:
- name: {{ .Values.anchoreEnterpriseGlobal.imagePullSecretName }}
Expand Down
5 changes: 3 additions & 2 deletions stable/anchore-engine/templates/simplequeue_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ spec:
{{ toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.anchoreGlobal.securityContext }}
securityContext:
runAsUser: 1000
runAsGroup: 1000
{{ toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.anchoreEnterpriseGlobal.enabled }}
imagePullSecrets:
- name: {{ .Values.anchoreEnterpriseGlobal.imagePullSecretName }}
Expand Down
6 changes: 6 additions & 0 deletions stable/anchore-engine/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ anchoreGlobal:
# Certs and keys should be added using the file name the certificate is stored at. This secret will be mounted to /home/anchore/certs.
certStoreSecretName: Null

# Specify your pod securityContext here, by default the anchore images utilize the user/group 'anchore' using uid/gid 1000
# To disable this securityContext comment out `runAsUser` & `runAsGroup`
securityContext:
runAsUser: 1000
runAsGroup: 1000

###
# Start of General Anchore Engine Configurations (populates /config/config.yaml)
###
Expand Down

0 comments on commit df6c450

Please sign in to comment.