apiVersion: v1
kind: Service
metadata:
  name: example-web
  #annotations:
  #  prometheus.io/path: /metrics
  #  prometheus.io/port: "9180"
  #  prometheus.io/scrape: "true"
  #  kube-router.io/service.scheduler: sh
  #服务启用DSR（直接服务器返回）功能
  #  kube-router.io/service.dsr: tunnel
  #  cilium-clustermesh Global Services
  #  io.cilium/global-service: "true"
  labels:
    k8s-app: example-web
    #kubernetes.io/cluster-service: "true"
spec:
  #headless service
  #clusterIP: None
  ports:
  #监控端口
  - name: metrics
    port: 9180
    protocol: TCP
    targetPort: 9180
  - name: http
    protocol: TCP
    port: 80
    targetPort: 80
  type: NodePort
  selector:
    app: example-web
    #version: v1
    #statefulset.kubernetes.io/pod-name: pod-0
  #sessionAffinity: None
