add gce-proxy support for anchore-engine (#12529)

Signed-off-by: Peter Balogh <p.balogh.sa@gmail.com>
This commit is contained in:
Peter Balogh
2019-04-15 15:51:03 -07:00
committed by Kubernetes Prow Robot
parent 46034198b4
commit 4c71ec3926
10 changed files with 81 additions and 4 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
name: anchore-engine
version: 0.12.1
version: 0.12.2
appVersion: 0.3.3
description: Anchore container analysis and policy evaluation engine service
keywords:
+18
View File
@@ -44,6 +44,24 @@ The recommended way to install the Anchore Engine Chart is with a customized val
defaultAdminEmail: <EMAIL>
```
#### Install using Google CloudSQL
```
## anchore_values.yaml
postgresql:
enabled: false
postgresPassword: <CLOUDSQL-PASSWORD>
postgresUser: <CLOUDSQL-USER>
postgresDatabase: <CLOUDSQL-DATABASE>
cloudsql:
enabled: true
instance: "project:zone:cloudsqlinstancename"
image:
repository: gcr.io/cloudsql-docker/gce-proxy
tag: 1.12
pullPolicy: IfNotPresent
```
## Upgrading to Chart version 0.12.0
Redis dependency chart major version updated to v6.1.3 - check redis chart readme for instructions for upgrade.
@@ -26,6 +26,13 @@ spec:
{{- end }}
spec:
containers:
{{- if .Values.cloudsql.enabled }}
- name: cloudsql-proxy
image: {{ .Values.cloudsql.image.repository }}:{{ .Values.cloudsql.image.tag }}
imagePullPolicy: {{ .Values.cloudsql.image.pullPolicy }}
command: ["/cloud_sql_proxy"]
args: ["-instances={{ .Values.cloudsql.instance }}=tcp:5432"]
{{- end }}
- name: {{ .Chart.Name }}-{{ $component }}
image: {{ .Values.anchoreGlobal.image }}
imagePullPolicy: {{ .Values.anchoreGlobal.imagePullPolicy }}
@@ -43,6 +43,13 @@ spec:
secretName: {{ .Values.anchoreGlobal.internalServicesSsl.certSecret }}
{{- end }}
containers:
{{- if .Values.cloudsql.enabled }}
- name: cloudsql-proxy
image: {{ .Values.cloudsql.image.repository }}:{{ .Values.cloudsql.image.tag }}
imagePullPolicy: {{ .Values.cloudsql.image.pullPolicy }}
command: ["/cloud_sql_proxy"]
args: ["-instances={{ .Values.cloudsql.instance }}=tcp:5432"]
{{- end }}
- name: "{{ .Chart.Name }}-{{ $component }}"
image: {{ .Values.anchoreGlobal.image }}
imagePullPolicy: {{ .Values.anchoreGlobal.imagePullPolicy }}
@@ -26,6 +26,13 @@ spec:
{{- end }}
spec:
containers:
{{- if .Values.cloudsql.enabled }}
- name: cloudsql-proxy
image: {{ .Values.cloudsql.image.repository }}:{{ .Values.cloudsql.image.tag }}
imagePullPolicy: {{ .Values.cloudsql.image.pullPolicy }}
command: ["/cloud_sql_proxy"]
args: ["-instances={{ .Values.cloudsql.instance }}=tcp:5432"]
{{- end }}
- name: {{ .Chart.Name }}-{{ $component }}
image: {{ .Values.anchoreGlobal.image }}
imagePullPolicy: {{ .Values.anchoreGlobal.imagePullPolicy }}
@@ -12,6 +12,8 @@ data:
ANCHORE_DB_USER: {{ index .Values "postgresql" "postgresUser" | quote }}
{{- if and (index .Values "postgresql" "externalEndpoint") (not (index .Values "postgresql" "enabled")) }}
ANCHORE_DB_HOST: {{ index .Values "postgresql" "externalEndpoint" | quote }}
{{- else if and (index .Values "cloudsql" "enabled") (not (index .Values "postgresql" "enabled")) }}
ANCHORE_DB_HOST: "localhost:5432"
{{- else }}
ANCHORE_DB_HOST: "{{ template "postgres.fullname" . }}:5432"
{{- end }}
@@ -38,6 +38,13 @@ spec:
imagePullSecrets:
- name: {{ .Values.anchoreEnterpriseGlobal.imagePullSecretName }}
containers:
{{- if .Values.cloudsql.enabled }}
- name: cloudsql-proxy
image: {{ .Values.cloudsql.image.repository }}:{{ .Values.cloudsql.image.tag }}
imagePullPolicy: {{ .Values.cloudsql.image.pullPolicy }}
command: ["/cloud_sql_proxy"]
args: ["-instances={{ .Values.cloudsql.instance }}=tcp:5432"]
{{- end }}
- name: "{{ .Chart.Name }}-{{ $component }}"
image: {{ .Values.anchoreEnterpriseGlobal.image }}
imagePullPolicy: {{ .Values.anchoreEnterpriseGlobal.imagePullPolicy }}
@@ -61,7 +68,10 @@ spec:
{{- if and (index .Values "anchore-feeds-db" "externalEndpoint") (not (index .Values "anchore-feeds-db" "enabled")) }}
- name: ANCHORE_DB_HOST
value: {{ index .Values "anchore-feeds-db" "externalEndpoint" | quote }}
{{- else}}
{{- else if and (index .Values "cloudsql" "enabled") (not (index .Values "anchore-feeds-db" "enabled")) }}
- name: ANCHORE_DB_HOST
value: "localhost:5432"
{{- else }}
- name: ANCHORE_DB_HOST
value: "{{ template "postgres.anchore-feeds-db.fullname" . }}:5432"
{{- end }}
@@ -26,6 +26,13 @@ spec:
{{- end }}
spec:
containers:
{{- if .Values.cloudsql.enabled }}
- name: cloudsql-proxy
image: {{ .Values.cloudsql.image.repository }}:{{ .Values.cloudsql.image.tag }}
imagePullPolicy: {{ .Values.cloudsql.image.pullPolicy }}
command: ["/cloud_sql_proxy"]
args: ["-instances={{ .Values.cloudsql.instance }}=tcp:5432"]
{{- end }}
- name: {{ .Chart.Name }}-{{ $component }}
image: {{ .Values.anchoreGlobal.image }}
imagePullPolicy: {{ .Values.anchoreGlobal.imagePullPolicy }}
@@ -26,6 +26,13 @@ spec:
{{- end }}
spec:
containers:
{{- if .Values.cloudsql.enabled }}
- name: cloudsql-proxy
image: {{ .Values.cloudsql.image.repository }}:{{ .Values.cloudsql.image.tag }}
imagePullPolicy: {{ .Values.cloudsql.image.pullPolicy }}
command: ["/cloud_sql_proxy"]
args: ["-instances={{ .Values.cloudsql.instance }}=tcp:5432"]
{{- end }}
- name: "{{ .Chart.Name }}-{{ $component }}"
image: {{ .Values.anchoreGlobal.image }}
imagePullPolicy: {{ .Values.anchoreGlobal.imagePullPolicy }}
+14 -2
View File
@@ -2,7 +2,7 @@
# Anchore engine has a dependency on Postgresql, configure here
postgresql:
# To use an external DB, uncomment & set 'enabled: false'
# To use an external DB or Google CloudSQL in GKE, uncomment & set 'enabled: false'
# externalEndpoint, postgresUser, postgresPassword & postgresDatabase are required values for external postgres
# enabled: false
postgresUser: anchoreengine
@@ -18,6 +18,18 @@ postgresql:
persistence:
size: 20Gi
# Google CloudSQL support in GKE via gce-proxy
cloudsql:
# To use CloudSQL in GKE set 'enable: true'
enabled: false
# set CloudSQL instance: 'project:zone:instancname'
instance: ""
image:
# set repo and image tag of gce-proxy
repository: gcr.io/cloudsql-docker/gce-proxy
tag: 1.12
pullPolicy: IfNotPresent
# Create an ingress resource for all external anchore engine services (API & Enterprise UI).
# By default this chart is setup to use the NGINX ingress controller which needs to be installed & configured on your cluster.
# To utilize a GCE/ALB ingress controller comment out the nginx annotations below, change ingress.class, edit path configurions as per the comments, & set API/UI services to use NodePort.
@@ -350,7 +362,7 @@ anchoreEnterpriseGlobal:
# Configure the second postgres database instance for the enterprise feeds service.
# Only utilized if anchoreEnterpriseFeeds.enabled: true
anchore-feeds-db:
# To use an external DB, uncomment & set 'enabled: false'
# To use an external DB or Google CloudSQL, uncomment & set 'enabled: false'
# externalEndpoint, postgresUser, postgresPassword & postgresDatabase are required values for external postgres
# enabled: false
postgresUser: anchoreengine