From 0cf2308b83729090b1bcebe9077da0cae159636f Mon Sep 17 00:00:00 2001 From: Sebastiaan van Steenis Date: Mon, 16 Dec 2019 16:53:17 +0100 Subject: [PATCH] Add more ingress controller debug --- .../kubernetes-resources/_index.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/content/rancher/v2.x/en/troubleshooting/kubernetes-resources/_index.md b/content/rancher/v2.x/en/troubleshooting/kubernetes-resources/_index.md index 06d63135786..c8eae70b743 100644 --- a/content/rancher/v2.x/en/troubleshooting/kubernetes-resources/_index.md +++ b/content/rancher/v2.x/en/troubleshooting/kubernetes-resources/_index.md @@ -112,6 +112,22 @@ kubectl -n ingress-nginx logs -l app=ingress-nginx kubectl -n ingress-nginx get events ``` +#### Debug logging + +To enable debug logging: + +``` +kubectl -n ingress-nginx patch ds nginx-ingress-controller --type='json' -p='[{"op": "add", "path": "/spec/template/spec/containers/0/args/-", "value": "--v=5"}]' +``` + +#### Check configuration + +Retrieve generated configuration in each pod: + +``` +kubectl -n ingress-nginx get pods -l app=ingress-nginx --no-headers -o custom-columns=.NAME:.metadata.name | while read pod; do kubectl -n ingress-nginx exec $pod -- cat /etc/nginx/nginx.conf; done +``` + ### Rancher agents Communication to the cluster (Kubernetes API via `cattle-cluster-agent`) and communication to the nodes (cluster provisioning via `cattle-node-agent`) is done through Rancher agents.