0% found this document useful (0 votes)
18 views16 pages

SESSION6 - Real Time Monitoring - 1

Uploaded by

YUVARAJ L
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views16 pages

SESSION6 - Real Time Monitoring - 1

Uploaded by

YUVARAJ L
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 16

Please do help me to achieve a target and do share my channel link with 10 your friends …..

My
channel needs 70 more to hit 7K subscribers 

By Praveen Singampalli
Saturday (16-07-2022)
4-6 PM
– SINGAM4DEVOPS
Kubernetes Architecture:
A Kubernetes cluster
consists of a set of worker
machines, called nodes,
that run containerized
applications. Every cluster
has at least one worker
node.
The worker node(s) host
the Pods that are the
components of the
application workload.
The control pane manages
the worker nodes and the
Pods in the cluster.
Grafana Installation
https://packages.grafana.com/
Step 1 grafana-enterprise
enterprise/rpm

Red Hat Package Manager.


Step 2 - vim /etc/yum.repos.d/grafana.repo

Step 3 - Step 6 -
[grafana] name=grafana sudo service grafana-server start sudo service grafana-server
baseurl=https://packages.grafana.com/enterprise/rpm status Bash
repo_gpgcheck=1 enabled=1 gpgcheck=1 sudo /sbin/chkconfig --add grafana-server
gpgkey=https://packages.grafana.com/gpg.key sslverify=1 ./bin/grafana-server web
sslcacert=/etc/pki/tls/certs/ca-bundle.crt Bash

Step 4 - yum install grafana-enterprise http_proxy=http://proxy.domain:3128/


https_proxy=http://proxy.domain:3128/
Step 5 – no_proxy=internal.domain,127.0.0.1
sudo systemctl daemon-reload
sudo systemctl start grafana-
server sudo systemctl status
grafana-server
MySql Installation
• https://dev.mysql.com/get/mysql80-community-release-el8-3.noarch.rpm
• sudo yum install platform-and-version-specific-package-name.rpm
• yum repolist enabled | grep "mysql.*-community.*”
• yum repolist all | grep mysql
• sudo yum-config-manager --disable mysql57-community
• sudo yum-config-manager --enable mysql80-community
• yum repolist enabled | grep mysql
• /etc/yum.repos.d/mysql-community.repo

[mysql57-community] name=MySQL 5.7 Community yum module disable mysql


Server systemctl start mysqld
baseurl=http://repo.mysql.com/yum/mysql-5.7- systemctl status mysqld
community/el/6/$basearch/ sudo grep 'temporary password' /var/log/mysqld.log
enabled=1 mysql -uroot –p
gpgcheck=1 mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY- 'MyNewPass4!';
mysql-2022
Step 1 – Select the Data source in Grafana Grafana Setup with MySq
Step 3 - Visualization in Grafana dashboard

Step 2 – Select the garafana query


Grafana Query generator
•Metric Collection: Prometheus uses the pull model
to retrieve metrics over HTTP. There is an option to
push metrics to Prometheus using Pushgateway for
use cases where Prometheus cannot Scrape the
metrics. One such example is collecting custom
PROMETHEUS
metrics from short-lived kubernetes jobs & Cronjobs
•Metric Endpoint: The systems that you want to
monitor using Prometheus should expose the
metrics on an /metrics endpoint. Prometheus uses
this endpoint to pull the metrics in regular intervals.
•PromQL: Prometheus comes with PromQL, a very
flexible query language that can be used to query
the metrics in the Prometheus dashboard. Also, the
PromQL query will be used by Prometheus UI and
Grafana to visualize metrics.
•Prometheus Exporters: Exporters are libraries
which converts existing metric from third-party apps
to Prometheus metrics format. There are many
official and community Prometheus exporters . One
example is, Prometheus node exporter. It exposes all
Linux system-level metrics in Prometheus format.
•TSDB (time-series database): Prometheus uses
TSDB for storing all the data efficiently. By default, all
the data gets stored locally. However, to avoid single
point of failure, there are options to integrate
remote storage for Prometheus TSDB.
Monitoring Kubernetes Cluster with Prometheus

• Prometheus is a pull-based system. It sends an HTTP request, a so-


called scrape, based on the configuration defined in the deployment file. The
response to this scrape request is stored and parsed in storage along with the
metrics for the scrape itself.
• Exporters are used for data that you do not have full control
over (for example, kernel metrics). Its purpose is to accept
HTTP requests from Prometheus, make sure the data is in a
supported format, and then provide the requested data to
the Prometheus server. (Data transfer)
• Prometheus discovers targets to scrape from by using Service
Discovery.(It tells where to look for data)
• The Kubernetes service discoveries that you can expose to
Prometheus are:
Node
endpoint
service
pod
ingress
Install and Configure Prometheus on Linux System
• Step 1: Update the yum package repositories.

Step 2: https://prometheus.io/download/

https://github.com/prometheus/prometheus/releases/download/v2.37.0/p
rometheus-2.37.0.linux-amd64.tar.gz
• Step 3: Download the source using curl, untar it, and rename
the extracted folder to prometheus-files.

• Step 4: Create a Prometheus user, required directories, and make


Prometheus the user as the owner of those directories.
• Step 5: Move the consoles and console_libraries directories from
prometheus-files to /etc/prometheus folder and change the
ownership to prometheus user.

• Step 6: Move the consoles and console_libraries directories from


prometheus-files to /etc/prometheus folder and change the
ownership to prometheus user.
Setup Prometheus
Configuration
• Step 1: Create the prometheus.yml file.

Step 2: Copy the following contents to the prometheus.yml file.

Step 3: Change the ownership of the file to prometheus user.


Setup Prometheus Service File
• Step 1: Create a prometheus service file.

Step 2: Copy the following content to the file.

Step 3: Reload the systemd service to register the prometheus service and
start the prometheus service.

Step 4: Check the status


Access Prometheus Web UI

prometheus query tab to query the available metrics


Prometheus Qurey Language
PROMQL to get the number of cores

min(kube_pod_container_resource_limits_cpu_cores{namespace=~"$namespace", container!="istio-proxy"}) by
(namespace, pod, container)

PROMQL to get the CPU usage

container_cpu_usage_bytes{namespace="memory-testing", pod=~"ubuntu.*"}

PROMQL to get the Memory usage


container_memory_usage_bytes{namespace="memory-testing", pod=~"ubuntu.*"}
Thank You
QnA

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy