Access logs settings get overridden if using a Global Custom Resource
While normally you can set access logs via either the config section, or the dedicated logging section in the values files such as
controller:
config:
syslog-server: "address:stdout, format: raw, facility:local0"
or
controller:
logging:
traffic:
address: stdout
format: raw
facility: local0
if you happen to try using the Global Custom Resource, the access logs will mysteriously vanish. Only to return if you happen to read through the CRD and realize there's a secret log_targets field that you must include additionally, such as
apiVersion: "core.haproxy.org/v1alpha2"
kind: Global
metadata:
name: global
spec:
log_targets:
- address: stdout
format: raw
facility: local0
level: debug
This isn't documented anywhere, and can be fixed with a bunch of ways such as
- documenting it in the values file logging section
- documenting it in the Global Custom Resource docs
- not having the Custom resource overwrite the other settings
- removing from either the Global CRD or the values file
Hi @apalmatier, as discussed on Slack we'll make the documentation more explicit in its dedicated section but the CRD will take precedance over any annotations. More precisely, if it exists then annotations are not considered anymore.
Sounds good! That last clarifying point is the one that got me. If that's somewhere I think it's much more obvious 👍
if it exists then annotations are not considered anymore
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hello, Bug is still here as documentation has not been updated yet :)
Can you please point to where we should make modifications on source code to make log_targets config option appear in https://www.haproxy.com/documentation/kubernetes-ingress/community/configuration-reference/global-crd/#anonkey-version-v1-11 ? I tried to modify crs/definition/ingress.v1.haproxy.org_globals.yaml but my work disappeared when I launched ./crs/code-generator.sh, meaning this yaml file is built automatically (by the way, you should add a comment on top of this file, stating it is generated automatically).
to me, this is not exactly "fixed" : the workaround was to document this behaviour in helm chart values.yaml but this very bug is about documenting entry log_targets on global CRD documentation.