75 lines
1.8 KiB
YAML
75 lines
1.8 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: prometheus
|
|
namespace: default
|
|
labels:
|
|
app: prometheus
|
|
spec:
|
|
replicas: 1
|
|
strategy:
|
|
type: Recreate
|
|
selector:
|
|
matchLabels:
|
|
app: prometheus
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: prometheus
|
|
spec:
|
|
serviceAccountName: prometheus
|
|
nodeSelector:
|
|
node-role.kubernetes.io/control-plane: "true"
|
|
containers:
|
|
- name: prometheus
|
|
image: registry.t-aaron.com/prom/prometheus:latest
|
|
ports:
|
|
- containerPort: 9090
|
|
args:
|
|
- "--config.file=/etc/prometheus/prometheus.yml"
|
|
- "--storage.tsdb.path=/prometheus/"
|
|
- "--web.console.libraries=/etc/prometheus/console_libraries"
|
|
- "--web.console.templates=/etc/prometheus/consoles"
|
|
- "--storage.tsdb.retention.time=200h"
|
|
- "--web.enable-lifecycle"
|
|
resources:
|
|
requests:
|
|
memory: "512Mi"
|
|
cpu: "500m"
|
|
limits:
|
|
memory: "1Gi"
|
|
cpu: "1000m"
|
|
volumeMounts:
|
|
- name: prometheus-config
|
|
mountPath: /etc/prometheus/
|
|
- name: prometheus-rules
|
|
mountPath: /etc/prometheus/rules/
|
|
- name: prometheus-storage
|
|
mountPath: /prometheus/
|
|
volumes:
|
|
- name: prometheus-config
|
|
configMap:
|
|
name: prometheus-config
|
|
- name: prometheus-rules
|
|
configMap:
|
|
name: prometheus-rules
|
|
- name: prometheus-storage
|
|
hostPath:
|
|
path: /opt/prometheus/data
|
|
type: DirectoryOrCreate
|
|
---
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: prometheus-service
|
|
namespace: default
|
|
spec:
|
|
selector:
|
|
app: prometheus
|
|
ports:
|
|
- name: http
|
|
port: 9090
|
|
targetPort: 9090
|
|
type: ClusterIP
|