Skip to content

Commit 6b29bf1

Browse files
authored
Added nodeSelector, affinity and tolerations to helm chart (#803)
* Added nodeSelector, affinity and tolerations to helm chart * Updated helm README.md and bumped version
1 parent f6afdf0 commit 6b29bf1

File tree

4 files changed

+28
-1
lines changed

4 files changed

+28
-1
lines changed

helm/trivy/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apiVersion: v2
22
name: trivy
3-
version: 0.4.1
3+
version: 0.4.2
44
appVersion: "0.15.0"
55
description: Trivy helm chart
66
keywords:

helm/trivy/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ The following table lists the configurable parameters of the Trivy chart and the
6363
| `httpProxy` | The URL of the HTTP proxy server | |
6464
| `httpsProxy` | The URL of the HTTPS proxy server | |
6565
| `noProxy` | The URLs that the proxy settings do not apply to | |
66+
| `nodeSelector` | Node labels for pod assignment | |
67+
| `affinity` | Affinity settings for pod assignment | |
68+
| `tolerations` | Tolerations for pod assignment | |
6669

6770
The above parameters map to the env variables defined in [trivy](https://github.com/aquasecurity/trivy#configuration).
6871

helm/trivy/templates/statefulset.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,18 @@ spec:
4040
imagePullSecrets:
4141
- name: {{ .Values.image.pullSecret }}
4242
{{- end }}
43+
{{- if .Values.nodeSelector }}
44+
nodeSelector:
45+
{{ toYaml .Values.nodeSelector | indent 8 }}
46+
{{- end }}
47+
{{- if .Values.tolerations }}
48+
tolerations:
49+
{{ toYaml .Values.tolerations | indent 8 }}
50+
{{- end }}
51+
{{- if .Values.affinity }}
52+
affinity:
53+
{{ toYaml .Values.affinity | indent 8 }}
54+
{{- end }}
4355
containers:
4456
- name: main
4557
image: {{ template "trivy.imageRef" . }}

helm/trivy/values.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,18 @@ securityContext:
3737
privileged: false
3838
readOnlyRootFilesystem: true
3939

40+
## Node labels for pod assignment
41+
## Ref: https://kubernetes.io/docs/user-guide/node-selection/
42+
nodeSelector: {}
43+
44+
## Affinity settings for pod assignment
45+
## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
46+
affinity: {}
47+
48+
## Tolerations for pod assignment
49+
## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
50+
tolerations: []
51+
4052
trivy:
4153
# debugMode the flag to enable Trivy debug mode
4254
debugMode: false

0 commit comments

Comments
 (0)