Keeping a close eye on your Kubernetes cluster is essential to detect issues early. In this section, I'll explain how I monitor my cluster.
A ridiculously over-engineered setup for a homelab
At this point, I know I'm over-engineering the cluster; I'm the only one using it, and my portfolio hosted on it gets minimal traffic, 5 visits per month at most (measured by with which greatly simplifies the deployment process. This stack is widely used in the professional world, so I wanted to explore it.
- Prometheus gather data from nodes and pods.
- Then, Grafana displays the data.
- I could also set up offers three ways to install the Prometheus Operator. I use a GitOps approach with ArgoCD to deploy everything to the cluster and chose the Helm chart for installation.
Chart.yaml
CODEapiVersion: v2
name: prometheus-subchart
type: application
version: 60.3.0
appVersion: "60.3.0"
dependencies:
- name: kube-prometheus-stack
version: 60.3.0
repository: https://prometheus-community.github.io/helm-charts
values.yaml
CODEkube-prometheus-stack:
namespaceOverride: prometheus-stack
defaultRules:
rules:
alertmanager: false
etcd: false # microk8s does not use etcd if HA is enabled
windows: false
alertmanager:
enabled: false
prometheus:
prometheusSpec:
retention: 30d
grafana:
ingress:
enabled: true
ingressClassName: nginx
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
hosts:
- grafana.mydomain
tls:
- secretName: certificate-prod-grafana
hosts:
- grafana.mydomain
sidecar:
datasources:
alertmanager:
enabled: false
kubeEtcd:
enabled: false # microk8s does not use etcd if HA is enabled
And voila!
Grafana is accessible through
grafana.mydomainwith the default credentialsadmin:prom-operator(change it!):
You can now configure metric scraping for your pods and services using
PodMonitorandServiceMonitorCRDs thanks to the operator.↗ Original-Artikel auf dev.to lesenVollständiger Original-BerichtAusführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
SOCIAL SHARE CARD GENERATOR