132 lines
3.1 KiB
YAML
132 lines
3.1 KiB
YAML
---
|
|
# Source: prometheus/templates/cm.yaml
|
|
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: prometheus-server
|
|
namespace: metrics
|
|
labels:
|
|
app.kubernetes.io/name: prometheus
|
|
data:
|
|
allow-snippet-annotations: "false"
|
|
prometheus.yml: |
|
|
global:
|
|
evaluation_interval: 1m
|
|
storage:
|
|
tsdb:
|
|
out_of_order_time_window: 30m
|
|
otlp:
|
|
translation_strategy: NoUTF8EscapingWithSuffixes
|
|
---
|
|
# Source: prometheus/templates/pvc.yaml
|
|
apiVersion: v1
|
|
kind: PersistentVolumeClaim
|
|
metadata:
|
|
labels:
|
|
app.kubernetes.io/name: prometheus
|
|
name: prometheus-server
|
|
namespace: metrics
|
|
spec:
|
|
accessModes:
|
|
- ReadWriteOnce
|
|
resources:
|
|
requests:
|
|
storage: "8Gi"
|
|
---
|
|
# Source: prometheus/templates/service.yaml
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: prometheus-server
|
|
namespace: metrics
|
|
labels:
|
|
app.kubernetes.io/name: prometheus
|
|
spec:
|
|
type: "ClusterIP"
|
|
sessionAffinity: None
|
|
ports:
|
|
- name: http
|
|
port: 9090
|
|
protocol: TCP
|
|
targetPort: 9090
|
|
selector:
|
|
app.kubernetes.io/name: prometheus
|
|
---
|
|
# Source: prometheus/templates/deploy.yaml
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: prometheus-server
|
|
namespace: metrics
|
|
labels:
|
|
app.kubernetes.io/name: prometheus
|
|
spec:
|
|
selector:
|
|
matchLabels:
|
|
app.kubernetes.io/name: prometheus
|
|
replicas: 1
|
|
revisionHistoryLimit: 10
|
|
strategy:
|
|
type: Recreate
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app.kubernetes.io/name: prometheus
|
|
spec:
|
|
securityContext:
|
|
runAsUser: 1000
|
|
runAsGroup: 1000
|
|
fsGroup: 1000
|
|
containers:
|
|
- name: prometheus-server
|
|
image: "quay.io/prometheus/prometheus:v3.2.1"
|
|
args:
|
|
- --storage.tsdb.retention.time=15d
|
|
- --config.file=/etc/config/prometheus.yml
|
|
- --storage.tsdb.path=/data
|
|
- --web.enable-lifecycle
|
|
- --web.enable-otlp-receiver
|
|
ports:
|
|
- containerPort: 9090
|
|
resources:
|
|
limits:
|
|
cpu: "500m"
|
|
memory: "256Mi"
|
|
requests:
|
|
cpu: "250m"
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /-/ready
|
|
port: 9090
|
|
scheme: HTTP
|
|
initialDelaySeconds: 30
|
|
periodSeconds: 5
|
|
timeoutSeconds: 4
|
|
failureThreshold: 3
|
|
successThreshold: 1
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /-/healthy
|
|
port: 9090
|
|
scheme: HTTP
|
|
initialDelaySeconds: 30
|
|
periodSeconds: 15
|
|
timeoutSeconds: 10
|
|
failureThreshold: 3
|
|
successThreshold: 1
|
|
volumeMounts:
|
|
- name: config-volume
|
|
mountPath: /etc/config
|
|
readOnly: true
|
|
- name: storage-volume
|
|
mountPath: /data
|
|
subPath: ""
|
|
dnsPolicy: ClusterFirst
|
|
terminationGracePeriodSeconds: 300
|
|
volumes:
|
|
- name: config-volume
|
|
configMap:
|
|
name: prometheus-server
|
|
- name: storage-volume
|
|
persistentVolumeClaim:
|
|
claimName: prometheus-server
|