diff --git a/.github/workflows/cd-helm-release.yml b/.github/workflows/cd-helm-release.yml new file mode 100644 index 0000000..5c3777a --- /dev/null +++ b/.github/workflows/cd-helm-release.yml @@ -0,0 +1,29 @@ +name: Release Chart + +on: + push: + branches: + - main + +jobs: + release: + permissions: + contents: write + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Configure Git + run: | + git config user.name "$GITHUB_ACTOR" + git config user.email "$GITHUB_ACTOR@users.noreply.github.com" + + - name: Run chart-releaser + uses: helm/chart-releaser-action@v1.5.0 + with: + config: charts/cr.yaml + env: + CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/ci-helm-lint-test.yml b/.github/workflows/ci-helm-lint-test.yml new file mode 100644 index 0000000..cbd4e39 --- /dev/null +++ b/.github/workflows/ci-helm-lint-test.yml @@ -0,0 +1,47 @@ +name: Lint and Test Chart + +on: + pull_request: + paths: + - 'charts/**' + +permissions: + contents: read + +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: "0" + + - name: Install Helm + uses: azure/setup-helm@v3.5 + + - name: Set up chart-testing + uses: helm/chart-testing-action@v2.6.0 + + - name: Run chart-testing (list-changed) + id: list-changed + run: | + changed=$(ct list-changed --config charts/ct.yaml) + if [[ -n "$changed" ]]; then + echo "changed=true" >> "$GITHUB_OUTPUT" + fi + + - name: Run chart-testing (lint) + id: lint + if: steps.list-changed.outputs.changed == 'true' + run: ct lint --config charts/ct.yaml + + - name: Create kind cluster + uses: helm/kind-action@v1.8.0 + if: steps.list-changed.outputs.changed == 'true' + + - name: Run chart-testing (install) + id: install + if: steps.list-changed.outputs.changed == 'true' + run: ct install --config charts/ct.yaml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ee69867 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +readme-gen +k8s.yaml \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..6561554 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,10 @@ + +# Contributing + +## Certificate of Origin + +By contributing to this project you agree to the Developer Certificate of Origin [DCO](../DCO). + +This document was created by the Linux Kernel community and is a simple statement that you, as a contributor, have the legal right to make the contribution. + +See the [DCO](../DCO) file for details. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..f4ce72d --- /dev/null +++ b/Makefile @@ -0,0 +1,8 @@ + +lint: + ct lint --config charts/ct.yaml + +test: + ct install --config charts/ct.yaml + +.PHONY: lint test \ No newline at end of file diff --git a/README.md b/README.md index 654bad3..88512a9 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,58 @@ -# helm-clair -Helm chart for Clair + +# clair-helm + +[![MIT Licensed](https://img.shields.io/github/license/guerzon/clair-helm)](https://github.com/guerzon/clair-helm/blob/main/LICENSE) +[![Helm Release](https://img.shields.io/github/v/release/guerzon/clair-helm)](https://github.com/guerzon/clair-helm/releases) + +Helm chart for [Clair](https://github.com/quay/clair). + +## Warning + +If you happen to stumble upon this repo, please be aware that this is a work in progress. Therefore, please assume version < 1.0.0 to be unstable. Or as long as you see this warning message. + +Also, it's a passion project, so please bear with me. + +## Features / TODO + +1. Supports running in `combo` mode (default). +2. Supports running on a single instance with the DB split per mode. +3. Supports running multiple instances. + +## Usage + +Add the repository: + +```bash +helm repo add clair https://guerzon.github.io/clair +``` + +List the chart: + +```bash +helm search repo clair +``` + +Please refer to the [detailed documentation](./charts/clair/README.md) to get started. + +## Testing + +If not using an ingresss: + +```bash +kubectl -n clair port-forward service/clair 6060:6060 + +## Test the vaultwarden/server image: +clairctl report --host http://localhost:6060 vaultwarden/server +``` + +## References + +- +- +- +- +- + +## License + +See [LICENSE](./LICENSE). diff --git a/chart-docs.sh b/chart-docs.sh new file mode 100644 index 0000000..000bb4c --- /dev/null +++ b/chart-docs.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +echo "[+] Setting up ..." +if [ ! -d "readme-gen" ]; then + git clone https://github.com/bitnami-labs/readme-generator-for-helm readme-gen +fi +cd readme-gen +docker build -t readme-gen . +cd .. + +echo "[+] Run the tool and mount the current project directory ..." +docker run --rm -v $(pwd):/mnt -w /mnt readme-gen readme-generator -v charts/clair/values.yaml -r charts/clair/README.md + +echo "Done" \ No newline at end of file diff --git a/charts/clair/.helmignore b/charts/clair/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/charts/clair/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/charts/clair/Chart.yaml b/charts/clair/Chart.yaml new file mode 100644 index 0000000..078376d --- /dev/null +++ b/charts/clair/Chart.yaml @@ -0,0 +1,41 @@ +apiVersion: v2 +name: clair +description: Vulnerability Static Analysis for Containers + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.0.2 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "4.7.2" + +kubeVersion: ">=1.26.0-0" + +maintainers: + - name: guerzon + email: guerzon@proton.me + url: https://github.com/guerzon + +keywords: + - clair + - static-analysis + - containers + - vulnerabilities + +sources: + - https://github.com/guerzon/clair-helm + - https://github.com/quay/clair diff --git a/charts/clair/README.md b/charts/clair/README.md new file mode 100644 index 0000000..01441d7 --- /dev/null +++ b/charts/clair/README.md @@ -0,0 +1,60 @@ + +# clair + +Vulnerability Static Analysis for Containers + +## TL;DR + +```bash +# install: +helm install clair clair/clair \ + --create-namespace \ + --namespace clair \ + --set "database.host=prod.contoso.org" \ + --set "database.dbName=clairdb" \ + --set "database.user=app" \ + --set "database.user=Supers3cret" +``` + +Using a custom values in the file `demo.yaml`: + +```bash +helm upgrade -i clair clair/clair \ + --create-namespace \ + --namespace clair \ + -f demo.yaml +``` + +## Detailed guide + +### General configuration + +This chart deploys `clair` from pre-built images on [quay.io](https://quay.io/repository/projectquay/clair). The image can be defined by specifying the tag with `image.tag`. + +Here is an example that uses the nightly image build `nightly` and an existing secret that contains registry credentials: + +```yaml +image: + tag: "nightly" + pullSecrets: + - myRegKey +``` + +### Database options + +Clair requires PostgreSQL for its data persistence. By default, it does migrations, so all you need is to point it to a database. + +To configure, set `database.type` to either `mysql` or `postgresql` and specify the datase connection information. + +Example for using an external MySQL database: + +```yaml +database: + host: database.contoso.eu + username: appuser + password: apppassword + dbName: prodapp + sslMode: disable +``` + +## Parameters diff --git a/charts/clair/templates/NOTES.txt b/charts/clair/templates/NOTES.txt new file mode 100644 index 0000000..7d7559b --- /dev/null +++ b/charts/clair/templates/NOTES.txt @@ -0,0 +1,22 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "clair.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "clair.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "clair.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "clair.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT +{{- end }} diff --git a/charts/clair/templates/_helpers.tpl b/charts/clair/templates/_helpers.tpl new file mode 100644 index 0000000..c5d177f --- /dev/null +++ b/charts/clair/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "clair.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "clair.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "clair.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "clair.labels" -}} +helm.sh/chart: {{ include "clair.chart" . }} +{{ include "clair.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "clair.selectorLabels" -}} +app.kubernetes.io/name: {{ include "clair.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "clair.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "clair.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/charts/clair/templates/configmap.yaml b/charts/clair/templates/configmap.yaml new file mode 100644 index 0000000..03c3c5a --- /dev/null +++ b/charts/clair/templates/configmap.yaml @@ -0,0 +1,38 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: clair +data: + config.yaml: |- + --- + http_listen_addr: ":{{ .Values.service.port }}" + introspection_addr: ":{{ .Values.introspectionService.port }}" + log_level: "{{ .Values.logLevel }}" + indexer: + connstring: "host={{ .Values.database.host }} user={{ .Values.database.user }} password={{ .Values.database.password }} dbname={{ .Values.database.dbName }} sslmode={{ .Values.database.sslMode }}" + scanlock_retry: 10 + layer_scan_concurrency: 5 + migrations: true + matcher: + connstring: "host={{ .Values.database.host }} user={{ .Values.database.user }} password={{ .Values.database.password }} dbname={{ .Values.database.dbName }} sslmode={{ .Values.database.sslMode }}" + indexer_addr: "http://localhost:{{ .Values.service.port }}/" + migrations: true + max_conn_pool: 100 + matchers: {} + updaters: + sets: + - ubuntu + - debian + - rhel + - alpine + - osv + notifier: + connstring: "host={{ .Values.database.host }} user={{ .Values.database.user }} password={{ .Values.database.password }} dbname={{ .Values.database.dbName }} sslmode={{ .Values.database.sslMode }}" + migrations: true + indexer_addr: "http://localhost:{{ .Values.service.port }}/" + matcher_addr: "http://localhost:{{ .Values.service.port }}/" + poll_interval: "1m" + delivery_interval: "30s" + disable_summary: false + metrics: + name: "prometheus" diff --git a/charts/clair/templates/deployment.yaml b/charts/clair/templates/deployment.yaml new file mode 100644 index 0000000..4d38cfa --- /dev/null +++ b/charts/clair/templates/deployment.yaml @@ -0,0 +1,75 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "clair.fullname" . }} + labels: + {{- include "clair.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "clair.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "clair.labels" . | nindent 8 }} + {{- with .Values.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "clair.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: {{ .Values.service.port }} + protocol: TCP + - name: introspection + containerPort: {{ .Values.introspectionService.port }} + protocol: TCP + livenessProbe: + httpGet: + path: /healthz + port: {{ .Values.introspectionService.port }} + readinessProbe: + httpGet: + path: /readyz + port: {{ .Values.introspectionService.port }} + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.volumeMounts }} + volumeMounts: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.volumes }} + volumes: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/charts/clair/templates/hpa.yaml b/charts/clair/templates/hpa.yaml new file mode 100644 index 0000000..318b7cd --- /dev/null +++ b/charts/clair/templates/hpa.yaml @@ -0,0 +1,32 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "clair.fullname" . }} + labels: + {{- include "clair.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "clair.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/charts/clair/templates/ingress.yaml b/charts/clair/templates/ingress.yaml new file mode 100644 index 0000000..81ca3ac --- /dev/null +++ b/charts/clair/templates/ingress.yaml @@ -0,0 +1,61 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "clair.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} + {{- end }} +{{- end }} +{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + {{- include "clair.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ .path }} + {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ .pathType }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- end }} +{{- end }} diff --git a/charts/clair/templates/service.yaml b/charts/clair/templates/service.yaml new file mode 100644 index 0000000..c4e564b --- /dev/null +++ b/charts/clair/templates/service.yaml @@ -0,0 +1,31 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "clair.fullname" . }} + labels: + {{- include "clair.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "clair.selectorLabels" . | nindent 4 }} +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ include "clair.fullname" . }}-metrics + labels: + {{- include "clair.labels" . | nindent 4 }} +spec: + type: {{ .Values.introspectionService.type }} + ports: + - port: {{ .Values.introspectionService.port }} + targetPort: introspection + protocol: TCP + name: introspection + selector: + {{- include "clair.selectorLabels" . | nindent 4 }} diff --git a/charts/clair/templates/serviceaccount.yaml b/charts/clair/templates/serviceaccount.yaml new file mode 100644 index 0000000..9b12a7b --- /dev/null +++ b/charts/clair/templates/serviceaccount.yaml @@ -0,0 +1,13 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "clair.serviceAccountName" . }} + labels: + {{- include "clair.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +automountServiceAccountToken: {{ .Values.serviceAccount.automount }} +{{- end }} diff --git a/charts/clair/templates/tests/test-connection.yaml b/charts/clair/templates/tests/test-connection.yaml new file mode 100644 index 0000000..2a4ba49 --- /dev/null +++ b/charts/clair/templates/tests/test-connection.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "clair.fullname" . }}-test-connection" + labels: + {{- include "clair.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "clair.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never diff --git a/charts/clair/values.yaml b/charts/clair/values.yaml new file mode 100644 index 0000000..79ad1ad --- /dev/null +++ b/charts/clair/values.yaml @@ -0,0 +1,126 @@ +# Default values for clair. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: quay.io/projectquay/clair + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "4.7.2" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +# Database Configuration +# this will be used for the indexer, notifier, and matcher databases +database: + # Currently only postgresql is supported + type: "postgres" + host: "" + port: "5432" + # Database name + dbName: "" + user: "" + password: "" + uriOverride: "" + existingSecret: "" + existingSecretKey: "" + sslMode: "verify-full" + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Automatically mount a ServiceAccount's API credentials? + automount: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podAnnotations: {} +podLabels: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 6060 + +introspectionService: + type: ClusterIP + port: 8089 + +ingress: + enabled: false + className: "" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: + - path: / + pathType: ImplementationSpecific + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 10 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +# Additional volumes on the output Deployment definition. +volumes: +- name: clair + configMap: + name: clair + items: + - key: config.yaml + path: config.yaml +# - name: foo +# secret: +# secretName: mysecret +# optional: false + +# Additional volumeMounts on the output Deployment definition. +volumeMounts: +- name: clair + mountPath: "/config" + readOnly: true + +nodeSelector: {} + +tolerations: [] + +affinity: {} + +logLevel: "info" diff --git a/charts/cr.yaml b/charts/cr.yaml new file mode 100644 index 0000000..707fead --- /dev/null +++ b/charts/cr.yaml @@ -0,0 +1,2 @@ +release-name-template: "v{{ .Version }}" +generate-release-notes: true diff --git a/charts/ct.yaml b/charts/ct.yaml new file mode 100644 index 0000000..e4cb09a --- /dev/null +++ b/charts/ct.yaml @@ -0,0 +1,3 @@ +# See https://github.com/helm/chart-testing#configuration +remote: origin +target-branch: main \ No newline at end of file diff --git a/demo.yaml b/demo.yaml new file mode 100644 index 0000000..92fa599 --- /dev/null +++ b/demo.yaml @@ -0,0 +1,19 @@ + +replicaCount: 2 + +autoscaling: + enabled: false + +database: + host: "clairdb-svc.clairdb" + dbName: "appdb" + user: "app" + password: "Supers3cret" + sslMode: "disable" + +logLevel: "debug-color" + +resources: + requests: + cpu: 100m + memory: 128Mi