-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This makes working on metrics easy for development and experimentation.
- Loading branch information
1 parent
9657642
commit fbc0849
Showing
2 changed files
with
65 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/bin/sh | ||
# (Re)deploy Prometheus/Grafana to local podman, for development | ||
# Note: This keeps the prometheus-data volume | ||
set -eux | ||
MYDIR=$(realpath -m "$0"/..) | ||
|
||
# clean up old deployment | ||
podman kube down "${MYDIR}/metrics.yaml" | ||
for filter in grafana prometheus-config; do | ||
podman volume ls -q --filter "name=$filter" | xargs --no-run-if-empty podman volume rm | ||
done | ||
|
||
# adjust the k8s deployment to work for podman play kube: | ||
# - grafana-dashboards ConfigMap gets built dynamically in metrics/deploy-k8s.sh, but | ||
# it is much more flexible and ergonomic to just mount the dashboards directory | ||
# - replace grafana-admin secret with static "foobar" admin password | ||
patch -o- "$MYDIR/metrics.yaml" - <<EOF | podman kube play - | ||
--- metrics/metrics.yaml | ||
+++ metrics/metrics.yaml | ||
@@ -35,10 +35,8 @@ spec: | ||
- name: GF_PATHS_PROVISIONING | ||
value: /etc/grafana/provisioning | ||
- name: GF_SECURITY_ADMIN_PASSWORD | ||
- valueFrom: | ||
- secretKeyRef: | ||
- name: metrics-secrets | ||
- key: grafana-admin | ||
+ value: foobar | ||
+ | ||
ports: | ||
- containerPort: 3000 | ||
protocol: TCP | ||
@@ -75,9 +73,8 @@ spec: | ||
configMap: | ||
name: grafana-provisioning-dashboards | ||
- name: grafana-dashboards | ||
- configMap: | ||
- # this is not defined here, but gets built from *.json files in ./deploy.sh | ||
- name: grafana-dashboards | ||
+ hostPath: | ||
+ path: metrics/dashboards | ||
--- | ||
kind: ConfigMap | ||
EOF |