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 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166
| kind: PersistentVolumeClaim apiVersion: v1 metadata: name: redis-data namespace: stable-db spec: accessModes: - ReadWriteOnce resources: requests: storage: 10Gi storageClassName: standard-rwo volumeMode: Filesystem --- kind: ConfigMap apiVersion: v1 metadata: name: redis-config namespace: stable-db data: default.conf: |- bind 0.0.0.0 port 6379 tcp-backlog 511 timeout 0 tcp-keepalive 300 daemonize no supervised no pidfile "" loglevel notice logfile "" databases 16 always-show-logo yes save "" stop-writes-on-bgsave-error yes rdbcompression yes rdbchecksum yes dbfilename dump.rdb dir /data/redis maxclients 10000 # maxmemory maxmemory-policy noeviction maxmemory-samples 5 appendonly yes appendfilename appendonly.aof appendfsync everysec no-appendfsync-on-rewrite no auto-aof-rewrite-percentage 100 auto-aof-rewrite-min-size 64mb aof-load-truncated yes aof-use-rdb-preamble yes lua-time-limit 5000 slowlog-log-slower-than 10000 slowlog-max-len 128 notify-keyspace-events "" hash-max-ziplist-entries 512 hash-max-ziplist-value 64 list-max-ziplist-size -2 list-compress-depth 0 set-max-intset-entries 512 zset-max-ziplist-entries 128 zset-max-ziplist-value 64 hll-sparse-max-bytes 3000 stream-node-max-bytes 4096 stream-node-max-entries 100 activerehashing yes client-output-buffer-limit normal 0 0 0 client-output-buffer-limit replica 256mb 64mb 60 client-output-buffer-limit pubsub 32mb 8mb 60 client-query-buffer-limit 1gb proto-max-bulk-len 512mb hz 10 dynamic-hz yes aof-rewrite-incremental-fsync yes rdb-save-incremental-fsync yes # lfu-log-factor 10 # lfu-decay-time 1 requirepass <password> user.conf: |- # redis.conf appendonly yes --- kind: StatefulSet apiVersion: apps/v1 metadata: name: redis namespace: stable-db labels: app: redis spec: replicas: 1 selector: matchLabels: app: redis template: metadata: labels: app: redis spec: volumes: - name: redis-data persistentVolumeClaim: claimName: redis-data - name: redis-config configMap: name: redis-config defaultMode: 420 containers: - name: redis image: redis:6.0.9-alpine command: - /bin/sh - -c - | rm -rf /redis/data/lost+found args=" --include /conf/default.conf --include /conf/user.conf " redis-server $args ports: - name: redis containerPort: 6379 protocol: TCP resources: limits: cpu: "2" memory: 4Gi ephemeral-storage: 5Gi requests: cpu: "2" memory: 4Gi ephemeral-storage: 5Gi livenessProbe: tcpSocket: port: 6379 initialDelaySeconds: 10 timeoutSeconds: 1 periodSeconds: 10 successThreshold: 1 failureThreshold: 3 readinessProbe: tcpSocket: port: 6379 initialDelaySeconds: 10 timeoutSeconds: 1 periodSeconds: 10 successThreshold: 1 failureThreshold: 3 startupProbe: tcpSocket: port: 6379 initialDelaySeconds: 10 timeoutSeconds: 1 periodSeconds: 10 successThreshold: 1 failureThreshold: 3 volumeMounts: - name: redis-data mountPath: /data/redis - name: redis-config mountPath: /conf readOnly: true terminationMessagePath: /dev/termination-log terminationMessagePolicy: File imagePullPolicy: IfNotPresent
|