kubernetes / ingress-nginx

Ingress NGINX Controller for Kubernetes
https://kubernetes.github.io/ingress-nginx/
Apache License 2.0
17.49k stars 8.25k forks source link

Support --dump-config option #12331

Open soupdiver opened 2 hours ago

soupdiver commented 2 hours ago

It would be nice to support a flag like --dump-config that dump the final config on startup. Even/Especially if it's invalid.

I know there is --v=3 but that also prints out a whole lot of other things. I was mainly interested in the config for debugging purpose.

I raised in issue here: https://github.com/kubernetes/ingress-nginx/issues/12330

Some context: I did maintenance on a cluster with a bunch of ingresses and apps and it's not entirely clear where all the ingrresses come from but they are there. One of them is affected by https://github.com/kubernetes/ingress-nginx/issues/11866 and it was tedious to find out from which ingress the error came. I used --v=3 but that dump not valid json I could use. It just looks like almost json. I also went into the container to get the config but no luck either. The startup process is pretty integrated from what I saw in the code. A tmp config is written and checked and if invalid startup aborts and the file is deleted. Without touching the code I could not find an easy way to just the config file.

I think the dump I had to scroll through was 2MB of unformated text.

k8s-ci-robot commented 2 hours ago

This issue is currently awaiting triage.

If Ingress contributors determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.