我很难使用入口控制器使它与NLB配合使用: https://kubernetes.github.io/ingress-nginx/deploy/#network-load-balancer-nlb
即使子网在这里也没有生效,也没有在创建NLB的API中传递我的配置:
================================
kind: Service
apiVersion: v1
metadata:
name: ingress-nginx
namespace: ingress-nginx
labels:
app.kubernetes.io/name: ingress-nginx
app.kubernetes.io/part-of: ingress-nginx
annotations:
service.beta.kubernetes.io/aws-load-balancer-type: nlb
service.beta.kubernetes.io/aws-load-balancer-eip-allocations: "eipalloc-
07e3afcd4b7b5d644,eipalloc-0d9cb0154be5ab55d,eipalloc-0e4e5ec3df81aa3ea"
service.beta.kubernetes.io/aws-load-balancer-subnets: "subnet-
061f4a497621a7179,subnet-001c2e5df9cc93960"
spec:
type: LoadBalancer
selector:
app.kubernetes.io/name: ingress-nginx
app.kubernetes.io/part-of: ingress-nginx
ports:
- name: http
port: 80
targetPort: http
- name: https
port: 443
targetPort: https
答案 0 :(得分:1)
因此,事实证明,仅自Kubernetes 1.16
(在AWS上即将推出)以来,才支持这些注释。
当前受支持的版本是1.15
,它只会忽略那些注释...
考虑到您在此处使用特定于AWS的注释(service.beta.kubernetes.io/aws-load-balancer-eip-allocations
)-我认为这正是它不适用于您的案例的原因。
作为一种解决方法,我建议:
官方声明: https://docs.aws.amazon.com/eks/latest/userguide/update-cluster.html#1-16-prequisites
注释的完整列表(当它们“被支持”时为c): https://github.com/kubernetes/kubernetes/blob/v1.16.0/staging/src/k8s.io/legacy-cloud-providers/aws/aws.go#L208-L211
敬请期待! :(