You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/blog/kubernetes-monitoring-using-prometheus-and-grafana-in-hpe-greenlake-for-private-cloud-enterprise.md
+11-10Lines changed: 11 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,14 +37,13 @@ Before starting, make sure you meet the following requirements:
37
37
38
38
[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.
39
39
40
-
### Deeploy Prometheus and Grafana using Terraform
40
+
### Deploy Prometheus and Grafana using Terraform
41
41
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).
42
43
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
44
45
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.
* 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.
133
132
* 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.
134
133
* 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.
135
134
136
-
#### Terraform run
135
+
#### Initialize working directory
137
136
138
-
* terraform init
137
+
With above main.tf file, the working directory can be initialized by running the following command:
139
138
140
139
````markdown
141
140
$ terraform init
@@ -170,8 +169,10 @@ There a few things need to point out in above config file.
170
169
commands will detect it and remind you to do so if necessary.
171
170
```
172
171
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
+
175
176
```markdown
176
177
$ terraform plan --var-file=../tfvar_files/variables.tfvars
0 commit comments