Prerequisites: My test data source at grafan is fine
I deployed the simple scalable model (no tenants configured) where the VALUES about gateway are as follows.
...
gateway:
enabled: true
ingress:
enabled: true
ingressClassName: "monitoring-nginx"
annotations: {}
hosts:
- host:xxxxx.com
paths:
- path: /
pathType: Prefix
tls:
- secretName: xxx-secret
hosts:
-xxxxx.com
basicAuth:
enabled: true
# -- The basic auth username for the gateway
username: xloki
# -- The basic auth password for the gateway
password: tW0eFx7uPD
...
The specific service is as follows
root@qcloud-singapore-3-dhysrhw-web-1:~/v1.30/addons/promtail# kubectl -n monitoring get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
grafana ClusterIP 192.168.0.73 <none> 80/TCP 5d2h
loki-backend ClusterIP 192.168.2.152 <none> 3100/TCP,9095/TCP 7m20s
loki-backend-headless ClusterIP None <none> 3100/TCP,9095/TCP 7m20s
loki-canary ClusterIP 192.168.2.227 <none> 3500/TCP 7m20s
loki-chunks-cache ClusterIP None <none> 11211/TCP,9150/TCP 7m20s
loki-gateway ClusterIP 192.168.2.251 <none> 80/TCP 7m20s
loki-memberlist ClusterIP None <none> 7946/TCP 7m20s
loki-query-scheduler-discovery ClusterIP None <none> 3100/TCP,9095/TCP 7m20s
loki-read ClusterIP 192.168.1.137 <none> 3100/TCP,9095/TCP 7m20s
loki-read-headless ClusterIP None <none> 3100/TCP,9095/TCP 7m20s
loki-results-cache ClusterIP None <none> 11211/TCP,9150/TCP 7m20s
loki-write ClusterIP 192.168.3.94 <none> 3100/TCP,9095/TCP 7m20s
loki-write-headless ClusterIP None <none> 3100/TCP,9095/TCP 7m20s
monitoring-ingress-nginx-controller LoadBalancer 192.168.3.59 xxxx 80:30372/TCP,443:31335/TCP 4d22h
monitoring-ingress-nginx-controller-admission ClusterIP 192.168.3.161 <none> 443/TCP 4d22h
The values of my promtail are as follows
config:
clients:
- url: http://loki-gateway/loki/api/v1/push
basic_auth:
username: "xloki"
password: "tW0eFx7uPD"
But I can check the logs of ds promtail and there is the following error reported. I don’t know what the problem is.
level=error ts=2025-02-11T08:01:36.555565365Z caller=client.go:430 component=client host=loki-gateway msg="final error sending batch" status=401 tenant= error="server returned HTTP status 401 Unauthorized (401): <html>"