Skip to content

Commit e6ee8a0

Browse files
committed
Update Blog “kubernetes-monitoring-using-prometheus-and-grafana-in-hpe-greenlake-for-private-cloud-enterprise”
1 parent 8ef189d commit e6ee8a0

File tree

4 files changed

+15
-16
lines changed

4 files changed

+15
-16
lines changed

content/blog/kubernetes-monitoring-using-prometheus-and-grafana-in-hpe-greenlake-for-private-cloud-enterprise.md

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Following sections will show how to add a monitoring stack using Prometheus and
4141

4242
### Deploy Prometheus and Grafana using Terraform
4343

44-
Prometheus and Gafana will be deployed to the K8s cluster using the [HPE GreenLake Terraform provider *hpegl*](https://registry.terraform.io/providers/HPE/hpegl/latest), together with the [Helm provider from Hashicorp]( https://registry.terraform.io/providers/hashicorp/helm/latest).
44+
Prometheus and Gafana will be deployed to the K8s cluster using the [HPE GreenLake Terraform provider *hpegl*](https://registry.terraform.io/providers/HPE/hpegl/latest), together with the [Helm provider from Hashicorp](https://registry.terraform.io/providers/hashicorp/helm/latest).
4545

4646
#### Create Terraform config
4747

@@ -126,7 +126,6 @@ resource "helm_release" "grafana-dashboard" {
126126
}
127127
```
128128

129-
130129
There are a few things worth noting in above config file:
131130

132131
<style> li { font-size: 100%; line-height: 23px; max-width: none; } </style>
@@ -172,10 +171,10 @@ With above main.tf config file, the working directory can be initialized by runn
172171
commands will detect it and remind you to do so if necessary.
173172
```
174173

175-
#### Deploy Prometheus and Grafana
174+
#### Deploy Prometheus and Grafana
175+
176+
Apply the Terraform configuration and deploy Prometheus and Grafana to the K8s cluster by responding *yes* at the prompt to confirm the operation. You may start first a dry run, by running *terraform plan*, to preview the changes to your infrastructure based on the data you provide in your Terraform file.
176177

177-
Apply the Terraform configuration and deploy Prometheus and Grafana to the K8s cluster by responding _yes_ at the prompt to confirm the operation. You may start first a dry run, by running *terraform plan*, to preview the changes to your infrastructure based on the data you provide in your Terraform file.
178-
179178
```markdown
180179
$ terraform apply --var-file=variables.tfvars
181180

@@ -307,9 +306,9 @@ Apply the Terraform configuration and deploy Prometheus and Grafana to the K8s c
307306

308307
#### Check Prometheus and Grafana
309308

310-
After few minutes Terraform run, both Prometheus and Grafana will be deployed in the K8s cluster to the namespace _monitoring_.
309+
After few minutes Terraform run, both Prometheus and Grafana will be deployed in the K8s cluster to the namespace *monitoring*.
311310

312-
Type the following command to check the deployed monitoring resources. They should be all in _Running_ states.
311+
Type the following command to check the deployed monitoring resources. They should be all in *Running* states.
313312

314313
```markdown
315314
$ kubectl get all -n monitoring
@@ -350,7 +349,7 @@ NAME READY AGE
350349
statefulset.apps/prometheus-stack-alertmanager 1/1 4d17h
351350
```
352351

353-
Typing _helm list_ command, it will show both Prometheus and Grafana helm charts and versions that are deployed to the _monitoring_ namespace in the cluster:
352+
Typing *helm list* command, it will show both Prometheus and Grafana helm charts and versions that are deployed to the *monitoring* namespace in the cluster:
354353

355354
```markdown
356355
$ helm list -n monitoring
@@ -361,7 +360,7 @@ prometheus-stack monitoring 1 2023-11-22 15:28:13.290386574 +0100 CET de
361360

362361
### Set up Prometheus and Grafana for K8s monitoring
363362

364-
#### Access Prometheus
363+
#### Access Prometheus
365364

366365
Prometheus can be accessed by pointing the browser to the URL *http://gl-tor-upc-cp-gw-node1.customer.yyz.gl-hpe.local:10015*, extracted by the following command:
367366

@@ -370,11 +369,11 @@ $ kubectl get service/prometheus-stack-server -n monitoring -o jsonpath='{.metad
370369
gl-tor-upc-cp-gw-node1.customer.yyz.gl-hpe.local:10015
371370
```
372371

373-
You can execute the query by using some metrics, e.g., *kube_pod_start_time*:
372+
You can execute the query by using some metrics, e.g., *node_procs_running*:
374373

375374
![](/img/prometheus.png)
376375

377-
#### Access Grafana
376+
#### Access Grafana
378377

379378
Grafana can be accessed by pointing the browser to the URL *http://gl-tor-upc-cp-gw-node1.customer.yyz.gl-hpe.local:10016*. The URL and the admin password can be extracted by the following commands:
380379

@@ -388,7 +387,7 @@ cs3O6LF2H9m0jLrgdR8UXplmZG22d9Co9WbnJNzx
388387

389388
![](/img/grafana.png)
390389

391-
#### Configure Grafana
390+
#### Configure Grafana
392391

393392
Prometheus can be configured as the data sources from the Grafana Administration page, by specifying the HTTP URL as *http://gl-tor-upc-cp-gw-node1.customer.yyz.gl-hpe.local:10015/*:
394393

@@ -400,16 +399,16 @@ From [Grafana Labs](https://grafana.com/grafana/dashboards/), there is a list
400399

401400
![](/img/grafana-dashboard-import.png)
402401

403-
Here is the imported dashboard for _K8s cluster monitoring (via Prometheus)_:
402+
Here is the imported dashboard for *K8s cluster monitoring (via Prometheus)*:
404403

405404
![](/img/grafana-cluster-monitoring.png)
406405

407-
Here is another imported dashboard for _K8s pod metrics_. It shows overall cluster CPU / memory / filesystem usage as well as individual pod, containers, systemd services statistics, etc.
406+
Here is another imported dashboard for *K8s pod metrics*. It shows overall cluster CPU / memory / filesystem usage as well as individual pod, containers, systemd services statistics, etc.
408407

409-
![](/img/grafana-cluster-monitoring.png)
408+
![](/img/grafana-pod-metrics.png)
410409

411410
### Summary
412411

413412
This blog post described the detailed process to deploy and set up Prometheus and Grafana as a monitoring stack in a K8s cluster in HPE GreenLake for Private Cloud Enterprise. Prometheus excels at collecting and storing time-series data, enabling developers to monitor various aspects of K8s, including metrics, performance, and health. Grafana complements Prometheus by providing developers with intuitive dashboards and visualizations, enabling them to gain meaningful insights into K8s performance and behavior. Integration of Prometheus and Grafana by deploying them in the K8s cluster adds a monitoring stack. It empowers users to gain a deep understanding of the cluster’s internal states and behaviors, enabling them to identify potential issues, optimize performance and enhance overall reliability.
414413

415-
You can keep coming back to the [HPE Developer blog]( https://developer.hpe.com/blog)] to learn more about HPE GreenLake for Private Cloud Enterprise.
414+
You can keep coming back to the [HPE Developer blog](https://developer.hpe.com/blog)] to learn more about HPE GreenLake for Private Cloud Enterprise.
-12.4 KB
Loading

static/img/grafana-pod-metrics.png

124 KB
Loading

static/img/prometheus.png

5.48 KB
Loading

0 commit comments

Comments
 (0)