126 lines
2.5 KiB
YAML
126 lines
2.5 KiB
YAML
apiVersion: v1
|
|
kind: Namespace
|
|
metadata:
|
|
name: monitoring
|
|
---
|
|
apiVersion: v1
|
|
kind: PersistentVolumeClaim
|
|
metadata:
|
|
name: victoria-metrics-pvc
|
|
namespace: monitoring
|
|
spec:
|
|
accessModes:
|
|
- ReadWriteOnce
|
|
storageClassName: proxmox-csi-general
|
|
resources:
|
|
requests:
|
|
storage: 20Gi
|
|
---
|
|
apiVersion: v1
|
|
kind: PersistentVolumeClaim
|
|
metadata:
|
|
name: grafana-data-pvc
|
|
namespace: monitoring
|
|
spec:
|
|
accessModes:
|
|
- ReadWriteOnce
|
|
storageClassName: proxmox-csi-general
|
|
resources:
|
|
requests:
|
|
storage: 5Gi
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: victoriametrics
|
|
namespace: monitoring
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: victoriametrics
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: victoriametrics
|
|
spec:
|
|
containers:
|
|
- name: victoriametrics
|
|
image: victoriametrics/victoria-metrics:latest
|
|
args:
|
|
- -storageDataPath=/vmagent-data
|
|
- -retentionPeriod=1y
|
|
ports:
|
|
- containerPort: 8428
|
|
volumeMounts:
|
|
- name: victoria-metrics-data
|
|
mountPath: /vmagent-data
|
|
volumes:
|
|
- name: victoria-metrics-data
|
|
persistentVolumeClaim:
|
|
claimName: victoria-metrics-pvc
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: victoriametrics
|
|
namespace: monitoring
|
|
spec:
|
|
type: ClusterIP
|
|
ports:
|
|
- port: 8428
|
|
targetPort: 8428
|
|
selector:
|
|
app: victoriametrics
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: grafana
|
|
namespace: monitoring
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: grafana
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: grafana
|
|
spec:
|
|
securityContext:
|
|
fsGroup: 472
|
|
containers:
|
|
- name: grafana
|
|
image: grafana/grafana:latest
|
|
ports:
|
|
- containerPort: 3000
|
|
env:
|
|
- name: GF_SECURITY_ADMIN_USER
|
|
value: "admin"
|
|
- name: GF_SECURITY_ADMIN_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: grafana-credentials
|
|
key: GF_SECURITY_ADMIN_PASSWORD
|
|
volumeMounts:
|
|
- name: grafana-data
|
|
mountPath: /var/lib/grafana
|
|
volumes:
|
|
- name: grafana-data
|
|
persistentVolumeClaim:
|
|
claimName: grafana-data-pvc
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: grafana
|
|
namespace: monitoring
|
|
spec:
|
|
type: ClusterIP
|
|
ports:
|
|
- port: 3000
|
|
targetPort: 3000
|
|
selector:
|
|
app: grafana
|