Access a service in EKS from another EKS cluster

1

Assume I have two EKS clusters, say cluster A in VPC A and cluster B in VPC B. Now I do a VPC peering to connect both VPCs.

My question is now, if I have an a service of type ClusterIP in cluster A, how could cluster B access it?

2 réponses
1

Hi,

You can't do it without using 3rd party tools. If you want to use only AWS services, you can expose the service with internal ELB.

If you are looking at how to access Service from another EKS cluster, take a look at solution from Cilium

profile picture
EXPERT
répondu il y a 5 mois
profile picture
EXPERT
vérifié il y a 4 mois
0

You have two main options:

If the service is HTTP based, you can use an internal ALB and native K8s ingress resource support to front your clusterIP service (this requires that you install the aws-load-balancer-controller in your cluster for both ALB and NLB options)

Or, you can use a service type load balancer instead of clusterIP and the EKS native cloud integration will provision a network load balancer for you. I guess if you are setting up peering that an internal NLB would be preferable so in this case you can set this annotations on the service: "service.beta.kubernetes.io/aws-load-balancer-scheme: internal"

Details on the other annotations available: https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.2/guide/service/annotations/

Also we aware of the subnet discovery process allowing you to set where the NLB is deployed : https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.2/deploy/subnet_discovery/

This will provide you with an NLB in the desired subnets.

Either way, if you want to have K8s ingress and services resolving from a route53 (private) zone, the external-dns project is your friend and you will find ready to use deployment patterns for it.

JFN
répondu il y a un mois

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions