当前位置:网站首页>kubernetes部署loki日志系统
kubernetes部署loki日志系统
2022-07-02 06:29:00 【freesharer】
loki简介
Loki 是受 Prometheus 启发可水平可扩展,高可用的多租户日志聚合系统。它被设计得非常轻量高效且易于操作。它不索引日志的内容,而是为每个日志流设置一组标签。一个小索引和高度压缩的块简化了操作,显著降低了 Loki 的成本。
Loki 的架构非常简单,主要由以下 3 个部分组成:
- Loki 是主服务器,负责存储日志和处理查询。
- Promtail 是代理,负责收集日志并将其发送给 Loki 。
- Grafana 用于UI 展示。
helm安装loki
参考:
https://grafana.github.io/loki/charts/
https://grafana.com/docs/loki/latest/installation/helm/
添加helm repo
helm repo add grafana https://grafana.github.io/helm-charts
helm repo update
安装loki,如果启用持久化需自备可用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
查看创建的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
查看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
查看持久卷
[[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查询日志
获取grafana admin用户密码
kubectl get secret --namespace loki-stack loki-grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo
修改grafana service类型为nodeport
kubectl -n loki-stack patch svc loki-grafana -p '{"spec": {"type": "NodePort"}}'
使用任意节点IP+nodePort登录loki
http://192.168.0.22:31451
配置 Grafana Loki 数据源,默认已配置
切换到Explore界面
查看 pod 日志
边栏推荐
- Introduction to anti interception technology of wechat domain name
- 群辉 NAS 配置 iSCSI 存储
- cve_ 2019_ 0708_ bluekeep_ Rce vulnerability recurrence
- Minecraft安装资源包
- Classes and objects (instantiation of classes and classes, this, static keyword, encapsulation)
- Sqli labs level 8 (Boolean blind note)
- HCIA—数据链路层
- [blackmail virus data recovery] suffix Crylock blackmail virus
- Global and Chinese market of electric cheese grinder 2022-2028: Research Report on technology, participants, trends, market size and share
- ARP及ARP欺骗
猜你喜欢
Sqli labs level 1
Minecraft模组服开服
Application of kotlin - higher order function
Gateway 简单使用
Jumping | Blue Bridge Cup
Simple implementation scheme of transcoding and streaming (I)
OpenShift 容器平台社区版 OKD 4.10.0部署
Use Wireshark to grab TCP three handshakes
TCP/IP—传输层
Googlenet network explanation and model building
随机推荐
In depth understanding of prototype drawings
Sqli labs level 12
Deep understanding of JVM
How to uninstall SQL Server cleanly
Rotating linked list (illustration)
Minecraft安装资源包
c语言自定义类型——结构体,位段(匿名结构体,结构体的自引用,结构体的内存对齐)
[blackmail virus data recovery] suffix Hydra blackmail virus
Carsim 学习心得-粗略翻译1
W10 is upgraded to W11 system, but the screen is black, but the mouse and desktop shortcuts can be used. How to solve it
程序猿学英语-Learning C
C language replaces spaces in strings with%20
D interface and domain problems
OpenFeign 简单使用
Global and Chinese markets of tilting feeders 2022-2028: Research Report on technology, participants, trends, market size and share
Programmer training, crazy job hunting, overtime ridiculed by colleagues deserve it
Pointer initialization
File upload and download performance test based on the locust framework
Minecraft插件服开服
Realize bidirectional linked list (with puppet node)