apiVersion: v1                # API version
kind: Service                 # Type of the kubernetes resource
metadata:
  name: chat-server-service    # Name of the kubernetes resource
  labels:                     # Labels that will be applied to this resource
    app: chat-server-service
spec:
  type: LoadBalancer              # The service will be exposed by opening a Port on each node and proxying it.
  selector:
    app: chat-server   # The service exposes Pods with label `app=polling-app-server`
  ports:                      # Forward incoming connections on port 8080 to the target port 8080
    - name: http
      port: 3000
      targetPort: 3000
