I am confused about the usage of clusterip. What is the point of ever hardcoding an clusterip and using it in the config files of other services instead of using the dns a-record that will resolve to the service?
Are doing these things equivalent? It seems to me that they are.
They aren't equivalent, as a ClusterIP is more ephemeral than the service itself, and not all services have ClusterIP's (although most do). I would believe using the ClusterIP in configuration to be an anti-pattern, and would suggest instead using the DNS provided with kube-dns for the service as a consistent means of communicating with your most common services.
This pattern will also extend to stateful sets and headless services, as well as services that are just defined as DNS Endpoints and represent a resource outside of your kubernetes cluster.