Skip to content

Commit 71908dc

Browse files
committed
doc: 📝 test and update outputs in doc
1 parent c4ccb20 commit 71908dc

File tree

7 files changed

+201
-286
lines changed

7 files changed

+201
-286
lines changed

pages/platform/kubernetes-k8s/monitoring-apps-grafana-prometheus/guide.en-asia.md

Lines changed: 30 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ slug: monitoring-apps-prometheus-grafana
44
excerpt: 'Find out how to monitor and visualize metrics with Prometheus and Grafana on an OVHcloud Managed Kubernetes Service'
55
section: Monitoring & Observability
66
order: 00
7-
updated: 2023-03-16
7+
updated: 2023-03-17
88
---
99

1010
<style>
@@ -29,7 +29,7 @@ updated: 2023-03-16
2929
}
3030
</style>
3131

32-
**Last updated March 16, 2023.**
32+
**Last updated March 17, 2023.**
3333

3434
## Objective
3535

@@ -83,39 +83,25 @@ Hang tight while we grab the latest from your chart repositories...
8383
Update Complete. ⎈Happy Helming!⎈
8484
</code></pre>
8585

86-
You need to modify some settings. To do this, inspect the chart to retrieve these values ​​in a file:
86+
To install the Prometheus Operator Helm chart in your OVHcloud Managed Kubernetes cluster, you need to customize some values.
87+
To do this, you can set parameters on the command line (`--set param.name=value`) or create a local file based on the values from the chart and pass it on the command line (`--values /tmp/kube-prometheus-stack.values`).
88+
For this tutorial we choosed the first method.
8789

88-
```bash
89-
helm inspect values prometheus-community/kube-prometheus-stack > /tmp/kube-prometheus-stack.values
90-
```
91-
92-
Open the `/tmp/kube-prometheus-stack.values` file in your favorite editor.
93-
94-
Then search into it for `adminPassword` and replace it with the password you want to use for Grafana.
95-
96-
By default, the Grafana password should be like this:
97-
98-
```yaml
99-
adminPassword: prom-operator
100-
```
101-
102-
Copy and save the Grafana admin password, you will use it later in this tutorial.
103-
104-
You are now ready to install Prometheus and Grafana.
90+
To install Prometheus and Grafana:
10591

10692
```bash
10793
helm install prometheus-community/kube-prometheus-stack \
10894
--create-namespace --namespace prometheus \
10995
--generate-name \
110-
--values /tmp/kube-prometheus-stack.values \
11196
--set prometheus.service.type=LoadBalancer \
11297
--set prometheus.prometheusSpec.serviceMonitorSelectorNilUsesHelmValues=false \
113-
--set grafana.service.type=LoadBalancer
98+
--set grafana.service.type=LoadBalancer \
99+
--set grafana.adminpassword=<my cool password>
114100
```
115101

116102
> [!primary]
117103
>
118-
> You can install only prometheus without Grafana by setting the following property to false: `--set grafana.enabled=false`
104+
> You can install only Prometheus without Grafana by setting the following property to false: `--set grafana.enabled=false`
119105
>
120106
121107
As you can see, a new `prometheus` namespace will be created and we specified that we want to deploy a LoadBalancer in order to access externally to Prometheus and Grafana easily.
@@ -128,44 +114,44 @@ You should have a behavior like this:
128114
--values /tmp/kube-prometheus-stack.values \
129115
--set prometheus.service.type=LoadBalancer \
130116
--set prometheus.prometheusSpec.serviceMonitorSelectorNilUsesHelmValues=false \
131-
--set grafana.service.type=LoadBalancer
132-
NAME: kube-prometheus-stack-1647417678
133-
LAST DEPLOYED: Wed Mar 16 09:01:23 2022
117+
--set grafana.service.type=LoadBalancer \
118+
--set grafana.adminpassword=myawesomepassword
119+
120+
NAME: kube-prometheus-stack-1679042344
121+
LAST DEPLOYED: Fri Mar 17 09:39:16 2023
134122
NAMESPACE: prometheus
135123
STATUS: deployed
136124
REVISION: 1
137125
NOTES:
138126
kube-prometheus-stack has been installed. Check its status by running:
139-
kubectl --namespace prometheus get pods -l "release=kube-prometheus-stack-1647417678"
127+
kubectl --namespace prometheus get pods -l "release=kube-prometheus-stack-1679042344"
140128

141129
Visit https://github.com/prometheus-operator/kube-prometheus for instructions on how to create & configure Alertmanager and Prometheus instances using the Operator.
142130
</code></pre>
143131

144132
You can also verify by checking the Pods in the new `prometheus` namespace:
145133

146134
<pre class="console"><code>$ kubectl get pods -n prometheus
147-
NAME READY STATUS RESTARTS AGE
148-
alertmanager-kube-prometheus-stack-1647-alertmanager-0 2/2 Running 0 14m
149-
kube-prometheus-stack-1647-operator-57b69b9667-d92sc 1/1 Running 0 14m
150-
kube-prometheus-stack-1647417678-grafana-695574b948-znqsd 3/3 Running 0 14m
151-
kube-prometheus-stack-1647417678-kube-state-metrics-6d4bc49pqlc 1/1 Running 0 14m
152-
kube-prometheus-stack-1647417678-prometheus-node-exporter-gxphr 1/1 Running 0 14m
153-
kube-prometheus-stack-1647417678-prometheus-node-exporter-jdtr6 1/1 Running 0 14m
154-
kube-prometheus-stack-1647417678-prometheus-node-exporter-xkqt2 1/1 Running 0 14m
155-
prometheus-kube-prometheus-stack-1647-prometheus-0 2/2 Running 0 14m
135+
NAME READY STATUS RESTARTS AGE
136+
alertmanager-kube-prometheus-stack-1679-alertmanager-0 2/2 Running 0 3m3s
137+
kube-prometheus-stack-1679-operator-9fdc894c9-frqc6 1/1 Running 0 3m12s
138+
kube-prometheus-stack-1679042344-grafana-86c64879cf-gqqkh 3/3 Running 0 3m12s
139+
kube-prometheus-stack-1679042344-kube-state-metrics-754cc98m2gh 1/1 Running 0 3m12s
140+
kube-prometheus-stack-1679042344-prometheus-node-exporter-2r8mc 1/1 Running 0 3m12s
141+
prometheus-kube-prometheus-stack-1679-prometheus-0 2/2 Running 0 3m2s
156142
</code></pre>
157143

158144
You can also check that `Prometheus` and `Grafana` have an external IP:
159145

160146
<pre class="console"><code>$ kubectl get svc -n prometheus
161147
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
162148
alertmanager-operated ClusterIP None <none> 9093/TCP,9094/TCP,9094/UDP 15m
163-
kube-prometheus-stack-1647-alertmanager ClusterIP 10.3.14.89 <none> 9093/TCP 15m
164-
kube-prometheus-stack-1647-operator ClusterIP 10.3.176.201 <none> 443/TCP 15m
165-
kube-prometheus-stack-1647-prometheus LoadBalancer 10.3.105.242 51.210.210.213 9090:31819/TCP 15m
166-
kube-prometheus-stack-1647417678-grafana LoadBalancer 10.3.28.111 51.210.253.47 80:32481/TCP 15m
167-
kube-prometheus-stack-1647417678-kube-state-metrics ClusterIP 10.3.235.254 <none> 8080/TCP 15m
168-
kube-prometheus-stack-1647417678-prometheus-node-exporter ClusterIP 10.3.237.94 <none> 9100/TCP 15m
149+
kube-prometheus-stack-1647-alertmanager ClusterIP ZZ.Z.ZZ.ZZ <none> 9093/TCP 15m
150+
kube-prometheus-stack-1647-operator ClusterIP ZZ.Z.ZZZ.ZZZ <none> 443/TCP 15m
151+
kube-prometheus-stack-1647-prometheus LoadBalancer ZZ.Z.ZZZ.ZZZ XX.XXX.XXX.XXX 9090:31819/TCP 15m
152+
kube-prometheus-stack-1647417678-grafana LoadBalancer ZZ.Z.ZZ.ZZZ YY.YYY.YYY.YY 80:32481/TCP 15m
153+
kube-prometheus-stack-1647417678-kube-state-metrics ClusterIP ZZ.Z.ZZZ.ZZZ <none> 8080/TCP 15m
154+
kube-prometheus-stack-1647417678-prometheus-node-exporter ClusterIP ZZ.Z.ZZZ.ZZ <none> 9100/TCP 15m
169155
prometheus-operated ClusterIP None <none> 9090/TCP 14m
170156
</code></pre>
171157

@@ -190,12 +176,12 @@ You should obtain the following result:
190176
<pre class="console"><code>$ export PROMETHEUS_URL=$(kubectl get svc -n prometheus -l app=kube-prometheus-stack-prometheus -o jsonpath='{.items[].status.loadBalancer.ingress[].ip}')
191177

192178
$ echo Prometheus URL: http://$PROMETHEUS_URL:9090
193-
Prometheus URL: http://152.228.168.191:9090
179+
Prometheus URL: http://XX.XXX.XXX.XXX:9090
194180

195181
$ export GRAFANA_URL=$(kubectl get svc -n prometheus -l app.kubernetes.io/name=grafana -o jsonpath='{.items[].status.loadBalancer.ingress[].ip}')
196182

197183
$ echo Grafana URL: http://$GRAFANA_URL
198-
Grafana URL: http://51.178.69.167
184+
Grafana URL: http://YY.YYY.YYY.YY
199185
</code></pre>
200186

201187
Open your browser and go to the Prometheus interface.

pages/platform/kubernetes-k8s/monitoring-apps-grafana-prometheus/guide.en-au.md

Lines changed: 30 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ slug: monitoring-apps-prometheus-grafana
44
excerpt: 'Find out how to monitor and visualize metrics with Prometheus and Grafana on an OVHcloud Managed Kubernetes Service'
55
section: Monitoring & Observability
66
order: 00
7-
updated: 2023-03-16
7+
updated: 2023-03-17
88
---
99

1010
<style>
@@ -29,7 +29,7 @@ updated: 2023-03-16
2929
}
3030
</style>
3131

32-
**Last updated March 16, 2023.**
32+
**Last updated March 17, 2023.**
3333

3434
## Objective
3535

@@ -83,39 +83,25 @@ Hang tight while we grab the latest from your chart repositories...
8383
Update Complete. ⎈Happy Helming!⎈
8484
</code></pre>
8585

86-
You need to modify some settings. To do this, inspect the chart to retrieve these values ​​in a file:
86+
To install the Prometheus Operator Helm chart in your OVHcloud Managed Kubernetes cluster, you need to customize some values.
87+
To do this, you can set parameters on the command line (`--set param.name=value`) or create a local file based on the values from the chart and pass it on the command line (`--values /tmp/kube-prometheus-stack.values`).
88+
For this tutorial we choosed the first method.
8789

88-
```bash
89-
helm inspect values prometheus-community/kube-prometheus-stack > /tmp/kube-prometheus-stack.values
90-
```
91-
92-
Open the `/tmp/kube-prometheus-stack.values` file in your favorite editor.
93-
94-
Then search into it for `adminPassword` and replace it with the password you want to use for Grafana.
95-
96-
By default, the Grafana password should be like this:
97-
98-
```yaml
99-
adminPassword: prom-operator
100-
```
101-
102-
Copy and save the Grafana admin password, you will use it later in this tutorial.
103-
104-
You are now ready to install Prometheus and Grafana.
90+
To install Prometheus and Grafana:
10591

10692
```bash
10793
helm install prometheus-community/kube-prometheus-stack \
10894
--create-namespace --namespace prometheus \
10995
--generate-name \
110-
--values /tmp/kube-prometheus-stack.values \
11196
--set prometheus.service.type=LoadBalancer \
11297
--set prometheus.prometheusSpec.serviceMonitorSelectorNilUsesHelmValues=false \
113-
--set grafana.service.type=LoadBalancer
98+
--set grafana.service.type=LoadBalancer \
99+
--set grafana.adminpassword=<my cool password>
114100
```
115101

116102
> [!primary]
117103
>
118-
> You can install only prometheus without Grafana by setting the following property to false: `--set grafana.enabled=false`
104+
> You can install only Prometheus without Grafana by setting the following property to false: `--set grafana.enabled=false`
119105
>
120106
121107
As you can see, a new `prometheus` namespace will be created and we specified that we want to deploy a LoadBalancer in order to access externally to Prometheus and Grafana easily.
@@ -128,44 +114,44 @@ You should have a behavior like this:
128114
--values /tmp/kube-prometheus-stack.values \
129115
--set prometheus.service.type=LoadBalancer \
130116
--set prometheus.prometheusSpec.serviceMonitorSelectorNilUsesHelmValues=false \
131-
--set grafana.service.type=LoadBalancer
132-
NAME: kube-prometheus-stack-1647417678
133-
LAST DEPLOYED: Wed Mar 16 09:01:23 2022
117+
--set grafana.service.type=LoadBalancer \
118+
--set grafana.adminpassword=myawesomepassword
119+
120+
NAME: kube-prometheus-stack-1679042344
121+
LAST DEPLOYED: Fri Mar 17 09:39:16 2023
134122
NAMESPACE: prometheus
135123
STATUS: deployed
136124
REVISION: 1
137125
NOTES:
138126
kube-prometheus-stack has been installed. Check its status by running:
139-
kubectl --namespace prometheus get pods -l "release=kube-prometheus-stack-1647417678"
127+
kubectl --namespace prometheus get pods -l "release=kube-prometheus-stack-1679042344"
140128

141129
Visit https://github.com/prometheus-operator/kube-prometheus for instructions on how to create & configure Alertmanager and Prometheus instances using the Operator.
142130
</code></pre>
143131

144132
You can also verify by checking the Pods in the new `prometheus` namespace:
145133

146134
<pre class="console"><code>$ kubectl get pods -n prometheus
147-
NAME READY STATUS RESTARTS AGE
148-
alertmanager-kube-prometheus-stack-1647-alertmanager-0 2/2 Running 0 14m
149-
kube-prometheus-stack-1647-operator-57b69b9667-d92sc 1/1 Running 0 14m
150-
kube-prometheus-stack-1647417678-grafana-695574b948-znqsd 3/3 Running 0 14m
151-
kube-prometheus-stack-1647417678-kube-state-metrics-6d4bc49pqlc 1/1 Running 0 14m
152-
kube-prometheus-stack-1647417678-prometheus-node-exporter-gxphr 1/1 Running 0 14m
153-
kube-prometheus-stack-1647417678-prometheus-node-exporter-jdtr6 1/1 Running 0 14m
154-
kube-prometheus-stack-1647417678-prometheus-node-exporter-xkqt2 1/1 Running 0 14m
155-
prometheus-kube-prometheus-stack-1647-prometheus-0 2/2 Running 0 14m
135+
NAME READY STATUS RESTARTS AGE
136+
alertmanager-kube-prometheus-stack-1679-alertmanager-0 2/2 Running 0 3m3s
137+
kube-prometheus-stack-1679-operator-9fdc894c9-frqc6 1/1 Running 0 3m12s
138+
kube-prometheus-stack-1679042344-grafana-86c64879cf-gqqkh 3/3 Running 0 3m12s
139+
kube-prometheus-stack-1679042344-kube-state-metrics-754cc98m2gh 1/1 Running 0 3m12s
140+
kube-prometheus-stack-1679042344-prometheus-node-exporter-2r8mc 1/1 Running 0 3m12s
141+
prometheus-kube-prometheus-stack-1679-prometheus-0 2/2 Running 0 3m2s
156142
</code></pre>
157143

158144
You can also check that `Prometheus` and `Grafana` have an external IP:
159145

160146
<pre class="console"><code>$ kubectl get svc -n prometheus
161147
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
162148
alertmanager-operated ClusterIP None <none> 9093/TCP,9094/TCP,9094/UDP 15m
163-
kube-prometheus-stack-1647-alertmanager ClusterIP 10.3.14.89 <none> 9093/TCP 15m
164-
kube-prometheus-stack-1647-operator ClusterIP 10.3.176.201 <none> 443/TCP 15m
165-
kube-prometheus-stack-1647-prometheus LoadBalancer 10.3.105.242 51.210.210.213 9090:31819/TCP 15m
166-
kube-prometheus-stack-1647417678-grafana LoadBalancer 10.3.28.111 51.210.253.47 80:32481/TCP 15m
167-
kube-prometheus-stack-1647417678-kube-state-metrics ClusterIP 10.3.235.254 <none> 8080/TCP 15m
168-
kube-prometheus-stack-1647417678-prometheus-node-exporter ClusterIP 10.3.237.94 <none> 9100/TCP 15m
149+
kube-prometheus-stack-1647-alertmanager ClusterIP ZZ.Z.ZZ.ZZ <none> 9093/TCP 15m
150+
kube-prometheus-stack-1647-operator ClusterIP ZZ.Z.ZZZ.ZZZ <none> 443/TCP 15m
151+
kube-prometheus-stack-1647-prometheus LoadBalancer ZZ.Z.ZZZ.ZZZ XX.XXX.XXX.XXX 9090:31819/TCP 15m
152+
kube-prometheus-stack-1647417678-grafana LoadBalancer ZZ.Z.ZZ.ZZZ YY.YYY.YYY.YY 80:32481/TCP 15m
153+
kube-prometheus-stack-1647417678-kube-state-metrics ClusterIP ZZ.Z.ZZZ.ZZZ <none> 8080/TCP 15m
154+
kube-prometheus-stack-1647417678-prometheus-node-exporter ClusterIP ZZ.Z.ZZZ.ZZ <none> 9100/TCP 15m
169155
prometheus-operated ClusterIP None <none> 9090/TCP 14m
170156
</code></pre>
171157

@@ -190,12 +176,12 @@ You should obtain the following result:
190176
<pre class="console"><code>$ export PROMETHEUS_URL=$(kubectl get svc -n prometheus -l app=kube-prometheus-stack-prometheus -o jsonpath='{.items[].status.loadBalancer.ingress[].ip}')
191177

192178
$ echo Prometheus URL: http://$PROMETHEUS_URL:9090
193-
Prometheus URL: http://152.228.168.191:9090
179+
Prometheus URL: http://XX.XXX.XXX.XXX:9090
194180

195181
$ export GRAFANA_URL=$(kubectl get svc -n prometheus -l app.kubernetes.io/name=grafana -o jsonpath='{.items[].status.loadBalancer.ingress[].ip}')
196182

197183
$ echo Grafana URL: http://$GRAFANA_URL
198-
Grafana URL: http://51.178.69.167
184+
Grafana URL: http://YY.YYY.YYY.YY
199185
</code></pre>
200186

201187
Open your browser and go to the Prometheus interface.

0 commit comments

Comments
 (0)