Question

I keep getting 400 Bad Request from Kubernetes with ingress-nginx helm chart

I’m running through the community example How To Set Up an Nginx Ingress on DigitalOcean Kubernetes Using Helm.

I’m using Kubernetes maintained chart rather than stable, since that seems like the most “official” chart, using this values.yaml:

controller:
  publishService:
    enabled: true
  service:
    annotations:
      service.beta.kubernetes.io/do-loadbalancer-enable-proxy-protocol: 'true'

defaultBackend:
  enable: true

I can see the load balancer in the DO control panels, and I’ve set up what I think are the correct DNS records:

A hw1.recfab.net <load balancer IP> 3600 TTL
A hw2.recfab.net <load balancer IP> 3600 TTL

I keep getting the default NGINX 400 Bad Request page when I hit hw1.recfab.net, or hw2.recfab.net`. I’ve checked the controller logs, and the service pod logs. I’m pretty sure the requests aren’t reaching the pods, but not sure why.

I’ve tried the Troubleshooting guide, and poked around with kubectl as well as the ingress-nginx kubectl plugin.

I have not been able to figure this out and I don’t know what else to try. I’m sure it’s something simple, but crucial, so hopefully someone here has a solution.

Thanks.


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

John Kwiatkoski
DigitalOcean Employee
DigitalOcean Employee badge
October 6, 2020
Accepted Answer

Hi there,

Can you ensure you have your ingress controller configured to respect the proxy protocol settings in the LB?

Looks like you need to add the proxy protocol directive to your configmap: https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/configmap/#use-proxy-protocol

Hope this helps!

John

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel