reverse-proxy icon indicating copy to clipboard operation
reverse-proxy copied to clipboard

[Question] Use YARP in kubernetes as a service plus ingress

Open pilucdes opened this issue 4 years ago • 5 comments

Following this article.

I'm wondering if it's okay or makes sense to add a BFF/gateway(YARP) as a service in K8S with an Ingress in front? I have some custom code in my YARP such as JWT validation and REDIS token invalidation services which seem difficult to achieve with APIM or APIGateway from Azure.

Will, this setup works, and does anyone tried it? Thanks!

pilucdes avatar Apr 04 '22 19:04 pilucdes

Triage:

  • @pilouk are you trying to add YARP as a regular service into your existing k8s config? ... This one should just work like any other service, right?
  • Or are you trying to use YARP as k8s Ingress -- i.e. part of k8s infrastructure? ... This one is in progress - see Kubernetes Ingress Controller issues

karelz avatar Apr 07 '22 16:04 karelz

Triage:

  • @pilouk are you trying to add YARP as a regular service into your existing k8s config? ... This one should just work like any other service, right?
  • Or are you trying to use YARP as k8s Ingress -- i.e. part of k8s infrastructure? ... This one is in progress - see Kubernetes Ingress Controller issues

Thanks for your time @karelz! I'm trying to add it as a regular service which will be the only one accessible externally. I will test it with "azure container apps" tomorrow and come back or close this issue if everything is fine!

pilucdes avatar Apr 07 '22 22:04 pilucdes

works like a charm!

pilucdes avatar Apr 08 '22 17:04 pilucdes

works like a charm! @pilouk Even I have to do similar stuff where reverse proxy will run like service hosted before traefik. It would be great if you provide some inputs on how you have achieved.

NitinM3 avatar Jun 27 '22 18:06 NitinM3

works like a charm! @pilouk Even I have to do similar stuff where reverse proxy will run like service hosted before traefik. It would be great if you provide some inputs on how you have achieved.

Nothing really complicated if you have some knowledge of .NET and cloud platforms. You can use any hosted platform however, be sure your YARP service is exposed to the internet "public" if you want it to act as a gateway. Most of the important things will come down to the configuration file in your YARP project where you will add your routes and pattern matching for your downstream service (other APIs/services) which may be "private" if you don't want those expose. @NitinM3 Are you asking inputs precisely on container apps ?

pilucdes avatar Jul 03 '22 21:07 pilucdes