apiVersion: v1
kind: Service
metadata:
  name: nginx-service-clusterip
spec:
  type: ClusterIP
  ports:
    - port: 80
      targetPort: 80
  clusterIP: 10.96.10.70   # If you don't specify the clusterIP, one will be assigned.
                           # If you specify an IP in a different subnet, you get an error.
  selector:
    app: nginx
    environment: production


# kubectl create -f nginx-deployment.yaml
# kubectl cluster-info dump | grep -m 1 service-cluster-ip-range  # Valid Cluster IP range to use.
#                                                                 # Use it in this file for clusterIP.
# kubectl create -f nginx-service-clusterip.yaml
# kubectl get service
# kubectl describe service nginx-service-clusterip
# kubectl get pods -o custom-columns=IP:status.podIP
# minikube ssh
# curl 10.100.123.26             # or whatever clusterIP address you find from the service
# exit
# kubectl delete deploy nginx-deployment
# kubectl delete service nginx-service-clusterip

