通过内网ULB访问Service

注意:ULB相关参数目前均不支持Update,如不确认如何填写,请咨询UCloud 技术支持。

仅需要通过 metadata.annotations 指定 load-balancer-type为inner,其他参数都有默认值,可不填写。

apiVersion: v1
kind: Service
metadata:
  name: ucloud-nginx-out-tcp-new
  labels:
    app: ucloud-nginx-out-tcp-new
  annotations:
    "service.beta.kubernetes.io/ucloud-load-balancer-type": "Inner"  ## ULB类型,默认为Outer,支持Outer、Inner
    "service.beta.kubernetes.io/ucloud-load-balancer-vserver-protocol": "TCP"       ## VServer协议类型,默认为TCP,支持TCP、UDP
    "service.beta.kubernetes.io/ucloud-load-balancer-vserver-method": "Roundrobin"  ## 默认为Roundrobin,支持Roundrobin,Source,ConsistentHash,SourcePort,ConsistentHashPort    
    "service.beta.kubernetes.io/ucloud-load-balancer-vserver-session-persistence-type": "None" ## 默认为None,支持None,ServerInsert,UserDefined
    "service.beta.kubernetes.io/ucloud-load-balancer-vserver-session-persistence-info": "string" ## 用户自定义KEY,会话保持方式为UserDefined有效
    "service.beta.kubernetes.io/ucloud-load-balancer-vserver-client-timeout": "60" ## 连接保持的时间,单位为秒,取值范围:[60,900],0 表示禁用连接保持
spec:
  type: LoadBalancer
  ports:
    - protocol: TCP
      port: 80
      targetPort: 80
  selector:
    app: ucloud-nginx-out-tcp-new
---
apiVersion: v1
kind: Pod
metadata:
  name: test-nginx-out-tcp
  labels:
    app: ucloud-nginx-out-tcp-new
spec:
  containers:
  - name: nginx
    image: uhub.service.ucloud.cn/ucloud/nginx:1.9.2
    ports:
    - containerPort: 80
如有疑问请联系 技术支持