diff --git a/contrib/helm/clair/templates/configmap.yaml b/contrib/helm/clair/templates/configmap.yaml index 5d68b625..e30cab3e 100644 --- a/contrib/helm/clair/templates/configmap.yaml +++ b/contrib/helm/clair/templates/configmap.yaml @@ -14,8 +14,11 @@ 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 -}} + source: "{{ .Values.config.postgresURI }}" + {{ else }} source: "postgres://{{ .Values.postgresql.postgresUser }}:{{ .Values.postgresql.postgresPassword }}@{{ template "postgresql.fullname" . }}:5432/{{ .Values.postgresql.postgresDatabase }}?sslmode=disable" + {{ end }} # Number of elements kept in the cache # Values unlikely to change (e.g. namespaces) are cached in order to save prevent needless roundtrips to the database. diff --git a/contrib/helm/clair/values.yaml b/contrib/helm/clair/values.yaml index bc2ec4a8..a30b8dcb 100644 --- a/contrib/helm/clair/values.yaml +++ b/contrib/helm/clair/values.yaml @@ -36,6 +36,7 @@ resources: cpu: 100m memory: 128Mi config: + # postgresURI: "postgres://user:password@host:5432/postgres?sslmode=disable" paginationKey: "XxoPtCUzrUv4JV5dS+yQ+MdW7yLEJnRMwigVY/bpgtQ=" updateInterval: 2h notificationWebhookEndpoint: https://example.com/notify/me @@ -55,13 +56,13 @@ config: - apk - dpkg - rpm -## Configuration values for the postgresql dependency. -## ref: https://github.com/kubernetes/charts/blob/master/stable/postgresql/README.md -## +# Configuration values for the postgresql dependency. +# ref: https://github.com/kubernetes/charts/blob/master/stable/postgresql/README.md postgresql: cpu: 1000m memory: 1Gi -## Harcording for now till https://github.com/kubernetes/helm/issues/2196 +# These values are hardcoded until Helm supports secrets. +# For more info see: https://github.com/kubernetes/helm/issues/2196 postgresUser: clair postgresPassword: clair postgresDatabase: clair