feat(loki): Add volume backup through Longhorn

This commit is contained in:
Tanguy Herbron 2023-07-29 09:39:18 +02:00
parent d84d06d1f5
commit a51063e828
3 changed files with 22 additions and 0 deletions

View File

@ -12,6 +12,10 @@ spec:
labels:
app: loki
spec:
securityContext:
runAsNonRoot: true
fsGroup: 2000
runAsUser: 1000
containers:
- name: loki
image: grafana/loki:2.8.2
@ -19,10 +23,15 @@ spec:
ports:
- containerPort: 3100
volumeMounts:
- name: loki-pv
mountPath: /loki
- name: loki-config-volume
mountPath: /mnt/config/loki-config.yaml
subPath: loki-config.yaml
volumes:
- name: loki-pv
persistentVolumeClaim:
claimName: loki-pvc
- name: loki-config-volume
configMap:
name: loki-config

View File

@ -2,6 +2,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- pvc.yaml
- configmap.yaml
- service.yaml
- deployment.yaml

12
manifests/loki/pvc.yaml Normal file
View File

@ -0,0 +1,12 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: loki-pvc
namespace: monitoring
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
storageClassName: flat-storage-class