[bitnami/airflow] Allow existingSecret for redis/postgresql .enabled = true (#2279)

* Allow  ExistingSecrets for postgres/redis enabled

For postgresql.enabled= true, and redis.enabled = true, allow the option of providing existing Secret name. 
Right now, if postgresql.enabled = true, it doesn't use existingSecret provided in externalDatabase.existingSecret & does not create a pod for postgres as well. Same logic for redis

* Add redis.existingSecret condition

generate this secret if redis.existingSecret is not provided on the top of existing conditions

* Add postgresql.existingSecret condition

* add redis.existingSecret/postgresql.existingSecret

* add redis.enabled/postgresql.enabled conditions

* Add redis.existingSecret/ posgresql.existingSecret

* add redis.existingSecret/postgresql.existingSecret

* upgrade to 5.0.7

* fix alignments

* upgrade to 5.1.0

* [bitnami/airflow] Update components versions

Signed-off-by: Bitnami Containers <containers@bitnami.com>

Co-authored-by: Marcos Bjoerkelund <marcos@bitnami.com>
Co-authored-by: Bitnami Containers <containers@bitnami.com>
This commit is contained in:
Abdourahamane S Abba
2020-04-10 15:04:32 -04:00
committed by GitHub
parent 958b35ec94
commit d5dba30a8c
7 changed files with 21 additions and 7 deletions

View File

@@ -1,6 +1,6 @@
apiVersion: v1 apiVersion: v1
name: airflow name: airflow
version: 6.0.0 version: 6.1.0
appVersion: 1.10.9 appVersion: 1.10.9
description: Apache Airflow is a platform to programmatically author, schedule and monitor workflows. description: Apache Airflow is a platform to programmatically author, schedule and monitor workflows.
keywords: keywords:

View File

@@ -154,6 +154,7 @@ The following tables lists the configurable parameters of the Airflow chart and
| `postgresql.postgresqlUsername` | Airflow Postgresql username | `bn_airflow` | | `postgresql.postgresqlUsername` | Airflow Postgresql username | `bn_airflow` |
| `postgresql.postgresqlPassword` | Airflow Postgresql password | `nil` | | `postgresql.postgresqlPassword` | Airflow Postgresql password | `nil` |
| `postgresql.postgresqlDatabase` | Airflow Postgresql database | `bitnami_airflow` | | `postgresql.postgresqlDatabase` | Airflow Postgresql database | `bitnami_airflow` |
| `postgresql.existingSecret` | Name of an existing secret containing the PostgreSQL password ('postgresql-password' key) . This secret is used in case of postgresql.enabled=true and we would like to specify password for newly created postgresql instance | `nil`
| `externalDatabase.host` | External PostgreSQL host | `nil` | | `externalDatabase.host` | External PostgreSQL host | `nil` |
| `externalDatabase.user` | External PostgreSQL user | `nil` | | `externalDatabase.user` | External PostgreSQL user | `nil` |
| `externalDatabase.password` | External PostgreSQL password | `nil` | | `externalDatabase.password` | External PostgreSQL password | `nil` |
@@ -161,6 +162,7 @@ The following tables lists the configurable parameters of the Airflow chart and
| `externalDatabase.port` | External PostgreSQL port | `nil` | | `externalDatabase.port` | External PostgreSQL port | `nil` |
| `externalDatabase.existingSecret` | Name of an existing secret containing the PostgreSQL password ('postgresql-password' key) | `nil` | | `externalDatabase.existingSecret` | Name of an existing secret containing the PostgreSQL password ('postgresql-password' key) | `nil` |
| `redis.enabled` | Switch to enable or disable the Redis helm chart | `true` | | `redis.enabled` | Switch to enable or disable the Redis helm chart | `true` |
| `redis.existingSecret` | Name of an existing secret containing the Redis password ('redis-password' key) . This secret is used in case of redis.enabled=true and we would like to specify password for newly created redis instance | `nil`
| `externalRedis.host` | External Redis host | `nil` | | `externalRedis.host` | External Redis host | `nil` |
| `externalRedis.port` | External Redis port | `nil` | | `externalRedis.port` | External Redis port | `nil` |
| `externalRedis.password` | External Redis password | `nil` | | `externalRedis.password` | External Redis password | `nil` |

View File

@@ -275,12 +275,14 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
Get the Redis credentials secret. Get the Redis credentials secret.
*/}} */}}
{{- define "airflow.redis.secretName" -}} {{- define "airflow.redis.secretName" -}}
{{- if .Values.redis.enabled -}} {{- if and (.Values.redis.enabled) (not .Values.redis.existingSecret) -}}
{{/* Create a template for the redis secret {{/* Create a template for the redis secret
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}} */}}
{{- $name := default "redis" .Values.redis.nameOverride -}} {{- $name := default "redis" .Values.redis.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- else if and (.Values.redis.enabled) ( .Values.redis.existingSecret) -}}
{{- printf "%s" .Values.redis.existingSecret -}}
{{- else }} {{- else }}
{{- if .Values.externalRedis.existingSecret -}} {{- if .Values.externalRedis.existingSecret -}}
{{- printf "%s" .Values.externalRedis.existingSecret -}} {{- printf "%s" .Values.externalRedis.existingSecret -}}
@@ -294,8 +296,10 @@ Get the Redis credentials secret.
Get the Postgresql credentials secret. Get the Postgresql credentials secret.
*/}} */}}
{{- define "airflow.postgresql.secretName" -}} {{- define "airflow.postgresql.secretName" -}}
{{- if .Values.postgresql.enabled -}} {{- if and (.Values.postgresql.enabled) (not .Values.postgresql.existingSecret) -}}
{{- printf "%s" (include "airflow.postgresql.fullname" .) -}} {{- printf "%s" (include "airflow.postgresql.fullname" .) -}}
{{- else if and (.Values.postgresql.enabled) (.Values.postgresql.existingSecret) -}}
{{- printf "%s" .Values.postgresql.existingSecret -}}
{{- else }} {{- else }}
{{- if .Values.externalDatabase.existingSecret -}} {{- if .Values.externalDatabase.existingSecret -}}
{{- printf "%s" .Values.externalDatabase.existingSecret -}} {{- printf "%s" .Values.externalDatabase.existingSecret -}}

View File

@@ -1,4 +1,4 @@
{{- if and (not .Values.postgresql.enabled) (not .Values.externalDatabase.existingSecret) }} {{- if and (not .Values.postgresql.enabled) (not .Values.externalDatabase.existingSecret) (not .Values.postgresql.existingSecret)}}
apiVersion: v1 apiVersion: v1
kind: Secret kind: Secret
metadata: metadata:

View File

@@ -1,4 +1,4 @@
{{- if and (not .Values.redis.enabled) (not .Values.externalRedis.existingSecret) }} {{- if and (not .Values.redis.enabled) (not .Values.externalRedis.existingSecret) (not .Values.redis.existingSecret)}}
apiVersion: v1 apiVersion: v1
kind: Secret kind: Secret
metadata: metadata:

View File

@@ -14,7 +14,7 @@
image: image:
registry: docker.io registry: docker.io
repository: bitnami/airflow repository: bitnami/airflow
tag: 1.10.9-debian-10-r65 tag: 1.10.9-debian-10-r66
## Specify a imagePullPolicy ## Specify a imagePullPolicy
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
@@ -382,6 +382,8 @@ postgresql:
postgresqlUsername: bn_airflow postgresqlUsername: bn_airflow
# postgresqlPassword: # postgresqlPassword:
postgresqlDatabase: bitnami_airflow postgresqlDatabase: bitnami_airflow
#In case of postgresql.enabled = true, allow the usage of existing secrets for postgresql
existingSecret: ""
externalDatabase: externalDatabase:
## All of these values are only used when postgresql.enabled is set to false ## All of these values are only used when postgresql.enabled is set to false
@@ -406,6 +408,8 @@ externalDatabase:
redis: redis:
enabled: true enabled: true
# password: "" # password: ""
#In case of redis.enabled = true, allow the usage of existing secrets for redis
existingSecret: ""
externalRedis: externalRedis:
## All of these values are only used when redis.enabled is set to false ## All of these values are only used when redis.enabled is set to false

View File

@@ -14,7 +14,7 @@
image: image:
registry: docker.io registry: docker.io
repository: bitnami/airflow repository: bitnami/airflow
tag: 1.10.9-debian-10-r65 tag: 1.10.9-debian-10-r66
## Specify a imagePullPolicy ## Specify a imagePullPolicy
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
@@ -382,6 +382,8 @@ postgresql:
postgresqlUsername: bn_airflow postgresqlUsername: bn_airflow
# postgresqlPassword: # postgresqlPassword:
postgresqlDatabase: bitnami_airflow postgresqlDatabase: bitnami_airflow
#In case of postgresql.enabled = true, allow the usage of existing secrets for postgresql
existingSecret: ""
externalDatabase: externalDatabase:
## All of these values are only used when postgresql.enabled is set to false ## All of these values are only used when postgresql.enabled is set to false
@@ -405,6 +407,8 @@ externalDatabase:
## ##
redis: redis:
enabled: true enabled: true
#In case of redis.enabled = true, allow the usage of existing secrets for redis
existingSecret: ""
# password: "" # password: ""
externalRedis: externalRedis: