How to use nginx with Kubernetes load balancer (GKE) and Google HTTPS

We use Ingress to create HTTPS load balancers that are directly passed to our (usually nodejs) services. However, recently we wanted to control more traffic in front of sites that Google Balancer does not support.

  • Standard user error pages
  • Standard rewrite rules (e.g. redirect http to https)
  • Cancel pod readiness Programs from the load balancing health check (therefore, we can serve user error pages when there are no healthy containers).

We use nginx in other parts of our stack, so this seems like a good choice, and I saw several examples of using nginx for front-end services in Kubernetes, usually in one of two configurations.

  • The nginx container in each traffic forwarding container directly to the application on the local hosting.
  • Separate deployment and maintenance of nginx, independently scalable and redirecting traffic to the corresponding Kubernetes service.

What are the advantages / disadvantages of each method and how to determine which one is most suitable for our use?

+4
source share
2 answers

, POD, . nginx , . , /. , , , , , , nginx ( , ).

+1

Vincent H, HTTPS Google nginx.

, ; ; .

, kubernetes.io/ingress.class: "gce", nginx. kubernetes.io/ingress.class: "nginx".

: https://github.com/kubernetes/ingress/tree/master/controllers/nginx. /etc/nginx/template/nginx.tmpl, .

nginx, .

+1

Source: https://habr.com/ru/post/1677518/


All Articles