阿里云ack创建内网ingress

  运维
apiVersion: v1
kind: Service
metadata:
  # 这里服务取名为nginx-ingress-lb-intranet
  name: nginx-ingress-lb-intranet
  namespace: kube-system
  labels:
    app: nginx-ingress-lb-intranet
  annotations:
    # 指明SLB实例地址类型为私网类型
    service.beta.kubernetes.io/alicloud-loadbalancer-address-type: intranet
    # 是否自动创建SLB端口监听(会覆写已有端口监听),也可手动创建端口监听
    service.beta.kubernetes.io/alicloud-loadbalancer-force-override-listeners: 'true'
spec:
  type: LoadBalancer
  # route traffic to other nodes
  externalTrafficPolicy: "Cluster"
  ports:
  - port: 80
    name: http
    targetPort: 80
  - port: 443
    name: https
    targetPort: 443
  - port: 8080
    name: http-alias
    targetPort: 80
  selector:
    # select app=ingress-nginx pods
    app: ingress-nginx

创建这个service后,会自动创建一个内网slb,和公网同时生效。
加一个annotations 可以指定外部slb

service.beta.kubernetes.io/alicloud-loadbalancer-id: <YOUR_INTRANET_SLB_ID>

LEAVE A COMMENT

Captcha Code