Skip to content

Commit

Permalink
Add logLevel for cron jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgeniy Dmitriev authored and 134171E committed Dec 28, 2023
1 parent 13d5272 commit 94ccb70
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 15 deletions.
12 changes: 6 additions & 6 deletions charts/ingress-nginx/templates/controller-configmap-cron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,32 @@ data:
crontab: |
{{- with .Values.controller.wallarm.cron.jobs.exportEnvironment }}
# export-environment
{{ .schedule }} timeout {{ .timeout }} /opt/wallarm/usr/share/wallarm-common/export-environment -l STDOUT
{{ .schedule }} timeout {{ .timeout }} /opt/wallarm/usr/share/wallarm-common/export-environment -l STDOUT -L {{ .logLevel }}
{{- end }}
{{- with .Values.controller.wallarm.cron.jobs.syncIpLists }}
# sync-ip-lists
{{ .schedule }} timeout {{ .timeout }} /opt/wallarm/usr/share/wallarm-common/sync-ip-lists -l STDOUT
{{ .schedule }} timeout {{ .timeout }} /opt/wallarm/usr/share/wallarm-common/sync-ip-lists -l STDOUT -L {{ .logLevel }}
{{- end }}
{{- with .Values.controller.wallarm.cron.jobs.exportMetrics }}
# export-metrics
{{ .schedule }} timeout {{ .timeout }} /opt/wallarm/usr/share/wallarm-common/export-metrics -l STDOUT
{{ .schedule }} timeout {{ .timeout }} /opt/wallarm/usr/share/wallarm-common/export-metrics -l STDOUT -L {{ .logLevel }}
{{- end }}
{{- with .Values.controller.wallarm.cron.jobs.syncIpListsSource }}
# sync-ip-lists-source
{{ .schedule }} timeout {{ .timeout }} /opt/wallarm/usr/share/wallarm-common/sync-ip-lists-source -l STDOUT
{{ .schedule }} timeout {{ .timeout }} /opt/wallarm/usr/share/wallarm-common/sync-ip-lists-source -l STDOUT -L {{ .logLevel }}
{{- end }}
{{- with .Values.controller.wallarm.cron.jobs.syncNode }}
# sync-node
{{ .schedule }} /opt/wallarm/usr/share/wallarm-common/syncnode -f -p -r 120 -l STDOUT -L DEBUG
{{ .schedule }} /opt/wallarm/usr/share/wallarm-common/syncnode -f -p -r 120 -l STDOUT -L {{ .logLevel }}
{{- end }}
{{- if .Values.controller.wallarm.apifirewall.enabled }}
{{- with .Values.controller.wallarm.cron.jobs.syncApiSpecs }}
# sync-api-specs
{{ .schedule }} /opt/wallarm/usr/share/wallarm-common/sync-api-specs -l STDOUT
{{ .schedule }} /opt/wallarm/usr/share/wallarm-common/sync-api-specs -l STDOUT -L {{ .logLevel }}
{{- end }}
{{- end }}
1 change: 1 addition & 0 deletions charts/ingress-nginx/templates/controller-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ spec:
annotations:
{{- if and .Values.controller.wallarm.enabled (not .Values.controller.wallarm.existingSecret.enabled) }}
checksum/token: {{ .Values.controller.wallarm.token | sha256sum }}
checksum/cron: {{ .Values.controller.wallarm.cron.jobs | toJson | sha256sum }}
{{- end }}
{{- if .Values.controller.podAnnotations -}}
{{- range $key, $value := .Values.controller.podAnnotations }}
Expand Down
1 change: 1 addition & 0 deletions charts/ingress-nginx/templates/controller-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ spec:
annotations:
{{- if and .Values.controller.wallarm.enabled (not .Values.controller.wallarm.existingSecret.enabled) }}
checksum/token: {{ .Values.controller.wallarm.token | sha256sum }}
checksum/cron: {{ .Values.controller.wallarm.cron.jobs | toJson | sha256sum }}
{{- end }}
{{- if .Values.controller.podAnnotations -}}
{{- range $key, $value := .Values.controller.podAnnotations }}
Expand Down
18 changes: 9 additions & 9 deletions charts/ingress-nginx/templates/tarantool-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,45 +13,45 @@ data:
crontab: |
{{- with .Values.controller.wallarm.cron.jobs.exportAttacks }}
# export-attacks
{{ .schedule }} timeout {{ .timeout }} /opt/wallarm/usr/share/wallarm-common/export-attacks -l STDOUT
{{ .schedule }} timeout {{ .timeout }} /opt/wallarm/usr/share/wallarm-common/export-attacks -l STDOUT -L {{ .logLevel }}
{{- end }}
{{- with .Values.controller.wallarm.cron.jobs.exportCounters }}
# export-counters
{{ .schedule }} timeout {{ .timeout }} /opt/wallarm/usr/share/wallarm-common/export-counters -l STDOUT
{{ .schedule }} timeout {{ .timeout }} /opt/wallarm/usr/share/wallarm-common/export-counters -l STDOUT -L {{ .logLevel }}
{{- end }}
{{- with .Values.controller.wallarm.cron.jobs.exportEnvironment }}
# export-environment
{{ .schedule }} timeout {{ .timeout }} /opt/wallarm/usr/share/wallarm-common/export-environment -l STDOUT
{{ .schedule }} timeout {{ .timeout }} /opt/wallarm/usr/share/wallarm-common/export-environment -l STDOUT -L {{ .logLevel }}
{{- end }}
{{- with .Values.controller.wallarm.cron.jobs.bruteDetect }}
# brute-detect
{{ .schedule }} timeout {{ .timeout }} /opt/wallarm/usr/share/wallarm-common/brute-detect -l STDOUT
{{ .schedule }} timeout {{ .timeout }} /opt/wallarm/usr/share/wallarm-common/brute-detect -l STDOUT -L {{ .logLevel }}
{{- end }}
{{- with .Values.controller.wallarm.cron.jobs.syncMarkers }}
# sync-markers
{{ .schedule }} timeout {{ .timeout }} /opt/wallarm/usr/share/wallarm-common/sync-markers -l STDOUT
{{ .schedule }} timeout {{ .timeout }} /opt/wallarm/usr/share/wallarm-common/sync-markers -l STDOUT -L {{ .logLevel }}
{{- end }}
{{- with .Values.controller.wallarm.cron.jobs.weakJwtDetect }}
# weak-jwt-detect
{{ .schedule }} /opt/wallarm/usr/share/wallarm-common/weak-jwt-detect -l STDOUT
{{ .schedule }} /opt/wallarm/usr/share/wallarm-common/weak-jwt-detect -l STDOUT -L {{ .logLevel }}
{{- end }}
{{- with .Values.controller.wallarm.cron.jobs.syncNode }}
# sync-node
{{ .schedule }} /opt/wallarm/usr/share/wallarm-common/syncnode -f -p -r 120 -l STDOUT -L DEBUG
{{ .schedule }} /opt/wallarm/usr/share/wallarm-common/syncnode -f -p -r 120 -l STDOUT -L {{ .logLevel }}
{{- end }}
{{- with .Values.controller.wallarm.cron.jobs.exportBlockedStat }}
# export-blocked-stats
{{ .schedule }} timeout {{ .timeout }} /opt/wallarm/usr/share/wallarm-common/export-blocked-stats -l STDOUT -L DEBUG
{{ .schedule }} timeout {{ .timeout }} /opt/wallarm/usr/share/wallarm-common/export-blocked-stats -l STDOUT -L {{ .logLevel }}
{{- end }}
{{- with .Values.controller.wallarm.cron.jobs.detectCredStuffing }}
# detect-cred-stuffing
{{ .schedule }} timeout {{ .timeout }} /opt/wallarm/usr/share/wallarm-common/detect-cred-stuffing -l STDOUT
{{ .schedule }} timeout {{ .timeout }} /opt/wallarm/usr/share/wallarm-common/detect-cred-stuffing -l STDOUT -L {{ .logLevel }}
{{- end }}
1 change: 1 addition & 0 deletions charts/ingress-nginx/templates/tarantool-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ spec:
{{- if not .Values.controller.wallarm.existingSecret.enabled }}
annotations:
checksum/token: {{ .Values.controller.wallarm.token | sha256sum }}
checksum/cron: {{ .Values.controller.wallarm.cron.jobs | toJson | sha256sum }}
{{- end }}
labels:
{{- include "ingress-nginx.selectorLabels" . | nindent 8 }}
Expand Down
1 change: 1 addition & 0 deletions charts/ingress-nginx/templates/tarantool-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ spec:
{{- if not .Values.controller.wallarm.existingSecret.enabled }}
annotations:
checksum/token: {{ .Values.controller.wallarm.token | sha256sum }}
checksum/cron: {{ .Values.controller.wallarm.cron.jobs | toJson | sha256sum }}
{{- end }}
labels:
{{- include "ingress-nginx.selectorLabels" . | nindent 8 }}
Expand Down
13 changes: 13 additions & 0 deletions charts/ingress-nginx/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -844,40 +844,53 @@ controller:
cron:
jobs:
exportEnvironment:
logLevel: INFO
schedule: "0 */1 * * *"
timeout: 10m
exportAttacks:
logLevel: INFO
schedule: "* * * * *"
timeout: 3h
exportCounters:
logLevel: ERROR
schedule: "* * * * *"
timeout: 11m
bruteDetect:
logLevel: INFO
schedule: "* * * * *"
timeout: 6m
syncIpLists:
logLevel: INFO
schedule: "* * * * *"
timeout: 3h
exportMetrics:
logLevel: INFO
schedule: "* * * * *"
timeout: 3h
syncIpListsSource:
logLevel: INFO
schedule: "*/5 * * * *"
timeout: 3h
syncMarkers:
logLevel: INFO
schedule: "* * * * *"
timeout: 1h
syncNode:
logLevel: INFO
schedule: "*/2 * * * *"
weakJwtDetect:
logLevel: INFO
schedule: "* * * * *"
exportBlockedStat:
logLevel: INFO
schedule: "* * * * *"
timeout: 24h
detectCredStuffing:
logLevel: INFO
schedule: "* * * * *"
timeout: 10m
syncApiSpecs:
logLevel: INFO
schedule: "* * * * *"
timeout: 10m
resources: {}
Expand Down

0 comments on commit 94ccb70

Please sign in to comment.