Version 2.1.0
Grafana 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.
Compared to other log aggregation systems, Loki:
After you deploy the stack you will have the following deployed to your cluster in the loki-stack
namespace:
Check that the Loki pods are running as expected:
kubectl --namespace loki-stack get pods
NAME READY STATUS RESTARTS AGE
loki-0 1/1 Running 0 47h
loki-grafana-5dc6466b8d-2xkwf 1/1 Running 0 47h
loki-promtail-8ggnr 1/1 Running 0 47h
loki-promtail-fhxjw 1/1 Running 0 47h
loki-promtail-hpq7j 1/1 Running 0 47h
Then grab the admin password for grafana:
kubectl get secret --namespace loki-stack loki-grafana -o jsonpath="{.data.admin-password}" | base64 --decode
Now port-forward to Grafana (using your own loki-grafana-xxxxxxxxx-xxxx
pod name) and login using the username admin
and password you got above. To access Grafana, port-forward:
kubectl --namespace loki-stack port-forward svc/loki-grafana 8080:80
and visit http://localhost:8080/explore
In the explore UI, enter the query {app="loki"}
or similar to get the logs. Happy querying!
Uninstalling
To uninstall Loki, you'll need to have Helm 3 installed. Once install, run the following:
helm uninstall loki -n loki-stack
followed by:
kubeclt delete ns loki-stack
In addition to creating Grafana Loki via the control panel, you can also use the DigitalOcean API.
As an example, to create a 3 node DigitalOcean Kubernetes cluster made up of Basic Droplets in the SFO2 region, you can use the following curl command. You’ll need to either save your API access token to an environment variable or substitute it into the command below.
curl -X POST -H "Content-Type: application/json" \
-H "Authorization: Bearer '$TOKEN'" -d \
'{"name": "choose-a-name","region": "sfo2","version": "1.17.5-do.0","node_pools": [{"size": "s-1vcpu-2gb","count": 3,"name": "choose-a-name"}]}' \
"https://api.digitalocean.com/v2/kubernetes/clusters"
Developers supporting developers
Ask anything related to system administration, programming, devops, open source, or the DigitalOcean platform.
Partner with us to build traction for your open source project or software company