iits-consulting / terraform-opentelekomcloud-project-factory

This repository helps to create an OTC-based cloud-native infrastructure landscape with Kubernetes, load balancers, VPCs, etc. With these modules, we provide you a rocket start while you can still deep-dive into detailed configuration later.
GNU General Public License v3.0
84 stars 20 forks source link

Disable/Enable health check for Listener #117

Closed nadtoka closed 3 weeks ago

nadtoka commented 1 month ago

Is there a way to disable health check for some of the listeners using your modules?

We already use your VPC, SNAT and CCE modules.

Currently we have a separate resource for ELB creation ( resource "opentelekomcloud_lb_loadbalancer_v2" "elb" ) and it looks like listeners are automatically being created as part of some of the mentioned above modules or included helm charts.

{"cluster_id":"fa47eb97-2f2e-11ef-801","service_id":"559ac","port":53,"attention":"Attention! It is auto-generated by CCE service, do not modify!"}

In any case I am trying to understand how listeners are created and how to enable disable health check for some of them.

Would be very grateful for help

nadtoka commented 1 month ago

I have checked the code of mentioned above 3 modules and have not seen there listeners resources.... But if I can manage health check using your modules then please let me know.

canaykin commented 1 month ago

Greetings,

As you have also checked and confirmed, the listener resources are not created by the Terraform. Instead they are created by the loadbalancer type services in kubernetes. You can find them out by running kubectl get svc -A | grep -i loadbalancer. For most common use cases, this service is likely created by your chosen ingresscontroller helm chart.

In more detail, the loadbalancer type service(s) in CCE Clusters that are annotated with the kubernetes.io/elb.id will target that ELB and create/update/manage listeners on that ELB based on the port and backend configurations inside the service. Since most kubernetes clusters will expose other services via an ingresscontroller, this is the most common case where a loadbalancer service is created. However, it is possible to connect an ELB directly to a pod using loadbalancer services for some scenarios where a layer7 reverse proxy (ingress) is not desired.

As described in OTC Docs - Creating a LoadBalancer Service you can disable the health check for the created listeners via kubernetes.io/elb.health-check-flag: off annotation. Alternatively, it can also be configured via kubernetes.io/elb.health-check-option.

I hope this clarifies the topic. Can

canaykin commented 1 month ago

Here are some additional notes on alternatives of creating ELBs and listeners and why we recommend doing it the way we do:

Let me know if you need further details on any of these topics and I'll try to clarify them to the best of my ability. Can.