From 9961aa0921c9ab1ec606208c17ff26ec1b27e832 Mon Sep 17 00:00:00 2001 From: hanzala1234 <42064189+hanzala1234@users.noreply.github.com> Date: Thu, 3 Jun 2021 10:30:31 +0500 Subject: [PATCH] Add redis properties configuration for external redis (#200) Signed-off-by: hanzala --- charts/airflow/Chart.yaml | 2 +- charts/airflow/README.md | 26 ++++++++++++++++++- charts/airflow/UPGRADE.md | 10 +++++++ .../templates/config/secret-config.yaml | 3 ++- charts/airflow/values.yaml | 4 +++ 5 files changed, 42 insertions(+), 3 deletions(-) diff --git a/charts/airflow/Chart.yaml b/charts/airflow/Chart.yaml index 8e74aa30..07f69427 100644 --- a/charts/airflow/Chart.yaml +++ b/charts/airflow/Chart.yaml @@ -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/ diff --git a/charts/airflow/README.md b/charts/airflow/README.md index 5a448e06..5ae72526 100644 --- a/charts/airflow/README.md +++ b/charts/airflow/README.md @@ -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) @@ -844,6 +845,28 @@ externalDatabase:
+### How to use an external redis? +
+Show More +
+ +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" +``` + +
+
+ ## Kubernetes Configs ### How to mount ConfigMaps/Secrets as environment variables? @@ -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 | `""`
@@ -1288,4 +1312,4 @@ Parameter | Description | Default
-
\ No newline at end of file +
diff --git a/charts/airflow/UPGRADE.md b/charts/airflow/UPGRADE.md index b7931b1f..e30827cd 100644 --- a/charts/airflow/UPGRADE.md +++ b/charts/airflow/UPGRADE.md @@ -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: diff --git a/charts/airflow/templates/config/secret-config.yaml b/charts/airflow/templates/config/secret-config.yaml index 5701ceef..4dd0bfa5 100644 --- a/charts/airflow/templates/config/secret-config.yaml +++ b/charts/airflow/templates/config/secret-config.yaml @@ -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 @@ -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 }} ## ================ diff --git a/charts/airflow/values.yaml b/charts/airflow/values.yaml index e005c0ce..8f42f41f 100644 --- a/charts/airflow/values.yaml +++ b/charts/airflow/values.yaml @@ -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 ###################################