我有一个 eks 集群(Argo cd 集群)和 Argo CD 在其上运行,我想添加位于另一个 AWS 账户上的另一个 EKS 集群(staging),在使用 argocd cli 添加集群时出现以下错误
argocd 集群添加
FATA[0034] rpc error: code = DeadlineExceeded desc = Get "https://7676334634763764377B080FC2E502754A3.gr7.eu-central-1.eks.amazonaws.com/version?timeout=32s": dial tcp 52.87.96.207:443: i/o timeout
我的临时集群公共访问仅限于办公室 VPN,我已将 Argocd 集群的 NAT Ip 和入口控制器 IP 列入白名单,但我仍然收到错误。
PS:当禁用公共访问 cidr 访问时,我可以成功添加集群。
不确定我在这里缺少什么,任何人都可以在这里帮助我。
要扩展您的答案,您需要:
使用 AWS NAT 网关识别 Argo CD 集群的正确 NAT IP:
# Use AWS CLI to describe the NAT Gateway and find the correct NAT IP
aws ec2 describe-nat-gateways --query 'NatGateways[?VpcId==`<vpc-id>`].{NatGatewayAddresses: NatGatewayAddresses}'
更新新 EKS 集群上的白名单以包含此 IP(安全组设置):
# That would likely be done in the AWS Management Console, under the security group settings for the new EKS cluster
# Alternatively, it can be done using the AWS CLI or SDKs
aws ec2 authorize-security-group-ingress --group-id <security-group-id> --protocol tcp --port 443 --cidr <nat-ip>/32
argocd cluster add
命令测试连接。
argocd cluster add <staging-cluster>
正确的 NAT IP 应列入白名单,允许 Argo CD 实例与新的 EKS 集群通信并解决超时错误。