Debian 11 Bullseye
Sponsored Link

MicroK8s : Enable Prometheus
Enable Prometheus add-on to monitor metrics on MicroK8s Cluster.
[1] Enable built-in Prometheus add-on on primary Node.
microk8s enable prometheus dashboard dns

Adding argument --authentication-token-webhook to nodes.
Adding argument --authentication-token-webhook to nodes.
Restarting nodes.
Restarting nodes.
Addon dns is already enabled.

..... created created
The Prometheus operator is enabled (user/pass: admin/admin)
Addon dashboard is already enabled.
Addon dns is already enabled.

microk8s kubectl get services -n monitoring

NAME                  TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)             AGE
prometheus-operator   ClusterIP   None             <none>        8443/TCP            79s
alertmanager-main     ClusterIP   <none>        9093/TCP            75s
grafana               ClusterIP   <none>        3000/TCP            74s
kube-state-metrics    ClusterIP   None             <none>        8443/TCP,9443/TCP   74s
node-exporter         ClusterIP   None             <none>        9100/TCP            74s
prometheus-adapter    ClusterIP   <none>        443/TCP             74s
prometheus-k8s        ClusterIP    <none>        9090/TCP            74s

microk8s kubectl get pods -n monitoring

NAME                                   READY   STATUS    RESTARTS   AGE
grafana-6b8df57c5b-vkcfd               1/1     Running   0          99s
prometheus-adapter-69b8496df6-6lmr4    1/1     Running   0          99s
prometheus-operator-7649c7454f-pdwhc   2/2     Running   0          99s
kube-state-metrics-78dc55b74b-2klfw    3/3     Running   0          99s
node-exporter-xx6ch                    2/2     Running   0          98s
alertmanager-main-0                    2/2     Running   0          73s
prometheus-k8s-0                       2/2     Running   1          73s

# set port-forwarding to enable external access

# Prometheus UI

microk8s kubectl port-forward -n monitoring service/prometheus-k8s --address 9090:9090

Forwarding from -> 9090
# Grafana UI

microk8s kubectl port-forward -n monitoring service/grafana --address 3000:3000

Forwarding from -> 3000
[2] Access to [https://(MicroK8s primary node's Hostname or IP address):(setting port)] with an web browser on a Client computer in local network. Then, that's OK if following Prometheus or Grafana UI is shown.
For default user/password on Grafana, it [admin/admin].
Matched Content