update redis

main
ycz008 2023-11-06 11:36:11 +08:00
parent 5765f19311
commit e0ea65c6b2
1 changed files with 23 additions and 32 deletions

View File

@ -1,20 +1,3 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
name: redis-config
labels:
app: redis
data:
redis.conf: |-
dir /srv
port 6379
bind 0.0.0.0
appendonly yes
daemonize no
requirepass beaconfire1qaz@WSX
pidfile /srv/redis-6379.pid
--- ---
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
@ -26,7 +9,7 @@ spec:
replicas: 1 replicas: 1
selector: selector:
matchLabels: matchLabels:
app: redis app: redisx
template: template:
metadata: metadata:
labels: labels:
@ -41,13 +24,16 @@ spec:
privileged: true privileged: true
containers: containers:
- name: redis - name: redis
image: redis:6.2.12 image: redis/redis-stack-server:7.2.0-v0
command:
- "sh"
- "-c"
- "redis-server /usr/local/redis/redis.conf"
ports: ports:
- containerPort: 6379 - protocol: TCP
containerPort: 6379
env:
- name: "REDIS_ARGS"
value: "--requirepass beaconfire@123"
volumeMounts:
- name: tcs-redis
mountPath: /data
resources: resources:
limits: limits:
cpu: 1 cpu: 1
@ -71,14 +57,19 @@ spec:
periodSeconds: 10 periodSeconds: 10
successThreshold: 1 successThreshold: 1
failureThreshold: 3 failureThreshold: 3
volumeMounts:
- name: config
mountPath: /usr/local/redis/redis.conf
subPath: redis.conf
volumes: volumes:
- name: config - name: tcs-redis
configMap: hostPath:
name: redis-config path: /data/tcs/redis
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: "kubernetes.io/hostname"
operator: In
values:
- bfs-k8snode-10-2-1-5.hetzner.base.beaconfireinc.com
--- ---
apiVersion: v1 apiVersion: v1
@ -92,5 +83,5 @@ spec:
targetPort: 6379 targetPort: 6379
nodePort: 30015 nodePort: 30015
selector: selector:
app: redis app: redis-stack
type: NodePort type: NodePort