oracle / oci-native-ingress-controller

OCI Native Ingress Controller
https://blogs.oracle.com/cloud-infrastructure/post/oracle-cloud-native-ingress-controller-kubernetes
Universal Permissive License v1.0
19 stars 21 forks source link

Rule set to redirect ports for TCP #101

Open rasticek opened 7 hours ago

rasticek commented 7 hours ago

Hi,

I would like to setup OCI LB for Kafka deployment by utilizing ClusterIP services with Ingress (for Kafka I am using https://github.com/bitnami/charts/tree/main/bitnami/kafka/#installing-the-chart). I am using 3 controllers/brokers for Kafka. Such setup is documented/working with nginx LB using config maps but I'm not able to configure similar with oci-native-ingress-controller. Anyway, when I configure it manually (the LB on OCI) it is working as expected.

Brief description:

  1. The Kafka service is exposed externally on 3 pods = 3 IP addresses with same Port> E.g., IP1:9095, IP2:9095, IP3:9095
  1. The OCI LB for this is correctly set using Ingress with one Listener (on port 9095) with Backend Set with 3 backends (IP1:9095, IP2:9095, IP3:9095).
  1. The Kafka is redirecting "initial" request (on Service) from client to the one of 3 Endpoints on same OCI LB which are distinguished by 3 different Ports and LB should the direct it to the right Enpoint based on the port - I am able to configure this manually but not using oci-native-ingress-controller.
  1. E.g., LB:9096 should redirect to IP1:9095, LB:9097 should redirect to IP2:9095, LB:9098 should redirect to IP3:9095,
  2. So, the LB configuration should be 3 listeners > Listener on port 9096 with Backend Set and one backed IP1:9095, Listener on port 9097 with Backend Set and one backed IIP2:9095, Listener on port 9098 with Backend Set and one backed IP3:9095

Nginx is using config maps on controller deployment and this is then propagated on Ingress and into LB afterwards . Sample config map

apiVersion: v1
kind: ConfigMap
metadata:
  name: tcp-ingress-4-kafka-ing
  namespace: kafka-ingress
data:
  9096: "kafka-ingress/kafka-ing-controller-0-external:9095"
  9097: "kafka-ingress/kafka-ing-controller-1-external:9095"
  9098: "kafka-ingress/kafka-ing-controller-2-external:9095"

Is it possible to achieve this configuration using oci-native-ingress-controller with Ingress or is this functionality missing so far please?

Thank you.

nirpai commented 5 hours ago

In general native ingerss controller creates one listener for each service port and one backend set for all backends of that service. So have you tried creating 3 different services with respective listener port/backend configuration?

rasticek commented 1 hour ago

Hi, yes I've tried already. Unfortunately it keeps failing because within kube it has same target port and/or the service is not exposed for these controllers on this port, it is just endpoint (not service). I believe that this is because example from nginx uses config map approach in this case. Is it possible to get to the configuration I described using oci-native-ingress-controller please?