Skip to content

Commit 6fcd7f8

Browse files
committed
docs
Signed-off-by: Gabriele Bartolini <[email protected]>
1 parent 8673eb6 commit 6fcd7f8

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,29 @@ kubectl cnpg install generate --control-plane | \
124124
- This installation process is repeated for each Kubernetes cluster in your
125125
environment.
126126

127+
## Monitoring with Prometheus and Grafana
128+
129+
The playground also includes an optional setup for evaluating Prometheus
130+
metrics and visualizing them with Grafana. To deploy both Prometheus and
131+
Grafana on the infrastructure node, run the following command:
132+
133+
```bash
134+
./scripts/monitoring-setup.sh
135+
```
136+
137+
To access Grafana from your local browser, open a terminal and forward the
138+
necessary ports locally. For example, use the following commands to forward
139+
ports for the EU and US environments:
140+
141+
```bash
142+
kubectl --context=kind-k8s-eu port-forward -n grafana service/grafana-service 3000:3000
143+
kubectl --context=kind-k8s-us port-forward -n grafana service/grafana-service 3001:3000
144+
```
145+
146+
This will make Grafana accessible on your local machine at
147+
`http://localhost:3000` for the EU environment and `http://localhost:3001` for
148+
the US environment.
149+
127150
## Cleaning up the Learning Environment
128151

129152
When you're ready to clean up and remove all resources from the learning

scripts/monitoring-setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ done
3232
# We make sure that monitoring workloads are deployed in the infrastructure node.
3333
for context in kind-k8s-eu kind-k8s-us; do
3434
kubectl kustomize ${git_repo_root}/k8s/monitoring/prometheus-instance | \
35-
kubectl --context=$context apply --force-conflicts --server-side=true -f -
35+
kubectl --context=$context apply --force-conflicts --server-side=true -f -
3636
kubectl --context=$context -n prometheus-operator \
3737
patch deployment prometheus-operator \
3838
--type='merge' --patch='{"spec":{"template":{"spec":{"tolerations":[{"key":"node-role.kubernetes.io/infra","operator":"Exists","effect":"NoSchedule"}],"nodeSelector":{"node-role.kubernetes.io/infra":""}}}}}'

0 commit comments

Comments
 (0)