Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions helm/trivy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ The following table lists the configurable parameters of the Trivy chart and the
| `image.pullPolicy` | Image pull policy | `IfNotPresent` |
| `image.pullSecret` | The name of an imagePullSecret used to pull trivy image from e.g. Docker Hub or a private registry | |
| `replicaCount` | Number of Trivy Pods to run | `1` |
| `persistence.existingClaim` | Use an existing PVC for the cache instead of creating one. Only for `replicaCount: 1`, because Trivy locks its cache. On an existing install, delete the StatefulSet first, as its `volumeClaimTemplates` can't be changed | `""` |
| `trivy.debugMode` | The flag to enable or disable Trivy debug mode | `false` |
| `trivy.gitHubToken` | The GitHub access token to download Trivy DB. More info: https://trivy.dev/docs/latest/references/troubleshooting/#github-rate-limiting | |
| `trivy.registryUsername` | The username used to log in at dockerhub. More info: https://trivy.dev/docs/latest/advanced/private-registries/docker-hub/ | |
Expand Down
6 changes: 5 additions & 1 deletion helm/trivy/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spec:
matchLabels:
app.kubernetes.io/name: {{ include "trivy.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- if .Values.persistence.enabled }}
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
volumeClaimTemplates:
- apiVersion: v1
kind: PersistentVolumeClaim
Expand Down Expand Up @@ -140,6 +140,10 @@ spec:
{{- if not .Values.persistence.enabled }}
- name: data
emptyDir: {}
{{- else if .Values.persistence.existingClaim }}
- name: data
persistentVolumeClaim:
claimName: {{ .Values.persistence.existingClaim | quote }}
{{- end }}
{{- with .Values.trivy.sslCertDir }}
- name: ssl-cert-dir
Expand Down
3 changes: 3 additions & 0 deletions helm/trivy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ replicaCount: 1

persistence:
enabled: true
# Use an existing PersistentVolumeClaim instead of creating one.
# Only for replicaCount: 1, because Trivy locks its cache.
existingClaim: ""
storageClass: ""
accessMode: ReadWriteOnce
size: 5Gi
Expand Down