Skip to content

ltblueberry/loki-k8s-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example of Loki Stack in K8S cluster

Example

Namespace

Create the monitoring namespace

kubectl create namespace monitoring

created namespace

Loki stack

Add and update Loki helm chart repository

helm repo add loki https://grafana.github.io/loki/charts
helm repo update

helm repo

Install Loki stack

helm install loki loki/loki-stack --namespace monitoring -f loki.values.yaml

loki pods

Grafana

Add and update Grafana helm chart repository

helm repo add grafana https://grafana.github.io/helm-charts
helm repo update

helm repo

Install Grafana

helm install grafana grafana/grafana --namespace monitoring -f grafana.values.yaml

grafana pod

Get admin password

kubectl get secret --namespace monitoring grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo

Deploy Grafana ingress

kubectl apply -f ingress.yaml

grafana ingress

Add ingress IP address to /etc/hosts for grafana.example.com

Check out web interface in browser. Sign in with user admin and password.

Create new dashboard and panel. Our Loki datasource is available and it is the default datasource.

Set log labels with value container="grafana" (it is an example, you can try any other meta label app, namespace, etc), set visualization type Logs.

grafana log panel

About

Example of Loki in K8S cluster

Topics

Resources

Stars

Watchers

Forks