Skip to content

Instantly share code, notes, and snippets.

@pavanbelagatti
Created August 22, 2023 07:29
Show Gist options
  • Save pavanbelagatti/cd5d0649635e2786b31cfefef3ca56fe to your computer and use it in GitHub Desktop.
Save pavanbelagatti/cd5d0649635e2786b31cfefef3ca56fe to your computer and use it in GitHub Desktop.
prometheus config file
apiVersion: v1
kind: ConfigMap
metadata:
name: prometheus-config
data:
prometheus.yml: |
global:
scrape_interval: 15s
scrape_configs:
- job_name: 'nodejs-app'
static_configs:
- targets: ['nodejs-app:3000']
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: prometheus-deployment
spec:
replicas: 1
selector:
matchLabels:
app: prometheus
template:
metadata:
labels:
app: prometheus
spec:
containers:
- name: prometheus
image: prom/prometheus:v2.30.0
args:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
ports:
- containerPort: 9090
volumeMounts:
- name: prometheus-config-volume
mountPath: /etc/prometheus/
- name: prometheus-storage-volume
mountPath: /prometheus
volumes:
- name: prometheus-config-volume
configMap:
name: prometheus-config
- name: prometheus-storage-volume
emptyDir: {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment