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

View File

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