Skip to content

Commit e57358d

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

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

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

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,13 @@ Before starting, make sure you meet the following requirements:
3737

3838
[Grafana](https://grafana.com/) is a powerful data visualization and monitoring tool. It serves as the interface for developers to visualize and analyze the data collected by Prometheus. With its rich set of visualization options and customizable dashboards, Grafana empowers developers to gain real-time insights into their systems’ performance, identify trends, and detect anomalies. By leveraging Grafana’s capabilities, developers can create comprehensive visual representations of their systems’ metrics, facilitating informed decision-making and proactive system management.
3939

40-
### Deeploy Prometheus and Grafana using Terraform
40+
### Deploy Prometheus and Grafana using Terraform
4141

42+
Both Prometheus and Gafana can be installed 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).
4243

43-
Apart from using the HPE GreenLake *hpegl* provider, it also uses the *helm* provider from Hashicorp to deploy both Prometheus and Grafana to the K8s cluster.
44+
#### Create Terraform config
4445

45-
#### Terraform config
46-
47-
Here is the terraform config file.
46+
Here is the terraform config file. You can refer to [Infrastructure-as-code on HPE GreenLake using Terraform](https://developer.hpe.com/blog/infrastructure-as-code-on-hpe-greenlake-using-terraform/) for the details about HPE GreenLake Terraform provider and its usage.
4847

4948
```markdown
5049
$ cat main.tf
@@ -125,17 +124,17 @@ resource "helm_release" "grafana-dashboard" {
125124
}
126125
```
127126

128-
There a few things need to point out in above config file.
127+
There a few things I want to point out in above config file:
129128

130129
<style> li { font-size: 100%; line-height: 23px; max-width: none; } </style>
131130

132131
* In Grafana, the persistence by default is disabled. In case Grafana pod gets terminated for some reason, you will lose all your data. In production deployment, such as HPE GreenLake for Containers, this needs to be enabled, by setting *persistence.enabled* as *true*, to prevent any data lose.
133132
* In Prometheus, the *DaemonSet* deployment of the node exporter is trying to mount the *hostPath* volume to the container root “/”, which violates against one deployed OPA (Open Policy Agent) policy to the K8s cluster for FS mount protections. Therefore, the DaemonSet deployment will never be ready, keep showing the warning events as *Warning FailedCreate daemonset-controller Error creating: admission webhook "soft-validate.hpecp.hpe.com" denied the request: Hostpath ("/") referenced in volume is not valid for this namespace because of FS Mount protections.*. You need disable the *hostRootFsMount*, together with *hostNetwork* and *hostPID*, to comply with the security policy in the cluster.
134133
* Both Prometheus and Grafana services are deployed as *NodePort* service types. Those services will be automatically mapped to the gateway host with assigned ports for easy access.
135134

136-
#### Terraform run
135+
#### Initialize working directory
137136

138-
* terraform init
137+
With above main.tf file, the working directory can be initialized by running the following command:
139138

140139
````markdown
141140
$ terraform init
@@ -170,8 +169,10 @@ There a few things need to point out in above config file.
170169
commands will detect it and remind you to do so if necessary.
171170
```
172171

173-
* terraform plan
174-
172+
#### Initialize working directoryDeploy
173+
174+
Apply the Terraform configuration and deploy Prometheus and Grafana to the K8s cluster by responingd _yes_ at the prompt to confirm the operation.
175+
175176
```markdown
176177
$ terraform plan --var-file=../tfvar_files/variables.tfvars
177178

0 commit comments

Comments
 (0)