How can I route traffic through a custom proxy to my kubernetes container?

1/12/2017

So we've got a big site with 1 nginx config that handles everything! This includes SSL.

At the moment, the config is setup to route all traffic for subdomain.ourdomain.com to our exposed kubernetes service.

When I visit subdomain.ourdomain.com, it returns a 502 Bad Gateway. I've triple checked that the service inside my kubernetes pod is running properly. I'm pretty certain there is something wrong with the kubernetes config I'm using.

So what I've done:

  1. Created kubernetes service
  2. Exposed it using type LoadBalancer
  3. Added the correct routing to our nginx config for our subdomain

This is what the kubectl get services returns:

users          <cluster_ip>   <external_ip>   80/TCP     12m

This is what kubectl get endpoints returns:

kubernetes     <kub_ip>:443   48d
redis-master   10.0.1.5:6379        48d
redis-slave    10.0.0.5:6379        48d
users          10.0.2.7:80          3m

All I want to do is route all traffic through our nginx configuration to our kubernetes service?

We tried routing all traffic to our kubernetes container cluster IP, but this didn't work.

-- James111
google-kubernetes-engine
kubectl
kubernetes
nginx

0 Answers