Skip to content

Latest commit

 

History

History
152 lines (105 loc) · 5.69 KB

prometheus-csi-baremetal-integration-configuration.md

File metadata and controls

152 lines (105 loc) · 5.69 KB

Отчёт по второму заданию лаборатории Dell Technologies - ВШПИ

Prometheus-CSI-Baremetal integration and configuration

The installation was performed on Ubuntu-20.04 (Parallel system)

Before installing the monitoring system, you must have CSI-baremetal installed. How to do this can be found here Installation CSI-baremetal on kind

Prometheus Prometheus

About

Prometheus — monitoring system. The main advantages are the possibility of creating flexible data queries and storing metric values in a time series database, the possibility of automation during administration.

How it works?

Prometheus scrapes metrics from instrumented jobs, either directly or via an intermediary push gateway for short-lived jobs. It stores all scraped samples locally and runs rules over this data to either aggregate and record new time series from existing data or generate alerts. Grafana or other API consumers can be used to visualize the collected data.

Prometheus schem

In short, Prometheus works with key-value pairs. The key describes what we measure, and the value stores the actual value as a number. Remember: Prometheus is not designed to store raw information, like plain text. It stores metrics aggregated over a period of time.

Grafana Grafana

About

Grafana — is an open source platform for data visualization, monitoring and analysis.

A Grafana dashboard supports multiple panels in a single grid. You can visualize results from multiple data sources simultaneously. It is a powerful open-source analytical and visualization tool that consists of multiple individual panels arranged in a grid. The panels interact with configured data sources including (but not limited to) AWS CloudWatch, Microsoft SQL server, Prometheus, MySQL, InfluxDB, and many others.

Grafana board

Deployment

The exporter may be installed either via Helm or through YAML manifests with the object definitions. It's recommended to use Helm as it's more convenient to manage the configuration of the deployment.

Installation

First you need to find out the version of k8s:

kubectl version

First way

To find out the release you need, see here kube-prometheus

# create namespace
kubectl create namespace monitoring

# clone
git clone --depth 1 https://github.com/prometheus-operator/kube-prometheus.git -b [your release]

# work with manifests
cd kube-prometheus
cp -r manifests [your directory]

# setup CRD's and Prometheus Operator
kubectl create -f ./manifests/setup/

# setup manifests
kubectl create -f ./manifests/

# check pods
kubectl -n monitoring get pods

# view metrics in Prometheus
kubectl -n monitoring port-forward svc/prometheus-k8s 9090

# view dashboards in Grafana
kubectl -n monitoring port-forward svc/grafana 3000

# view Alert Manager
kubectl -n monitoring port-forward svc/alertmanager-main 9093

Then access via http://localhost:'port'. In grafana use the default user:password of admin:admin.

If you want to see how Prometheus is configured you should look at the services:

kubectl -n monitoring get svc

Second way

# deploy Prometheus
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update
helm install [your release] prometheus-community/kube-prometheus-stack

Ingress

Ingress exposes HTTP and HTTPS routes from outside the cluster to services within the cluster. Traffic routing is controlled by rules defined on the Ingress resource. An Ingress may be configured to give Services externally-reachable URLs, load balance traffic, terminate SSL / TLS, and offer name-based virtual hosting. An Ingress controller is responsible for fulfilling the Ingress, usually with a load balancer, though it may also configure your edge router or additional frontends to help handle the traffic.

An Ingress does not expose arbitrary ports or protocols. Exposing services other than HTTP and HTTPS to the internet you can use a service of type Service.Type=Node Port or Service.Type=LoadBalancer.

If you wnat to deploy Ingress you can use this commands:

kubectl get svc
kubectl edit svc prometheus-grafana
#Change to type NodePort

NodePort for Grafana

After the completed operations, you can apply your yaml file:

kubectl apply -f ingress.yaml

Here are examples of what you should get approximately as a result:

Prometheus Example Pods Svc