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

Add redis #9

Draft
wants to merge 7 commits into
base: dev
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
9 changes: 9 additions & 0 deletions charts/tuleap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ The following table lists the configurable parameters of the Tuleap chart and th
| --------- | ----------- | ------- |
| `smtpHost` | SMTP server host | "" |
| `smtpPort` | SMTP server port | "" |

### Bundled Mysql Chart

| Parameter | Description | Default |
Expand All @@ -162,6 +163,14 @@ The following table lists the configurable parameters of the Tuleap chart and th
| `mysql.auth.rootPassword` | Mysql root password | `""` |
| `mysql.architecture` | MySQL architecture (`standalone` or `replication`) | `standalone` |

### Bundled Redis Chart

| Parameter | Description | Default |
| --------- | ----------- | ------- |
| `redis.enabled` | Set to `false` to use external server | `true` |
| `redis.server` | Hostname of the external server | `null` |
| `redis.port` | Port of server | `6379` |

### Tests

| Parameter | Description | Default |
Expand Down
11 changes: 11 additions & 0 deletions charts/tuleap/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,17 @@ Redefined expecting Helm 3.7 to be able to make call like template "mysql.secret
{{- end -}}
{{- end -}}

{{/*
Determine the hostname to use for Redis.
*/}}
{{- define "redis.hostname" -}}
{{- if .Values.redis.enabled -}}
{{- printf "%s-%s" .Release.Name "redis-master" | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s" .Values.redis.server -}}
{{- end -}}
{{- end -}}

{{/*
Create chart name and version as used by the chart label.
*/}}
Expand Down
13 changes: 13 additions & 0 deletions charts/tuleap/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,19 @@ spec:
secretKeyRef:
name: {{ template "tuleap.mysql.secretName" .}}
key: mysql-root-password
{{- if or .Values.redis.enabled .Values.redis.server }}
- name: TULEAP_FPM_SESSION_MODE
value: "redis"
- name: TULEAP_REDIS_SERVER
value: "{{ template "redis.hostname" .}}"
- name: TULEAP_REDIS_PORT
value: "{{ .Values.redis.port }}"
- name: TULEAP_REDIS_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "redis.secretName" .Subcharts.redis }}
key: {{ template "redis.secretPasswordKey" .Subcharts.mysql }}
{{- end }}
{{- with .Values.env }}
{{- . | toYaml | trim | nindent 12 }}
{{- end }}
Expand Down
2 changes: 2 additions & 0 deletions charts/tuleap/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ mysql:

redis:
enabled: true
# server: external.hostname
port: 6379

mailhog:
enabled: true
Expand Down