使用 Helm 安装包时如何更改依赖项的属性值?

问题描述

所以我从 this tutorial 安装了 kube-prometheus-stack

helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update
kubectl create ns monitoring
helm install prometheus prometheus-community/kube-prometheus-stack -n monitoring
kubectl get all -n monitoring

然后我从 git prometheus-community/helm-charts 复制,修改 values.yaml 以满足我的需要(alertmanager 的东西),然后运行此命令以应用更新:

helm dependency update -n monitoring kube-prometheus-stack/ # one time
helm upgrade prometheus -n monitoring kube-prometheus-stack/

现在我需要 grafana 使用共享密码,我创建了一个 basic-auth 秘密入口:

apiVersion: networking.k8s.io/v1
kind: Ingress
Metadata:
  name: monitoring-ingress
  namespace: monitoring
  annotations:
    cert-manager.io/cluster-issuer: letsencrypt-prod
    Nginx.ingress.kubernetes.io/auth-type: basic
    Nginx.ingress.kubernetes.io/auth-secret: basic-auth
    Nginx.ingress.kubernetes.io/auth-realm: "Authentication required"
spec:
  rules:
    - host: monitor.blabla.com
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: prometheus-grafana.monitoring
                port:
                  number: 80
  tls:
    - hosts:
        - monitor.blabla.com
      secretName: monitor.blabla.com-cert

这些工作正常,但问题是,我需要更改 grafana 的内部配置(使其passwordless),正确/正确的方法是什么?

the chart directory structure

解决方法

我已经部署了 Grafana 7.3.5 版本,我只能通过完全删除登录屏幕来实现这一点。

在 Grafana 图表的 values.yaml 中查找 grafana.ini 级别。然后附加以下配置值对:

grafana.ini:
  users:
    viewers_can_edit: false
  auth:
    disable_login_form: false
    disable_signout_menu: false
  auth.anonymous:
    enabled: true
    org_role: Viewer

来源:https://github.com/helm/charts/issues/10622#issuecomment-454397952