내용으로 건너뛰기

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개 답변
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

전문가

답변함 3년 전

전문가

검토됨 3년 전

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.

답변함 3년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

관련 콘텐츠