当前位置:网站首页>Kubernetes deploys Loki logging system
Kubernetes deploys Loki logging system
2022-07-02 08:42:00 【freesharer】
loki brief introduction
Loki Is subject to Prometheus Heuristic, horizontally scalable , Highly available multi tenant log aggregation system . It is designed to be very light, efficient and easy to operate . It doesn't index the contents of the log , Instead, set a set of labels for each log stream . A small index and highly compressed blocks simplify the operation , Significantly reduced Loki Cost of .
Loki The architecture of is very simple , Mainly by the following 3 Component composition :
- Loki Is the primary server , Responsible for storing logs and processing queries .
- Promtail Is the agent , Responsible for collecting logs and sending them to Loki .
- Grafana be used for UI Exhibition .
helm install loki
Reference resources :
https://grafana.github.io/loki/charts/
https://grafana.com/docs/loki/latest/installation/helm/
add to helm repo
helm repo add grafana https://grafana.github.io/helm-charts
helm repo update
install loki, If you enable persistence, you need to provide it yourself storageclass
helm upgrade --install loki grafana/loki-stack \
--namespace=loki-stack \
--create-namespace \
--set grafana.enabled=true \
--set loki.persistence.enabled=true \
--set loki.persistence.storageClassName=longhorn \
--set loki.persistence.size=5Gi
View the created pods
[[email protected] ~]# kubectl -n loki-stack get pods
NAME READY STATUS RESTARTS AGE
loki-0 1/1 Running 0 28m
loki-grafana-6886db999c-djnhz 1/1 Running 0 28m
loki-promtail-krkxl 1/1 Running 0 28m
loki-promtail-mgdxh 1/1 Running 0 28m
loki-promtail-z7wl2 1/1 Running 0 28m
see service
[[email protected] ~]# kubectl -n loki-stack get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
loki ClusterIP 10.101.148.142 <none> 3100/TCP 29m
loki-grafana NodePort 10.97.174.254 <none> 80:31451/TCP 29m
loki-headless ClusterIP None <none> 3100/TCP 29m
View persistent volumes
[[email protected] ~]# kubectl -n loki-stack get pvc
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
storage-loki-0 Bound pvc-854c0d90-266c-41fe-af13-33883b4da5e8 5Gi RWO longhorn 29m
loki Query log
obtain grafana admin User password
kubectl get secret --namespace loki-stack loki-grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo
modify grafana service The type is nodeport
kubectl -n loki-stack patch svc loki-grafana -p '{"spec": {"type": "NodePort"}}'
Use any node IP+nodePort Sign in loki
http://192.168.0.22:31451
To configure Grafana Loki data source , Default configured
Switch to Explore Interface
see pod journal
Reference resources :
https://anoyi.com/p/474a5034a501
边栏推荐
猜你喜欢
Qt——如何在QWidget中设置阴影效果
OpenShift构建镜像
Use the kaggle training model and download your own training model
Minecraft群組服開服
Gateway 简单使用
Implementation of bidirectional linked list (simple difference, connection and implementation between bidirectional linked list and unidirectional linked list)
Minecraft安装资源包
Classes and objects (instantiation of classes and classes, this, static keyword, encapsulation)
整理秒杀系统的面试必备!!!
Sqli labs Level 2
随机推荐
D interface and domain problems
【无标题】
Routing foundation - dynamic routing
文件上传-upload-labs
Implementation of bidirectional linked list (simple difference, connection and implementation between bidirectional linked list and unidirectional linked list)
Hcia - Application Layer
Programmer training, crazy job hunting, overtime ridiculed by colleagues deserve it
Dip1000 implicitly tagged with fields
Minecraft模组服开服
用数字 5,5,5,1 ,进行四则运算,每个数字当且仅当用一次,要求运算结果值为 24
方法递归(斐波那契数列,青蛙跳台阶,汉诺塔问题)
Openshift deployment application
Realize bidirectional linked list (with puppet node)
The best blog to explain the basics of compilation (share)
How to build the alliance chain? How much is the development of the alliance chain
Pointer initialization
How to apply for a secondary domain name?
HCIA—應用層
Web security -- core defense mechanism
Sentinel easy to use