Skip to content

Latest commit

 

History

History
94 lines (57 loc) · 3.2 KB

File metadata and controls

94 lines (57 loc) · 3.2 KB

Monitoring

This module defines the resources required for monitoring the state of system. This includes:

Installation - All Monitoring Services

  1. First, initialize terraform:
terraform init
  1. Validate that the terraform resources are valid. If your terraform is valid the validate command will respond with "Success! The configuration is valid."
terraform validate
  1. Run a terraform plan. The terraform plan will give you a summary of all the changes terraform will perform prior to deploying any change.
terraform plan
  1. Deploy the changes by applying the terraform plan. You will be asked to confirm the changes and must respond with "yes".
terraform apply

Instructions for installing individual monitoring services can be found in their specific README files.

Resources

Grafana

Charts and visualizations for viewing system usage and performance are available in the Grafana Dashboard. For developer access to the Grafana dashboard, first enable port forwarding:

Grafana Port Forwarding

or run this on the command line:

kubectl port-forward --namespace monitoring svc/kube-prometheus-stack-grafana 8080:3009

This will allow you to access the Grafana dashboard at http://localhost:8080

If you don't already have your Grafana credentials, they can be obtained with:

# Username
kubectl get secret kube-prometheus-stack-grafana -n monitoring -o jsonpath="{.data.admin-user}" | base64 --decode

# Password
kubectl get secret kube-prometheus-stack-grafana -n monitoring -o jsonpath="{.data.admin-password}" | base64 --decode


And use those credentials to login at:   localhost:{port_from_above}

Grafana Login

Loki and Prometheus have automatically been added as data sources to Grafana.

Prometheus

The Prometheus server UI can be accessed by port-forwarding to a localhost port:

kubectl port-forward --namespace monitoring svc/kube-prometheus-stack-prometheus 9090:9090

You could also port-forward the kube-prometheus-stack-prometheus service using the Rancher Desktop UI. This will allow you to access the Prometheus dashboard at http://localhost:9090

There is no login needed. Observe/monitor the cluster status by clicking on 'Status' on the top ribbon and exploring the various options on that tab.

Prometheus

Loki

To visualize basic Loki monitoring logs:

In Grafana click "Explore" on the left-side menu. For Label Filters enter "namespace = monitoring". Click "Run Query" and you should see logs from the Loki instance:

Grafana monitoring logs

Promtail

The promtail agent will be installed as a DaemonSet and configured with the default settings to scrape logs from any pod in the cluster. The logs will be sent to and stored in Loki.