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

Support redis as sidecar of Symphony API pod #269

Merged
Merged
Show file tree
Hide file tree
Changes from 2 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 packages/helm/symphony/files/symphony-api.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"type": "providers.pubsub.redis",
"config": {
"name": "redis",
"host": "symphony-redis:6379",
"host": "{{ include "symphony.redisHost" . }}",
"requireTLS": false,
"password": "",
"numberOfWorkers": 1
Expand Down
8 changes: 8 additions & 0 deletions packages/helm/symphony/templates/redis-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: redis-config-map
data:
redis.conf: |
protected-mode yes
RemindD marked this conversation as resolved.
Show resolved Hide resolved

2 changes: 1 addition & 1 deletion packages/helm/symphony/templates/redis.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.redis.enabled }}
{{- if and .Values.redis.enabled (not .Values.redis.asSidecar)}}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down
9 changes: 9 additions & 0 deletions packages/helm/symphony/templates/symphony-core/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,13 @@ Symphony full url Endpoint
{{/* Symphony Env Config Name */}}
{{- define "symphony.envConfigName" -}}
{{- printf "%s-env-config" (include "symphony.fullname" .) }}
{{- end }}

{{/* Symphony Redis host*/}}
{{- define "symphony.redisHost" -}}
{{- if .Values.redis.asSidecar }}
{{- printf "localhost:%s" .Values.redis.port }}
{{- else }}
{{- printf "%s-redis:%s" (include "symphony.name" .) .Values.redis.port }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,16 @@ spec:
subPath: proxy-cert.crt
name: proxy-certstore
{{- end }}

{{- if and .Values.redis.enabled .Values.redis.asSidecar }}
- name: redis
image: {{ .Values.redis.image }}
command: ["redis-server", "/usr/var/redis/redis.conf"]
ports:
- containerPort: {{ .Values.redis.port }}
volumeMounts:
- name: redis-config
mountPath: /usr/var/redis
{{- end}}
{{- if .Values.global.azure.identity.mSIAdapterYaml }}
- name: msi-adapter
env:
Expand Down Expand Up @@ -108,3 +117,11 @@ spec:
- name: ssl-certs
emptyDir: {}
{{ end }}
{{- if and .Values.redis.enabled .Values.redis.asSidecar }}
- name: redis-config
configMap:
name: redis-config-map
items:
- key: redis.conf
path: redis.conf
{{- end }}
3 changes: 2 additions & 1 deletion packages/helm/symphony/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ cert-manager:
flavor: oss
redis:
enabled: true
asSidecar: false
image: redis/redis-stack-server:latest
port: 6379
port: "6379"
RemindD marked this conversation as resolved.
Show resolved Hide resolved
parent:
url:
username: admin
Expand Down
Loading