apiVersion: v1
kind: Service
metadata:
  name: $APP_NAME-lb
  namespace: $NAMESPACE
spec:
  ports:
  - name: http
    port: 9080
    protocol: TCP
    targetPort: 9080
  - name: https
    port: 9443
    protocol: TCP
    targetPort: 9443
  # - name: admin-port
  #   port: 9180
  #   protocol: TCP
  #   targetPort: 9180
  selector:
    app: $PROJECT
    component: $APP_NAME
  type: NodePort
  # 将请求代理到本地端点，不将流量转发到其他节点，从而保留原始IP地址
  externalTrafficPolicy: Local
  # sessionAffinity: None