Troubleshooting nginx-proxy


The nginx-proxy container is deployed on every node that does not have the controlplane role. It provides access to all the nodes with the controlplane role by dynamically generating the NGINX configuration based on available nodes with the controlplane role.

Check if the Container is Running

The container is called nginx-proxy and should have status Up. The duration shown after Up is the time the container has been running.

  1. docker ps -a -f=name=nginx-proxy

Example output:

  1. docker ps -a -f=name=nginx-proxy
  2. CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
  3. c3e933687c0e rancher/rke-tools:v0.1.15 "nginx-proxy CP_HO..." 3 hours ago Up 3 hours nginx-proxy

Check Generated NGINX Configuration

The generated configuration should include the IP addresses of the nodes with the controlplane role. The configuration can be checked using the following command:

  1. docker exec nginx-proxy cat /etc/nginx/nginx.conf

Example output:

  1. error_log stderr notice;
  2. worker_processes auto;
  3. events {
  4. multi_accept on;
  5. use epoll;
  6. worker_connections 1024;
  7. }
  8. stream {
  9. upstream kube_apiserver {
  10. server ip_of_controlplane_node1:6443;
  11. server ip_of_controlplane_node2:6443;
  12. }
  13. server {
  14. listen 6443;
  15. proxy_pass kube_apiserver;
  16. proxy_timeout 30;
  17. proxy_connect_timeout 2s;
  18. }
  19. }

nginx-proxy Container Logging

The logging of the containers can contain information on what the problem could be.

  1. docker logs nginx-proxy