Why are there two loki services?

After installing loki/grafana I see there are two loki services created, one of them a loki-headless. Because I started loki with the serviceMonitor.enabled=true I also see a service monitor is created to have Prometheus scrap the loki-headless.

So why are there two services pointing to the same pods?

I think the assumption is that you might b using the Prometheus operator for Kubernetes. That operator manages config that mainly discovers ServiceMonitor resources and as the resource name suggests, you will need a Service resource for it to monitor (if that makes sense).

More info prometheus-operator/troubleshooting.md at main · prometheus-operator/prometheus-operator · GitHub