traefik vs nginx ingress controller - nginx

Hi I am using kubernetes and now need to make a choice between traefik and nginx ingress controller for ingress expose. I have googled a lot, but seems no such big difference, especially nginx just announce support grpc now. Anyone can give a advice? Thanks very very much!

Found this comment at stackshare by Howie Zhao
The reasons for choosing Traefik over Nginx are as follows:
Traefik built-in Let’s Encrypt and supports automatic renewal
Traefik automatically enables HTTP/2
Prometheus can be supported through simple Traefik configuration
cookiecutter django integrates Traefik's configuration by default

Related

How can I use ingress to control the routing between two instances?

I have a service deployed on Kubernetes and it has url app.io (using ingress).
What if I need a user to every time go to app.io and:
if it's running okay with no errors, it redirects to the app.io (on k8s)
and if not running well or have an error, it would redirect on a backup service on Heroku for example with url backup.io.
How can I do that?
Thanks in advance
Fallback routing like you describe is not part of the Ingress standard. It only does routing based on incoming Host header and request path. It's possible some specific Ingress Controller supports this as a custom extension but I don't know of any that do.
I think you may need to put a L7 load balancer like HAproxy in front. Configure your backup location in backend pool, and HAProxy will take care of the rest.
You may want to configure ingress befault-backendto be some sort of fallback service. With most of the cases people tend to use that for some custom 404 but you might just direct it to another service, for example backup-io:
kind: Ingress
metadata:
name: my-ingress
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/rewrite-target: "/"
nginx.ingress.kubernetes.io/default-backend: backup-io
That's of course assuming you're using nginx controller. Kong has also fallback service instructions.

Nginx Ingress Controller with Nginx Reverse Proxy

I am a bit confused with the architecture of load-balancing K8s traffic with Nginx ingress controller.
I learned that an ingress controller is supposed to configure the load-balancer you're using according to ingress configurations.
So if I want to use Nginx ingress controller and I have a Physical server that is running Nginx that stands in front of my network, how can I make the ingress controller configure it?
Ingress exposes HTTP and HTTPS routes from outside the cluster to services within the cluster. Traffic routing is controlled by rules defined on the Ingress resource. You must have an Ingress controller to satisfy an Ingress. Only creating an Ingress resource has no effect. Take a look at the example graph below:
Nginx Ingress Controller is using service of type LoadBalancer to get the traffic enter the controller and then to get rerouted to particular services.
I strongly suggest going through the official documentation in order to get a good understanding of the topic and see some examples of using it.
is the nginx ingress controller supposed to (or can) configure an
Nginx machine?
NGINX Ingress Controller works with both NGINX and NGINX Plus and supports the standard Ingress features - content-based routing and TLS/SSL termination.

HTTP2 support for Traefik ingress in Kubernetes (K3S)

I use K3S for my Kubernetes cluster. It's really fast and efficient. By default K3S use Traefik for ingress controller which also work well til now.
The only issue I have is, I want to have HTTP2 server push. The service I have is behind the ingress, generates Link header which in the case of NGINX I can simply turn it into the HTTP2 server push (explained here). Is there any same solution for Traefik? Or is it possible to switch to NGINX in K3S?
HTTP2 Push not supported in Traefik yet. See the github open issue #906 for progress on the matter.
Though, you can safely switch to the nginx ingress controller to accomplish HTTP2 push
a) helm install stable/nginx-ingress
b) in your ingress yaml set appropriate annotation
metadata:
annotations:
kubernetes.io/ingress.class: nginx
I don't know about that HTTP2 in traefik, but you can simply tell k3s not to start traefik and deploy your choice of ingress controller:
https://github.com/rancher/k3s#traefik
You probably do not want HTTP/2 Server Push given it's being removed from Chromium. If you would like to switch ingress controllers you can choose another by:
Starting K3s with the --disable traefik option.
Adding another controller such as NGINX or Ambassador
For detailed instructions on adding Ambassador to K3s see the following link: https://rancher.com/blog/2020/deploy-an-ingress-controllers

kubernetes: nginx ingress vs traefik ingress vs ha-proxy ingress vs kong ingress

We are looking at various opensource ingress controllers available for kubernetes and need to chose the best one among all. We are evaluating the below four ingress controllers
Nginx ingress controller
Traefik ingress controller
Ha-proxy ingress controller
Kong ingress controller
What are the difference between these In terms of features and performance and which one should be adopted in production. please provide your suggestions
One difference I’m aware of, is that haproxy and nginx ingresses can work in TCP mode, whereas traefik only works in HTTP/HTTPS modes. If you want to ingress services like SMTP or MQTT, then this is a useful distinction.
Also, haproxy supports the “PROXY” protocol, allowing you to pass real client IP to backend services. I used the haproxy ingress recently for a docker-mailserver helm chart - https://hub.helm.sh/charts/funkypenguin

Kubernetes ingress nginx controller routing using HTTP headers

I have installed Kubernetes ingress nginx controller as described here. I am looking further to customize the routing logic by parsing HTTP header and altering the base ingress route accordingly. I know that it can be done using Lua script to be executed as part of the server routing configuration.
Can anyone advise how I inject the lua script into Kubernetes ingress nginx controller configuration?
I am doing a quite similar task. Previously we have a separate Nginx instance which has openresty installed.
My solution is to build our own customized image based on kubernetes nginx-ingress, and also include the openresty module inside the module.

Resources