apiVersion: v1
kind: Service
metadata:
  labels:
    app: courier
  name: courier
  annotations:
    prometheus.io/scrape: "true"
    prometheus.io/path: "/actuator/prometheus"
    prometheus.io/port: "8081"
spec:
  ports:
    - name: 8081-8081
      port: 8081
      protocol: TCP
      targetPort: 8081
    - name: 7001-7001
      port: 7001
      protocol: TCP
      targetPort: 7001
  selector:
    app: courier
  type: LoadBalancer
  # Sticky Session: If you want to make sure that connections from a particular client are passed to the same Pod each time, you can select the session affinity based on the client's IP addresses by setting service.spec.sessionAffinity to "ClientIP" (the default is "None").
  sessionAffinity: ClientIP
