add infra app prometheus
This commit is contained in:
87
infrastructures/prometheus/env/k3s-cluster/deployment.yaml
vendored
Normal file
87
infrastructures/prometheus/env/k3s-cluster/deployment.yaml
vendored
Normal file
@@ -0,0 +1,87 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: prometheus
|
||||
namespace: prometheus
|
||||
labels:
|
||||
app: prometheus
|
||||
spec:
|
||||
strategy:
|
||||
rollingUpdate: null
|
||||
type: Recreate
|
||||
selector:
|
||||
matchLabels:
|
||||
app: prometheus
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: prometheus
|
||||
spec:
|
||||
securityContext:
|
||||
runAsUser: 0
|
||||
runAsGroup: 0
|
||||
containers:
|
||||
- name: prometheus
|
||||
image: prom/prometheus:v2.53.0
|
||||
args:
|
||||
- "--storage.tsdb.retention.time=14d"
|
||||
- "--config.file=/etc/prometheus/prometheus.yaml"
|
||||
- "--storage.tsdb.path=/prometheus/"
|
||||
ports:
|
||||
- containerPort: 9090
|
||||
resources:
|
||||
requests:
|
||||
cpu: 500m
|
||||
memory: 500M
|
||||
limits:
|
||||
cpu: "1"
|
||||
memory: 2Gi
|
||||
volumeMounts:
|
||||
- name: prometheus-config-volume
|
||||
mountPath: /etc/prometheus/
|
||||
- name: prometheus-storage-volume
|
||||
mountPath: /prometheus/
|
||||
- name: grafana
|
||||
image: grafana/grafana:11.0.1
|
||||
ports:
|
||||
- containerPort: 3000
|
||||
volumeMounts:
|
||||
- name: grafana-config-volume
|
||||
mountPath: /etc/grafana
|
||||
- name: grafana-data-volume
|
||||
mountPath: /var/lib/grafana
|
||||
- name: grafana-logs-volume
|
||||
mountPath: /var/log/grafana
|
||||
- name: grafana-plugins-volume
|
||||
mountPath: /var/lib/grafana/plugins
|
||||
- name: grafana-provisioning-volume
|
||||
mountPath: /etc/grafana/provisioning
|
||||
volumes:
|
||||
- name: prometheus-config-volume
|
||||
hostPath:
|
||||
path: /mnt/nfs/AppData/prometheus/conf
|
||||
type: Directory
|
||||
- name: prometheus-storage-volume
|
||||
hostPath:
|
||||
path: /mnt/nfs/AppData/prometheus/storage
|
||||
type: Directory
|
||||
- name: grafana-config-volume
|
||||
hostPath:
|
||||
path: /mnt/nfs/AppData/grafana/config
|
||||
type: Directory
|
||||
- name: grafana-data-volume
|
||||
hostPath:
|
||||
path: /mnt/nfs/AppData/grafana/data
|
||||
type: Directory
|
||||
- name: grafana-logs-volume
|
||||
hostPath:
|
||||
path: /mnt/nfs/AppData/grafana/logs
|
||||
type: Directory
|
||||
- name: grafana-plugins-volume
|
||||
hostPath:
|
||||
path: /mnt/nfs/AppData/grafana/plugins
|
||||
type: Directory
|
||||
- name: grafana-provisioning-volume
|
||||
hostPath:
|
||||
path: /mnt/nfs/AppData/grafana/provisioning
|
||||
type: Directory
|
||||
Reference in New Issue
Block a user