Skip to content

Commit

Permalink
Merge pull request #116 from maykinmedia/feature/objecttypes-caching
Browse files Browse the repository at this point in the history
Add redis for objecttypes
  • Loading branch information
sjoerdie authored Jul 4, 2024
2 parents 404bf8e + a796597 commit 9375dc2
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 2 deletions.
11 changes: 9 additions & 2 deletions charts/objecttypen/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,12 @@ name: objecttypen
description: API om object definities te beheren

type: application
version: 1.0.5
appVersion: 2.1.0
version: 1.1.0
appVersion: 2.2.0

dependencies:
- name: redis
version: 17.3.14
repository: https://charts.bitnami.com/bitnami
tags:
- redis
9 changes: 9 additions & 0 deletions charts/objecttypen/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ data:
DJANGO_SETTINGS_MODULE: {{ .Values.settings.djangoSettingsModule | toString | quote }}
ENVIRONMENT: {{ .Values.settings.environment | default (include "objecttypen.fullname" .) }}
ALLOWED_HOSTS: "{{ include "objecttypen.fullname" . }},{{ include "objecttypen.fullname" . }}.{{ .Release.Namespace }},{{ .Values.settings.allowedHosts | replace " " "" | toString }}"
{{- if .Values.tags.redis }}
CACHE_DEFAULT: {{ printf "%s-master.%s:6379/0" (include "common.names.fullname" .Subcharts.redis) .Release.Namespace | toString | quote }}
CACHE_AXES: {{ printf "%s-master.%s:6379/0" (include "common.names.fullname" .Subcharts.redis) .Release.Namespace | toString | quote }}
CACHE_OIDC: {{ printf "%s-master.%s:6379/0" (include "common.names.fullname" .Subcharts.redis) .Release.Namespace | toString | quote }}
{{ else }}
CACHE_DEFAULT: {{ .Values.settings.cache.default | toString | quote }}
CACHE_AXES: {{ .Values.settings.cache.axes | toString | quote }}
CACHE_OIDC: {{ .Values.settings.cache.oidc | toString | quote }}
{{- end }}
DB_NAME: {{ .Values.settings.database.name | toString | quote }}
DB_HOST: {{ .Values.settings.database.host | toString | quote }}
DB_USER: {{ .Values.settings.database.username | toString | quote }}
Expand Down
29 changes: 29 additions & 0 deletions charts/objecttypen/values.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
tags:
redis: true

replicaCount: 1

image:
Expand Down Expand Up @@ -186,6 +189,16 @@ settings:
sentry:
dsn: ""

# Cache settings, when the redis subchart is enabled these settings will be ignored and caching will default to the redis subchart services.
cache:
# e.g.:
# default: openforms-redis-master-0:6379/0
# axes: openforms-redis-master-0:6379/0
# oidc: openforms-redis-master-0:6379/0
default: ""
axes: ""
oidc: ""

debug: false

twoFactorAuthentication:
Expand All @@ -200,3 +213,19 @@ settings:
processes: ''
maxRequests: ''
harakiri: ''

##################
# Redis subchart #
##################

redis:
architecture: standalone
auth:
enabled: false
master:
persistence:
enabled: false
resources:
requests:
cpu: 10m
memory: 20Mi

0 comments on commit 9375dc2

Please sign in to comment.