diff options
| author | Paul Buetow <paul@buetow.org> | 2025-10-22 09:40:59 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-10-22 09:40:59 +0300 |
| commit | fb8fcf27d60117a43a14ad0e3f36c22165156919 (patch) | |
| tree | 3cabca01006d5f1b4a78d4a8d606382f0db812af /f3s/prometheus | |
| parent | 77b1a714b00901b47ea7544ab10f759df864fdfa (diff) | |
add prometheus
Diffstat (limited to 'f3s/prometheus')
| -rw-r--r-- | f3s/prometheus/README.md | 46 | ||||
| -rw-r--r-- | f3s/prometheus/grafana-ingress/Chart.yaml | 5 | ||||
| -rw-r--r-- | f3s/prometheus/grafana-ingress/Justfile | 12 | ||||
| -rw-r--r-- | f3s/prometheus/grafana-ingress/templates/ingress.yaml | 20 | ||||
| -rw-r--r-- | f3s/prometheus/grafana-ingress/values.yaml | 10 |
5 files changed, 93 insertions, 0 deletions
diff --git a/f3s/prometheus/README.md b/f3s/prometheus/README.md new file mode 100644 index 0000000..5a1ede1 --- /dev/null +++ b/f3s/prometheus/README.md @@ -0,0 +1,46 @@ +# Prometheus installation + +## Prometheus stack installation + +First, install the Prometheus Helm chart using the following commands: + +```sh +kubectl greate ns monitoring +helm repo add prometheus-community https://prometheus-community.github.io/helm-charts +helm repo update +``` + +Followed by the actual installation into the monitoring namespace: + +```sh +helm install prometheus prometheus-community/kube-prometheus-stack --namespace monitoring + +NAME: prometheus +LAST DEPLOYED: Wed Oct 22 09:22:00 2025 +NAMESPACE: monitoring +STATUS: deployed +REVISION: 1 +NOTES: +kube-prometheus-stack has been installed. Check its status by running: + kubectl --namespace monitoring get pods -l "release=prometheus" + +Get Grafana 'admin' user password by running: + + kubectl --namespace monitoring get secrets prometheus-grafana -o jsonpath="{.data.admin-password}" | base64 -d ; echo + +Access Grafana local instance: + + export POD_NAME=$(kubectl --namespace monitoring get pod -l "app.kubernetes.io/name=grafana,app.kubernetes.io/instance=prometheus" -oname) + kubectl --namespace monitoring port-forward $POD_NAME 3000 + +Visit https://github.com/prometheus-operator/kube-prometheus for instructions on how to create & configure Alertmanager and Prometheus instances using the Operator. + +``` + +## Grafana Ingress + +After this, deploy Grafana Ingress: + +``` +helm install grafana-ingress ./grafana-ingress +``` diff --git a/f3s/prometheus/grafana-ingress/Chart.yaml b/f3s/prometheus/grafana-ingress/Chart.yaml new file mode 100644 index 0000000..535575e --- /dev/null +++ b/f3s/prometheus/grafana-ingress/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v2 +name: grafana-ingress +description: A Helm chart for Grafana ingress +version: 0.1.0 +appVersion: "1.0" diff --git a/f3s/prometheus/grafana-ingress/Justfile b/f3s/prometheus/grafana-ingress/Justfile new file mode 100644 index 0000000..fd63af0 --- /dev/null +++ b/f3s/prometheus/grafana-ingress/Justfile @@ -0,0 +1,12 @@ +NAMESPACE := "monitoring" +RELEASE_NAME := "grafana-ingress" +CHART_PATH := "." + +install: + helm install {{RELEASE_NAME}} {{CHART_PATH}} --namespace {{NAMESPACE}} --create-namespace + +upgrade: + helm upgrade {{RELEASE_NAME}} {{CHART_PATH}} --namespace {{NAMESPACE}} + +delete: + helm uninstall {{RELEASE_NAME}} --namespace {{NAMESPACE}} diff --git a/f3s/prometheus/grafana-ingress/templates/ingress.yaml b/f3s/prometheus/grafana-ingress/templates/ingress.yaml new file mode 100644 index 0000000..5d6b08d --- /dev/null +++ b/f3s/prometheus/grafana-ingress/templates/ingress.yaml @@ -0,0 +1,20 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: grafana-ingress + namespace: {{ .Values.ingress.namespace }} + annotations: + spec.ingressClassName: {{ index .Values.ingress.annotations "spec.ingressClassName" }} + traefik.ingress.kubernetes.io/router.entrypoints: {{ index .Values.ingress.annotations "traefik.ingress.kubernetes.io/router.entrypoints" }} +spec: + rules: + - host: {{ .Values.ingress.host }} + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: {{ .Values.ingress.service.name }} + port: + number: {{ .Values.ingress.service.port }} diff --git a/f3s/prometheus/grafana-ingress/values.yaml b/f3s/prometheus/grafana-ingress/values.yaml new file mode 100644 index 0000000..eda3480 --- /dev/null +++ b/f3s/prometheus/grafana-ingress/values.yaml @@ -0,0 +1,10 @@ +ingress: + enabled: true + host: grafana.f3s.buetow.org + namespace: monitoring + service: + name: prometheus-grafana + port: 80 + annotations: + "spec.ingressClassName": traefik + "traefik.ingress.kubernetes.io/router.entrypoints": web |
