ClusterIP makes the Service only reachable from within the cluster. This is the default ServiceType. You can read more information about services here.
As the command in the first answer doesn't work, I'm posting the working solution:
kubectl run tmp-name --rm --image nginx -i --restart=Never -- /bin/bash -c 'curl -s clusterip:port'
with the above command curl is working fine. You can use a service name instead of cluster IP address.
--restart=Never
is needed for using curl like this.
--rm
ensures the Pod is deleted when the shell exits.
Edited:
But if you want to access your ClusterIp service from the host on which you run kubectl, you can use Port Forwarding.
kubectl port-forward service/yourClusterIpServiceName 28015:yourClusterIpPort
You will get output like this:
Forwarding from 127.0.0.1:28015 -> yourClusterIpPort
Forwarding from [::1]:28015 -> yourClusterIpPort
after that you will be able to reach your ClusterIP service using this command:
curl localhost:28015
More information about port forwarding is on the official documentation page.