Skip to content

Commit

Permalink
Update prometheus.md
Browse files Browse the repository at this point in the history
  • Loading branch information
RishiKumarRay authored Dec 13, 2021
1 parent fc94013 commit 2e99573
Showing 1 changed file with 38 additions and 7 deletions.
45 changes: 38 additions & 7 deletions resources/prometheus.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,31 @@ now to run as side car container we will just use its image and specify the port
ports:
- containerPort: 9108
args: ['-es.uri=http://localhost:9200']
```
```

Now we will also create a config file for Prometheus:

![image-20211213175431699](/home/knoldus/.config/Typora/typora-user-images/image-20211213175431699.png)
```
apiVersion: v1
data:
prometheus.yml: |-
global:
scrape_interval: 15s
evaluation_interval: 15s
scrape_configs:
- job_name: "prometheus"
static_configs:
- targets: ["localhost:9090"]
- job_name: "exporter"
static_configs:
- targets: ["elasticsearch:9108"]
kind: ConfigMap
metadata:
name: pr-conf
namespace: elk
```


Here make sure you either write your own namespace or create this elk namespace before running.

Now next we will write a deployment file for Prometheus.
Expand All @@ -38,7 +55,21 @@ Now next we will write a deployment file for Prometheus.
​ Now we will create a service file for nodePort , so that we can access it through our browser through our <node-ip>:<node-port>

![image-20211213175056154](/home/knoldus/.config/Typora/typora-user-images/image-20211213175056154.png)
```
apiVersion: v1
kind: Service
metadata:
name: prometheus
namespace: elk
spec:
selector:
app: pr
type: NodePort
ports:
- port: 9090
targetPort: 9090
nodePort: 32200
```
Now we will be able to access the prometheus on 32200 which is our nodePort so start all the services one by one and you're good to go and also we can use Grafana for visualisation too along with prometheus.

0 comments on commit 2e99573

Please sign in to comment.