Failed start loki-gateway after helm deploy on Openshift

Hello, We have a problem with start loki-gateway pod after Helm install.
We get this error:
/docker-entrypoint.sh: No files found in /docker-entrypoint.d/, skipping configuration
2022/10/27 11:04:44 [emerg] 1#1: host not found in resolver “kube-dns.kube-system.svc.cluster.local.” in /etc/nginx/nginx.conf:27
nginx: [emerg] host not found in resolver “kube-dns.kube-system.svc.cluster.local.” in /etc/nginx/nginx.conf:27

We use:
Loki version 2.6.1
Chart version: 3.3.0

helm chart: grafana/loki

getting same in k3s based kubernetes cluster, have you found anything??

2022/10/29 07:37:24 [emerg] 1#1: host not found in resolver “kube-dns.kube-system.svc.cluster.local” in /etc/nginx/nginx.conf:27
nginx: [emerg] host not found in resolver “kube-dns.kube-system.svc.cluster.local” in /etc/nginx/nginx.conf:27

Had the same error.
After looking online I found that this issue is not specific to the loki chart. This stackoverflow post reports the exact same behavior of an nginx pod from a different application .
This made me realize that the issue stems from the fact that kubernetes clusters now typically run CoreDNS instead of the older kube-dns. That also means that some helm charts or kubernetes apps may need to be updated.

Thankfully this will not be necessary here. The Loki chart has long been updated (as highlighted by this github issue), and there is a value you can set to change the DNS provider, which resolved the issue for me :

# values.yaml

global:
  dnsService: coredns

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.