[英]EKS + NLB: `service.beta.kubernetes.io/aws-load-balancer-internal: true` not working with `service.beta.kubernetes.io/aws-load-balancer-type: nlb`
我有一個 EKS Kube.netes 1.16.x。 包含三個標記為kube.netes.io/role/elb: 1
的公共 su.net 和三個標記為kube.netes.io/role/internal-elb: 1
的私有 su.net 的集群
我正在嘗試創建一個內部 NLB LoadBalancer 服務。 在內部,我希望它托管在三個私有 su.net 上,而不是三個公共 su.net 上。
我正在關注https 上的文檔://docs.aws.amazon.com/eks/latest/userguide/load-balancing.html
apiVersion: v1
kind: Service
metadata:
annotations:
service.beta.kubernetes.io/aws-load-balancer-type: nlb
service.beta.kubernetes.io/aws-load-balancer-backend-protocol: http
service.beta.kubernetes.io/aws-load-balancer-internal: true
name: grafana-nlb
namespace: prometheus
spec:
ports:
- name: service
port: 80
protocol: TCP
targetPort: 3000
selector:
app.kubernetes.io/instance: prom
app.kubernetes.io/name: grafana
type: LoadBalancer
如果我省略service.beta.kube.netes.io/aws-load-balancer-internal: true
注釋,一切似乎都能完美運行並產生我所期望的結果。 我獲得了一個僅托管在三個公共 su.net 上的公共 NLB。 我可以通過aws elbv2 describe-load-balancers
和"Scheme": "inte.net-facing"
, "Type": .network",
通過 AWS cli 看到這一點。
如果使用service.beta.kube.netes.io/aws-load-balancer-internal: true
注釋創建它,我會得到一個經典的 ELB 而不是 NLB,它仍然是公開的。 它具有"Scheme": "inte.net-facing"
並且僅托管在三個公共 su.net 上。 使用 CLI,我可以使用aws elb describe-load-balancers
看到負載均衡器,但看不到aws elbv2 describe-load-balancers
這似乎是錯誤的行為。 關於如何排除故障或繼續進行的任何提示?
true
需要在yaml中引用為"true"
。
這有效:
service.beta.kubernetes.io/aws-load-balancer-internal: "true"
這會導致我遇到的錯誤:
service.beta.kubernetes.io/aws-load-balancer-internal: true
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.