Everything you need for a fully functioning monitoring stack managed by RenovateBot and Argo CD. This doesn't seem like a big deal, but trust me, it is very much a pain to do manually.
This app utilizes the ApplicationSet Secret Plugin Generator so follow the directions there if you haven't already, so that Argo CD can populate the appropriate templated values in the ApplicationSet.
- crds/ - Prometheus Operator Custom Resource Definitions
- app_of_apps/ - main stable prometheus stack
- app_of_apps_with_matrix/ - experimental prometheus stack utilizing matrix for alerting
- Kube Prometheus Stack Custom Resource Definitions
- Kube Prometheus Stack helm chart:
- Prometheus for metric collection
- Grafana for dashboards and visualizations
- Alert Manager for alerting based on metrics
- Prometheus Push Gateway for apps to push metrics
- Loki stack (including promtail) for collecting logging into prometheus
Either create this file, and do a kubectl apply -f or through the GUI, select "ceate new app" and then "edit as YAML" and paste this in:
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: monitoring-app-of-apps
namespace: argocd
spec:
project: prometheus
source:
repoURL: 'https://github.com/small-hack/argocd-apps'
targetRevision: main
path: prometheus/app_of_apps/
destination:
server: "https://kubernetes.default.svc"
namespace: prometheus
syncPolicy:
syncOptions:
- Replace=true
automated:
prune: true
selfHeal: trueThis will deploy:
- Prometheus
- Alert Manager for prometheus
- Grafana
Ref for prometheus giant chart of charts: https://blog.ediri.io/kube-prometheus-stack-and-argocd-23-how-to-remove-a-workaround
-
Patch the Nginx Ingress controller to enable the metrics exporter
helm upgrade ingress-nginx ingress-nginx \ --repo https://kubernetes.github.io/ingress-nginx \ --namespace ingress \ --set controller.metrics.enabled=true \ --set-string controller.podAnnotations."prometheus\.io/scrape"="true" \ --set-string controller.podAnnotations."prometheus\.io/port"="10254"
-
Create a yaml file containing your prometheus scrape configs, for example:
- job_name: "nginx-ingress" static_configs: - targets: ["ingress-nginx-controller-metrics.ingress-nginx.svc.cluster.local:10254"] - job_name: "postgres" static_configs: - targets: ["postgres-postgresql-metrics.default.svc.cluster.local:9187"] - job_name: "nvidia-smi" static_configs: - targets: ["nvidia-dcgm-exporter.default.svc.cluster.local:9400"]
-
Convert the file to a secret. Name of secret must match what is set in the helm
values.yamlwget https://raw.githubusercontent.com/small-hack/argocd-apps/main/prometheus/scrape-targets.yaml kubectl create secret generic additional-scrape-configs --from-file=scrape-targets.yaml \ --dry-run=client -oyaml > additional-scrape-configs.yaml kubectl apply -f additional-scrape-configs.yaml -n prometheus
Push metrics instead of scraping them It should be used only for process that run infrequently or too quickly to be scraped properly.
Helm Chart Source:
When to use the Push Gateway:
Pushing Metrics:
Push metrics from a unix shell:
Use the push gateway with the kube-prometheus-stack:
like Prometheus, but for logs
- Loki is a horizontally-scalable, highly-available, multi-tenant log aggregation system inspired by Prometheus.
- It is designed to be very cost effective and easy to operate.
- It does not index the contents of the logs, but rather a set of labels for each log stream.
See: https://github.com/grafana/loki
Soon you'll also be able to use smol-k8s-lab to deploy this.

