diff --git a/BREEZE.rst b/BREEZE.rst index 7aada00b9ffa9..03e893cd93143 100644 --- a/BREEZE.rst +++ b/BREEZE.rst @@ -940,7 +940,7 @@ All parameters of the command are here: Running k8s tests ................. -You can run ``breeze k8s tests`` command to run ``pytest`` tests with your cluster. Those testa are placed +You can run ``breeze k8s tests`` command to run ``pytest`` tests with your cluster. Those tests are placed in ``kubernetes_tests/`` and you can either specify the tests to run as parameter of the tests command or you can leave them empty to run all tests. By passing ``--run-in-parallel`` the tests can be run for all clusters in parallel. diff --git a/chart/Chart.lock b/chart/Chart.lock index bf25c5d6c7911..20839ad8db324 100644 --- a/chart/Chart.lock +++ b/chart/Chart.lock @@ -1,5 +1,6 @@ dependencies: - name: postgresql - version: 10.5.3 -digest: sha256:7104938113e866364a96f78802697be6bd121526cccbd06cae6a38827b7b36f9 -generated: "2022-06-11T22:19:11.389661+02:00" + repository: https://charts.bitnami.com/bitnami + version: 12.1.9 +digest: sha256:becf42e73c2aac0b2200698e1aaeee1be13507db2f882e5713c91833351a94e6 +generated: "2023-01-20T11:34:59.293080448Z" diff --git a/chart/Chart.yaml b/chart/Chart.yaml index 3bd13966bb3fb..756602bd72ac4 100644 --- a/chart/Chart.yaml +++ b/chart/Chart.yaml @@ -34,7 +34,8 @@ keywords: - scheduler dependencies: - name: postgresql - version: 10.5.3 + version: 12.1.9 + repository: https://charts.bitnami.com/bitnami condition: postgresql.enabled maintainers: - email: dev@airflow.apache.org diff --git a/chart/charts/postgresql-10.5.3.tgz b/chart/charts/postgresql-10.5.3.tgz deleted file mode 100644 index aac3fa60fce21..0000000000000 Binary files a/chart/charts/postgresql-10.5.3.tgz and /dev/null differ diff --git a/chart/charts/postgresql-12.1.9.tgz b/chart/charts/postgresql-12.1.9.tgz new file mode 100644 index 0000000000000..dc21bbf5eb5ab Binary files /dev/null and b/chart/charts/postgresql-12.1.9.tgz differ diff --git a/chart/templates/NOTES.txt b/chart/templates/NOTES.txt index ff12562cc1b1b..75c3e51de9fe7 100644 --- a/chart/templates/NOTES.txt +++ b/chart/templates/NOTES.txt @@ -187,3 +187,9 @@ Information on how to set a static webserver secret key can be found here: https://airflow.apache.org/docs/helm-chart/stable/production-guide.html#webserver-secret-key {{- end }} + +{{- if or .Values.postgresql.postgresqlUsername .Values.postgresql.postgresqlPassword }} + + {{ fail "postgresql.postgresqlUsername and postgresql.postgresqlPassword are no longer supported. If you wish to use the 'postgres' user, set its password with postgresql.auth.postgresPassword. If you wish to create a different user, do so with postgresql.auth.username and postgresql.auth.password." }} + +{{- end }} diff --git a/chart/values.schema.json b/chart/values.schema.json index 31044ddbc2949..194051cb0ea2c 100644 --- a/chart/values.schema.json +++ b/chart/values.schema.json @@ -5200,15 +5200,41 @@ "type": "boolean", "default": true }, - "postgresqlPassword": { - "description": "PostgreSQL password.", - "type": "string", - "default": "postgres" - }, - "postgresqlUsername": { - "description": "PostgreSQL username.", - "type": "string", - "default": "postgres" + "auth": { + "description": "PostgreSQL authentication values.", + "type": "object", + "additionalProperties": true, + "properties": { + "enablePostgresUser": { + "description": "Assign a password to the 'postgres' admin user. Otherwise, remote access will be blocked for this user", + "type": "boolean", + "default": true + }, + "postgresPassword": { + "description": "Password for the 'postgres' admin user.", + "type": [ + "string", + "null" + ], + "default": "postgres" + }, + "username": { + "description": "Name for a custom user to create", + "type": [ + "string", + "null" + ], + "default": null + }, + "password": { + "description": "Password for the custom user to create.", + "type": [ + "string", + "null" + ], + "default": null + } + } } } }, diff --git a/chart/values.yaml b/chart/values.yaml index 17231711ee342..229d3bc0ab657 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -1698,8 +1698,11 @@ cleanup: # Not recommended for production postgresql: enabled: true - postgresqlPassword: postgres - postgresqlUsername: postgres + auth: + enablePostgresUser: true + postgresPassword: postgres + username: ~ + password: ~ # Config settings to go into the mounted airflow.cfg # diff --git a/newsfragments/27353.significant.rst b/newsfragments/27353.significant.rst new file mode 100644 index 0000000000000..02bb8a3de9c76 --- /dev/null +++ b/newsfragments/27353.significant.rst @@ -0,0 +1,8 @@ +The helm chart is now using a newer version of bitnami/postgresql (from 10.5.3 to 12.1.9) + +This version of the chart uses different variable names for setting usernames and passwords in the postgres database. +```postgresql.auth.enablePostgresUser``` is used to determine if the "postgres" admin account will be created. +```postgresql.auth.postgresPassword``` sets the password for the "postgres" user. +```postgresql.auth.username``` and ```postrgesql.auth.password``` are used to set credentials for a non-admin account if desired. +```postgresql.postgresqlUsername``` and ```postgresql.postresqlPassword```, which were used in the previous version of the chart, are no longer used. +Users will need to change these variable names in their values files if they are using the helm chart. diff --git a/tests/charts/test_basic_helm_chart.py b/tests/charts/test_basic_helm_chart.py index a80b95aa35009..a4f5ff2d4b30d 100644 --- a/tests/charts/test_basic_helm_chart.py +++ b/tests/charts/test_basic_helm_chart.py @@ -83,7 +83,7 @@ def test_basic_deployments(self, version): ("Role", "test-basic-pod-log-reader-role"), ("RoleBinding", "test-basic-pod-launcher-rolebinding"), ("RoleBinding", "test-basic-pod-log-reader-rolebinding"), - ("Service", "test-basic-postgresql-headless"), + ("Service", "test-basic-postgresql-hl"), ("Service", "test-basic-postgresql"), ("Service", "test-basic-redis"), ("Service", "test-basic-statsd"), @@ -160,7 +160,7 @@ def test_basic_deployment_with_standalone_dag_processor(self, version): ("Role", "test-basic-pod-log-reader-role"), ("RoleBinding", "test-basic-pod-launcher-rolebinding"), ("RoleBinding", "test-basic-pod-log-reader-rolebinding"), - ("Service", "test-basic-postgresql-headless"), + ("Service", "test-basic-postgresql-hl"), ("Service", "test-basic-postgresql"), ("Service", "test-basic-redis"), ("Service", "test-basic-statsd"), diff --git a/tests/charts/test_rbac.py b/tests/charts/test_rbac.py index 9a0ad4f559330..ca78b1e27d550 100644 --- a/tests/charts/test_rbac.py +++ b/tests/charts/test_rbac.py @@ -28,7 +28,7 @@ ("Secret", "test-rbac-pgbouncer-stats"), ("ConfigMap", "test-rbac-airflow-config"), ("ConfigMap", "test-rbac-statsd"), - ("Service", "test-rbac-postgresql-headless"), + ("Service", "test-rbac-postgresql-hl"), ("Service", "test-rbac-postgresql"), ("Service", "test-rbac-statsd"), ("Service", "test-rbac-webserver"), @@ -89,6 +89,7 @@ CUSTOM_CREATE_USER_JOBS_NAME, CUSTOM_MIGRATE_DATABASE_JOBS_NAME, CUSTOM_REDIS_NAME, + CUSTOM_POSTGRESQL_NAME, ) = ( "TestScheduler", "TestWebserver", @@ -101,6 +102,7 @@ "TestCreateUserJob", "TestMigrateDatabaseJob", "TestRedis", + "TestPostgresql", ) @@ -254,6 +256,7 @@ def test_service_account_custom_names(self): "flower": {"enabled": True, "serviceAccount": {"name": CUSTOM_FLOWER_NAME}}, "statsd": {"serviceAccount": {"name": CUSTOM_STATSD_NAME}}, "redis": {"serviceAccount": {"name": CUSTOM_REDIS_NAME}}, + "postgresql": {"serviceAccount": {"create": True, "name": CUSTOM_POSTGRESQL_NAME}}, "pgbouncer": { "enabled": True, "serviceAccount": { @@ -289,6 +292,7 @@ def test_service_account_custom_names_in_objects(self): "flower": {"enabled": True, "serviceAccount": {"name": CUSTOM_FLOWER_NAME}}, "statsd": {"serviceAccount": {"name": CUSTOM_STATSD_NAME}}, "redis": {"serviceAccount": {"name": CUSTOM_REDIS_NAME}}, + "postgresql": {"serviceAccount": {"name": CUSTOM_POSTGRESQL_NAME}}, "pgbouncer": { "enabled": True, "serviceAccount": {