Skip to content

Commit

Permalink
feat: adding external redis option (#87)
Browse files Browse the repository at this point in the history
* feat: adding external redis option

* Update to 3.10.1
  • Loading branch information
ilkerispir authored Nov 10, 2023
1 parent 4ce2fee commit 0b22914
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ Once you have completed the above steps you can complete the file values.yaml to
| postgres.* | No | Setup based on https://github.com/bitnami/charts/tree/main/bitnami/postgres |
| redis.* | No | Setup based on https://github.com/bitnami/charts/tree/main/bitnami/redis |
| api.enabled | Yes | true/false |
| api.defaultRedis | No | Enable default Redis using Bitnami helm chart |
| api.defaultDatabase | No | Enable default database using postgresql helm chart |
| api.version | Yes | Terrakube API version |
| api.replicaCount | Yes | |
Expand Down
3 changes: 2 additions & 1 deletion charts/terrakube/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: 3.10.0
version: 3.10.1

# 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 All @@ -41,4 +41,5 @@ dependencies:

- name: redis
version: "17.10.1"
condition: api.defaultRedis
repository: "https://charts.bitnami.com/bitnami"
12 changes: 11 additions & 1 deletion charts/terrakube/templates/secrets-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,20 @@ stringData:
AzBuilderExecutorUrl: 'http://terrakube-executor-service:8090/api/v1/terraform-rs'
TerrakubeUiURL: '{{- if .Values.ingress.useTls }}https{{else}}http{{ end }}://{{ .Values.ingress.ui.domain }}'
TERRAKUBE_ADMIN_GROUP: '{{ .Values.security.adminGroup }}'

{{- if .Values.api.defaultRedis -}}

TerrakubeRedisHostname: 'terrakube-redis-master'
TerrakubeRedisPort: '6379'
TerrakubeRedisPassword: '{{ .Values.redis.auth.password }}'

{{ else }}

TerrakubeRedisHostname: '{{ .Values.api.properties.redisHostname }}'
TerrakubeRedisPassword: '{{ .Values.api.properties.redisPassword }}'

{{- end }}

TerrakubeRedisPort: '6379'

{{- if .Values.storage.defaultStorage -}}

Expand Down
12 changes: 11 additions & 1 deletion charts/terrakube/templates/secrets-executor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,20 @@ stringData:
TerrakubeEnableSecurity: 'true'
TerrakubeRegistryDomain: '{{ .Values.ingress.registry.domain }}'
TerrakubeApiUrl: '{{- if .Values.ingress.useTls }}https{{else}}http{{ end }}://{{ .Values.ingress.api.domain }}'

{{- if .Values.api.defaultRedis -}}

TerrakubeRedisHostname: 'terrakube-redis-master'
TerrakubeRedisPort: '6379'
TerrakubeRedisPassword: '{{ .Values.redis.auth.password }}'

{{ else }}

TerrakubeRedisHostname: '{{ .Values.api.properties.redisHostname }}'
TerrakubeRedisPassword: '{{ .Values.api.properties.redisPassword }}'

{{- end }}

TerrakubeRedisPort: '6379'

{{- if .Values.storage.defaultStorage -}}

Expand Down
6 changes: 5 additions & 1 deletion charts/terrakube/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
},
"api": {
"type": "object",
"required": ["enabled", "replicaCount", "properties", "defaultDatabase", "loadSampleData", "terraformReleasesUrl"],
"required": ["enabled", "replicaCount", "properties", "defaultDatabase", "defaultRedis", "loadSampleData", "terraformReleasesUrl"],
"properties": {
"enabled": {
"description": "Enable API",
Expand Down Expand Up @@ -217,6 +217,10 @@
"description": "Enable Default Database",
"type": "boolean"
},
"defaultRedis": {
"description": "Enable Default Redis",
"type": "boolean"
},
"properties": {
"type": "object",
"required": ["databaseType", "databaseHostname", "databaseName", "databaseUser", "databasePassword"],
Expand Down
3 changes: 3 additions & 0 deletions charts/terrakube/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ api:
serviceAccountName: ""
resources: {}
defaultDatabase: true
defaultRedis: true
loadSampleData: true
terraformReleasesUrl: "https://releases.hashicorp.com/terraform/index.json"
cache:
Expand All @@ -179,6 +180,8 @@ api:
databasePassword: ""
databaseSslMode: "disable"
databasePort: "3306"
redisHostname: ""
redisPassword: ""


## The database port is only used for mysql databases
Expand Down

0 comments on commit 0b22914

Please sign in to comment.