k8s/prometheus/prometheus-deploy.yaml
pengtao 92adf00e40 3
2022-05-04 14:47:05 +08:00

55 lines
1.2 KiB
YAML

apiVersion: v1
kind: "Service"
metadata:
name: prometheus
namespace: prometheus
labels:
name: prometheus
spec:
ports:
- name: prometheus
protocol: TCP
port: 9090
targetPort: 9090
selector:
name: prometheus
type: NodePort
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
name: prometheus
name: prometheus
namespace: prometheus
spec:
replicas: 1
selector:
matchLabels:
name: prometheus
template:
metadata:
labels:
name: prometheus
spec:
containers:
- name: prometheus
image: prom/prometheus:v2.35.0
command:
- "/bin/prometheus"
args:
- "--config.file=/etc/prometheus/prometheus.yml"
ports:
- containerPort: 9090
protocol: TCP
volumeMounts:
- mountPath: "/etc/prometheus"
name: prometheus-config
volumes:
- name: prometheus-config
configMap:
name: prometheus-config
serviceAccountName: prometheus
serviceAccount: prometheus
#https://www.acagroup.be/en/blog/auto-discovery-of-kubernetes-endpoint-services-prometheus/s