112 lines
2.1 KiB
YAML
112 lines
2.1 KiB
YAML
apiVersion: v1
|
|
kind: PersistentVolumeClaim
|
|
metadata:
|
|
name: loki-pvc
|
|
namespace: sysadmin
|
|
spec:
|
|
accessModes:
|
|
- ReadWriteOnce
|
|
storageClassName: longhorn
|
|
resources:
|
|
requests:
|
|
storage: 10Gi
|
|
limits:
|
|
storage: 10Gi
|
|
---
|
|
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: loki-configmap
|
|
namespace: sysadmin
|
|
data:
|
|
loki-config.yaml: |
|
|
auth_enabled: false
|
|
|
|
server:
|
|
http_listen_port: 3100
|
|
|
|
common:
|
|
instance_addr: 127.0.0.1
|
|
path_prefix: /loki
|
|
storage:
|
|
filesystem:
|
|
chunks_directory: /loki/chunks
|
|
rules_directory: /loki/rules
|
|
replication_factor: 1
|
|
ring:
|
|
kvstore:
|
|
store: inmemory
|
|
|
|
compactor:
|
|
retention_enabled: true
|
|
retention_delete_delay: 1h
|
|
retention_delete_worker_count: 150
|
|
|
|
limits_config:
|
|
retention_period: 1000h
|
|
|
|
schema_config:
|
|
configs:
|
|
- from: 2020-10-24
|
|
store: tsdb
|
|
object_store: filesystem
|
|
schema: v12
|
|
index:
|
|
prefix: index_
|
|
period: 24h
|
|
|
|
ruler:
|
|
alertmanager_url: http://localhost:9093
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: loki
|
|
namespace: sysadmin
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
ms: loki
|
|
template:
|
|
metadata:
|
|
labels:
|
|
ms: loki
|
|
spec:
|
|
containers:
|
|
- name: loki
|
|
image: grafana/loki:2.8.6
|
|
imagePullPolicy: IfNotPresent
|
|
args: ["-config.file=/etc/loki/config/loki-config.yaml"]
|
|
ports:
|
|
- containerPort: 3100
|
|
protocol: TCP
|
|
volumeMounts:
|
|
- mountPath: /loki
|
|
name: loki-pv
|
|
- name: config
|
|
mountPath: /etc/loki/config/
|
|
securityContext:
|
|
runAsUser: 1000
|
|
fsGroup: 2000
|
|
volumes:
|
|
- name: loki-pv
|
|
persistentVolumeClaim:
|
|
claimName: loki-pvc
|
|
- name: config
|
|
configMap:
|
|
name: loki-configmap
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: loki
|
|
namespace: sysadmin
|
|
spec:
|
|
type: NodePort
|
|
selector:
|
|
ms: loki
|
|
ports:
|
|
- port: 3100
|
|
targetPort: 3100
|