diff --git a/stable/anchore-engine/Chart.yaml b/stable/anchore-engine/Chart.yaml index c06e578a74..65c663937b 100644 --- a/stable/anchore-engine/Chart.yaml +++ b/stable/anchore-engine/Chart.yaml @@ -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: diff --git a/stable/anchore-engine/README.md b/stable/anchore-engine/README.md index 627f596551..c10b96ef59 100644 --- a/stable/anchore-engine/README.md +++ b/stable/anchore-engine/README.md @@ -44,6 +44,24 @@ The recommended way to install the Anchore Engine Chart is with a customized val defaultAdminEmail: ``` +#### Install using Google CloudSQL + ``` + ## anchore_values.yaml + postgresql: + enabled: false + postgresPassword: + postgresUser: + postgresDatabase: + + 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. diff --git a/stable/anchore-engine/templates/analyzer_deployment.yaml b/stable/anchore-engine/templates/analyzer_deployment.yaml index c818e35d01..14d35f4cdc 100644 --- a/stable/anchore-engine/templates/analyzer_deployment.yaml +++ b/stable/anchore-engine/templates/analyzer_deployment.yaml @@ -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 }} diff --git a/stable/anchore-engine/templates/api_deployment.yaml b/stable/anchore-engine/templates/api_deployment.yaml index 311a696b4b..c1e3eadd5a 100644 --- a/stable/anchore-engine/templates/api_deployment.yaml +++ b/stable/anchore-engine/templates/api_deployment.yaml @@ -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 }} diff --git a/stable/anchore-engine/templates/catalog_deployment.yaml b/stable/anchore-engine/templates/catalog_deployment.yaml index efe5dac4b0..b5ee8355d1 100644 --- a/stable/anchore-engine/templates/catalog_deployment.yaml +++ b/stable/anchore-engine/templates/catalog_deployment.yaml @@ -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 }} diff --git a/stable/anchore-engine/templates/engine_configmap.yaml b/stable/anchore-engine/templates/engine_configmap.yaml index 5190a65640..2e18409b39 100644 --- a/stable/anchore-engine/templates/engine_configmap.yaml +++ b/stable/anchore-engine/templates/engine_configmap.yaml @@ -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 }} diff --git a/stable/anchore-engine/templates/enterprise_feeds_deployment.yaml b/stable/anchore-engine/templates/enterprise_feeds_deployment.yaml index 28084501c6..27e0def8a0 100644 --- a/stable/anchore-engine/templates/enterprise_feeds_deployment.yaml +++ b/stable/anchore-engine/templates/enterprise_feeds_deployment.yaml @@ -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 }} diff --git a/stable/anchore-engine/templates/policy_engine_deployment.yaml b/stable/anchore-engine/templates/policy_engine_deployment.yaml index cb2c172cc2..38cb939cce 100644 --- a/stable/anchore-engine/templates/policy_engine_deployment.yaml +++ b/stable/anchore-engine/templates/policy_engine_deployment.yaml @@ -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 }} diff --git a/stable/anchore-engine/templates/simplequeue_deployment.yaml b/stable/anchore-engine/templates/simplequeue_deployment.yaml index 2efa107447..51ce303d02 100644 --- a/stable/anchore-engine/templates/simplequeue_deployment.yaml +++ b/stable/anchore-engine/templates/simplequeue_deployment.yaml @@ -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 }} diff --git a/stable/anchore-engine/values.yaml b/stable/anchore-engine/values.yaml index 3e0e995696..08e8303eb7 100644 --- a/stable/anchore-engine/values.yaml +++ b/stable/anchore-engine/values.yaml @@ -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