Skip to content

Commit

Permalink
Added nodeSelector, affinity and tolerations to helm chart (aquasecur…
Browse files Browse the repository at this point in the history
…ity#803)

* Added nodeSelector, affinity and tolerations to helm chart

* Updated helm README.md and bumped version
  • Loading branch information
ctolon22 authored Jan 11, 2021
1 parent f6afdf0 commit 6b29bf1
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion helm/trivy/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: trivy
version: 0.4.1
version: 0.4.2
appVersion: "0.15.0"
description: Trivy helm chart
keywords:
Expand Down
3 changes: 3 additions & 0 deletions helm/trivy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ The following table lists the configurable parameters of the Trivy chart and the
| `httpProxy` | The URL of the HTTP proxy server | |
| `httpsProxy` | The URL of the HTTPS proxy server | |
| `noProxy` | The URLs that the proxy settings do not apply to | |
| `nodeSelector` | Node labels for pod assignment | |
| `affinity` | Affinity settings for pod assignment | |
| `tolerations` | Tolerations for pod assignment | |

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

Expand Down
12 changes: 12 additions & 0 deletions helm/trivy/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@ spec:
imagePullSecrets:
- name: {{ .Values.image.pullSecret }}
{{- end }}
{{- if .Values.nodeSelector }}
nodeSelector:
{{ toYaml .Values.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.tolerations }}
tolerations:
{{ toYaml .Values.tolerations | indent 8 }}
{{- end }}
{{- if .Values.affinity }}
affinity:
{{ toYaml .Values.affinity | indent 8 }}
{{- end }}
containers:
- name: main
image: {{ template "trivy.imageRef" . }}
Expand Down
12 changes: 12 additions & 0 deletions helm/trivy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@ securityContext:
privileged: false
readOnlyRootFilesystem: true

## Node labels for pod assignment
## Ref: https://kubernetes.io/docs/user-guide/node-selection/
nodeSelector: {}

## Affinity settings for pod assignment
## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
affinity: {}

## Tolerations for pod assignment
## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
tolerations: []

trivy:
# debugMode the flag to enable Trivy debug mode
debugMode: false
Expand Down

0 comments on commit 6b29bf1

Please sign in to comment.