Kubernetes Logging: EFK vs. PLG



. . , โ€” , , .



. : EFK (Elasticsearch) PLG (Loki) .



EFK



, ELK EFK. : Elasticsearch ( ), Logstash FluentD ( ) Kibana .



:





Elasticsearch โ€” . , . JSON, . , , Apache Lucene.



FluentD โ€” , . JSON . , , , .



Kibana โ€” Elasticsearch , , , , .



Elasticsearch



Elasticsearch . . , .



:



  • aster node โ€” , , ;
  • data node โ€” ;
  • ingest node โ€” ;
  • coordinating node โ€” , , ;
  • alerting node โ€” ;
  • machine learning node โ€” .


, .





, , :







, helm chart:



$ helm install efk-stack stable/elastic-stack --set logstash.enabled=false --set fluentd.enabled=true --set fluentd-elastics


PLG



, , Grafana Loki. , . , , Grafana, . , Prometheus, Loki, . Loki , , .



Promtail โ€” Loki. Grafana โ€” Loki.





Loki , Prometheus, Kubernetes.



Loki



Loki , , .





, , . . . , .



:





โ€” ( ):





:



Promtail โ€” , ( ), API Kubernetes , . Loki. , Prometheus.



Distributor โ€” -, . , . , , . . n (3, ).



Ingester โ€” -. . , . , Chunks ( ). , .





Index โ€” , DynamoDB, Cassandra, Google BigTable .



Chunks โ€” , , , S3.



Querier โ€” , . , . .



.





Kubernetes helm. , ( ! . )



.



$ helm repo add loki https://grafana.github.io/loki/charts
$ helm repo update
$ helm upgrade --install loki loki/loki-stack --set grafana.enabled=true,prometheus.enabled=true,prometheus.alertmanager.persistentVolume.enabled=false,prometheus.server.persistentVolume.enabled=false


, Prometheus Etcd Loki Etcd.





, .







Elasticsearch Query DSL Lucene query language, . . .



โ€” LogQL, Loki, PromQL (Prometheus query language). . , , Elastic language.



Loki โ€” , .





, Loki , , . Loki .





โ€” OPEX, . Elasticsearch : , , , . Loki HTTP X-Scope-OrgID.





Loki - , , . (), , Elasticsearch.





EFK , Kibana , . .



Loki Kubernetes - . Grafana .



, Loki .



โ€” . , GKE Stackdriver, . .



:





โ€” , (Kubernetes, DevOps, Docker, Ansible, Ceph, SRE, Agile)




All Articles