ConfigMap
apiVersion: v1
kind: ConfigMap
metadata:
name: prometheus-config-ems
data:
prometheus.yml: |-
global:
scrape_interval: 15s
evaluation_interval: 15s
scrape_configs:
- job_name: "emsservice"
static_configs:
- targets:
- "192.165.25.160:9182"
- "192.165.25.161:9182"
- "192.165.25.162:9182"
- "192.165.25.163:9182"
- "192.165.25.164:9182"
- "192.165.25.165:9182"
- "192.165.25.166:9182"
- "192.165.25.167:9182"
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: promems-deployment
spec:
replicas: 1
selector:
matchLabels:
app: promems
template:
metadata:
labels:
app: promems
spec:
containers:
- name: promems
image: prom/prometheus
command:
- "/bin/prometheus"
args:
- "--config.file=/etc/prometheus/prometheus.yml"
ports:
- containerPort: 9090
protocol: TCP
volumeMounts:
- name: promems
mountPath: /etc/prometheus
volumes:
- name: promems
configMap:
name: prometheus-config-ems
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
Service
kind: Service
apiVersion: v1
metadata:
labels:
app:
name: ems-service
namespace: default
spec:
type: NodePort
ports:
- name: http
port: 9090
targetPort: 9090
protocol: TCP
nodePort: 31004
selector:
app: promems
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17