繁体   English   中英

Kube.netes 中的 AWS ALB 服务

[英]AWS ALB service in Kubernetes

我想为在 Kube.netes 中运行的 Traefik 部署 Application Load Balancer。 所以,我尝试了以下方法:

kind: Service
apiVersion: v1
metadata:
  name: traefik-application-elb
  namespace: kube-system
  annotations:
    service.beta.kubernetes.io/aws-load-balancer-backend-protocol: "tcp"
    service.beta.kubernetes.io/aws-load-balancer-type: "elb"
    service.beta.kubernetes.io/aws-load-balancer-name: "eks-traefik-application-elb"
    service.beta.kubernetes.io/aws-load-balancer-additional-resource-tags: "App=traefik,Env=dev"
spec:
  type: LoadBalancer
  ports:
    - protocol: TCP
      name: web
      port: 80
    - protocol: TCP
      name: websecure
      port: 443
  selector:
    app: traefik

但是创建了面向 inte.net 的Classic负载均衡器。 还尝试了service.beta.kube.netes.io/aws-load-balancer-type: "alb"但没有任何改变。

这里有什么问题?

来自文档: https://docs.aws.amazon.com/eks/latest/userguide.network-load-balancing.html

当您创建类型为 LoadBalancer 的 Kube.netes 服务时,AWS 云提供商负载均衡器 controller 默认创建 AWS Classic Load Balancer,但也可以创建 AWS 网络负载均衡器。

不支持将 ALB 作为 k8s 负载均衡器。 如果需要,您可以指定 NLB。

但是,您可以使用 ALB 作为入口 controller 进行这样的部署 - https://aws.amazon.com/blogs/containers/introducing-aws-load-balancer-controller/

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: SearchApp
  annotations:
    # share a single ALB with all ingress rules with search-app-ingress
    alb.ingress.kubernetes.io/group.name: search-app-ingress
spec:
  defaultBackend:
    service:
      name: search-svc # route traffic to the service search-svc
      port:
        number: 80

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM