apiVersion: v1
kind: Service
metadata:
  labels:
    app: restaurant
  name: restaurant
  annotations:
    prometheus.io/scrape: "true"
    prometheus.io/path: "/actuator/prometheus"
    prometheus.io/port: "8080"
spec:
  ports:
    - name: 8080-8080
      port: 8080
      protocol: TCP
      targetPort: 8080
    - name: 7000-7000
      port: 7000
      protocol: TCP
      targetPort: 7000
  selector:
    app: restaurant
  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
