openebs / monitoring

OpenEBS Monitoring add-on. A set of Grafana, Prometheus, and alert manager plugins.
Apache License 2.0
26 stars 20 forks source link

Received a error message when installation when Grafana Ingress is enabled and hosts are specified #88

Closed survivant closed 2 years ago

survivant commented 2 years ago

I added this part in values.yaml to enable Grafana ingress, but I received that error

PS C:\openebs-monitoring\monitoring\deploy\charts> helm --kube-context cluster114 install monitoring .
Error: INSTALLATION FAILED: template: openebs-monitoring/templates/NOTES.txt:12:12: executing "openebs-monitoring/templates/NOTES.txt" at <.paths>: can't evaluate field paths in type interface {}
PS C:\openebs-monitoring\monitoring\deploy\charts>

here my modification in values.yaml

...
grafana.ini:
      ## If you have Ingress, you need to change the root_url to match ingress path
      server:
        root_url: http://localhost:3000/grafana
....
ingress:
      ## If true, Grafana Ingress will be created
      ##
      enabled: true

      annotations:
        nginx.ingress.kubernetes.io/ssl-redirect: "false"
        nginx.ingress.kubernetes.io/rewrite-target: /$2
      path: /grafana(/|$)(.*)
      hosts:
        - default.dynamic.cluster114.local

but if I don't specify the hosts, It will pass

ingress:
      ## If true, Grafana Ingress will be created
      ##
      enabled: true

      annotations:
        nginx.ingress.kubernetes.io/ssl-redirect: "false"
        nginx.ingress.kubernetes.io/rewrite-target: /$2
      path: /grafana(/|$)(.*)
      #hosts:
#        - default.dynamic.cluster114.local
PS C:\openebs-monitoring\monitoring\deploy\charts> helm --kube-context cluster114 install monitoring .
NAME: monitoring
LAST DEPLOYED: Fri Oct 15 13:38:52 2021
NAMESPACE: default
STATUS: deployed
REVISION: 1
NOTES:
OpenEBS monitoring has been installed.
Check its status by running:
$ kubectl get pods -n default -o wide

Use `kubectl get svc -n default` to list all the
services in the `default` namespace.

To access the dashboards, form the Grafana URL and open it in the browser

For more information, visit our Slack at https://openebs.io/community

here the ingress yaml generated

---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    meta.helm.sh/release-name: monitoring
    meta.helm.sh/release-namespace: default
    nginx.ingress.kubernetes.io/rewrite-target: /$2
    nginx.ingress.kubernetes.io/ssl-redirect: "false"
  creationTimestamp: "2021-10-15T17:39:15Z"
  generation: 1
  labels:
    app.kubernetes.io/instance: monitoring
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: grafana
    app.kubernetes.io/version: 8.1.5
    helm.sh/chart: grafana-6.16.9
  name: monitoring-grafana
  namespace: default
  resourceVersion: "40300396"
  uid: 0f2ce36d-1143-4dbc-bd83-e148bad0d247
spec:
  rules:
  - http:
      paths:
      - backend:
          service:
            name: monitoring-grafana
            port:
              number: 80
        path: /grafana(/|$)(.*)
        pathType: Prefix
status:
  loadBalancer:
    ingress:
    - ip: 10.1.34.55

here a example of a ingress generated with a host

root@test-pcl4004:~# kubectl get ingress monitoring-grafana -o yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    meta.helm.sh/release-name: monitoring
    meta.helm.sh/release-namespace: default
    nginx.ingress.kubernetes.io/rewrite-target: /$2
    nginx.ingress.kubernetes.io/ssl-redirect: "false"
  creationTimestamp: "2021-10-13T12:26:05Z"
  generation: 3
  labels:
    app.kubernetes.io/managed-by: Helm
  name: monitoring-grafana
  namespace: dev
  resourceVersion: "108710984"
  uid: 31a8eaf8-007e-4413-ae30-c47df20a2aa4
spec:
  rules:
  - host: default.dynamic.cluster114.local
    http:
      paths:
      - backend:
          service:
            name: monitoring-grafana
            port:
              number: 80
        path: /grafana(/|$)(.*)
        pathType: Prefix
status:
  loadBalancer:
    ingress:
    - ip: 10.1.34.55
root@test-pcl4004:~#
Ab-hishek commented 2 years ago

Closing this issue as it has been resolved by #89 .