From 582620b1669407eca6857afb72b1ea1d3bc5807d Mon Sep 17 00:00:00 2001 From: ycz008 Date: Mon, 10 Jul 2023 19:32:41 +0800 Subject: [PATCH] add redis --- dev-upgrade/redis/redis.yaml | 96 ++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 dev-upgrade/redis/redis.yaml diff --git a/dev-upgrade/redis/redis.yaml b/dev-upgrade/redis/redis.yaml new file mode 100644 index 0000000..0a626df --- /dev/null +++ b/dev-upgrade/redis/redis.yaml @@ -0,0 +1,96 @@ +--- +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 +kind: Deployment +metadata: + name: redis + labels: + app: redis +spec: + replicas: 1 + 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:6.2.12 + command: + - "sh" + - "-c" + - "redis-server /usr/local/redis/redis.conf" + ports: + - containerPort: 6379 + resources: + limits: + cpu: 1 + memory: 1Gi + requests: + cpu: 50m + memory: 128Mi + 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 + volumeMounts: + - name: config + mountPath: /usr/local/redis/redis.conf + subPath: redis.conf + volumes: + - name: config + configMap: + name: redis-config + +--- +apiVersion: v1 +kind: Service +metadata: + name: redis +spec: + ports: + - port: 6379 + protocol: TCP + targetPort: 6379 + nodePort: 30015 + selector: + app: redis + type: NodePort