Skip to content

Commit

Permalink
fix: make log level configurable in helm values
Browse files Browse the repository at this point in the history
Allow configuring log level of all components in openshift template.
  • Loading branch information
Ulf Lilleengen committed Oct 2, 2023
1 parent 17a7450 commit 83c2c5a
Show file tree
Hide file tree
Showing 18 changed files with 48 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ spec:
- "/etc/config/auth.yaml"
env:
- name: RUST_LOG
value: info
value: {{ default "info" .Values.bombastic.api.logLevel }}
- name: STORAGE_ACCESS_KEY
valueFrom:
secretKeyRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ spec:
- "sbom"
env:
- name: RUST_LOG
value: info
value: {{ default "info" .Values.bombastic.exporter.logLevel }}
- name: STORAGE_ACCESS_KEY
valueFrom:
secretKeyRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ spec:
{{ end }}
env:
- name: RUST_LOG
value: info
value: {{ default "info" .Values.bombastic.indexer.logLevel }}
- name: STORAGE_ACCESS_KEY
valueFrom:
secretKeyRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ spec:
- "true"
env:
- name: RUST_LOG
value: info
value: {{ default "info" .Values.bombastic.walker.logLevel }}
- name: INFRASTRUCTURE_ENABLED
value: "true"
- name: INFRASTRUCTURE_BIND
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ spec:
- "http://guac-graphql.$(NAMESPACE).svc:8080/query"
env:
- name: RUST_LOG
value: info
value: {{ default "info" .Values.collector.nvd.logLevel }}
- name: NAMESPACE
valueFrom:
fieldRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ spec:
- "http://guac-graphql.$(NAMESPACE).svc:8080/query"
env:
- name: RUST_LOG
value: info
value: {{ default "info" .Values.collector.osv.logLevel }}
- name: NAMESPACE
valueFrom:
fieldRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ spec:
- "http://guac-graphql.$(NAMESPACE).svc:8080/query"
env:
- name: RUST_LOG
value: info
value: {{ default "info" .Values.collector.snyk.logLevel }}
- name: NAMESPACE
valueFrom:
fieldRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ spec:
- "/etc/config/collectorist.yaml"
env:
- name: RUST_LOG
value: info
value: {{ default "info" .Values.collectorist.api.logLevel }}
{{ include "trustification.http-server" . | nindent 12 }}
- name: INFRASTRUCTURE_ENABLED
value: "true"
Expand Down
2 changes: 1 addition & 1 deletion deploy/k8s/chart/templates/exhort/api/030-Deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ spec:
- "/etc/config/auth.yaml"
env:
- name: RUST_LOG
value: info
value: {{ default "info" .Values.exhort.api.logLevel }}
- name: NAMESPACE
valueFrom:
fieldRef:
Expand Down
2 changes: 1 addition & 1 deletion deploy/k8s/chart/templates/spog/api/030-Deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ spec:
- "/etc/config/auth.yaml"
env:
- name: RUST_LOG
value: info
value: {{ default "info" .Values.spog.api.logLevel }}
- name: NAMESPACE
valueFrom:
fieldRef:
Expand Down
2 changes: 1 addition & 1 deletion deploy/k8s/chart/templates/v11y/api/030-Deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ spec:
- "/data"
env:
- name: RUST_LOG
value: info
value: {{ default "info" .Values.v11y.api.logLevel }}
{{ include "trustification.http-server" . | nindent 12 }}
- name: INFRASTRUCTURE_ENABLED
value: "true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ spec:
- "/etc/config/auth.yaml"
env:
- name: RUST_LOG
value: info
value: {{ default "info" .Values.vexination.api.logLevel }}
{{ include "trustification.http-server" . | nindent 12 }}
- name: STORAGE_ACCESS_KEY
valueFrom:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ spec:
{{ end }}
env:
- name: RUST_LOG
value: info
value: {{ default "info" .Values.vexination.indexer.logLevel }}
- name: STORAGE_ACCESS_KEY
valueFrom:
secretKeyRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ spec:
- "-3"
env:
- name: RUST_LOG
value: info
value: {{ default "info" .Values.vexination.walker.logLevel }}
- name: INFRASTRUCTURE_ENABLED
value: "true"
- name: INFRASTRUCTURE_BIND
Expand Down
3 changes: 3 additions & 0 deletions deploy/openshift/parameters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,6 @@ parameters:
required: true
- name: K8S_NAMESPACE
required: true
- name: LOG_LEVEL
required: false
default: "info"
27 changes: 15 additions & 12 deletions deploy/openshift/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ objects:
- /etc/config/auth.yaml
env:
- name: RUST_LOG
value: info
value: ${LOG_LEVEL}
- name: STORAGE_ACCESS_KEY
valueFrom:
secretKeyRef:
Expand Down Expand Up @@ -641,7 +641,7 @@ objects:
- sbom
env:
- name: RUST_LOG
value: info
value: ${LOG_LEVEL}
- name: STORAGE_ACCESS_KEY
valueFrom:
secretKeyRef:
Expand Down Expand Up @@ -740,7 +740,7 @@ objects:
- always
env:
- name: RUST_LOG
value: info
value: ${LOG_LEVEL}
- name: STORAGE_ACCESS_KEY
valueFrom:
secretKeyRef:
Expand Down Expand Up @@ -848,7 +848,7 @@ objects:
- http://guac-graphql.$(NAMESPACE).svc:8080/query
env:
- name: RUST_LOG
value: info
value: ${LOG_LEVEL}
- name: NAMESPACE
valueFrom:
fieldRef:
Expand Down Expand Up @@ -964,7 +964,7 @@ objects:
- http://guac-graphql.$(NAMESPACE).svc:8080/query
env:
- name: RUST_LOG
value: info
value: ${LOG_LEVEL}
- name: NAMESPACE
valueFrom:
fieldRef:
Expand Down Expand Up @@ -1075,7 +1075,7 @@ objects:
- http://guac-graphql.$(NAMESPACE).svc:8080/query
env:
- name: RUST_LOG
value: info
value: ${LOG_LEVEL}
- name: NAMESPACE
valueFrom:
fieldRef:
Expand Down Expand Up @@ -1197,7 +1197,7 @@ objects:
- /etc/config/collectorist.yaml
env:
- name: RUST_LOG
value: info
value: ${LOG_LEVEL}
- name: HTTP_SERVER_BIND_ADDR
value: '::'
- name: HTTP_SERVER_TLS_ENABLED
Expand Down Expand Up @@ -1296,7 +1296,7 @@ objects:
- /etc/config/auth.yaml
env:
- name: RUST_LOG
value: info
value: ${LOG_LEVEL}
- name: NAMESPACE
valueFrom:
fieldRef:
Expand Down Expand Up @@ -1538,7 +1538,7 @@ objects:
- /etc/config/auth.yaml
env:
- name: RUST_LOG
value: info
value: ${LOG_LEVEL}
- name: NAMESPACE
valueFrom:
fieldRef:
Expand Down Expand Up @@ -1722,7 +1722,7 @@ objects:
- /data
env:
- name: RUST_LOG
value: info
value: ${LOG_LEVEL}
- name: HTTP_SERVER_BIND_ADDR
value: '::'
- name: HTTP_SERVER_TLS_ENABLED
Expand Down Expand Up @@ -1814,7 +1814,7 @@ objects:
- /etc/config/auth.yaml
env:
- name: RUST_LOG
value: info
value: ${LOG_LEVEL}
- name: HTTP_SERVER_BIND_ADDR
value: '::'
- name: HTTP_SERVER_TLS_ENABLED
Expand Down Expand Up @@ -1922,7 +1922,7 @@ objects:
- always
env:
- name: RUST_LOG
value: info
value: ${LOG_LEVEL}
- name: STORAGE_ACCESS_KEY
valueFrom:
secretKeyRef:
Expand Down Expand Up @@ -2226,3 +2226,6 @@ parameters:
required: true
- name: K8S_NAMESPACE
required: true
- name: LOG_LEVEL
required: false
default: "info"
15 changes: 15 additions & 0 deletions deploy/openshift/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,67 +20,82 @@ spog:
resources: ${{SPOG_UI_RESOURCES}}
api:
resources: ${{SPOG_API_RESOURCES}}
logLevel: ${LOG_LEVEL}
bombastic:
bucket: ${BOMBASTIC_STORAGE_BUCKET}
credentials: ${BOMBASTIC_AWS_SECRET_NAME}
indexMode: file
exporter:
topic: ${BOMBASTIC_INDEXER_GUAC_TOPIC}
logLevel: ${LOG_LEVEL}
indexer:
reindex: true
topics:
stored: ${BOMBASTIC_INDEXER_STORED_TOPIC}
indexed: ${BOMBASTIC_INDEXER_INDEXED_TOPIC}
failed: ${BOMBASTIC_INDEXER_FAILED_TOPIC}
resources: ${{BOMBASTIC_INDEXER_RESOURCES}}
logLevel: ${LOG_LEVEL}
walker:
enable: false
source: "https://access.redhat.com/security/data/sbom/beta/"
signingKey: "https://access.redhat.com/security/data/97f5eac4.txt#77E79ABE93673533ED09EBE2DCE3823597F5EAC4"
resources: ${{BOMBASTIC_WALKER_RESOURCES}}
logLevel: ${LOG_LEVEL}
api:
resources: ${{BOMBASTIC_API_RESOURCES}}
logLevel: ${LOG_LEVEL}
v11y:
enabled: true
api:
resources: ${{V11Y_API_RESOURCES}}
logLevel: ${LOG_LEVEL}
collectorist:
enabled: true
api:
resources: ${{COLLECTORIST_RESOURCES}}
logLevel: ${LOG_LEVEL}
exhort:
enabled: true
api:
resources: ${{EXHORT_API_RESOURCES}}
logLevel: ${LOG_LEVEL}
collector:
snyk:
enabled: true
credentials: snyk-collector-secret
resources: ${{COLLECTOR_SNYK_RESOURCES}}
logLevel: ${LOG_LEVEL}
osv:
enabled: true
resources: ${{COLLECTOR_OSV_RESOURCES}}
logLevel: ${LOG_LEVEL}
nvd:
enabled: true
credentials: nvd-collector-secret
resources: ${{COLLECTOR_NVD_RESOURCES}}
logLevel: ${LOG_LEVEL}
vexination:
bucket: ${VEXINATION_STORAGE_BUCKET}
credentials: ${VEXINATION_AWS_SECRET_NAME}
indexMode: file
exporter:
topic: ${VEXINATION_INDEXER_GUAC_TOPIC}
logLevel: ${LOG_LEVEL}
walker:
source: https://www.redhat.com/.well-known/csaf/provider-metadata.json
logLevel: ${LOG_LEVEL}
indexer:
reindex: true
topics:
stored: ${VEXINATION_INDEXER_STORED_TOPIC}
indexed: ${VEXINATION_INDEXER_INDEXED_TOPIC}
failed: ${VEXINATION_INDEXER_FAILED_TOPIC}
resources: ${{VEXINATION_INDEXER_RESOURCES}}
logLevel: ${LOG_LEVEL}
api:
resources: ${{VEXINATION_API_RESOURCES}}
logLevel: ${LOG_LEVEL}
keycloak:
enabled: false
guac:
Expand Down
1 change: 1 addition & 0 deletions indexer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ impl<'a, INDEX: Index> Indexer<'a, INDEX> {
Ok(Some(event)) => {
if let Some(payload) = event.payload() {
if let Ok(data) = self.storage.decode_event(payload) {
log::debug!("Received {} records", data.records.len());
for data in data.records {
if self.storage.is_index(data.key()) {
log::trace!("It's an index event, ignoring");
Expand Down

0 comments on commit 83c2c5a

Please sign in to comment.