46 lines
1.0 KiB
YAML
46 lines
1.0 KiB
YAML
|
|
apiVersion: apps/v1
|
|||
|
|
kind: Deployment
|
|||
|
|
metadata:
|
|||
|
|
name: loki
|
|||
|
|
namespace: default
|
|||
|
|
spec:
|
|||
|
|
replicas: 1
|
|||
|
|
selector:
|
|||
|
|
matchLabels:
|
|||
|
|
app: loki
|
|||
|
|
template:
|
|||
|
|
metadata:
|
|||
|
|
labels:
|
|||
|
|
app: loki
|
|||
|
|
spec:
|
|||
|
|
securityContext:
|
|||
|
|
fsGroup: 10001 # 使 PVC 挂载目录对 Loki 默认用户(UID 10001)可写
|
|||
|
|
runAsUser: 10001
|
|||
|
|
runAsGroup: 10001
|
|||
|
|
containers:
|
|||
|
|
- name: loki
|
|||
|
|
image: grafana/loki:2.9.4
|
|||
|
|
args:
|
|||
|
|
- -config.file=/etc/loki/loki.yaml
|
|||
|
|
ports:
|
|||
|
|
- containerPort: 3100
|
|||
|
|
volumeMounts:
|
|||
|
|
- name: config
|
|||
|
|
mountPath: /etc/loki
|
|||
|
|
- name: storage
|
|||
|
|
mountPath: /loki
|
|||
|
|
resources:
|
|||
|
|
limits:
|
|||
|
|
cpu: 500m
|
|||
|
|
memory: 512Mi
|
|||
|
|
requests:
|
|||
|
|
cpu: 100m
|
|||
|
|
memory: 128Mi
|
|||
|
|
volumes:
|
|||
|
|
- name: config
|
|||
|
|
configMap:
|
|||
|
|
name: loki-config
|
|||
|
|
- name: storage
|
|||
|
|
persistentVolumeClaim:
|
|||
|
|
claimName: loki-pvc
|