amazon-web-services - 在 AWS 基础设施中私下访问 EKS 服务
问题描述
我在 K8S 中有一个服务,我想从另一个 EKS 集群的 POD 私下访问它。
服务.yaml
apiVersion: v1
kind: Service
metadata:
name: test
namespace: test
spec:
type: LoadBalancer
selector:
app: test
ports:
- name: http
protocol: TCP
port: 80
targetPort: 8888
在 LoadBalancer 的安全组中,我只删除0.0.0.0/0
并启用了客户端的工作节点 IP 和 POD IP
工作节点 IP
Type: All traffic
Protocol: All
Port range: All
Source: 10.x.0.0/16
点播IP
Type: All traffic
Protocol: All
Port range: All
Source: 10.x.x.x/32
现在当我从客户端的 POD telnet 到服务时,telnet 挂在 Trying 状态
telnet xxxx-xxxxx.us-west-1.elb.amazonaws.com 80
Trying xx.xxx.xxx.xxx...
如果我启用安全组中的所有源,如下所示,一切正常。这不是预期的行为,因为必须私下访问此资源。
Type: HTTP
Protocol: TCP
Port range: 80
Source: 0.0.0.0/0
我尝试了其他服务选项,没有任何效果
....
annotations:
service.beta.kubernetes.io/aws-load-balancer-type: "nlb"
service.beta.kubernetes.io/aws-load-balancer-internal: "true"
spec:
externalTrafficPolicy: Local # Tried both Cluster and Local
....
解决方案
推荐阅读
- python - 使用 tensorflow 2.0 通过索引列表索引和张量
- python - 在 Python 中编写 Discord 机器人 - 在 on_raw_reaction_add 中,我如何判断消息是否有图像?
- compression - HBase 2.3.5 无法启动 regionserver,错误日志:java.io.IOException: Compression codec snappy not supported, aborting RS construction
- go - G110:减压炸弹的潜在 DoS 漏洞 (gosec)
- 1password - 在 gopass 中保存环境变量
- python - python - 如何获取分层类名
- python - Django None 参数函数问题
- r - 数据框列表中每个数据框的列方差系数
- python - f2py 错误:导入模块时未定义符号
- python - 手动尝试拍照不起作用