SlideShare une entreprise Scribd logo
1  sur  25
Télécharger pour lire hors ligne
Deploy Monitoring and
Centralized Logging
with Prometheus + Grafana
and EFK Stack
on Kubic k8s clusters
Syah Dwi Prihatmoko / sdmoko
sdmoko@opensuse.org
Syah Dwi Prihatmoko
Moko
@sdmoko
openSUSE-ID Member
GNU Linux Bogor Activist
Cloud Engineer at Btech
FOSS Contributor and Enthusiast
In this talks,
we'll learn how to deploy monitoring and logging with
Prometheus - Grafana and EFK Stack in Kubic k8s clusters.
The example is to monitoring and logging pods in k8s
clusters.
Kubic?
Deploy k8s on Kubic
openSUSE MicroOS Kubic came with kubeadm to make it easy to
bootstrapping a kubernetes cluster. Just run this command to init a k8s
cluster.
kubeadm init --pod-network-cidr=10.244.0.0/16
After this you need to configure user to talk to cluster by running
mkdir -p ~/.kube
cp -i /etc/kubernetes/admin.conf ~/.kube/config
Deploy k8s on Kubic
The next step is to set up the network plugin. Kubic recommended to use
flannel. Run the command to set up flannel.
kubectl apply -f /usr/share/k8s-yaml/flannel/kube-flannel.yaml
After this you can join the worker node, to get the join command execute
this command on master node.
kubeadm token create --print-join-command
https://blog.sdmoko.net/create-k8s-cluster-with-kubic.html
Monitoring
Vs
Logging
EFK Stack
Elasticsearch, Fluentd and Kibana
EFK Deployment Guide can be
found on my blog.
https://blog.sdmoko.net/efk-cluster
-on-kubernetes.html
Deploy EFK Stack
The YAML file available at https://github.com/sdmoko/EFK-kubernetes
First create a storage class
kubectl apply -f 00-storageClass.yaml
After this we need to create PV.
kubectl apply -f 01-pv-0.yaml
kubectl apply -f 02-pv-1.yaml
kubectl apply -f 03-pv-2.yaml
Deploy EFK Stack
Then we need to create a namespaces for a logging system.
kubectl apply -f 04-namespaces.yaml
After this create a service for elasticsearch cluster, so the Fluentd and
Kibana can use it.
kubectl apply -f 05-elasticsearch_svc.yaml
Then create a cluster elasticsearch which use the volume that we create
before.
kubectl apply -f 06-elasticsearch_statefulset.yaml
Deploy EFK Stack
Then deploy Kibana and Fluentd to make it a complete logging stack.
Where we can visualize the data.
kubectl apply -f 07-kibana.yaml
kubectl apply -f 08-fluentd.yaml
Kibana Dashboard
Prometheus + Grafana
Prometheus + Grafana
Prometheus + Grafana deployment guide can
be found on my blog.
https://blog.sdmoko.net/deploy-prometheus-gr
afana-on-kubernetes.html
Deploy Prometheus + Grafana
The yaml for this deployment can be found here
https://github.com/sdmoko/k8s-prometheus-grafana
First, we need to deploy prometheus as a metric storage (TSDB).
To deploy prometheus we need to add a RBAC for prometheus.
kubectl apply -f prometheus/00-prometheus-rbac.yaml
Then deploy a configmap for prometheus config.
kubectl apply -f prometheus/01-prometheus-configmap.yaml
Deploy Prometheus + Grafana
Then we can create a rules that will trigger the alertmanager.
kubectl apply -f prometheus/02-prometheus-rules.yaml
Then we can create a storage for prometheus store the data.
kubectl apply -f prometheus/03-prometheus-storage.yaml
Then we can create a deployment and service for prometheus.
kubectl apply -f prometheus/prometheus-deployment.yaml
kubectl apply -f prometheus/prometheus-service.yaml
Deploy Prometheus + Grafana
Then we deploy kube-metrics server to expose container and pod metrics
other than those exposed by cadvisor on the nodes.
kubectl apply -f kube-state-metrics/kube-state-metrics.yaml
Then we can deploy and provide service for grafana dashboard to visualize
the monitoring data.
kubectl apply -f grafana/grafana-deployment.yaml
kubectl apply -f grafana/grafana-service.yaml
Deploy Prometheus + Grafana
Then we open the grafana service from browser, and then add prometheus
data source and add a dashboard. For config of the grafana data source
use:
Name : DS_Prometheus
Type : Prometheus
URL : http://prometheus-service:8080
Grafana Dashboard
Questions ?
Reference
https://github.com/sdmoko/EFK-kubernetes
https://github.com/sdmoko/k8s-prometheus-grafana
https://medium.com/faun/production-grade-kubernetes-monitoring-using-prometheus-78144b835b60
https://www.digitalocean.com/community/tutorials/how-to-set-up-an-elasticsearch-fluentd-and-kibana-efk-logging-stack-o
n-kubernetes
Terima Kasih.
Thank You.

Contenu connexe

Tendances

Tendances (20)

[DockerCon 2019] Hardening Docker daemon with Rootless mode
[DockerCon 2019] Hardening Docker daemon with Rootless mode[DockerCon 2019] Hardening Docker daemon with Rootless mode
[DockerCon 2019] Hardening Docker daemon with Rootless mode
 
ksqlDB로 실시간 데이터 변환 및 스트림 처리
ksqlDB로 실시간 데이터 변환 및 스트림 처리ksqlDB로 실시간 데이터 변환 및 스트림 처리
ksqlDB로 실시간 데이터 변환 및 스트림 처리
 
Whoops, The Numbers Are Wrong! Scaling Data Quality @ Netflix
Whoops, The Numbers Are Wrong! Scaling Data Quality @ NetflixWhoops, The Numbers Are Wrong! Scaling Data Quality @ Netflix
Whoops, The Numbers Are Wrong! Scaling Data Quality @ Netflix
 
0-60: Tesla's Streaming Data Platform ( Jesse Yates, Tesla) Kafka Summit SF 2019
0-60: Tesla's Streaming Data Platform ( Jesse Yates, Tesla) Kafka Summit SF 20190-60: Tesla's Streaming Data Platform ( Jesse Yates, Tesla) Kafka Summit SF 2019
0-60: Tesla's Streaming Data Platform ( Jesse Yates, Tesla) Kafka Summit SF 2019
 
Squirreling Away $640 Billion: How Stripe Leverages Flink for Change Data Cap...
Squirreling Away $640 Billion: How Stripe Leverages Flink for Change Data Cap...Squirreling Away $640 Billion: How Stripe Leverages Flink for Change Data Cap...
Squirreling Away $640 Billion: How Stripe Leverages Flink for Change Data Cap...
 
Shipping Data from Postgres to Clickhouse, by Murat Kabilov, Adjust
Shipping Data from Postgres to Clickhouse, by Murat Kabilov, AdjustShipping Data from Postgres to Clickhouse, by Murat Kabilov, Adjust
Shipping Data from Postgres to Clickhouse, by Murat Kabilov, Adjust
 
Confluent Workshop Series: ksqlDB로 스트리밍 앱 빌드
Confluent Workshop Series: ksqlDB로 스트리밍 앱 빌드Confluent Workshop Series: ksqlDB로 스트리밍 앱 빌드
Confluent Workshop Series: ksqlDB로 스트리밍 앱 빌드
 
Highly efficient backups with percona xtrabackup
Highly efficient backups with percona xtrabackupHighly efficient backups with percona xtrabackup
Highly efficient backups with percona xtrabackup
 
Red Hat Insights
Red Hat InsightsRed Hat Insights
Red Hat Insights
 
Spark + Cassandra = Real Time Analytics on Operational Data
Spark + Cassandra = Real Time Analytics on Operational DataSpark + Cassandra = Real Time Analytics on Operational Data
Spark + Cassandra = Real Time Analytics on Operational Data
 
Gitlab flow solo
Gitlab flow soloGitlab flow solo
Gitlab flow solo
 
10 Good Reasons to Use ClickHouse
10 Good Reasons to Use ClickHouse10 Good Reasons to Use ClickHouse
10 Good Reasons to Use ClickHouse
 
Data integration with Apache Kafka
Data integration with Apache KafkaData integration with Apache Kafka
Data integration with Apache Kafka
 
Kubernetes Networking
Kubernetes NetworkingKubernetes Networking
Kubernetes Networking
 
Splunk: Druid on Kubernetes with Druid-operator
Splunk: Druid on Kubernetes with Druid-operatorSplunk: Druid on Kubernetes with Druid-operator
Splunk: Druid on Kubernetes with Druid-operator
 
Using ClickHouse for Experimentation
Using ClickHouse for ExperimentationUsing ClickHouse for Experimentation
Using ClickHouse for Experimentation
 
Hudi architecture, fundamentals and capabilities
Hudi architecture, fundamentals and capabilitiesHudi architecture, fundamentals and capabilities
Hudi architecture, fundamentals and capabilities
 
MySQL Group Replication - HandsOn Tutorial
MySQL Group Replication - HandsOn TutorialMySQL Group Replication - HandsOn Tutorial
MySQL Group Replication - HandsOn Tutorial
 
Pinot: Realtime Distributed OLAP datastore
Pinot: Realtime Distributed OLAP datastorePinot: Realtime Distributed OLAP datastore
Pinot: Realtime Distributed OLAP datastore
 
Microservices-DDD-Telosys-Devoxx-FR-2022
Microservices-DDD-Telosys-Devoxx-FR-2022Microservices-DDD-Telosys-Devoxx-FR-2022
Microservices-DDD-Telosys-Devoxx-FR-2022
 

Similaire à Deploy Prometheus - Grafana and EFK stack on Kubic k8s Clusters

kubeadm Cluster Creation Internals_ From Self-Hosting to Upgradability and HA...
kubeadm Cluster Creation Internals_ From Self-Hosting to Upgradability and HA...kubeadm Cluster Creation Internals_ From Self-Hosting to Upgradability and HA...
kubeadm Cluster Creation Internals_ From Self-Hosting to Upgradability and HA...
ssuser92b4be
 

Similaire à Deploy Prometheus - Grafana and EFK stack on Kubic k8s Clusters (20)

Kubernetes installation
Kubernetes installationKubernetes installation
Kubernetes installation
 
Learn kubernetes in 90 minutes
Learn kubernetes in 90 minutesLearn kubernetes in 90 minutes
Learn kubernetes in 90 minutes
 
From 0 to 60 with kubernetes and istio
From 0 to 60 with kubernetes and istioFrom 0 to 60 with kubernetes and istio
From 0 to 60 with kubernetes and istio
 
Deploying calico on kubernetes
Deploying calico on kubernetesDeploying calico on kubernetes
Deploying calico on kubernetes
 
OSS Japan 2019 service mesh bridging Kubernetes and legacy
OSS Japan 2019 service mesh bridging Kubernetes and legacyOSS Japan 2019 service mesh bridging Kubernetes and legacy
OSS Japan 2019 service mesh bridging Kubernetes and legacy
 
Effective Building your Platform with Kubernetes == Keep it Simple
Effective Building your Platform with Kubernetes == Keep it Simple Effective Building your Platform with Kubernetes == Keep it Simple
Effective Building your Platform with Kubernetes == Keep it Simple
 
Install a micro k8s single node cluster of kubernetes on windows 10
Install a micro k8s single node cluster of kubernetes on windows 10Install a micro k8s single node cluster of kubernetes on windows 10
Install a micro k8s single node cluster of kubernetes on windows 10
 
Monitoring Docker Containers with Metricbeat, Elasticsearch, and Kibana
Monitoring Docker Containers with Metricbeat, Elasticsearch, and KibanaMonitoring Docker Containers with Metricbeat, Elasticsearch, and Kibana
Monitoring Docker Containers with Metricbeat, Elasticsearch, and Kibana
 
Run K8s on Local Environment
Run K8s on Local EnvironmentRun K8s on Local Environment
Run K8s on Local Environment
 
kubeadm Cluster Creation Internals_ From Self-Hosting to Upgradability and HA...
kubeadm Cluster Creation Internals_ From Self-Hosting to Upgradability and HA...kubeadm Cluster Creation Internals_ From Self-Hosting to Upgradability and HA...
kubeadm Cluster Creation Internals_ From Self-Hosting to Upgradability and HA...
 
Getting started with project calico
Getting started with project calicoGetting started with project calico
Getting started with project calico
 
Kubernetes meetup 102
Kubernetes meetup 102Kubernetes meetup 102
Kubernetes meetup 102
 
Kubernetes Architecture and Introduction
Kubernetes Architecture and IntroductionKubernetes Architecture and Introduction
Kubernetes Architecture and Introduction
 
kubernetes practice
kubernetes practicekubernetes practice
kubernetes practice
 
Prometheus on NKS
Prometheus on NKSPrometheus on NKS
Prometheus on NKS
 
Kubernetes
KubernetesKubernetes
Kubernetes
 
Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17
 
Kubernetes Architecture and Introduction – Paris Kubernetes Meetup
Kubernetes Architecture and Introduction – Paris Kubernetes MeetupKubernetes Architecture and Introduction – Paris Kubernetes Meetup
Kubernetes Architecture and Introduction – Paris Kubernetes Meetup
 
CloudStack and cloud-init
CloudStack and cloud-initCloudStack and cloud-init
CloudStack and cloud-init
 
Salvatore Incandela, Fabio Marinelli - Using Spinnaker to Create a Developmen...
Salvatore Incandela, Fabio Marinelli - Using Spinnaker to Create a Developmen...Salvatore Incandela, Fabio Marinelli - Using Spinnaker to Create a Developmen...
Salvatore Incandela, Fabio Marinelli - Using Spinnaker to Create a Developmen...
 

Dernier

Dernier (20)

AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 

Deploy Prometheus - Grafana and EFK stack on Kubic k8s Clusters

  • 1. Deploy Monitoring and Centralized Logging with Prometheus + Grafana and EFK Stack on Kubic k8s clusters Syah Dwi Prihatmoko / sdmoko sdmoko@opensuse.org
  • 3. openSUSE-ID Member GNU Linux Bogor Activist Cloud Engineer at Btech FOSS Contributor and Enthusiast
  • 4. In this talks, we'll learn how to deploy monitoring and logging with Prometheus - Grafana and EFK Stack in Kubic k8s clusters. The example is to monitoring and logging pods in k8s clusters.
  • 6. Deploy k8s on Kubic openSUSE MicroOS Kubic came with kubeadm to make it easy to bootstrapping a kubernetes cluster. Just run this command to init a k8s cluster. kubeadm init --pod-network-cidr=10.244.0.0/16 After this you need to configure user to talk to cluster by running mkdir -p ~/.kube cp -i /etc/kubernetes/admin.conf ~/.kube/config
  • 7. Deploy k8s on Kubic The next step is to set up the network plugin. Kubic recommended to use flannel. Run the command to set up flannel. kubectl apply -f /usr/share/k8s-yaml/flannel/kube-flannel.yaml After this you can join the worker node, to get the join command execute this command on master node. kubeadm token create --print-join-command https://blog.sdmoko.net/create-k8s-cluster-with-kubic.html
  • 10. EFK Deployment Guide can be found on my blog. https://blog.sdmoko.net/efk-cluster -on-kubernetes.html
  • 11. Deploy EFK Stack The YAML file available at https://github.com/sdmoko/EFK-kubernetes First create a storage class kubectl apply -f 00-storageClass.yaml After this we need to create PV. kubectl apply -f 01-pv-0.yaml kubectl apply -f 02-pv-1.yaml kubectl apply -f 03-pv-2.yaml
  • 12. Deploy EFK Stack Then we need to create a namespaces for a logging system. kubectl apply -f 04-namespaces.yaml After this create a service for elasticsearch cluster, so the Fluentd and Kibana can use it. kubectl apply -f 05-elasticsearch_svc.yaml Then create a cluster elasticsearch which use the volume that we create before. kubectl apply -f 06-elasticsearch_statefulset.yaml
  • 13. Deploy EFK Stack Then deploy Kibana and Fluentd to make it a complete logging stack. Where we can visualize the data. kubectl apply -f 07-kibana.yaml kubectl apply -f 08-fluentd.yaml
  • 17. Prometheus + Grafana deployment guide can be found on my blog. https://blog.sdmoko.net/deploy-prometheus-gr afana-on-kubernetes.html
  • 18. Deploy Prometheus + Grafana The yaml for this deployment can be found here https://github.com/sdmoko/k8s-prometheus-grafana First, we need to deploy prometheus as a metric storage (TSDB). To deploy prometheus we need to add a RBAC for prometheus. kubectl apply -f prometheus/00-prometheus-rbac.yaml Then deploy a configmap for prometheus config. kubectl apply -f prometheus/01-prometheus-configmap.yaml
  • 19. Deploy Prometheus + Grafana Then we can create a rules that will trigger the alertmanager. kubectl apply -f prometheus/02-prometheus-rules.yaml Then we can create a storage for prometheus store the data. kubectl apply -f prometheus/03-prometheus-storage.yaml Then we can create a deployment and service for prometheus. kubectl apply -f prometheus/prometheus-deployment.yaml kubectl apply -f prometheus/prometheus-service.yaml
  • 20. Deploy Prometheus + Grafana Then we deploy kube-metrics server to expose container and pod metrics other than those exposed by cadvisor on the nodes. kubectl apply -f kube-state-metrics/kube-state-metrics.yaml Then we can deploy and provide service for grafana dashboard to visualize the monitoring data. kubectl apply -f grafana/grafana-deployment.yaml kubectl apply -f grafana/grafana-service.yaml
  • 21. Deploy Prometheus + Grafana Then we open the grafana service from browser, and then add prometheus data source and add a dashboard. For config of the grafana data source use: Name : DS_Prometheus Type : Prometheus URL : http://prometheus-service:8080