# https://cloud.google.com/kubernetes-engine/docs/concepts/service
#. - The idea of a Service is to group a set of Pod endpoints into a single resource. You can configure various ways to access the grouping. By default, you get a stable cluster IP address that clients inside the cluster can use to contact Pods in the Service. A client sends a request to the stable IP address, and the request is routed to one of the Pods in the Service.
#  - A Service identifies its member Pods with a selector. For a Pod to be a member of the Service, the Pod must have all of the labels specified in the selector. A label is an arbitrary key/value pair that is attached to an object.
apiVersion: v1
kind: Service
metadata:
  name: fantasy-world
  namespace: default
spec:
  selector:
    app: fantasy-world
  type: LoadBalancer
  sessionAffinity: ClientIP
  sessionAffinityConfig:
    clientIP:
      timeoutSeconds: 10800
  ports:
  - name: fantasy-map
    protocol: TCP
    port: 9000
    targetPort: 9000
    # If you set the `spec.type` field to `NodePort` and you want a specific port number,
    # you can spaecify a value in the `spec.ports[*].nodePort` field.
    nodePort: 32000
  - name: fantasy-towns
    protocol: TCP
    port: 8090
    targetPort: 8090
    nodePort: 32090
