Skip to content

Commit 2a57ee8

Browse files
authored
feat: Add extraEnv option to Helm chart (#2288)
* Add extraEnv option to Helm chart * Document extraEnv config option * Reindent comments to ensure auto-formatting is not confused
1 parent 73fe67c commit 2a57ee8

File tree

3 files changed

+22
-15
lines changed

3 files changed

+22
-15
lines changed

deploy/helm/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Keeps security report resources updated
1919
| compliance.reportType | string | `"summary"` | reportType this flag control the type of report generated (summary or all) |
2020
| compliance.specs | list | `["k8s-cis-1.23","k8s-nsa-1.0","k8s-pss-baseline-0.1","k8s-pss-restricted-0.1"]` | specs is a list of compliance specs to be used by the cluster compliance scanner - k8s-cis-1.23 - k8s-nsa-1.0 - k8s-pss-baseline-0.1 - k8s-pss-restricted-0.1 - eks-cis-1.4 - rke2-cis-1.24 |
2121
| excludeNamespaces | string | `""` | excludeNamespaces is a comma separated list of namespaces (or glob patterns) to be excluded from scanning. Only applicable in the all namespaces install mode, i.e. when the targetNamespaces values is a blank string. |
22+
| extraEnv | list | `[]` | extraEnv is a list of extra environment variables for the trivy-operator. |
2223
| fullnameOverride | string | `""` | fullnameOverride override operator full name |
2324
| global | object | `{"image":{"registry":""}}` | global values provide a centralized configuration for 'image.registry', reducing the potential for errors. If left blank, the chart will default to the individually set 'image.registry' values |
2425
| image.pullPolicy | string | `"IfNotPresent"` | pullPolicy set the operator pullPolicy |

deploy/helm/templates/deployment.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ metadata:
66
{{- with .Values.operator.annotations }}
77
annotations: {{- toYaml . | nindent 4 }}
88
{{- end }}
9-
labels:
9+
labels:
1010
{{- include "trivy-operator.labels" . | nindent 4 }}
1111
{{- with .Values.operator.labels }}
1212
{{- toYaml . | nindent 4 }}
@@ -50,6 +50,9 @@ spec:
5050
value: {{ tpl .Values.targetWorkloads . | quote }}
5151
- name: OPERATOR_SERVICE_ACCOUNT
5252
value: {{ include "trivy-operator.serviceAccountName" . | quote }}
53+
{{- with .Values.extraEnv }}
54+
{{- toYaml . | nindent 12 }}
55+
{{- end }}
5356
envFrom:
5457
- configMapRef:
5558
name: trivy-operator-config

deploy/helm/values.yaml

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ targetNamespaces: ""
2020
# mode, i.e. when the targetNamespaces values is a blank string.
2121
excludeNamespaces: ""
2222

23+
# -- extraEnv is a list of extra environment variables for the trivy-operator.
24+
extraEnv: []
25+
2326
# -- targetWorkloads is a comma seperated list of Kubernetes workload resources
2427
# to be included in the vulnerability and config-audit scans
2528
# if left blank, all workload resources will be scanned
@@ -636,7 +639,7 @@ serviceAccount:
636639
podAnnotations: {}
637640

638641
podSecurityContext: {}
639-
# fsGroup: 2000
642+
# fsGroup: 2000
640643

641644
# -- securityContext security context
642645
securityContext:
@@ -659,16 +662,17 @@ volumes:
659662
emptyDir: {}
660663

661664
resources: {}
662-
# -- We usually recommend not to specify default resources and to leave this as a conscious
663-
# choice for the user. This also increases chances charts run on environments with little
664-
# resources, such as Minikube. If you do want to specify resources, uncomment the following
665-
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
666-
# limits:
667-
# cpu: 100m
668-
# memory: 128Mi
669-
# requests:
670-
# cpu: 100m
671-
# memory: 128Mi
665+
# -- We usually recommend not to specify default resources and to leave this as a conscious
666+
# choice for the user. This also increases chances charts run on environments with little
667+
# resources, such as Minikube. If you do want to specify resources, uncomment the following
668+
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
669+
# limits:
670+
# cpu: 100m
671+
# memory: 128Mi
672+
# requests:
673+
# cpu: 100m
674+
# memory: 128Mi
675+
672676
# -- nodeSelector set the operator nodeSelector
673677
nodeSelector: {}
674678

@@ -681,7 +685,7 @@ affinity: {}
681685
# -- priorityClassName set the operator priorityClassName
682686
priorityClassName: ""
683687

684-
# -- automountServiceAccountToken the flag to enable automount for service account token
688+
# -- automountServiceAccountToken the flag to enable automount for service account token
685689
automountServiceAccountToken: true
686690

687691
policiesBundle:
@@ -691,7 +695,7 @@ policiesBundle:
691695
repository: aquasec/trivy-checks
692696
# -- tag version of the policies bundle
693697
tag: 1
694-
# -- registryUser is the user for the registry
698+
# -- registryUser is the user for the registry
695699
registryUser: ~
696700
# -- registryPassword is the password for the registry
697701
registryPassword: ~
@@ -703,7 +707,6 @@ policiesBundle:
703707
# -- insecure is the flag to enable insecure connection to the policy bundle registry
704708
insecure: false
705709

706-
707710
nodeCollector:
708711
# -- useNodeSelector determine if to use nodeSelector (by auto detecting node name) with node-collector scan job
709712
useNodeSelector: true

0 commit comments

Comments
 (0)