fix(infra-ingress): add field for access logging

This commit is contained in:
WrenIX 2024-09-03 23:10:54 +02:00
parent 85d398da55
commit 37c84787de
Signed by: wrenix
GPG key ID: 7AFDB012974B1BB5
3 changed files with 40 additions and 0 deletions

View file

@ -0,0 +1,28 @@
{{- if and
(eq .Values.controller "traefik")
(.Capabilities.APIVersions.Has "logging.banzaicloud.io/v1beta1/Flow")
}}
---
apiVersion: logging.banzaicloud.io/v1beta1
kind: Flow
metadata:
name: traefik
spec:
match:
- select:
labels:
app.kubernetes.io/name: traefik
filters:
- tag_normaliser: {}
- parser:
reserve_data: true
remove_key_name_field: true
parse:
type: json
time_key: "time"
time_type: "string"
time_format: "%iso8601"
hash_value_field: "traefik"
globalOutputRefs:
- "default"
{{- end }}

View file

@ -109,6 +109,14 @@ spec:
isDefaultClass: true isDefaultClass: true
rbac: rbac:
enabled: false enabled: false
{{- else }}
logs:
general:
format: "json"
level: WARN
access:
enabled: {{ toYaml .Values.logs.access }}
format: "json"
{{- end }} {{- end }}
metrics: metrics:

View file

@ -50,6 +50,10 @@ commons:
controller: "traefik" controller: "traefik"
hostNetwork: true hostNetwork: true
external: true external: true
logs:
access: false
traefik: traefik:
ports: {} ports: {}
hostPath: /srv/k8s/pv/pvc-traefik-certs hostPath: /srv/k8s/pv/pvc-traefik-certs