Skip to content

Commit a791fa0

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

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

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

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ Before starting, make sure you meet the following requirements:
4141

4242
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.
4343

44+
#### Terraform config
45+
4446
Here is the terraform config file.
4547

4648
```markdown
@@ -128,9 +130,9 @@ There a few things need to point out in above config file.
128130

129131
* In both Prometheus and Grafana, the persistence by default is disabled. In case the Prometheus and Grafana pods get terminated for some reason, you will lose all your data. In production deployment, such as HPE GreenLake for Containers, this needs to be enabled to prevent any data lose, *persistence.enabled: true*
130132
* 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*.
131-
* Both Prometheus and Grafana services are deployed as *NodePort* service type. Those services will be automatically mapped to the gateway host with assigned ports to easy their access
133+
* Both Prometheus and Grafana services are deployed as *NodePort* service type. Those services will be automatically mapped to the gateway host with assigned ports for easy acces
132134

133-
#### Run Terraform
135+
#### Terraform run
134136

135137
* terraform init
136138

@@ -408,9 +410,14 @@ There a few things need to point out in above config file.
408410

409411
Apply complete! Resources: 2 added, 0 changed, 0 destroyed.
410412
````
413+
#### Prometheus and Grafana access
414+
415+
After few minutes Terraform run, both Prometheus and Grafana get deployed in the K8s cluster, to its _monitoring_ namespace.
416+
417+
Type the following command to check all the deployed monitoring resources. They should be all in _Running_ and _Ready_ states.
411418

412419
```markdown
413-
$ k get all -n monitoring
420+
$ kubectl get all -n monitoring
414421
NAME READY STATUS RESTARTS AGE
415422
pod/grafana-dashboard-5674bcd6d4-zh8zk 1/1 Running 0 4d17h
416423
pod/prometheus-stack-alertmanager-0 1/1 Running 0 4d17h
@@ -448,6 +455,8 @@ NAME READY AGE
448455
statefulset.apps/prometheus-stack-alertmanager 1/1 4d17h
449456
```
450457

458+
Type _helm list_ command, both Prometheus and Grafana helm charts are deployed to the _monitoring_ namespace:
459+
451460
```markdown
452461
$ helm list -n monitoring
453462
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION

0 commit comments

Comments
 (0)