Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make redis-stack-server more production ready #64

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/redis-stack-server/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.4.14
version: 0.4.15

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
54 changes: 0 additions & 54 deletions charts/redis-stack-server/templates/redis-stack-server.yaml

This file was deleted.

15 changes: 15 additions & 0 deletions charts/redis-stack-server/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: "{{ .Values.name }}"
namespace: {{ .Release.Namespace }}
labels:
app: "{{ .Values.name }}"
spec:
ports:
- port: {{ .Values.redis_stack_server.service.port }}
name: {{ .Values.name }}
type: {{ .Values.redis_stack_server.service.type }}
selector:
app: "{{ .Values.name }}"

66 changes: 66 additions & 0 deletions charts/redis-stack-server/templates/statefulset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: "{{ .Values.name }}"
spec:
selector:
matchLabels:
app: "{{ .Values.name }}"
serviceName: "{{ .Values.name }}"
replicas: {{ .Values.redis_stack_server.replicas }}
template:
metadata:
labels:
app: "{{ .Values.name }}"
spec:
terminationGracePeriodSeconds: 10
containers:
- name: "{{ .Values.name }}"
image: {{ .Values.redis_stack_server.image }}:{{ .Values.redis_stack_server.tag }}
imagePullPolicy: Always
ports:
- containerPort: 6379
name: redis
{{- if .Values.redis_stack_server.persistence.enabled }}
volumeMounts:
- name: redis-data
mountPath: /data
{{- end }}
resources:
{{- if .Values.redis_stack_server.resources }}
requests:
memory: {{ .Values.redis_stack_server.resources.requests.memory }}
cpu: {{ .Values.redis_stack_server.resources.requests.cpu }}
limits:
memory: {{ .Values.redis_stack_server.resources.limits.memory }}
cpu: {{ .Values.redis_stack_server.resources.limits.cpu }}
{{- end }}
readinessProbe:
exec:
command:
- redis-cli
- ping
initialDelaySeconds: 5
periodSeconds: 20
livenessProbe:
exec:
command:
- redis-cli
- ping
initialDelaySeconds: 30
periodSeconds: 20
{{- if .Values.redis_stack_server.persistence.enabled }}
volumeClaimTemplates:
- metadata:
name: db
spec:
accessModes: [ "ReadWriteOnce" ]
storageClassName: {{ .Values.redis_stack_server.storageClass }}
resources:
requests:
storage: {{ .Values.redis_stack_server.size | default "1Gi" }}
{{- end }}
{{- if .Values.redis_stack_server.affinity }}
affinity:
{{ toYaml .Values.redis_stack_server.affinity | indent 8 }}
{{- end }}
19 changes: 15 additions & 4 deletions charts/redis-stack-server/values.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
name: redis-stack-server

redis_stack_server:
image: "redis/redis-stack-server"
tag: "7.4.0-v1"
port: 6379
replicas: 1
storage_class: standard
storage: 1Gi
affinity: {}
resources:
limits:
cpu: 100m
memory: 128Mi
requests:
cpu: 100m
memory: 128Mi
persistence:
enabled: false
size: 1Gi
# storageClass: standard
service:
port: 6379
type: ClusterIP