Skip to content

Commit

Permalink
feat: add extra labels for operator and server controllers in Helm ch…
Browse files Browse the repository at this point in the history
…art (aquasecurity#1867)

* feat: add extra labels for operator and server controllers in Helm chart

* Update docs
  • Loading branch information
fhielpos authored Feb 25, 2024
1 parent 048d77e commit b05764c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
4 changes: 3 additions & 1 deletion deploy/helm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Keeps security report resources updated
| operator.controllerCacheSyncTimeout | string | `"5m"` | controllerCacheSyncTimeout the duration to wait for controller resources cache sync (default: 5m). |
| operator.exposedSecretScannerEnabled | bool | `true` | exposedSecretScannerEnabled the flag to enable exposed secret scanner |
| operator.infraAssessmentScannerEnabled | bool | `true` | infraAssessmentScannerEnabled the flag to enable infra assessment scanner |
| operator.labels | object | `{}` | additional labels for the operator deployment |
| operator.leaderElectionId | string | `"trivyoperator-lock"` | leaderElectionId determines the name of the resource that leader election will use for holding the leader lock. |
| operator.logDevMode | bool | `false` | logDevMode the flag to enable development mode (more human-readable output, extra stack traces and logging information, etc) |
| operator.mergeRbacFindingWithConfigAudit | bool | `false` | mergeRbacFindingWithConfigAudit the flag to enable merging rbac finding with config-audit report |
Expand Down Expand Up @@ -129,11 +130,12 @@ Keeps security report resources updated
| trivy.insecureRegistries | object | `{}` | The registry to which insecure connections are allowed. There can be multiple registries with different keys. |
| trivy.javaDbRegistry | string | `"ghcr.io"` | javaDbRegistry is the registry for the Java vulnerability database. |
| trivy.javaDbRepository | string | `"aquasecurity/trivy-java-db"` | |
| trivy.labels | object | `{}` | labels is the extra labels to be used for trivy server statefulset |
| trivy.mode | string | `"Standalone"` | mode is the Trivy client mode. Either Standalone or ClientServer. Depending on the active mode other settings might be applicable or required. |
| trivy.noProxy | string | `nil` | noProxy is a comma separated list of IPs and domain names that are not subject to proxy settings. |
| trivy.nonSslRegistries | object | `{}` | Registries without SSL. There can be multiple registries with different keys. |
| trivy.offlineScan | bool | `false` | offlineScan is the flag to enable the offline scan functionality in Trivy This will prevent outgoing HTTP requests, e.g. to search.maven.org |
| trivy.podLabels | string | `nil` | podLabels is the extra pod labels to be used for trivy server |
| trivy.podLabels | object | `{}` | podLabels is the extra pod labels to be used for trivy server |
| trivy.priorityClassName | string | `""` | priorityClassName is the name of the priority class used for trivy server |
| trivy.registry | object | `{"mirror":{}}` | Mirrored registries. There can be multiple registries with different keys. Make sure to quote registries containing dots |
| trivy.resources | object | `{"limits":{"cpu":"500m","memory":"500M"},"requests":{"cpu":"100m","memory":"100M"}}` | resources resource requests and limits for scan job containers |
Expand Down
6 changes: 5 additions & 1 deletion deploy/helm/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ kind: Deployment
metadata:
name: {{ include "trivy-operator.fullname" . }}
namespace: {{ include "trivy-operator.namespace" . }}
labels: {{- include "trivy-operator.labels" . | nindent 4 }}
labels:
{{- include "trivy-operator.labels" . | nindent 4 }}
{{- with .Values.operator.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
replicas: {{ .Values.operator.replicas }}
{{- with .Values.operator.revisionHistoryLimit }}
Expand Down
3 changes: 3 additions & 0 deletions deploy/helm/templates/trivy-server/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ metadata:
labels:
app.kubernetes.io/name: trivy-server
app.kubernetes.io/instance: trivy-server
{{- with .Values.trivy.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
podManagementPolicy: "Parallel"
serviceName: {{ .Values.trivy.serverServiceName }}
Expand Down
8 changes: 7 additions & 1 deletion deploy/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ operator:
# -- number of old history to retain to allow rollback (if not set, default Kubernetes value is set to 10)
revisionHistoryLimit: ~

# -- additional labels for the operator deployment
labels: {}

# -- additional labels for the operator pod
podLabels: {}

Expand Down Expand Up @@ -320,8 +323,11 @@ trivy:
# -- storageSize is the size of the trivy server PVC
storageSize: "5Gi"

# -- labels is the extra labels to be used for trivy server statefulset
labels: {}

# -- podLabels is the extra pod labels to be used for trivy server
podLabels:
podLabels: {}

# -- priorityClassName is the name of the priority class used for trivy server
priorityClassName: ""
Expand Down

0 comments on commit b05764c

Please sign in to comment.