Repository navigation
Expand file tree
/
Copy pathredis.yaml
More file actions
65 lines (65 loc) · 1.77 KB
/
Copy pathredis.yaml
File metadata and controls
65 lines (65 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Rybbit のセッション追跡・ボット判定のカウンタ。上流の compose どおり noeviction + AOF。
# セッションの鍵は 30 分で消えるのでメモリは増え続けない。データは PVC を持たない(emptyDir)。
# 再起動で消えるのは進行中のセッションの継ぎ目だけで、集計(ClickHouse)には残っている。
apiVersion: v1
kind: Service
metadata:
name: redis
namespace: rybbit
spec:
selector:
app: redis
ports:
- name: redis
port: 6379
targetPort: 6379
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: redis
namespace: rybbit
annotations:
secrets.infisical.com/auto-reload: "true"
spec:
replicas: 1
selector:
matchLabels:
app: redis
template:
metadata:
labels:
app: redis
spec:
containers:
- name: redis
image: redis:8.10.2-alpine
ports:
- containerPort: 6379
env:
- name: REDIS_PASSWORD
valueFrom:
secretKeyRef:
name: rybbit
key: redis-password
command:
- /bin/sh
- -c
- exec redis-server --requirepass "$REDIS_PASSWORD" --appendonly yes --appendfsync everysec --maxmemory-policy noeviction
readinessProbe:
exec:
command: [/bin/sh, -c, 'redis-cli -a "$REDIS_PASSWORD" --no-auth-warning ping | grep -q PONG']
initialDelaySeconds: 5
periodSeconds: 10
resources:
requests:
cpu: 10m
memory: 32Mi
limits:
memory: 256Mi
volumeMounts:
- name: data
mountPath: /data
volumes:
- name: data
emptyDir: {}