diff --git a/admin/README.md b/admin/README.md index 3c1f897dbace25f4f59e6da36042b0dd456af868..f4c2b86ca0f468dfe26a73ef7b9b17c73189e8eb 100644 --- a/admin/README.md +++ b/admin/README.md @@ -219,3 +219,48 @@ ingress: Note: this annotation applies to the traefik ingress controller and may not be the same for nginx or other ingress controllers installed on a cluster. + +## Monitoring a cluster with Prometheus + +One of the best ways to fully monitor your cluster is to install Prometheus. +Prometheus is itself a separate service for collecting metrics from various +sources and presenting them to the user. One of the best ways to get this +functionality on a Kubernetes cluster is by installing +[Prometheus Operator](https://github.com/prometheus-operator/prometheus-operator). +Prometheus Operator will install its own custom resources definitions (CRDs) +to allow other applications to create their own ways of interacting with +Prometheus. + +To install this on the Kubekorner K3s cluster we will use the stable +prometheus-operator helm chart maintained by the helm community: + +https://github.com/helm/charts/tree/master/stable/prometheus-operator + +First we will create a namespace specifically for prometheus: + +```bash +kubectl create namespace monitoring +``` + +Then we will install the helm chart in that namespace with the release name +"prometheus-operator". + +```bash +helm install -n monitoring prometheus-operator stable/prometheus-operator +``` + +Note, if your helm installation doesn't already have the stable chart +repository added you may need to do: + +```bash +helm repo add stable https://kubernetes-charts.storage.googleapis.com +helm repo update +``` + +Also note at the time of writing this installation results in some warnings: + +``` +manifest_sorter.go:192: info: skipping unknown hook: "crd-install" +``` + +This is described in a GitHub issue here: https://github.com/helm/charts/issues/17511 \ No newline at end of file