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

feat: Processing tasks in Arq through Redis #44

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
15 changes: 15 additions & 0 deletions charts/keep/templates/keep-redis-pv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{- if and .Values.redis.enabled .Values.redis.pv.enabled -}}
apiVersion: v1
kind: PersistentVolume
metadata:
name: {{ include "keep.fullname" . }}-redis-pv
spec:
capacity:
storage: {{ .Values.redis.pv.size }}
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
storageClassName: {{ .Values.redis.pv.storageClass }}
hostPath:
path: "/data"
{{- end }}
13 changes: 13 additions & 0 deletions charts/keep/templates/keep-redis-pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{- if and .Values.redis.enabled .Values.redis.pvc.enabled -}}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ include "keep.fullname" . }}-redis-pvc
spec:
accessModes:
- ReadWriteOnce
storageClassName: {{ .Values.redis.pvc.storageClass }}
resources:
requests:
storage: {{ .Values.redis.pvc.size }}
{{- end }}
19 changes: 19 additions & 0 deletions charts/keep/templates/keep-redis-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{{- if .Values.redis.enabled -}}
apiVersion: v1
kind: Service
metadata:
name: {{ include "keep.name" . }}-redis
labels:
{{- include "keep.labels" . | nindent 4 }}
keep-component: redis-service
spec:
type: {{ .Values.redis.service.type }}
ports:
- port: {{ .Values.redis.service.port }}
targetPort: 6379
protocol: TCP
name: redis
selector:
{{- include "keep.selectorLabels" . | nindent 4 }}
keep-component: redis
{{- end }}
80 changes: 80 additions & 0 deletions charts/keep/templates/keep-redis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{{- if .Values.redis.enabled -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "keep.fullname" . }}-redis
labels:
{{- include "keep.labels" . | nindent 4 }}
keep-component: redis
spec:
{{- if not .Values.redis.autoscaling.enabled }}
replicas: {{ .Values.redis.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "keep.selectorLabels" . | nindent 6 }}
keep-component: redis
template:
metadata:
{{- with .Values.redis.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "keep.selectorLabels" . | nindent 8 }}
keep-component: redis
spec:
{{- with .Values.redis.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "keep.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.redis.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.redis.securityContext | nindent 12 }}
image: "{{ .Values.redis.image.repository }}:{{ .Values.redis.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.redis.image.pullPolicy }}
ports:
- name: redis
containerPort: {{ .Values.redis.service.port }}
protocol: TCP
env:
{{- range .Values.redis.env }}
- name: {{ .name }}
value: {{ .value | quote }}
{{- end }}
volumeMounts:
- mountPath: /data
name: {{ include "keep.fullname" . }}-redis-pv
readOnly: false
{{- with .Values.redis.extraVolumeMounts }}
{{- toYaml . | nindent 10 }}
{{- end }}
{{- if .Values.redis.healthCheck.enabled }}
{{- toYaml .Values.redis.healthCheck.probes | nindent 10 }}
{{- end }}
resources:
{{- toYaml .Values.redis.resources | nindent 12 }}
{{- with .Values.redis.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.redis.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.redis.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
- name: {{ include "keep.fullname" . }}-redis-pv
persistentVolumeClaim:
claimName: {{ include "keep.fullname" . }}-redis-pvc
{{- with .Values.redis.extraVolumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
50 changes: 50 additions & 0 deletions charts/keep/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@
value: keep-websocket
- name: PUSHER_PORT
value: 6001
- name: REDIS
value: true
- name: REDIS_HOST
value: keep-redis
- name: REDIS_PORT
value: 6379
- name: KEEP_ARQ_TASK_POOL
value: basic_processing
openAiApi:
enabled: false
openAiApiKey: ""
Expand Down Expand Up @@ -237,7 +245,7 @@
tag: "latest"
env:
- name: MYSQL_ALLOW_EMPTY_PASSWORD
value: yes

Check warning on line 248 in charts/keep/values.yaml

View workflow job for this annotation

GitHub Actions / lint-chart

248:14 [truthy] truthy value should be one of [false, true]
- name: MYSQL_DATABASE
value: keep
- name: MYSQL_PASSWORD
Expand Down Expand Up @@ -268,3 +276,45 @@
port: 3306
extraVolumeMounts: []
extraVolumes: []

redis:
enabled: true
replicaCount: 1
pv:
enabled: true
size: 1Gi
storageClass: ""
pvc:
enabled: true
size: 1Gi
storageClass: ""
image:
repository: redis
pullPolicy: IfNotPresent
tag: "latest"
imagePullSecrets: []
podAnnotations: {}
podSecurityContext: {}
securityContext: {}
service:
type: ClusterIP
port: 6379
resources: {}
autoscaling:
enabled: false
nodeSelector: {}
tolerations: []
affinity: {}
healthCheck:
enabled: false
probes:
readinessProbe:
tcpSocket:
port: 6379
initialDelaySeconds: 30
periodSeconds: 10
livenessProbe:
tcpSocket:
port: 6379
extraVolumeMounts: []
extraVolumes: []
Loading