通过Annotation配置负载均衡类型的服务 SSL证书ID spec: selector: app: nginx ports: protocol: TCP port: 443 targetPort: 80 type: LoadBalancer 配置附加XForwardedFor请求头 plaintext kind: Service apiVersion: v1 metadata: name: nginx annotations: service.beta.kubernetes.io/ctyunloadbalancerid: "${YOURLOADBALANCERID}" service.beta.kubernetes.io/ctyunloadbalancerxforwardedfor: "true" spec: selector: app: nginx ports: protocol: TCP port: 80 targetPort: 80 type: LoadBalancer 配置全局健康检查 plaintext kind: Service apiVersion: v1 metadata: name: nginx annotations: service.beta.kubernetes.io/ctyunloadbalancerid: "${YOURLOADBALANCERID}" service.beta.kubernetes.io/ctyunloadbalancerhealthcheckflag: "on" service.beta.kubernetes.io/ctyunloadbalancerhealthcheckoption: '{ "protocol":"TCP", "interval":"5", "timeout":"10", "maxRetry":"3" }' spec: selector: app: nginx ports: protocol: TCP port: 80 targetPort: 80 protocol: TCP port: 90 targetPort: 90 type: LoadBalancer 配置部分端口健康检查 plaintext kind: Service apiVersion: v1 metadata: name: nginx annotations: service.beta.kubernetes.io/ctyunloadbalancerid: "${YOURLOADBALANCERID}" service.beta.kubernetes.io/ctyunloadbalancerhealthcheckflag: "on" service.beta.kubernetes.io/ctyunloadbalancerhealthcheckoptions: '[ { "servicePort":"TCP:90", 指定监听协议为TCP、服务端口为90的端口配置 "protocol":"TCP", 指定健康检查协议为TCP "interval":"5", "timeout":"10", "maxRetry":"3" }, { "servicePort":"TCP:80",