Skip to content

Commit d67fa9f

Browse files
authored
PR : Configure Grafana with behind Ingress Controller #433 (#445)
* WIP 433: Grafana Ingress Config * Issue 433: Installation script/values revision; remove unrequired yaml files * Issue 433: reconf install.sh -- apply custom prometheus stack * fix grafana version to v9.0.1
1 parent 6ee06c6 commit d67fa9f

File tree

8 files changed

+68
-179
lines changed

8 files changed

+68
-179
lines changed

grabdish/observability/install.sh

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,20 @@ echo Installing ServiceAccount, ClusterRole, and ClusterRole binding needed for
1414
kubectl apply -f install/prom_rbac.yaml -n msdataworkshop
1515
echo
1616

17-
echo Installing Prometheus...
17+
echo Updating Helm Repo...
1818
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
19-
helm install stable prometheus-community/kube-prometheus-stack --namespace=msdataworkshop
20-
echo
21-
22-
echo Installing Grafana...
23-
kubectl apply -f install/grafana-config-map-ini.yml -n msdataworkshop
24-
kubectl apply -f install/grafana.yaml -n msdataworkshop
25-
#todo instead of LB... kubectl apply -f install/grafana-ingress.yaml -n msdataworkshop
26-
#mkdir tls
27-
#chmod 700 tls
28-
#openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout tls/tls.key -out tls/tls.crt -subj "/CN=grabdish/O=grabdish"
29-
#kubectl create secret tls ssl-certificate-secret --key tls/tls.key --cert $GRABDISH_HOME/tls/tls.crt -n msdataworkshop
19+
helm repo add grafana https://grafana.github.io/helm-charts
20+
helm repo update
3021

31-
echo Creating Grafana Service...
32-
kubectl apply -f install/grafana-service.yaml -n msdataworkshop
22+
echo Installing Prometheus and custom Grafana ...
23+
helm install stable prometheus-community/kube-prometheus-stack --namespace msdataworkshop -f install/prometheus-stack-values.yaml
24+
#helm install stable prometheus-community/kube-prometheus-stack --namespace=msdataworkshop --set grafana.enabled=false
3325
echo
3426

27+
# echo Installing Grafana...
28+
# helm install grafana-lab grafana/grafana --namespace msdataworkshop -f install/grafana-helm-values.yaml
29+
# echo
30+
3531
echo Installing loki-stack with Promtail...
36-
helm repo add grafana https://grafana.github.io/helm-charts
3732
helm install loki-stack grafana/loki-stack --create-namespace --namespace loki-stack --set promtail.enabled=true,loki.persistence.enabled=true,loki.persistence.size=100Gi
3833
echo

grabdish/observability/install/grafana-config-map-ini.yml

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Administrator credentials when not using an existing secret (see below)
2+
adminPassword: prom-operator
3+
4+
ingress:
5+
enabled: true
6+
annotations:
7+
kubernetes.io/ingress.class: "nginx"
8+
nginx.ingress.kubernetes.io/rewrite-target: /$1
9+
nginx.ingress.kubernetes.io/use-regex: "true"
10+
nginx.ingress.kubernetes.io/enable-rewrite-log: "true"
11+
#nginx.ingress.kubernetes.io/force-ssl-redirect: "false"
12+
13+
path: /grafana/?(.*)
14+
hosts:
15+
- ""
16+
tls:
17+
- secretName: ssl-certificate-secret
18+
19+
persistence:
20+
enabled: true
21+
type: pvc
22+
#size: 10Gi
23+
24+
grafana.ini:
25+
server:
26+
root_url: "%(protocol)s://%(domain)s/grafana"
27+
serve_from_sub_path: true
28+
router_logging: true

grabdish/observability/install/grafana-ingress.yaml

Lines changed: 0 additions & 29 deletions
This file was deleted.

grabdish/observability/install/grafana-root-ingress.yaml

Lines changed: 0 additions & 27 deletions
This file was deleted.

grabdish/observability/install/grafana-service.yaml

Lines changed: 0 additions & 30 deletions
This file was deleted.

grabdish/observability/install/grafana.yaml

Lines changed: 0 additions & 70 deletions
This file was deleted.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
## Using custom values based on https://github.com/grafana/helm-charts/blob/main/charts/grafana/values.yaml
2+
##
3+
grafana:
4+
image:
5+
tag: "9.0.1"
6+
ingress:
7+
enabled: true
8+
annotations:
9+
kubernetes.io/ingress.class: "nginx"
10+
nginx.ingress.kubernetes.io/rewrite-target: /$1
11+
nginx.ingress.kubernetes.io/use-regex: "true"
12+
nginx.ingress.kubernetes.io/enable-rewrite-log: "true"
13+
#nginx.ingress.kubernetes.io/force-ssl-redirect: "false"
14+
15+
path: /grafana/?(.*)
16+
hosts:
17+
- ""
18+
tls:
19+
- secretName: ssl-certificate-secret
20+
21+
persistence:
22+
enabled: true
23+
type: pvc
24+
#size: 10Gi
25+
26+
grafana.ini:
27+
server:
28+
root_url: "%(protocol)s://%(domain)s/grafana"
29+
serve_from_sub_path: true
30+
router_logging: true

0 commit comments

Comments
 (0)