How to property change values of a dependency when the package installed using Helm?

4/16/2021

So I installed kube-prometheus-stack from this tutorial:

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

then I copied from the git prometheus-community/helm-charts, modify the values.yaml to suit my needs (alertmanager stuff), then run this command to apply the update:

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

Now I need the grafana to work with shared password, I created a basic-auth secret an ingress:

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

these works fine, but the problem is, I need to change grafana's internal configuration (to make it passwordless), what's the correct/proper way to do this?

the chart directory structure

-- Kokizzu
grafana
kubernetes
kubernetes-helm
prometheus

1 Answer

4/16/2021

I'm have deployed version 7.3.5 of Grafana, and I only could achieve this by removing the login screen completely.

In the values.yaml of your Grafana chart look for the grafana.ini level. Then append the following config value pairs:

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

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

-- Daniel Marques
Source: StackOverflow