OKR/prod-upgrade/redis/redis.yaml

88 lines
2.0 KiB
YAML
Raw Normal View History

2023-08-18 14:42:45 +08:00
---
apiVersion: apps/v1
2024-03-25 18:05:04 +08:00
kind: StatefulSet
2023-08-18 14:42:45 +08:00
metadata:
name: redis
labels:
app: redis
spec:
replicas: 1
2024-03-25 18:06:21 +08:00
serviceName: redis
2023-08-18 14:42:45 +08:00
selector:
matchLabels:
app: redis
template:
metadata:
labels:
app: redis
spec:
initContainers:
- name: init
image: busybox
imagePullPolicy: IfNotPresent
command: ["/bin/sh", "-c", "sysctl -w net.core.somaxconn=1024"]
securityContext:
privileged: true
containers:
- name: redis
image: redis/redis-stack-server:7.2.0-v0
2023-08-18 14:42:45 +08:00
ports:
- protocol: TCP
containerPort: 6379
env:
- name: "REDIS_ARGS"
value: "--requirepass beaconfire@123"
volumeMounts:
- name: redis
mountPath: /data
2023-08-18 14:42:45 +08:00
resources:
limits:
cpu: 1
memory: 2Gi
2023-08-18 14:42:45 +08:00
requests:
cpu: 100m
memory: 256Mi
2023-08-18 14:42:45 +08:00
livenessProbe:
tcpSocket:
port: 6379
initialDelaySeconds: 300
timeoutSeconds: 1
periodSeconds: 10
successThreshold: 1
failureThreshold: 3
readinessProbe:
tcpSocket:
port: 6379
initialDelaySeconds: 5
timeoutSeconds: 1
periodSeconds: 10
successThreshold: 1
failureThreshold: 3
volumes:
- name: redis
hostPath:
path: /data/prod/redis
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: "kubernetes.io/hostname"
operator: In
values:
- bfs-k8snode-10-2-2-8.hetzner.base.beaconfireinc.com
2023-08-18 14:42:45 +08:00
---
apiVersion: v1
kind: Service
metadata:
name: redis
spec:
ports:
- port: 6379
protocol: TCP
targetPort: 6379
selector:
app: redis
type: ClusterIP