# ClusterIP

apiVersion: v1
kind: Service
metadata:
  name: foo-service
spec:
  selector:
    app: foo
  ports:
  - protocol: TCP
    port: 80
    targetPort: 80

---
# NodePort

apiVersion: v1
kind: Service
metadata:
  name: bar-service
spec:
  type: NodePort
  selector:
    app: foo
  ports:
  - protocol: TCP
    port: 80
    targetPort: 80
