带头盔的 https 入口配置背后的 Loki

Loki behind https ingress configuration with helm

有什么方法可以配置 promtail 以通过 https-ingress 将日志发送到 loki?

promtail ---> https-ingress ---> loki

我将这张舵图 promtail and configured loki url 用作 http://gateway.loki.monitoring.example.com:80/loki/api/v1/push。部署 promtail 图表后,我在 promtail pod

中看到以下错误
level=error ts=2022-03-28T14:10:23.740581978Z caller=client.go:360 component=client host=gateway.loki.monitoring.example.com:80 msg="f
inal error sending batch" status=308 error="server returned HTTP status 308 Permanent Redirect (308): <html>"

我什至在 loki url 中将 https 指定为 https://gateway.loki.monitoring.example.com:80/loki/api/v1/push 但仍然失败

level=warn ts=2022-03-28T14:27:47.976570998Z caller=client.go:349 component=client host=gateway.loki.monitoring.example:80 msg="er
ror sending batch, will retry" status=-1 error="Post \"https://gateway.loki.monitoring.example.com:80/loki/api/v1/push\": http: server
 gave HTTP response to HTTPS client"

我找到了这个配置 https://grafana.com/docs/loki/latest/installation/helm/#run-loki-behind-https-ingress,但是它已经过时了

注意:

...
  ingress:
    # -- Specifies whether an ingress for the gateway should be created
    enabled: true
    # -- Ingress Class Name. MAY be required for Kubernetes versions >= 1.18
    ingressClassName: monitoring-ingress
    # -- Annotations for the gateway ingress
    annotations:
      cert-manager.io/cluster-issuer: monitoring-cluster-issuer
    # -- Hosts configuration for the gateway ingress
    hosts:
      - host: gateway.loki.monitoring.example.com
        paths:
          - path: /
            # -- pathType (e.g. ImplementationSpecific, Prefix, .. etc.) might also be required by some Ingress Controllers
            pathType: Prefix
    # -- TLS configuration for the gateway ingress
    tls:
      - secretName: loki-gateway-tls-certs
        hosts:
          - gateway.loki.monitoring.example.com
...

我是否错过了 loki 的任何入口配置?

玩了一段时间后,我明白我需要删除端口并为 loki URL 指定 https。应该像下面这样

https://gateway.loki.monitoring.example.com/loki/api/v1/push