---
apiVersion: v1
kind: Service                    # Type of kubernetes resource
metadata:
  name: go-app-test-service   # Name of the resource
  namespace: test-apps
spec:
  type: NodePort                 # A port is opened on each node in your cluster via Kube proxy.
  ports:                         # Take incoming HTTP requests on port 9090 and forward them to the targetPort of 8080
  - name: http
    port: 9090
    targetPort: 9080
  selector:
    app: go-app-test         # Map any pod with label `app=go-hello-world` to this service