From 64c2853e753d7b0ce974aefecdd2e1a1158c0a7c Mon Sep 17 00:00:00 2001 From: Diederik van der Boor Date: Fri, 9 Feb 2018 13:26:38 +0100 Subject: [PATCH 1/2] Fix helm chart to generate config.postgresURI The configuration was merged with the comment line above due to usage of the {{- ... -}} construct. --- contrib/helm/clair/templates/configmap.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/helm/clair/templates/configmap.yaml b/contrib/helm/clair/templates/configmap.yaml index e30cab3e..7c592bd4 100644 --- a/contrib/helm/clair/templates/configmap.yaml +++ b/contrib/helm/clair/templates/configmap.yaml @@ -14,7 +14,7 @@ data: # PostgreSQL Connection string # https://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-CONNSTRING # This should be done using secrets or Vault, but for now this will also work - {{- if .Values.config.postgresURI -}} + {{- if .Values.config.postgresURI }} source: "{{ .Values.config.postgresURI }}" {{ else }} source: "postgres://{{ .Values.postgresql.postgresUser }}:{{ .Values.postgresql.postgresPassword }}@{{ template "postgresql.fullname" . }}:5432/{{ .Values.postgresql.postgresDatabase }}?sslmode=disable" From e454314beb5e7fa7c6c123d9a7501ec923fb26d9 Mon Sep 17 00:00:00 2001 From: Diederik van der Boor Date: Fri, 9 Feb 2018 13:30:46 +0100 Subject: [PATCH 2/2] Cleanup and improve chart values - be more accurate in memory requests, so chair is scheduled on a host that has that space available. - add an explicit mention for the postgresql.enabled flag --- contrib/helm/clair/values.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/contrib/helm/clair/values.yaml b/contrib/helm/clair/values.yaml index a30b8dcb..39e2b3aa 100644 --- a/contrib/helm/clair/values.yaml +++ b/contrib/helm/clair/values.yaml @@ -34,7 +34,7 @@ resources: memory: 1Gi requests: cpu: 100m - memory: 128Mi + memory: 500Mi config: # postgresURI: "postgres://user:password@host:5432/postgres?sslmode=disable" paginationKey: "XxoPtCUzrUv4JV5dS+yQ+MdW7yLEJnRMwigVY/bpgtQ=" @@ -59,6 +59,9 @@ config: # Configuration values for the postgresql dependency. # ref: https://github.com/kubernetes/charts/blob/master/stable/postgresql/README.md postgresql: +# The dependant Postgres chart can be disabled, to connect to +# an existing database by defining config.postgresURI + enabled: true cpu: 1000m memory: 1Gi # These values are hardcoded until Helm supports secrets. @@ -68,4 +71,4 @@ postgresql: postgresDatabase: clair persistence: - size: 10Gi \ No newline at end of file + size: 10Gi