Skip to content

Commit

Permalink
Add redis properties configuration for external redis (#200)
Browse files Browse the repository at this point in the history
Signed-off-by: hanzala <[email protected]>
  • Loading branch information
hanzala1234 authored Jun 3, 2021
1 parent ab1f488 commit 9961aa0
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 3 deletions.
2 changes: 1 addition & 1 deletion charts/airflow/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
description: the community-maintained descendant of the stable/airflow helm chart - focused on ease-of-use
name: airflow
version: 8.1.3
version: 8.2.0
appVersion: 2.0.1
icon: https://airflow.apache.org/_images/pin_large.png
home: https://airflow.apache.org/
Expand Down
26 changes: 25 additions & 1 deletion charts/airflow/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ kubectl port-forward --namespace $NAMESPACE $POD_NAME 8080:8080

Old Version | New Version | Upgrade Guide
--- | --- | ---
v8.1.X | v8.2.0 | [link](UPGRADE.md#v81x--v820)
v8.0.X | v8.1.0 | [link](UPGRADE.md#v80x--v810)
v7.15.X | v8.0.0 | [link](UPGRADE.md#v715x--v800)
v7.14.X | v7.15.0 | [link](UPGRADE.md#v714x--v7150)
Expand Down Expand Up @@ -844,6 +845,28 @@ externalDatabase:
<hr>
</details>

### How to use an external redis?
<details>
<summary>Show More</summary>
<hr>

Example values for an external redis with ssl enabled:
```yaml
redis:
enabled: false
externalRedis:
host: "example.redis.cache.windows.net"
port: 6380
databaseNumber: 15
passwordSecret: "redis-password"
passwordSecretKey: "value"
properties: "?ssl_cert_reqs=CERT_OPTIONAL"
```

<hr>
</details>

## Kubernetes Configs

### How to mount ConfigMaps/Secrets as environment variables?
Expand Down Expand Up @@ -1265,6 +1288,7 @@ Parameter | Description | Default
`externalRedis.databaseNumber` | the database number to use within the the external redis | `1`
`externalRedis.passwordSecret` | the name of a pre-created secret containing the external redis password | `""`
`externalRedis.passwordSecretKey` | the key within `externalRedis.passwordSecret` containing the password string | `redis-password`
`externalDatabase.properties` | the connection properties eg ?ssl_cert_reqs=CERT_OPTIONAL | `""`

<hr>
</details>
Expand All @@ -1288,4 +1312,4 @@ Parameter | Description | Default
</details>

<br>
<br>
<br>
10 changes: 10 additions & 0 deletions charts/airflow/UPGRADE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Upgrading Steps

## `v8.1.X``v8.2.0`

__The following IMPROVEMENTS have been made:__

* Added an ability to setup external redis connection propertites with the value `externalRedis.properties` for TLS or other advanced parameters

__The following values have been ADDED:__

* `externalRedis.properties`

## `v8.0.X``v8.1.0`

### VALUES - New:
Expand Down
3 changes: 2 additions & 1 deletion charts/airflow/templates/config/secret-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ stringData:
REDIS_HOST: {{ .Values.externalRedis.host | quote }}
REDIS_PORT: {{ .Values.externalRedis.port | quote }}
REDIS_DBNUM: {{ .Values.externalRedis.databaseNumber | quote }}
REDIS_PROPERTIES: {{.Values.externalRedis.properties | quote }}
{{- end }}

## a bash command which echos the URL encoded value of $REDIS_PASSWORD
Expand All @@ -76,7 +77,7 @@ stringData:
## a bash command which echos the Redis connection string
REDIS_CONNECTION_CMD: |-
echo -n "redis://$(eval $REDIS_PASSWORD_CMD)${REDIS_HOST}:${REDIS_PORT}/${REDIS_DBNUM}"
echo -n "redis://$(eval $REDIS_PASSWORD_CMD)${REDIS_HOST}:${REDIS_PORT}/${REDIS_DBNUM}${REDIS_PROPERTIES}"
{{- end }}

## ================
Expand Down
4 changes: 4 additions & 0 deletions charts/airflow/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1514,6 +1514,10 @@ externalRedis:
##
passwordSecretKey: "redis-password"

## the connection properties for external redis, e.g. "?ssl_cert_reqs=CERT_OPTIONAL"
##
properties: ""

###################################
# Prometheus Operator - ServiceMonitor
###################################
Expand Down

0 comments on commit 9961aa0

Please sign in to comment.