-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Helm Chart: Use Secret for config file. Fix some minor issues
- Config file for Clair now is inside a Secret. Fixes #581. - Update helper template to use latest Helm conventions for "name" and "fullname". - Update labels to use the recommended labels by Helm. See: https://docs.helm.sh/chart_best_practices/#standard-labels - Remove service.name from values file because it is not used. Service discovery for parent charts can be made by using the "clair.fullname" template since template functions are shared between charts.
- Loading branch information
Roberto Soares
committed
Aug 8, 2018
1 parent
c26154a
commit bc6f37f
Showing
8 changed files
with
133 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
clair: | ||
database: | ||
# Database driver. | ||
type: pgsql | ||
options: | ||
# PostgreSQL Connection string. | ||
# https://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-CONNSTRING | ||
{{- 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. | ||
cachesize: 16384 | ||
|
||
# 32-bit URL-safe base64 key used to encrypt pagination tokens. | ||
# If one is not provided, it will be generated. | ||
# Multiple clair instances in the same cluster need the same value. | ||
paginationkey: "{{ .Values.config.paginationKey }}" | ||
api: | ||
# v3 grpc/RESTful API server address. | ||
addr: "0.0.0.0:{{ .Values.service.internalApiPort }}" | ||
|
||
# Health server address. | ||
# This is an unencrypted endpoint useful for load balancers to check to healthiness of the clair server. | ||
healthaddr: "0.0.0.0:{{ .Values.service.internalHealthPort }}" | ||
|
||
# Deadline before an API request will respond with a 503. | ||
timeout: 900s | ||
|
||
# Optional PKI configuration. | ||
# If you want to easily generate client certificates and CAs, try the following projects: | ||
# https://github.com/coreos/etcd-ca | ||
# https://github.com/cloudflare/cfssl | ||
servername: | ||
cafile: | ||
keyfile: | ||
certfile: | ||
|
||
worker: | ||
namespace_detectors: | ||
{{- range $key, $value := .Values.config.enabledNamespaceDetectors }} | ||
- {{ $value }} | ||
{{- end }} | ||
|
||
feature_listers: | ||
{{- range $key, $value := .Values.config.enabledFeatureListers }} | ||
- {{ $value }} | ||
{{- end }} | ||
|
||
updater: | ||
# Frequency the database will be updated with vulnerabilities from the default data sources. | ||
# The value 0 disables the updater entirely. | ||
interval: "{{ .Values.config.updateInterval }}" | ||
enabledupdaters: | ||
{{- range $key, $value := .Values.config.enabledUpdaters }} | ||
- {{ $value }} | ||
{{- end }} | ||
|
||
notifier: | ||
# Number of attempts before the notification is marked as failed to be sent. | ||
attempts: 3 | ||
|
||
# Duration before a failed notification is retried. | ||
renotifyinterval: 2h | ||
|
||
http: | ||
# Optional endpoint that will receive notifications via POST requests. | ||
endpoint: "{{ .Values.config.notificationWebhookEndpoint }}" | ||
|
||
# Optional PKI configuration. | ||
# If you want to easily generate client certificates and CAs, try the following projects: | ||
# https://github.com/cloudflare/cfssl | ||
# https://github.com/coreos/etcd-ca | ||
servername: | ||
cafile: | ||
keyfile: | ||
certfile: | ||
|
||
# Optional HTTP Proxy: must be a valid URL (including the scheme). | ||
proxy: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: {{ template "clair.fullname" . }} | ||
labels: | ||
heritage: {{ .Release.Service | quote }} | ||
release: {{ .Release.Name | quote }} | ||
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" | ||
app: {{ template "clair.fullname" . }} | ||
type: Opaque | ||
data: | ||
config.yaml: |- | ||
{{ include (print .Template.BasePath "/_config.yaml.tpl") . | b64enc | indent 4 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,22 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ template "fullname" . }} | ||
name: {{ template "clair.fullname" . }} | ||
labels: | ||
heritage: {{ .Release.Service | quote }} | ||
release: {{ .Release.Name | quote }} | ||
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" | ||
app: {{ template "clair.fullname" . }} | ||
spec: | ||
type: {{ .Values.service.type }} | ||
ports: | ||
- name: clair-api | ||
- name: "{{ .Chart.Name }}-api" | ||
port: {{ .Values.service.externalApiPort }} | ||
targetPort: {{ .Values.service.internalApiPort }} | ||
protocol: TCP | ||
name: "{{ .Values.service.name }}-api" | ||
- name: clair-health | ||
- name: "{{ .Chart.Name }}-health" | ||
port: {{ .Values.service.externalHealthPort }} | ||
targetPort: {{ .Values.service.internalHealthPort }} | ||
protocol: TCP | ||
name: "{{ .Values.service.name }}-health" | ||
selector: | ||
app: {{ template "fullname" . }} | ||
app: {{ template "clair.fullname" . }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters