You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by as...@apache.org on 2024/11/29 12:37:35 UTC
(airflow) branch run-api-server-helm-chart updated (6b922ff0531 -> 2384924617e)
This is an automated email from the ASF dual-hosted git repository.
ash pushed a change to branch run-api-server-helm-chart
in repository https://gitbox.apache.org/repos/asf/airflow.git
omit 6b922ff0531 fixup! Swap internal RPC server for API server in the helm chart
omit f752f1c9e52 Swap internal RPC server for API server in the helm chart
add 69cd23722d7 AIP-84 Migrate private graph_data endpoint (#44394)
add 3e427c92488 AIP-84: Migrate Dag Parsing endpoint to FastApi (#44416)
add e9f544cc3fb Remove AIP-44 configuration from the code (#44454)
add ab2bd2d4a9d Add import compatibility check (#44458)
add 1fdaebd9047 feat: add OpenLineage support for S3ToGCSOperator (#44426)
add 5e38319f750 Fix issues reported by ruff team before new ruff rules are out (#44460)
add 1f18458f7fe Remove internal-api command (#44462)
add 6e3a25eccfb AIP-72: Handle External update TI state in Supervisor (#44406)
add 840018a4264 Docs: Add prominent deprecations notice via css (#43909)
add 79a9c828698 Add 'airflow assets details' subcommand (#44445)
add eee6919ff64 fix(provider/edge): add back mising method map (#44468)
add fdd353a03e4 AIP-72: Adding PUT Variable Endpoint for execution API (#44449)
add 03349014513 Fix yoda-conditions (#44466)
add b2d2bcb136f AIP-72: Matching the test naming convention to execution API endpoint (#44471)
add b882246702c AIP-84 Introduce SessionDep and AsyncSessionDep construct (#44461)
new 2384924617e Swap internal RPC server for API server in the helm chart
This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version. This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:
* -- * -- B -- O -- O -- O (6b922ff0531)
\
N -- N -- N refs/heads/run-api-server-helm-chart (2384924617e)
You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.
Any revisions marked "omit" are not gone; other references still
refer to them. Any revisions marked "discard" are gone forever.
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.pre-commit-config.yaml | 1 -
airflow/__main__.py | 30 +-
airflow/api_connexion/endpoints/dag_parsing.py | 2 +
airflow/api_fastapi/common/db/common.py | 39 +--
.../api_fastapi/core_api/datamodels/ui/graph.py | 60 ++++
.../api_fastapi/core_api/openapi/v1-generated.yaml | 297 ++++++++++++++++---
.../api_fastapi/core_api/routes/public/__init__.py | 2 +
.../api_fastapi/core_api/routes/public/assets.py | 24 +-
.../core_api/routes/public/backfills.py | 18 +-
.../core_api/routes/public/connections.py | 13 +-
.../core_api/routes/public}/dag_parsing.py | 45 ++-
.../api_fastapi/core_api/routes/public/dag_run.py | 21 +-
.../core_api/routes/public/dag_sources.py | 9 +-
.../core_api/routes/public/dag_stats.py | 9 +-
.../core_api/routes/public/dag_warning.py | 5 +-
airflow/api_fastapi/core_api/routes/public/dags.py | 19 +-
.../core_api/routes/public/event_logs.py | 7 +-
.../core_api/routes/public/extra_links.py | 11 +-
.../core_api/routes/public/import_error.py | 7 +-
airflow/api_fastapi/core_api/routes/public/job.py | 5 +-
airflow/api_fastapi/core_api/routes/public/log.py | 10 +-
.../api_fastapi/core_api/routes/public/pools.py | 15 +-
.../core_api/routes/public/task_instances.py | 28 +-
.../core_api/routes/public/variables.py | 13 +-
airflow/api_fastapi/core_api/routes/public/xcom.py | 9 +-
airflow/api_fastapi/core_api/routes/ui/__init__.py | 6 +-
airflow/api_fastapi/core_api/routes/ui/assets.py | 9 +-
airflow/api_fastapi/core_api/routes/ui/dags.py | 8 +-
.../api_fastapi/core_api/routes/ui/dashboard.py | 20 +-
airflow/api_fastapi/core_api/routes/ui/graph.py | 60 ++++
.../execution_api/datamodels/variable.py | 7 +
.../execution_api/routes/task_instances.py | 9 +-
.../api_fastapi/execution_api/routes/variables.py | 26 +-
airflow/api_fastapi/execution_api/routes/xcoms.py | 9 +-
airflow/api_internal/__init__.py | 16 -
airflow/api_internal/endpoints/__init__.py | 16 -
airflow/api_internal/endpoints/health_endpoint.py | 22 --
airflow/api_internal/endpoints/rpc_api_endpoint.py | 246 ----------------
airflow/api_internal/gunicorn_config.py | 33 ---
airflow/api_internal/internal_api_call.py | 161 +---------
airflow/api_internal/openapi/internal_api_v1.yaml | 101 -------
airflow/cli/cli_config.py | 82 +-----
airflow/cli/commands/asset_command.py | 32 ++
airflow/cli/commands/dag_processor_command.py | 4 -
airflow/cli/commands/db_command.py | 3 -
airflow/cli/commands/internal_api_command.py | 263 -----------------
airflow/cli/commands/task_command.py | 13 +-
airflow/executors/executor_loader.py | 4 -
airflow/models/taskinstance.py | 11 +-
airflow/sensors/base.py | 4 +-
airflow/serialization/serialized_objects.py | 17 +-
airflow/settings.py | 162 ----------
airflow/task/standard_task_runner.py | 13 -
airflow/ui/openapi-gen/queries/common.ts | 132 +++++----
airflow/ui/openapi-gen/queries/prefetch.ts | 149 ++++++----
airflow/ui/openapi-gen/queries/queries.ts | 211 +++++++++----
airflow/ui/openapi-gen/queries/suspense.ts | 171 +++++++----
airflow/ui/openapi-gen/requests/schemas.gen.ts | 195 ++++++++++++
airflow/ui/openapi-gen/requests/services.gen.ts | 202 ++++++++-----
airflow/ui/openapi-gen/requests/types.gen.ts | 204 ++++++++++---
airflow/utils/cli.py | 3 +-
airflow/utils/task_instance_session.py | 8 -
airflow/www/app.py | 7 -
.../api-server/api-server-deployment.yaml | 21 +-
contributing-docs/17_adding_api_endpoints.rst | 2 +-
.../airflow_breeze/commands/kubernetes_commands.py | 7 +-
.../src/airflow_breeze/params/build_prod_params.py | 12 +
dev/breeze/src/airflow_breeze/utils/packages.py | 2 +-
dev/breeze/src/airflow_breeze/utils/run_tests.py | 2 +-
.../src/airflow_breeze/utils/selective_checks.py | 11 +-
dev/breeze/tests/test_packages.py | 6 +-
.../tests/test_pytest_args_for_test_types.py | 5 +-
docker_tests/test_prod_image.py | 4 +-
docs/conf.py | 1 +
docs/sphinx_design/static/custom.css | 9 +
helm_tests/airflow_aux/test_airflow_common.py | 33 ++-
helm_tests/airflow_aux/test_basic_helm_chart.py | 40 +--
.../airflow_aux/test_celery_kubernetes_executor.py | 8 +-
helm_tests/airflow_aux/test_cleanup_pods.py | 92 +++---
helm_tests/airflow_aux/test_configmap.py | 12 +-
helm_tests/airflow_aux/test_create_user_job.py | 110 ++++---
.../test_logs_persistent_volume_claim.py | 12 +-
.../airflow_aux/test_migrate_database_job.py | 106 ++++---
helm_tests/airflow_aux/test_pod_launcher_role.py | 2 +-
helm_tests/airflow_aux/test_pod_template_file.py | 161 +++++-----
helm_tests/airflow_core/test_api_server.py | 271 +++++++----------
helm_tests/airflow_core/test_dag_processor.py | 184 +++++++-----
helm_tests/airflow_core/test_scheduler.py | 207 +++++++------
helm_tests/airflow_core/test_triggerer.py | 189 +++++++-----
helm_tests/airflow_core/test_worker.py | 182 +++++++-----
.../other/test_dags_persistent_volume_claim.py | 18 +-
helm_tests/other/test_flower.py | 164 ++++++-----
helm_tests/other/test_git_ssh_key_secret.py | 4 +-
helm_tests/other/test_git_sync_scheduler.py | 16 +-
helm_tests/other/test_git_sync_webserver.py | 19 +-
helm_tests/other/test_git_sync_worker.py | 24 +-
helm_tests/other/test_limit_ranges.py | 4 +-
helm_tests/other/test_pgbouncer.py | 162 +++++-----
helm_tests/other/test_redis.py | 76 +++--
helm_tests/other/test_resource_quota.py | 4 +-
helm_tests/other/test_statsd.py | 101 ++++---
helm_tests/security/test_elasticsearch_secret.py | 11 +-
helm_tests/security/test_kerberos.py | 2 +-
.../security/test_metadata_connection_secret.py | 22 +-
.../test_result_backend_connection_secret.py | 17 +-
helm_tests/security/test_scc_rolebinding.py | 50 ++--
helm_tests/security/test_security_context.py | 60 ++--
helm_tests/webserver/test_ingress_flower.py | 40 +--
helm_tests/webserver/test_ingress_web.py | 40 +--
helm_tests/webserver/test_webserver.py | 223 +++++++-------
.../airflow/providers/arangodb/sensors/arangodb.py | 2 +-
.../celery/executors/celery_executor_utils.py | 5 -
.../kubernetes/executors/kubernetes_executor.py | 2 +-
.../providers/dbt/cloud/utils/openlineage.py | 4 +-
.../src/airflow/providers/edge/cli/edge_command.py | 25 --
.../providers/edge/worker_api/routes/rpc_api.py | 109 ++++++-
.../providers/google/cloud/openlineage/utils.py | 18 ++
.../providers/google/cloud/sensors/dataproc.py | 4 +-
.../providers/google/cloud/transfers/s3_to_gcs.py | 15 +
.../airflow/providers/standard/operators/python.py | 5 -
.../providers/standard/operators/trigger_dagrun.py | 9 -
.../providers/standard/sensors/filesystem.py | 17 +-
.../aws/executors/batch/test_batch_executor.py | 2 +-
.../amazon/aws/executors/ecs/test_ecs_executor.py | 26 +-
providers/tests/amazon/aws/hooks/test_base_aws.py | 2 +-
providers/tests/amazon/aws/hooks/test_s3.py | 50 ++--
.../tests/amazon/aws/hooks/test_step_function.py | 2 +-
.../tests/amazon/aws/log/test_s3_task_handler.py | 4 +-
providers/tests/amazon/aws/operators/test_glue.py | 14 +-
.../amazon/aws/operators/test_kinesis_analytics.py | 4 +-
providers/tests/amazon/aws/operators/test_s3.py | 2 +-
.../amazon/aws/secrets/test_secrets_manager.py | 4 +-
.../amazon/aws/secrets/test_systems_manager.py | 6 +-
providers/tests/amazon/aws/transfers/test_base.py | 4 +-
.../amazon/aws/transfers/test_dynamodb_to_s3.py | 20 +-
.../tests/amazon/aws/transfers/test_gcs_to_s3.py | 4 +-
providers/tests/apache/drill/hooks/test_drill.py | 2 +-
providers/tests/apache/druid/hooks/test_druid.py | 2 +-
.../tests/apache/druid/operators/test_druid.py | 4 +-
providers/tests/apache/hdfs/hooks/test_webhdfs.py | 4 +-
providers/tests/apache/hive/macros/test_hive.py | 10 +-
.../hive/sensors/test_named_hive_partition.py | 2 +-
providers/tests/apache/kafka/sensors/test_kafka.py | 2 +-
.../apache/kylin/operators/test_kylin_cube.py | 10 +-
providers/tests/apache/livy/hooks/test_livy.py | 9 +-
providers/tests/apache/pig/operators/test_pig.py | 2 +-
.../executors/test_kubernetes_executor.py | 10 +-
.../tests/cncf/kubernetes/test_pod_generator.py | 4 +-
providers/tests/common/sql/hooks/test_dbapi.py | 14 +-
providers/tests/common/sql/sensors/test_sql.py | 4 +-
.../tests/databricks/operators/test_databricks.py | 20 +-
providers/tests/dingding/hooks/test_dingding.py | 2 +-
providers/tests/edge/cli/test_edge_command.py | 2 +-
.../tests/edge/worker_api/routes/test_rpc_api.py | 298 -------------------
.../elasticsearch/log/test_es_task_handler.py | 70 ++---
providers/tests/exasol/hooks/test_exasol.py | 2 +-
.../api_endpoints/test_asset_endpoint.py | 24 +-
.../api_endpoints/test_import_error_endpoint.py | 16 +-
.../test_role_and_permission_endpoint.py | 4 +-
.../api_endpoints/test_user_endpoint.py | 4 +-
.../api_endpoints/test_xcom_endpoint.py | 2 +-
.../security_manager/test_constants.py | 4 +-
providers/tests/fab/auth_manager/test_security.py | 2 +-
.../_internal_client/test_secret_manager_client.py | 4 +-
.../tests/google/cloud/hooks/test_bigquery.py | 18 +-
.../tests/google/cloud/hooks/test_cloud_sql.py | 130 ++++----
.../hooks/test_cloud_storage_transfer_service.py | 32 +-
.../tests/google/cloud/hooks/test_compute_ssh.py | 14 +-
.../tests/google/cloud/hooks/test_dataflow.py | 2 +-
.../tests/google/cloud/hooks/test_dataproc.py | 4 +-
.../tests/google/cloud/hooks/test_functions.py | 8 +-
providers/tests/google/cloud/hooks/test_kms.py | 4 +-
.../tests/google/cloud/hooks/test_life_sciences.py | 5 +-
providers/tests/google/cloud/hooks/test_pubsub.py | 12 +-
.../google/cloud/log/test_gcs_task_handler.py | 2 +-
.../cloud/log/test_gcs_task_handler_system.py | 4 +-
.../cloud/log/test_stackdriver_task_handler.py | 34 +--
.../log/test_stackdriver_task_handler_system.py | 8 +-
.../google/cloud/operators/test_datacatalog.py | 10 +-
.../tests/google/cloud/operators/test_dataproc.py | 8 +-
.../tests/google/cloud/operators/test_mlengine.py | 16 +-
.../tests/google/cloud/operators/test_pubsub.py | 2 +-
.../google/cloud/operators/test_stackdriver.py | 4 +-
.../tests/google/cloud/operators/test_tasks.py | 30 +-
.../tests/google/cloud/operators/test_translate.py | 4 +-
.../cloud/operators/test_translate_speech.py | 4 +-
.../tests/google/cloud/operators/test_vision.py | 4 +-
.../google/cloud/secrets/test_secret_manager.py | 8 +-
providers/tests/google/cloud/sensors/test_gcs.py | 4 +-
.../google/cloud/transfers/test_local_to_gcs.py | 2 +
.../google/cloud/transfers/test_mssql_to_gcs.py | 14 +-
.../google/cloud/transfers/test_mysql_to_gcs.py | 24 +-
.../google/cloud/transfers/test_oracle_to_gcs.py | 14 +-
.../google/cloud/transfers/test_postgres_to_gcs.py | 12 +-
.../tests/google/cloud/transfers/test_s3_to_gcs.py | 32 ++
.../cloud/transfers/test_salesforce_to_gcs.py | 2 +-
.../google/cloud/transfers/test_trino_to_gcs.py | 24 +-
.../cloud/utils/test_credentials_provider.py | 8 +-
.../google/cloud/utils/test_field_sanitizer.py | 22 +-
.../cloud/utils/test_mlengine_operator_utils.py | 110 +++----
.../utils/test_mlengine_prediction_summary.py | 4 +-
.../common/auth_backend/test_google_openid.py | 12 +-
.../tests/google/common/hooks/test_base_google.py | 12 +-
.../tests/google/firebase/hooks/test_firestore.py | 5 +-
providers/tests/google/suite/hooks/test_drive.py | 6 +-
.../_internal_client/test_vault_client.py | 106 +++----
providers/tests/hashicorp/hooks/test_vault.py | 88 +++---
providers/tests/hashicorp/secrets/test_vault.py | 24 +-
.../integration/apache/pinot/hooks/test_pinot.py | 2 +-
.../google/cloud/transfers/test_mssql_to_gcs.py | 6 +-
.../google/cloud/transfers/test_trino_to_gcs.py | 24 +-
.../tests/integration/trino/hooks/test_trino.py | 4 +-
.../microsoft/azure/secrets/test_key_vault.py | 2 +-
providers/tests/mongo/hooks/test_mongo.py | 32 +-
providers/tests/mysql/hooks/test_mysql.py | 2 +-
.../tests/opensearch/log/test_os_task_handler.py | 26 +-
providers/tests/opsgenie/hooks/test_opsgenie.py | 6 +-
.../tests/opsgenie/operators/test_opsgenie.py | 4 +-
.../tests/papermill/operators/test_papermill.py | 4 +-
providers/tests/postgres/hooks/test_postgres.py | 4 +-
providers/tests/presto/hooks/test_presto.py | 4 +-
providers/tests/smtp/hooks/test_smtp.py | 4 +-
providers/tests/snowflake/hooks/test_snowflake.py | 8 +-
providers/tests/ssh/hooks/test_ssh.py | 2 +-
providers/tests/ssh/operators/test_ssh.py | 2 +-
providers/tests/standard/operators/test_python.py | 29 +-
.../tests/standard/utils/test_python_virtualenv.py | 16 +-
providers/tests/telegram/hooks/test_telegram.py | 4 +-
.../tests/telegram/operators/test_telegram.py | 4 +-
providers/tests/teradata/utils/test_constants.py | 20 +-
providers/tests/trino/hooks/test_trino.py | 4 +-
pyproject.toml | 2 +
scripts/ci/docker-compose/devcontainer.env | 1 -
scripts/cov/cli_coverage.py | 1 -
scripts/cov/other_coverage.py | 1 -
scripts/cov/restapi_coverage.py | 2 +-
.../src/airflow/sdk/execution_time/supervisor.py | 123 ++++++--
task_sdk/tests/conftest.py | 9 +-
task_sdk/tests/defintions/test_dag.py | 4 +-
task_sdk/tests/execution_time/test_supervisor.py | 152 +++++++++-
tests/always/test_connection.py | 40 +--
tests/always/test_project_structure.py | 4 +-
tests/always/test_providers_manager.py | 14 +-
tests/always/test_secrets.py | 12 +-
tests/always/test_secrets_backends.py | 8 +-
tests/always/test_secrets_local_filesystem.py | 4 +-
.../api_connexion/endpoints/test_asset_endpoint.py | 4 +-
.../endpoints/test_connection_endpoint.py | 8 +-
tests/api_connexion/endpoints/test_dag_endpoint.py | 72 ++---
tests/api_connexion/endpoints/test_dag_parsing.py | 4 +-
.../endpoints/test_dag_run_endpoint.py | 8 +-
.../endpoints/test_dag_source_endpoint.py | 16 +-
.../endpoints/test_event_log_endpoint.py | 4 +-
.../endpoints/test_extra_link_endpoint.py | 30 +-
.../endpoints/test_health_endpoint.py | 14 +-
.../endpoints/test_import_error_endpoint.py | 16 +-
tests/api_connexion/endpoints/test_log_endpoint.py | 8 +-
.../api_connexion/endpoints/test_pool_endpoint.py | 56 ++--
.../endpoints/test_task_instance_endpoint.py | 20 +-
.../endpoints/test_version_endpoint.py | 4 +-
.../api_connexion/endpoints/test_xcom_endpoint.py | 14 +-
tests/api_connexion/schemas/test_common_schema.py | 6 +-
tests/api_connexion/schemas/test_dag_schema.py | 8 +-
tests/api_connexion/schemas/test_error_schema.py | 8 +-
tests/api_connexion/schemas/test_pool_schemas.py | 4 +-
tests/api_connexion/test_error_handling.py | 12 +-
.../core_api/routes/public/test_connections.py | 8 +-
.../core_api/routes/public/test_dag_parsing.py | 80 +++++
.../core_api/routes/public/test_dag_run.py | 4 +-
.../core_api/routes/public/test_dag_sources.py | 12 +-
.../api_fastapi/core_api/routes/public/test_log.py | 8 +-
.../core_api/routes/public/test_monitor.py | 14 +-
.../core_api/routes/public/test_pools.py | 2 +-
.../core_api/routes/public/test_task_instances.py | 20 +-
.../core_api/routes/public/test_variables.py | 2 +-
.../core_api/routes/public/test_version.py | 4 +-
tests/api_fastapi/core_api/routes/ui/test_graph.py | 198 +++++++++++++
.../execution_api/routes/test_task_instances.py | 2 +-
.../execution_api/routes/test_variables.py | 89 ++++++
tests/api_internal/__init__.py | 16 -
tests/api_internal/endpoints/__init__.py | 16 -
.../endpoints/test_rpc_api_endpoint.py | 250 ----------------
tests/api_internal/test_internal_api_call.py | 327 ---------------------
tests/charts/log_groomer.py | 26 +-
tests/cli/commands/test_asset_command.py | 26 ++
tests/cli/commands/test_config_command.py | 2 +-
tests/cli/commands/test_dag_command.py | 8 +-
tests/cli/commands/test_db_command.py | 8 +-
tests/cli/commands/test_info_command.py | 2 +-
tests/cli/commands/test_internal_api_command.py | 223 --------------
tests/cli/commands/test_legacy_commands.py | 2 +-
tests/cli/commands/test_variable_command.py | 20 +-
tests/cli/commands/test_webserver_command.py | 8 +-
tests/cli/test_cli_parser.py | 12 +-
tests/core/test_configuration.py | 65 ++--
tests/core/test_settings.py | 22 +-
tests/core/test_sqlalchemy_config.py | 5 -
tests/dags/test_mark_state.py | 4 +-
tests/decorators/test_python.py | 6 +-
tests/executors/test_executor_loader.py | 4 +-
.../integration/executors/test_celery_executor.py | 10 +-
tests/jobs/test_local_task_job.py | 2 +-
tests/jobs/test_scheduler_job.py | 86 +++---
tests/models/test_baseoperator.py | 20 +-
tests/models/test_dag.py | 45 ++-
tests/models/test_dag_version.py | 2 +-
tests/models/test_dagbag.py | 24 +-
tests/models/test_dagrun.py | 38 +--
tests/models/test_pool.py | 46 +--
tests/models/test_renderedtifields.py | 12 +-
tests/models/test_taskinstance.py | 47 ++-
tests/models/test_taskmixin.py | 20 +-
tests/models/test_variable.py | 12 +-
tests/operators/test_latest_only_operator.py | 28 +-
tests/operators/test_trigger_dagrun.py | 3 -
tests/plugins/test_plugins_manager.py | 14 +-
tests/sensors/test_external_task_sensor.py | 4 +-
tests/serialization/test_dag_serialization.py | 2 +-
tests/serialization/test_pydantic_models.py | 295 -------------------
tests/serialization/test_serialized_objects.py | 4 -
tests/task/test_standard_task_runner.py | 2 +-
tests/utils/log/test_log_reader.py | 4 +-
tests/utils/test_email.py | 12 +-
tests/utils/test_file.py | 2 +-
tests/utils/test_net.py | 4 +-
tests/utils/test_operator_helpers.py | 4 +-
tests/utils/test_process_utils.py | 18 +-
tests/utils/test_serve_logs.py | 2 +-
tests/www/test_app.py | 8 +-
tests/www/test_utils.py | 43 +--
tests/www/views/test_anonymous_as_admin_role.py | 2 +-
tests/www/views/test_views.py | 2 +-
tests/www/views/test_views_base.py | 2 +-
tests/www/views/test_views_connection.py | 14 +-
tests/www/views/test_views_extra_links.py | 2 +-
tests/www/views/test_views_home.py | 16 +-
tests/www/views/test_views_log.py | 22 +-
tests/www/views/test_views_tasks.py | 2 +-
tests_common/pytest_plugin.py | 1 -
tests_common/test_utils/compat.py | 5 -
340 files changed, 5202 insertions(+), 5950 deletions(-)
create mode 100644 airflow/api_fastapi/core_api/datamodels/ui/graph.py
copy airflow/{api_connexion/endpoints => api_fastapi/core_api/routes/public}/dag_parsing.py (62%)
create mode 100644 airflow/api_fastapi/core_api/routes/ui/graph.py
delete mode 100644 airflow/api_internal/__init__.py
delete mode 100644 airflow/api_internal/endpoints/__init__.py
delete mode 100644 airflow/api_internal/endpoints/health_endpoint.py
delete mode 100644 airflow/api_internal/endpoints/rpc_api_endpoint.py
delete mode 100644 airflow/api_internal/gunicorn_config.py
delete mode 100644 airflow/api_internal/openapi/internal_api_v1.yaml
delete mode 100644 airflow/cli/commands/internal_api_command.py
delete mode 100644 providers/tests/edge/worker_api/routes/test_rpc_api.py
create mode 100644 tests/api_fastapi/core_api/routes/public/test_dag_parsing.py
create mode 100644 tests/api_fastapi/core_api/routes/ui/test_graph.py
delete mode 100644 tests/api_internal/__init__.py
delete mode 100644 tests/api_internal/endpoints/__init__.py
delete mode 100644 tests/api_internal/endpoints/test_rpc_api_endpoint.py
delete mode 100644 tests/api_internal/test_internal_api_call.py
delete mode 100644 tests/cli/commands/test_internal_api_command.py
delete mode 100644 tests/serialization/test_pydantic_models.py
(airflow) 01/01: Swap internal RPC server for API server in the helm chart
Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ash pushed a commit to branch run-api-server-helm-chart
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit 2384924617e802f7e7f2b6901e31a7ff6b7cd1dc
Author: Ash Berlin-Taylor <as...@apache.org>
AuthorDate: Thu Nov 28 21:35:10 2024 +0000
Swap internal RPC server for API server in the helm chart
Previously the PRC server was possible to disable/enable, where as now the new
api-server is a required component in Airflow 3.0+
This also does a little bit of drive-by refactoring of the helper templates
for service account name generation
---
chart/templates/_helpers.yaml | 92 ++---
.../api-server-deployment.yaml} | 165 ++++----
.../api-server-networkpolicy.yaml} | 20 +-
.../api-server-poddisruptionbudget.yaml} | 18 +-
.../api-server-service.yaml} | 28 +-
.../api-server-serviceaccount.yaml} | 16 +-
chart/values.schema.json | 177 ++++-----
chart/values.yaml | 26 +-
.../airflow_breeze/commands/kubernetes_commands.py | 7 +-
.../src/airflow_breeze/params/build_prod_params.py | 12 +
helm_tests/airflow_aux/test_basic_helm_chart.py | 42 +-
.../{test_rpc_server.py => test_api_server.py} | 424 ++++++---------------
helm_tests/security/test_rbac.py | 47 ++-
13 files changed, 399 insertions(+), 675 deletions(-)
diff --git a/chart/templates/_helpers.yaml b/chart/templates/_helpers.yaml
index 25a70cb7802..887e9bd33cb 100644
--- a/chart/templates/_helpers.yaml
+++ b/chart/templates/_helpers.yaml
@@ -590,122 +590,80 @@ server_tls_key_file = /etc/pgbouncer/server.key
{{- end }}
{{- end }}
-{{/* Create the name of the webserver service account to use */}}
-{{- define "webserver.serviceAccountName" -}}
- {{- if .Values.webserver.serviceAccount.create }}
- {{- default (printf "%s-webserver" (include "airflow.serviceAccountName" .)) .Values.webserver.serviceAccount.name }}
+{{/* Helper to generate service account name respecting .Values.$section.serviceAccount flags */}}
+{{- define "_serviceAccountName" -}}
+ {{- $sa := get (get .Values .key) "serviceAccount" }}
+ {{- if $sa.create }}
+ {{- default (printf "%s-%s" (include "airflow.serviceAccountName" .) (default .key .nameSuffix )) $sa.name | quote }}
{{- else }}
- {{- default "default" .Values.webserver.serviceAccount.name }}
+ {{- default "default" $sa.name | quote }}
{{- end }}
{{- end }}
+{{/* Create the name of the webserver service account to use */}}
+{{- define "webserver.serviceAccountName" -}}
+ {{- include "_serviceAccountName" (merge (dict "key" "webserver") .) -}}
+{{- end }}
+
-{{/* Create the name of the RPC server service account to use */}}
-{{- define "rpcServer.serviceAccountName" -}}
- {{- if .Values._rpcServer.serviceAccount.create }}
- {{- default (printf "%s-rpc-server" (include "airflow.serviceAccountName" .)) .Values._rpcServer.serviceAccount.name }}
- {{- else }}
- {{- default "default" .Values._rpcServer.serviceAccount.name }}
- {{- end }}
+{{/* Create the name of the API server service account to use */}}
+{{- define "apiServer.serviceAccountName" -}}
+ {{- include "_serviceAccountName" (merge (dict "key" "apiServer" "nameSuffix" "api-server" ) .) -}}
{{- end }}
{{/* Create the name of the redis service account to use */}}
{{- define "redis.serviceAccountName" -}}
- {{- if .Values.redis.serviceAccount.create }}
- {{- default (printf "%s-redis" (include "airflow.serviceAccountName" .)) .Values.redis.serviceAccount.name }}
- {{- else }}
- {{- default "default" .Values.redis.serviceAccount.name }}
- {{- end }}
+ {{- include "_serviceAccountName" (merge (dict "key" "redis") .) -}}
{{- end }}
{{/* Create the name of the flower service account to use */}}
{{- define "flower.serviceAccountName" -}}
- {{- if .Values.flower.serviceAccount.create }}
- {{- default (printf "%s-flower" (include "airflow.serviceAccountName" .)) .Values.flower.serviceAccount.name }}
- {{- else }}
- {{- default "default" .Values.flower.serviceAccount.name }}
- {{- end }}
+ {{- include "_serviceAccountName" (merge (dict "key" "flower") .) -}}
{{- end }}
{{/* Create the name of the scheduler service account to use */}}
{{- define "scheduler.serviceAccountName" -}}
- {{- if .Values.scheduler.serviceAccount.create }}
- {{- default (printf "%s-scheduler" (include "airflow.serviceAccountName" .)) .Values.scheduler.serviceAccount.name }}
- {{- else }}
- {{- default "default" .Values.scheduler.serviceAccount.name }}
- {{- end }}
+ {{- include "_serviceAccountName" (merge (dict "key" "scheduler") .) -}}
{{- end }}
{{/* Create the name of the StatsD service account to use */}}
{{- define "statsd.serviceAccountName" -}}
- {{- if .Values.statsd.serviceAccount.create }}
- {{- default (printf "%s-statsd" (include "airflow.serviceAccountName" .)) .Values.statsd.serviceAccount.name }}
- {{- else }}
- {{- default "default" .Values.statsd.serviceAccount.name }}
- {{- end }}
+ {{- include "_serviceAccountName" (merge (dict "key" "statsd") .) -}}
{{- end }}
{{/* Create the name of the create user job service account to use */}}
{{- define "createUserJob.serviceAccountName" -}}
- {{- if .Values.createUserJob.serviceAccount.create }}
- {{- default (printf "%s-create-user-job" (include "airflow.serviceAccountName" .)) .Values.createUserJob.serviceAccount.name }}
- {{- else }}
- {{- default "default" .Values.createUserJob.serviceAccount.name }}
- {{- end }}
+ {{- include "_serviceAccountName" (merge (dict "key" "createUserJob" "nameSuffix" "create-user-job") .) -}}
{{- end }}
{{/* Create the name of the migrate database job service account to use */}}
{{- define "migrateDatabaseJob.serviceAccountName" -}}
- {{- if .Values.migrateDatabaseJob.serviceAccount.create }}
- {{- default (printf "%s-migrate-database-job" (include "airflow.serviceAccountName" .)) .Values.migrateDatabaseJob.serviceAccount.name }}
- {{- else }}
- {{- default "default" .Values.migrateDatabaseJob.serviceAccount.name }}
- {{- end }}
+ {{- include "_serviceAccountName" (merge (dict "key" "migrateDatabaseJob" "nameSuffix" "migrate-database-job") .) -}}
{{- end }}
{{/* Create the name of the worker service account to use */}}
{{- define "worker.serviceAccountName" -}}
- {{- if .Values.workers.serviceAccount.create }}
- {{- default (printf "%s-worker" (include "airflow.serviceAccountName" .)) .Values.workers.serviceAccount.name }}
- {{- else }}
- {{- default "default" .Values.workers.serviceAccount.name }}
- {{- end }}
+ {{- include "_serviceAccountName" (merge (dict "key" "workers" "nameSuffix" "worker") .) -}}
{{- end }}
{{/* Create the name of the triggerer service account to use */}}
{{- define "triggerer.serviceAccountName" -}}
- {{- if .Values.triggerer.serviceAccount.create }}
- {{- default (printf "%s-triggerer" (include "airflow.serviceAccountName" .)) .Values.triggerer.serviceAccount.name }}
- {{- else }}
- {{- default "default" .Values.triggerer.serviceAccount.name }}
- {{- end }}
+ {{- include "_serviceAccountName" (merge (dict "key" "triggerer") .) -}}
{{- end }}
{{/* Create the name of the dag processor service account to use */}}
{{- define "dagProcessor.serviceAccountName" -}}
- {{- if .Values.dagProcessor.serviceAccount.create }}
- {{- default (printf "%s-dag-processor" (include "airflow.serviceAccountName" .)) .Values.dagProcessor.serviceAccount.name }}
- {{- else }}
- {{- default "default" .Values.dagProcessor.serviceAccount.name }}
- {{- end }}
+ {{- include "_serviceAccountName" (merge (dict "key" "dagProcessor" "nameSuffix" "dag-processor") .) -}}
{{- end }}
{{/* Create the name of the pgbouncer service account to use */}}
{{- define "pgbouncer.serviceAccountName" -}}
- {{- if .Values.pgbouncer.serviceAccount.create }}
- {{- default (printf "%s-pgbouncer" (include "airflow.serviceAccountName" .)) .Values.pgbouncer.serviceAccount.name }}
- {{- else }}
- {{- default "default" .Values.pgbouncer.serviceAccount.name }}
- {{- end }}
+ {{- include "_serviceAccountName" (merge (dict "key" "pgbouncer") .) -}}
{{- end }}
{{/* Create the name of the cleanup service account to use */}}
{{- define "cleanup.serviceAccountName" -}}
- {{- if .Values.cleanup.serviceAccount.create }}
- {{- default (printf "%s-cleanup" (include "airflow.serviceAccountName" .)) .Values.cleanup.serviceAccount.name }}
- {{- else }}
- {{- default "default" .Values.cleanup.serviceAccount.name }}
- {{- end }}
+ {{- include "_serviceAccountName" (merge (dict "key" "cleanup") .) -}}
{{- end }}
{{- define "wait-for-migrations-command" -}}
diff --git a/chart/templates/rpc-server/rpc-server-deployment.yaml b/chart/templates/api-server/api-server-deployment.yaml
similarity index 54%
rename from chart/templates/rpc-server/rpc-server-deployment.yaml
rename to chart/templates/api-server/api-server-deployment.yaml
index 4a3766c5853..b4cf2cd4461 100644
--- a/chart/templates/rpc-server/rpc-server-deployment.yaml
+++ b/chart/templates/api-server/api-server-deployment.yaml
@@ -18,44 +18,43 @@
*/}}
################################
-## Airflow rpc-server Deployment
+## Airflow API Server Deployment
#################################
-{{- if .Values._rpcServer.enabled }}
-{{- $nodeSelector := or .Values._rpcServer.nodeSelector .Values.nodeSelector }}
-{{- $affinity := or .Values._rpcServer.affinity .Values.affinity }}
-{{- $tolerations := or .Values._rpcServer.tolerations .Values.tolerations }}
-{{- $topologySpreadConstraints := or .Values._rpcServer.topologySpreadConstraints .Values.topologySpreadConstraints }}
-{{- $revisionHistoryLimit := or .Values._rpcServer.revisionHistoryLimit .Values.revisionHistoryLimit }}
-{{- $securityContext := include "airflowPodSecurityContext" (list . .Values._rpcServer) }}
-{{- $containerSecurityContext := include "containerSecurityContext" (list . .Values._rpcServer) }}
-{{- $containerSecurityContextWaitForMigrations := include "containerSecurityContext" (list . .Values._rpcServer.waitForMigrations) }}
-{{- $containerLifecycleHooks := or .Values._rpcServer.containerLifecycleHooks .Values.containerLifecycleHooks }}
+{{- if semverCompare ">=3.0.0" .Values.airflowVersion }}
+{{- $nodeSelector := or .Values.apiServer.nodeSelector .Values.nodeSelector }}
+{{- $affinity := or .Values.apiServer.affinity .Values.affinity }}
+{{- $tolerations := or .Values.apiServer.tolerations .Values.tolerations }}
+{{- $topologySpreadConstraints := or .Values.apiServer.topologySpreadConstraints .Values.topologySpreadConstraints }}
+{{- $revisionHistoryLimit := or .Values.apiServer.revisionHistoryLimit .Values.revisionHistoryLimit }}
+{{- $securityContext := include "airflowPodSecurityContext" (list . .Values.apiServer) }}
+{{- $containerSecurityContext := include "containerSecurityContext" (list . .Values.apiServer) }}
+{{- $containerSecurityContextWaitForMigrations := include "containerSecurityContext" (list . .Values.apiServer.waitForMigrations) }}
+{{- $containerLifecycleHooks := or .Values.apiServer.containerLifecycleHooks .Values.containerLifecycleHooks }}
apiVersion: apps/v1
kind: Deployment
metadata:
- name: {{ include "airflow.fullname" . }}-rpc-server
+ name: {{ include "airflow.fullname" . }}-api-server
labels:
tier: airflow
- component: rpc-server
+ component: api-server
release: {{ .Release.Name }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
heritage: {{ .Release.Service }}
{{- with .Values.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
- {{- if .Values._rpcServer.annotations }}
- annotations: {{- toYaml .Values._rpcServer.annotations | nindent 4 }}
+ {{- if .Values.apiServer.annotations }}
+ annotations: {{- toYaml .Values.apiServer.annotations | nindent 4 }}
{{- end }}
spec:
- replicas: {{ .Values._rpcServer.replicas }}
+ replicas: {{ .Values.apiServer.replicas }}
{{- if $revisionHistoryLimit }}
revisionHistoryLimit: {{ $revisionHistoryLimit }}
{{- end }}
strategy:
- {{- if .Values._rpcServer.strategy }}
- {{- toYaml .Values._rpcServer.strategy | nindent 4 }}
+ {{- if .Values.apiServer.strategy }}
+ {{- toYaml .Values.apiServer.strategy | nindent 4 }}
{{- else }}
- {{- if semverCompare ">=2.0.0" .Values.airflowVersion }}
# Here we define the rolling update strategy
# - maxSurge define how many pod we can add at a time
# - maxUnavailable define how many pod can be unavailable
@@ -67,23 +66,20 @@ spec:
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
- {{- else }}
- type: Recreate
- {{- end }}
{{- end }}
selector:
matchLabels:
tier: airflow
- component: rpc-server
+ component: api-server
release: {{ .Release.Name }}
template:
metadata:
labels:
tier: airflow
- component: rpc-server
+ component: api-server
release: {{ .Release.Name }}
- {{- if or (.Values.labels) (.Values._rpcServer.labels) }}
- {{- mustMerge .Values._rpcServer.labels .Values.labels | toYaml | nindent 8 }}
+ {{- if or (.Values.labels) (.Values.apiServer.labels) }}
+ {{- mustMerge .Values.apiServer.labels .Values.labels | toYaml | nindent 8 }}
{{- end }}
annotations:
checksum/metadata-secret: {{ include (print $.Template.BasePath "/secrets/metadata-connection-secret.yaml") . | sha256sum }}
@@ -94,16 +90,16 @@ spec:
{{- if .Values.airflowPodAnnotations }}
{{- toYaml .Values.airflowPodAnnotations | nindent 8 }}
{{- end }}
- {{- if .Values._rpcServer.podAnnotations }}
- {{- toYaml .Values._rpcServer.podAnnotations | nindent 8 }}
+ {{- if .Values.apiServer.podAnnotations }}
+ {{- toYaml .Values.apiServer.podAnnotations | nindent 8 }}
{{- end }}
spec:
- {{- if .Values._rpcServer.hostAliases }}
- hostAliases: {{- toYaml .Values._rpcServer.hostAliases | nindent 8 }}
+ {{- if .Values.apiServer.hostAliases }}
+ hostAliases: {{- toYaml .Values.apiServer.hostAliases | nindent 8 }}
{{- end }}
- serviceAccountName: {{ include "rpcServer.serviceAccountName" . }}
- {{- if .Values._rpcServer.priorityClassName }}
- priorityClassName: {{ .Values._rpcServer.priorityClassName }}
+ serviceAccountName: {{ include "apiServer.serviceAccountName" . }}
+ {{- if .Values.apiServer.priorityClassName }}
+ priorityClassName: {{ .Values.apiServer.priorityClassName }}
{{- end }}
{{- if .Values.schedulerName }}
schedulerName: {{ .Values.schedulerName }}
@@ -118,7 +114,7 @@ spec:
- podAffinityTerm:
labelSelector:
matchLabels:
- component: rpc-server
+ component: api-server
topologyKey: kubernetes.io/hostname
weight: 100
{{- end }}
@@ -131,9 +127,9 @@ spec:
- name: {{ template "registry_secret" . }}
{{- end }}
initContainers:
- {{- if .Values._rpcServer.waitForMigrations.enabled }}
+ {{- if .Values.apiServer.waitForMigrations.enabled }}
- name: wait-for-airflow-migrations
- resources: {{- toYaml .Values._rpcServer.resources | nindent 12 }}
+ resources: {{- toYaml .Values.apiServer.resources | nindent 12 }}
image: {{ template "airflow_image_for_migrations" . }}
imagePullPolicy: {{ .Values.images.airflow.pullPolicy }}
securityContext: {{ $containerSecurityContextWaitForMigrations | nindent 12 }}
@@ -142,36 +138,36 @@ spec:
{{- if .Values.volumeMounts }}
{{- toYaml .Values.volumeMounts | nindent 12 }}
{{- end }}
- {{- if .Values._rpcServer.extraVolumeMounts }}
- {{- tpl (toYaml .Values._rpcServer.extraVolumeMounts) . | nindent 12 }}
+ {{- if .Values.apiServer.extraVolumeMounts }}
+ {{- tpl (toYaml .Values.apiServer.extraVolumeMounts) . | nindent 12 }}
{{- end }}
args: {{- include "wait-for-migrations-command" . | indent 10 }}
envFrom: {{- include "custom_airflow_environment_from" . | default "\n []" | indent 10 }}
env:
{{- include "custom_airflow_environment" . | indent 10 }}
{{- include "standard_airflow_environment" . | indent 10 }}
- {{- if .Values._rpcServer.waitForMigrations.env }}
- {{- tpl (toYaml .Values._rpcServer.waitForMigrations.env) $ | nindent 12 }}
+ {{- if .Values.apiServer.waitForMigrations.env }}
+ {{- tpl (toYaml .Values.apiServer.waitForMigrations.env) $ | nindent 12 }}
{{- end }}
{{- end }}
- {{- if .Values._rpcServer.extraInitContainers }}
- {{- toYaml .Values._rpcServer.extraInitContainers | nindent 8 }}
+ {{- if .Values.apiServer.extraInitContainers }}
+ {{- toYaml .Values.apiServer.extraInitContainers | nindent 8 }}
{{- end }}
containers:
- - name: rpc-server
+ - name: api-server
image: {{ template "airflow_image" . }}
imagePullPolicy: {{ .Values.images.airflow.pullPolicy }}
securityContext: {{ $containerSecurityContext | nindent 12 }}
{{- if $containerLifecycleHooks }}
lifecycle: {{- tpl (toYaml $containerLifecycleHooks) . | nindent 12 }}
{{- end }}
- {{- if .Values._rpcServer.command }}
- command: {{ tpl (toYaml .Values._rpcServer.command) . | nindent 12 }}
+ {{- if .Values.apiServer.command }}
+ command: {{ tpl (toYaml .Values.apiServer.command) . | nindent 12 }}
{{- end }}
- {{- if .Values._rpcServer.args }}
- args: {{- tpl (toYaml .Values._rpcServer.args) . | nindent 12 }}
+ {{- if .Values.apiServer.args }}
+ args: {{- tpl (toYaml .Values.apiServer.args) . | nindent 12 }}
{{- end }}
- resources: {{- toYaml .Values._rpcServer.resources | nindent 12 }}
+ resources: {{- toYaml .Values.apiServer.resources | nindent 12 }}
volumeMounts:
{{- include "airflow_config_mount" . | nindent 12 }}
{{- if .Values.logs.persistence.enabled }}
@@ -181,63 +177,48 @@ spec:
{{- if .Values.volumeMounts }}
{{- toYaml .Values.volumeMounts | nindent 12 }}
{{- end }}
- {{- if .Values._rpcServer.extraVolumeMounts }}
- {{- tpl (toYaml .Values._rpcServer.extraVolumeMounts) . | nindent 12 }}
+ {{- if .Values.apiServer.extraVolumeMounts }}
+ {{- tpl (toYaml .Values.apiServer.extraVolumeMounts) . | nindent 12 }}
{{- end }}
ports:
- - name: rpc-server
- containerPort: {{ .Values.ports._rpcServer }}
+ - name: api-server
+ containerPort: {{ .Values.ports.apiServer }}
livenessProbe:
httpGet:
- path: {{ if .Values.config.core.internal_api_url }}{{- with urlParse (tpl .Values.config.core.internal_api_url .) }}{{ .path }}{{ end }}{{ end }}/internal_api/v1/health
- port: {{ .Values.ports._rpcServer }}
- {{- if .Values.config.core.internal_api_url}}
- httpHeaders:
- - name: Host
- value: {{ regexReplaceAll ":\\d+$" (urlParse (tpl .Values.config.core.internal_api_url .)).host "" }}
- {{- end }}
- scheme: {{ .Values._rpcServer.livenessProbe.scheme | default "http" }}
- initialDelaySeconds: {{ .Values._rpcServer.livenessProbe.initialDelaySeconds }}
- timeoutSeconds: {{ .Values._rpcServer.livenessProbe.timeoutSeconds }}
- failureThreshold: {{ .Values._rpcServer.livenessProbe.failureThreshold }}
- periodSeconds: {{ .Values._rpcServer.livenessProbe.periodSeconds }}
+ path: /public/version
+ port: {{ .Values.ports.apiServer }}
+ scheme: {{ .Values.apiServer.livenessProbe.scheme | default "http" }}
+ initialDelaySeconds: {{ .Values.apiServer.livenessProbe.initialDelaySeconds }}
+ timeoutSeconds: {{ .Values.apiServer.livenessProbe.timeoutSeconds }}
+ failureThreshold: {{ .Values.apiServer.livenessProbe.failureThreshold }}
+ periodSeconds: {{ .Values.apiServer.livenessProbe.periodSeconds }}
readinessProbe:
httpGet:
- path: {{ if .Values.config.core.internal_api_url }}{{- with urlParse (tpl .Values.config.core.internal_api_url .) }}{{ .path }}{{ end }}{{ end }}/internal_api/v1/health
- port: {{ .Values.ports._rpcServer }}
- {{- if .Values.config.core.internal_api_url }}
- httpHeaders:
- - name: Host
- value: {{ regexReplaceAll ":\\d+$" (urlParse (tpl .Values.config.core.internal_api_url .)).host "" }}
- {{- end }}
- scheme: {{ .Values._rpcServer.readinessProbe.scheme | default "http" }}
- initialDelaySeconds: {{ .Values._rpcServer.readinessProbe.initialDelaySeconds }}
- timeoutSeconds: {{ .Values._rpcServer.readinessProbe.timeoutSeconds }}
- failureThreshold: {{ .Values._rpcServer.readinessProbe.failureThreshold }}
- periodSeconds: {{ .Values._rpcServer.readinessProbe.periodSeconds }}
+ path: /public/version
+ port: {{ .Values.ports.apiServer }}
+ scheme: {{ .Values.apiServer.readinessProbe.scheme | default "http" }}
+ initialDelaySeconds: {{ .Values.apiServer.readinessProbe.initialDelaySeconds }}
+ timeoutSeconds: {{ .Values.apiServer.readinessProbe.timeoutSeconds }}
+ failureThreshold: {{ .Values.apiServer.readinessProbe.failureThreshold }}
+ periodSeconds: {{ .Values.apiServer.readinessProbe.periodSeconds }}
startupProbe:
httpGet:
- path: {{ if .Values.config.core.internal_api_url }}{{- with urlParse (tpl .Values.config.core.internal_api_url .) }}{{ .path }}{{ end }}{{ end }}/internal_api/v1/health
- port: {{ .Values.ports._rpcServer }}
- {{- if .Values.config.core.internal_api_url}}
- httpHeaders:
- - name: Host
- value: {{ regexReplaceAll ":\\d+$" (urlParse (tpl .Values.config.core.internal_api_url .)).host "" }}
- {{- end }}
- scheme: {{ .Values._rpcServer.startupProbe.scheme | default "http" }}
- timeoutSeconds: {{ .Values._rpcServer.startupProbe.timeoutSeconds }}
- failureThreshold: {{ .Values._rpcServer.startupProbe.failureThreshold }}
- periodSeconds: {{ .Values._rpcServer.startupProbe.periodSeconds }}
+ path: /public/version
+ port: {{ .Values.ports.apiServer }}
+ scheme: {{ .Values.apiServer.startupProbe.scheme | default "http" }}
+ timeoutSeconds: {{ .Values.apiServer.startupProbe.timeoutSeconds }}
+ failureThreshold: {{ .Values.apiServer.startupProbe.failureThreshold }}
+ periodSeconds: {{ .Values.apiServer.startupProbe.periodSeconds }}
envFrom: {{- include "custom_airflow_environment_from" . | default "\n []" | indent 10 }}
env:
{{- include "custom_airflow_environment" . | indent 10 }}
{{- include "standard_airflow_environment" . | indent 10 }}
- {{- include "container_extra_envs" (list . .Values._rpcServer.env) | indent 10 }}
+ {{- include "container_extra_envs" (list . .Values.apiServer.env) | indent 10 }}
{{- if and (.Values.dags.gitSync.enabled) (not .Values.dags.persistence.enabled) (semverCompare "<2.0.0" .Values.airflowVersion) }}
{{- include "git_sync_container" . | nindent 8 }}
{{- end }}
- {{- if .Values._rpcServer.extraContainers }}
- {{- tpl (toYaml .Values._rpcServer.extraContainers) . | nindent 8 }}
+ {{- if .Values.apiServer.extraContainers }}
+ {{- tpl (toYaml .Values.apiServer.extraContainers) . | nindent 8 }}
{{- end }}
volumes:
- name: config
@@ -253,7 +234,7 @@ spec:
{{- if .Values.volumes }}
{{- toYaml .Values.volumes | nindent 8 }}
{{- end }}
- {{- if .Values._rpcServer.extraVolumes }}
- {{- tpl (toYaml .Values._rpcServer.extraVolumes) . | nindent 8 }}
+ {{- if .Values.apiServer.extraVolumes }}
+ {{- tpl (toYaml .Values.apiServer.extraVolumes) . | nindent 8 }}
{{- end }}
{{- end }}
diff --git a/chart/templates/rpc-server/rpc-server-networkpolicy.yaml b/chart/templates/api-server/api-server-networkpolicy.yaml
similarity index 71%
rename from chart/templates/rpc-server/rpc-server-networkpolicy.yaml
rename to chart/templates/api-server/api-server-networkpolicy.yaml
index ce345342945..af460181120 100644
--- a/chart/templates/rpc-server/rpc-server-networkpolicy.yaml
+++ b/chart/templates/api-server/api-server-networkpolicy.yaml
@@ -18,36 +18,36 @@
*/}}
################################
-## Airflow rpc-server NetworkPolicy
+## Airflow API server NetworkPolicy
#################################
-{{- if .Values._rpcServer.enabled }}
+{{- if semverCompare ">=3.0.0" .Values.airflowVersion }}
{{- if .Values.networkPolicies.enabled }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
- name: {{ include "airflow.fullname" . }}-rpc-server-policy
+ name: {{ include "airflow.fullname" . }}-api-server-policy
labels:
tier: airflow
- component: airflow-rpc-server-policy
+ component: airflow-api-server-policy
release: {{ .Release.Name }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
heritage: {{ .Release.Service }}
- {{- if or (.Values.labels) (.Values._rpcServer.labels) }}
- {{- mustMerge .Values._rpcServer.labels .Values.labels | toYaml | nindent 4 }}
+ {{- if or (.Values.labels) (.Values.apiServer.labels) }}
+ {{- mustMerge .Values.apiServer.labels .Values.labels | toYaml | nindent 4 }}
{{- end }}
spec:
podSelector:
matchLabels:
tier: airflow
- component: rpc-server
+ component: api-server
release: {{ .Release.Name }}
policyTypes:
- Ingress
- {{- if .Values._rpcServer.networkPolicy.ingress.from }}
+ {{- if .Values.apiServer.networkPolicy.ingress.from }}
ingress:
- - from: {{- toYaml .Values._rpcServer.networkPolicy.ingress.from | nindent 6 }}
+ - from: {{- toYaml .Values.apiServer.networkPolicy.ingress.from | nindent 6 }}
ports:
- {{ range .Values._rpcServer.networkPolicy.ingress.ports }}
+ {{ range .Values.apiServer.networkPolicy.ingress.ports }}
-
{{- range $key, $val := . }}
{{ $key }}: {{ tpl (toString $val) $ }}
diff --git a/chart/templates/rpc-server/rpc-server-poddisruptionbudget.yaml b/chart/templates/api-server/api-server-poddisruptionbudget.yaml
similarity index 70%
rename from chart/templates/rpc-server/rpc-server-poddisruptionbudget.yaml
rename to chart/templates/api-server/api-server-poddisruptionbudget.yaml
index e6d4afebb2d..7d0b162e41e 100644
--- a/chart/templates/rpc-server/rpc-server-poddisruptionbudget.yaml
+++ b/chart/templates/api-server/api-server-poddisruptionbudget.yaml
@@ -18,29 +18,29 @@
*/}}
################################
-## Airflow rpc-server PodDisruptionBudget
+## Airflow api-server PodDisruptionBudget
#################################
-{{- if .Values._rpcServer.enabled }}
-{{- if .Values._rpcServer.podDisruptionBudget.enabled }}
+{{- if semverCompare ">=3.0.0" .Values.airflowVersion }}
+{{- if .Values.apiServer.podDisruptionBudget.enabled }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
- name: {{ include "airflow.fullname" . }}-rpc-server-pdb
+ name: {{ include "airflow.fullname" . }}-api-server-pdb
labels:
tier: airflow
- component: rpc-server
+ component: api-server
release: {{ .Release.Name }}
chart: {{ .Chart.Name }}
heritage: {{ .Release.Service }}
- {{- if or (.Values.labels) (.Values._rpcServer.labels) }}
- {{- mustMerge .Values._rpcServer.labels .Values.labels | toYaml | nindent 4 }}
+ {{- if or (.Values.labels) (.Values.apiServer.labels) }}
+ {{- mustMerge .Values.apiServer.labels .Values.labels | toYaml | nindent 4 }}
{{- end }}
spec:
selector:
matchLabels:
tier: airflow
- component: rpc-server
+ component: api-server
release: {{ .Release.Name }}
- {{- toYaml .Values._rpcServer.podDisruptionBudget.config | nindent 2 }}
+ {{- toYaml .Values.apiServer.podDisruptionBudget.config | nindent 2 }}
{{- end }}
{{- end }}
diff --git a/chart/templates/rpc-server/rpc-server-service.yaml b/chart/templates/api-server/api-server-service.yaml
similarity index 63%
rename from chart/templates/rpc-server/rpc-server-service.yaml
rename to chart/templates/api-server/api-server-service.yaml
index f6b9160d2fb..0a360aee085 100644
--- a/chart/templates/rpc-server/rpc-server-service.yaml
+++ b/chart/templates/api-server/api-server-service.yaml
@@ -18,42 +18,42 @@
*/}}
################################
-## Airflow rpc-server Service
+## Airflow api-server Service
#################################
-{{- if .Values._rpcServer.enabled }}
+{{- if semverCompare ">=3.0.0" .Values.airflowVersion }}
apiVersion: v1
kind: Service
metadata:
- name: {{ include "airflow.fullname" . }}-rpc-server
+ name: {{ include "airflow.fullname" . }}-api-server
labels:
tier: airflow
- component: rpc-server
+ component: api-server
release: {{ .Release.Name }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
heritage: {{ .Release.Service }}
- {{- if or (.Values.labels) (.Values._rpcServer.labels) }}
- {{- mustMerge .Values._rpcServer.labels .Values.labels | toYaml | nindent 4 }}
+ {{- if or (.Values.labels) (.Values.apiServer.labels) }}
+ {{- mustMerge .Values.apiServer.labels .Values.labels | toYaml | nindent 4 }}
{{- end }}
- {{- with .Values._rpcServer.service.annotations }}
+ {{- with .Values.apiServer.service.annotations }}
annotations: {{- toYaml . | nindent 4 }}
{{- end }}
spec:
- type: {{ .Values._rpcServer.service.type }}
+ type: {{ .Values.apiServer.service.type }}
selector:
tier: airflow
- component: rpc-server
+ component: api-server
release: {{ .Release.Name }}
ports:
- {{ range .Values._rpcServer.service.ports }}
+ {{ range .Values.apiServer.service.ports }}
-
{{- range $key, $val := . }}
{{ $key }}: {{ tpl (toString $val) $ }}
{{- end }}
{{- end }}
- {{- if .Values._rpcServer.service.loadBalancerIP }}
- loadBalancerIP: {{ .Values._rpcServer.service.loadBalancerIP }}
+ {{- if .Values.apiServer.service.loadBalancerIP }}
+ loadBalancerIP: {{ .Values.apiServer.service.loadBalancerIP }}
{{- end }}
- {{- if .Values._rpcServer.service.loadBalancerSourceRanges }}
- loadBalancerSourceRanges: {{- toYaml .Values._rpcServer.service.loadBalancerSourceRanges | nindent 4 }}
+ {{- if .Values.apiServer.service.loadBalancerSourceRanges }}
+ loadBalancerSourceRanges: {{- toYaml .Values.apiServer.service.loadBalancerSourceRanges | nindent 4 }}
{{- end }}
{{- end }}
diff --git a/chart/templates/rpc-server/rpc-server-serviceaccount.yaml b/chart/templates/api-server/api-server-serviceaccount.yaml
similarity index 68%
rename from chart/templates/rpc-server/rpc-server-serviceaccount.yaml
rename to chart/templates/api-server/api-server-serviceaccount.yaml
index 655b346fbe0..3b864d01602 100644
--- a/chart/templates/rpc-server/rpc-server-serviceaccount.yaml
+++ b/chart/templates/api-server/api-server-serviceaccount.yaml
@@ -18,24 +18,24 @@
*/}}
######################################
-## Airflow rpc-server ServiceAccount
+## Airflow api-server ServiceAccount
######################################
-{{- if and .Values._rpcServer.enabled .Values._rpcServer.serviceAccount.create }}
+{{- if and .Values.apiServer.serviceAccount.create (semverCompare ">=3.0.0" .Values.airflowVersion) }}
apiVersion: v1
kind: ServiceAccount
-automountServiceAccountToken: {{ .Values._rpcServer.serviceAccount.automountServiceAccountToken }}
+automountServiceAccountToken: {{ .Values.apiServer.serviceAccount.automountServiceAccountToken }}
metadata:
- name: {{ include "rpcServer.serviceAccountName" . }}
+ name: {{ include "apiServer.serviceAccountName" . }}
labels:
tier: airflow
- component: rpc-server
+ component: api-server
release: {{ .Release.Name }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
heritage: {{ .Release.Service }}
- {{- if or (.Values.labels) (.Values._rpcServer.labels) }}
- {{- mustMerge .Values._rpcServer.labels .Values.labels | toYaml | nindent 4 }}
+ {{- if or (.Values.labels) (.Values.apiServer.labels) }}
+ {{- mustMerge .Values.apiServer.labels .Values.labels | toYaml | nindent 4 }}
{{- end }}
- {{- with .Values._rpcServer.serviceAccount.annotations }}
+ {{- with .Values.apiServer.serviceAccount.annotations }}
annotations: {{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
diff --git a/chart/values.schema.json b/chart/values.schema.json
index 6bfa5fe8b5e..813a08e7170 100644
--- a/chart/values.schema.json
+++ b/chart/values.schema.json
@@ -9,7 +9,7 @@
"Ports",
"Database",
"PgBouncer",
- "RPC Server",
+ "API Server",
"Scheduler",
"Webserver",
"Workers",
@@ -4668,19 +4668,14 @@
}
}
},
- "_rpcServer": {
- "description": "Airflow RPC server settings (AIP-44). Experimental / for dev purpose only.",
+ "apiServer": {
+ "description": "Airflow API server settings.",
"type": "object",
- "x-docsSection": "RPC Server",
+ "x-docsSection": "API Server",
"additionalProperties": false,
"properties": {
- "enabled": {
- "description": "Enable RPC server",
- "type": "boolean",
- "default": false
- },
"configMapAnnotations": {
- "description": "Extra annotations to apply to the RPC server configmap.",
+ "description": "Extra annotations to apply to the API server configmap.",
"type": "object",
"default": {},
"additionalProperties": {
@@ -4688,7 +4683,7 @@
}
},
"hostAliases": {
- "description": "HostAliases for the RPC server pod.",
+ "description": "HostAliases for the API server pod.",
"items": {
"$ref": "#/definitions/io.k8s.api.core.v1.HostAlias"
},
@@ -4710,7 +4705,7 @@
]
},
"allowPodLogReading": {
- "description": "Allow RPC server to read k8s pod logs. Useful when you don't have an external log store.",
+ "description": "Allow API server to read k8s pod logs. Useful when you don't have an external log store.",
"type": "boolean",
"default": true
},
@@ -4720,27 +4715,27 @@
"additionalProperties": false,
"properties": {
"initialDelaySeconds": {
- "description": "RPC server Liveness probe initial delay.",
+ "description": "API server Liveness probe initial delay.",
"type": "integer",
"default": 15
},
"timeoutSeconds": {
- "description": "RPC server Liveness probe timeout seconds.",
+ "description": "API server Liveness probe timeout seconds.",
"type": "integer",
"default": 5
},
"failureThreshold": {
- "description": "RPC server Liveness probe failure threshold.",
+ "description": "API server Liveness probe failure threshold.",
"type": "integer",
"default": 5
},
"periodSeconds": {
- "description": "RPC server Liveness probe period seconds.",
+ "description": "API server Liveness probe period seconds.",
"type": "integer",
"default": 10
},
"scheme": {
- "description": "RPC server Liveness probe scheme.",
+ "description": "API server Liveness probe scheme.",
"type": "string",
"default": "HTTP"
}
@@ -4752,27 +4747,27 @@
"additionalProperties": false,
"properties": {
"initialDelaySeconds": {
- "description": "RPC server Readiness probe initial delay.",
+ "description": "API server Readiness probe initial delay.",
"type": "integer",
"default": 15
},
"timeoutSeconds": {
- "description": "RPC server Readiness probe timeout seconds.",
+ "description": "API server Readiness probe timeout seconds.",
"type": "integer",
"default": 5
},
"failureThreshold": {
- "description": "RPC server Readiness probe failure threshold.",
+ "description": "API server Readiness probe failure threshold.",
"type": "integer",
"default": 5
},
"periodSeconds": {
- "description": "RPC server Readiness probe period seconds.",
+ "description": "API server Readiness probe period seconds.",
"type": "integer",
"default": 10
},
"scheme": {
- "description": "RPC server Readiness probe scheme.",
+ "description": "API server Readiness probe scheme.",
"type": "string",
"default": "HTTP"
}
@@ -4784,29 +4779,29 @@
"additionalProperties": false,
"properties": {
"timeoutSeconds": {
- "description": "RPC server Startup probe timeout seconds.",
+ "description": "API server Startup probe timeout seconds.",
"type": "integer",
"default": 20
},
"failureThreshold": {
- "description": "RPC server Startup probe failure threshold.",
+ "description": "API server Startup probe failure threshold.",
"type": "integer",
"default": 6
},
"periodSeconds": {
- "description": "RPC server Startup probe period seconds.",
+ "description": "API server Startup probe period seconds.",
"type": "integer",
"default": 10
},
"scheme": {
- "description": "RPC server Startup probe scheme.",
+ "description": "API server Startup probe scheme.",
"type": "string",
"default": "HTTP"
}
}
},
"replicas": {
- "description": "How many Airflow RPC server replicas should run.",
+ "description": "How many Airflow API server replicas should run.",
"type": "integer",
"default": 1
},
@@ -4820,7 +4815,7 @@
"x-docsSection": null
},
"command": {
- "description": "Command to use when running the Airflow RPC server (templated).",
+ "description": "Command to use when running the Airflow API server (templated).",
"type": [
"array",
"null"
@@ -4828,12 +4823,10 @@
"items": {
"type": "string"
},
- "default": [
- "bash"
- ]
+ "default": null
},
"args": {
- "description": "Args to use when running the Airflow RPC server (templated).",
+ "description": "Args to use when running the Airflow API server (templated).",
"type": [
"array",
"null"
@@ -4842,8 +4835,9 @@
"type": "string"
},
"default": [
+ "bash",
"-c",
- "exec airflow internal-api"
+ "exec airflow fastapi-api"
]
},
"strategy": {
@@ -4877,7 +4871,7 @@
"default": null
},
"annotations": {
- "description": "Annotations to add to the RPC server Kubernetes ServiceAccount.",
+ "description": "Annotations to add to the API server Kubernetes ServiceAccount.",
"type": "object",
"default": {},
"additionalProperties": {
@@ -4887,7 +4881,7 @@
}
},
"podDisruptionBudget": {
- "description": "RPC server pod disruption budget.",
+ "description": "API server pod disruption budget.",
"type": "object",
"additionalProperties": false,
"properties": {
@@ -4902,7 +4896,7 @@
"additionalProperties": false,
"properties": {
"maxUnavailable": {
- "description": "Max unavailable pods for RPC server.",
+ "description": "Max unavailable pods for API server.",
"type": [
"integer",
"string"
@@ -4910,7 +4904,7 @@
"default": 1
},
"minAvailable": {
- "description": "Min available pods for RPC server.",
+ "description": "Min available pods for API server.",
"type": [
"integer",
"string"
@@ -4921,27 +4915,18 @@
}
}
},
- "extraNetworkPolicies": {
- "description": "Additional NetworkPolicies as needed (Deprecated - renamed to `RPC server.networkPolicy.ingress.from`).",
- "type": "array",
- "items": {
- "type": "object",
- "$ref": "#/definitions/io.k8s.api.networking.v1.NetworkPolicyPeer"
- },
- "default": []
- },
"networkPolicy": {
- "description": "RPC server NetworkPolicy configuration",
+ "description": "API server NetworkPolicy configuration",
"type": "object",
"additionalProperties": false,
"properties": {
"ingress": {
- "description": "RPC server NetworkPolicyingress configuration",
+ "description": "API server NetworkPolicyingress configuration",
"type": "object",
"additionalProperties": false,
"properties": {
"from": {
- "description": "Peers for RPC server NetworkPolicyingress.",
+ "description": "Peers for API server NetworkPolicyingress.",
"type": "array",
"default": [],
"items": {
@@ -4949,19 +4934,19 @@
}
},
"ports": {
- "description": "Ports for RPC server NetworkPolicyingress (if `from` is set).",
+ "description": "Ports for API server NetworkPolicyingress (if `from` is set).",
"type": "array",
"items": {
"$ref": "#/definitions/io.k8s.api.networking.v1.NetworkPolicyPort"
},
"default": [
{
- "port": "{{ .Values.ports._rpcServer }}"
+ "port": "{{ .Values.ports.apiServer }}"
}
],
"examples": [
{
- "port": 9080
+ "port": 9091
}
]
}
@@ -4970,7 +4955,7 @@
}
},
"containerLifecycleHooks": {
- "description": "Container Lifecycle Hooks definition for the RPC server. If not set, the values from global `containerLifecycleHooks` will be used.",
+ "description": "Container Lifecycle Hooks definition for the API server. If not set, the values from global `containerLifecycleHooks` will be used.",
"type": "object",
"$ref": "#/definitions/io.k8s.api.core.v1.Lifecycle",
"default": {},
@@ -4999,12 +4984,12 @@
]
},
"securityContexts": {
- "description": "Security context definition for the RPC server. If not set, the values from global `securityContexts` will be used.",
+ "description": "Security context definition for the API server. If not set, the values from global `securityContexts` will be used.",
"type": "object",
"x-docsSection": "Kubernetes",
"properties": {
"pod": {
- "description": "Pod security context definition for the RPC server.",
+ "description": "Pod security context definition for the API server.",
"type": "object",
"$ref": "#/definitions/io.k8s.api.core.v1.PodSecurityContext",
"default": {},
@@ -5018,7 +5003,7 @@
]
},
"container": {
- "description": "Container security context definition for the RPC server.",
+ "description": "Container security context definition for the API server.",
"type": "object",
"$ref": "#/definitions/io.k8s.api.core.v1.SecurityContext",
"default": {},
@@ -5037,7 +5022,7 @@
}
},
"resources": {
- "description": "Resources for RPC server pods.",
+ "description": "Resources for API server pods.",
"type": "object",
"default": {},
"examples": [
@@ -5098,7 +5083,7 @@
}
},
"extraContainers": {
- "description": "Launch additional containers into RPC server.",
+ "description": "Launch additional containers into API server.",
"type": "array",
"default": [],
"items": {
@@ -5106,7 +5091,7 @@
}
},
"extraInitContainers": {
- "description": "Add additional init containers into RPC server.",
+ "description": "Add additional init containers into API server.",
"type": "array",
"default": [],
"items": {
@@ -5114,7 +5099,7 @@
}
},
"extraVolumes": {
- "description": "Mount additional volumes into RPC server.",
+ "description": "Mount additional volumes into API server.",
"type": "array",
"default": [],
"items": {
@@ -5122,49 +5107,25 @@
}
},
"extraVolumeMounts": {
- "description": "Mount additional volumes into RPC server.",
+ "description": "Mount additional volumes into API server.",
"type": "array",
"default": [],
"items": {
"$ref": "#/definitions/io.k8s.api.core.v1.VolumeMount"
}
},
- "RPC serverConfig": {
- "description": "This string (can be templated) will be mounted into the Airflow RPC server as a custom `RPC server_config.py`. You can bake a `RPC server_config.py` in to your image instead or specify a configmap containing the RPC server_config.py.",
- "type": [
- "string",
- "null"
- ],
- "x-docsSection": "Common",
- "default": null,
- "examples": [
- "from airflow import configuration as conf\n\n# The SQLAlchemy connection string.\nSQLALCHEMY_DATABASE_URI = conf.get('database', 'SQL_ALCHEMY_CONN')\n\n# Flask-WTF flag for CSRF\nCSRF_ENABLED = True"
- ]
- },
- "RPC serverConfigConfigMapName": {
- "description": "The configmap name containing the RPC server_config.py.",
- "type": [
- "string",
- "null"
- ],
- "x-docsSection": "Common",
- "default": null,
- "examples": [
- "my-RPC server-configmap"
- ]
- },
"service": {
- "description": "RPC server Service configuration.",
+ "description": "API server Service configuration.",
"type": "object",
"additionalProperties": false,
"properties": {
"type": {
- "description": "RPC server Service type.",
+ "description": "API server Service type.",
"type": "string",
"default": "ClusterIP"
},
"annotations": {
- "description": "Annotations for the RPC server Service.",
+ "description": "Annotations for the API server Service.",
"type": "object",
"default": {},
"additionalProperties": {
@@ -5172,7 +5133,7 @@
}
},
"ports": {
- "description": "Ports for the RPC server Service.",
+ "description": "Ports for the API server Service.",
"type": "array",
"items": {
"type": "object",
@@ -5206,15 +5167,15 @@
},
"default": [
{
- "name": "rpc-server",
- "port": "{{ .Values.ports._rpcServer }}"
+ "name": "api-server",
+ "port": "{{ .Values.ports.apiServer }}"
}
],
"examples": [
{
- "name": "rpc-server",
- "port": 9080,
- "targetPort": "rpc-server"
+ "name": "api-server",
+ "port": 9091,
+ "targetPort": "api-server"
},
{
"name": "only_sidecar",
@@ -5224,7 +5185,7 @@
]
},
"loadBalancerIP": {
- "description": "RPC server Service loadBalancerIP.",
+ "description": "API server Service loadBalancerIP.",
"type": [
"string",
"null"
@@ -5232,7 +5193,7 @@
"default": null
},
"loadBalancerSourceRanges": {
- "description": "RPC server Service ``loadBalancerSourceRanges``.",
+ "description": "API server Service ``loadBalancerSourceRanges``.",
"type": "array",
"items": {
"type": "string"
@@ -5245,7 +5206,7 @@
}
},
"nodeSelector": {
- "description": "Select certain nodes for RPC server pods.",
+ "description": "Select certain nodes for API server pods.",
"type": "object",
"default": {},
"additionalProperties": {
@@ -5253,7 +5214,7 @@
}
},
"priorityClassName": {
- "description": "Specify priority for RPC server pods.",
+ "description": "Specify priority for API server pods.",
"type": [
"string",
"null"
@@ -5261,13 +5222,13 @@
"default": null
},
"affinity": {
- "description": "Specify scheduling constraints for RPC server pods.",
+ "description": "Specify scheduling constraints for API server pods.",
"type": "object",
"default": "See values.yaml",
"$ref": "#/definitions/io.k8s.api.core.v1.Affinity"
},
"tolerations": {
- "description": "Specify Tolerations for RPC server pods.",
+ "description": "Specify Tolerations for API server pods.",
"type": "array",
"default": [],
"items": {
@@ -5276,7 +5237,7 @@
}
},
"topologySpreadConstraints": {
- "description": "Specify topology spread constraints for RPC server pods.",
+ "description": "Specify topology spread constraints for API server pods.",
"type": "array",
"default": [],
"x-docsSection": "Kubernetes",
@@ -5286,7 +5247,7 @@
}
},
"annotations": {
- "description": "Annotations to add to the RPC server deployment",
+ "description": "Annotations to add to the API server deployment",
"type": "object",
"default": {},
"additionalProperties": {
@@ -5294,7 +5255,7 @@
}
},
"podAnnotations": {
- "description": "Annotations to add to the RPC server pods.",
+ "description": "Annotations to add to the API server pods.",
"type": "object",
"default": {},
"additionalProperties": {
@@ -5302,7 +5263,7 @@
}
},
"labels": {
- "description": "Labels to add to the RPC server objects and pods.",
+ "description": "Labels to add to the API server objects and pods.",
"type": "object",
"default": {},
"additionalProperties": {
@@ -5367,7 +5328,7 @@
}
},
"env": {
- "description": "Add additional env vars to RPC server.",
+ "description": "Add additional env vars to API server.",
"type": "array",
"default": [],
"items": {
@@ -8099,10 +8060,10 @@
"type": "integer",
"default": 8080
},
- "_rpcServer": {
- "description": "RPC server port (AIP-44). Experimental / dev purpose only.",
+ "apiServer": {
+ "description": "API server port.",
"type": "integer",
- "default": 9080
+ "default": 9091
},
"workerLogs": {
"description": "Worker logs port.",
diff --git a/chart/values.yaml b/chart/values.yaml
index 495fa25749c..89aebfeb86b 100644
--- a/chart/values.yaml
+++ b/chart/values.yaml
@@ -1243,18 +1243,15 @@ migrateDatabaseJob:
applyCustomEnv: true
env: []
-# rpcServer support is experimental / dev purpose only and will later be renamed
-_rpcServer:
- enabled: false
+apiServer:
# Labels specific to workers objects and pods
labels: {}
- # Command to use when running the Airflow rpc server (templated).
- command:
- - "bash"
- # Args to use when running the Airflow rpc server (templated).
- args: ["-c", "exec airflow internal-api"]
+ # Command to use when running the Airflow API server (templated).
+ command: ~
+ # Args to use when running the Airflow API server (templated).
+ args: ["bash", "-c", "exec airflow fastapi-api"]
env: []
serviceAccount:
# default value is true
@@ -1273,8 +1270,8 @@ _rpcServer:
## service annotations
annotations: {}
ports:
- - name: rpc-server
- port: "{{ .Values.ports._rpcServer }}"
+ - name: api-server
+ port: "{{ .Values.ports.apiServer }}"
loadBalancerIP: ~
## Limit load balancer source ips to list of CIDRs
@@ -1307,15 +1304,13 @@ _rpcServer:
# Launch additional containers into the flower pods.
extraContainers: []
- # Additional network policies as needed (Deprecated - renamed to `webserver.networkPolicy.ingress.from`)
- extraNetworkPolicies: []
networkPolicy:
ingress:
# Peers for webserver NetworkPolicy ingress
from: []
# Ports for webserver NetworkPolicy ingress (if `from` is set)
ports:
- - port: "{{ .Values.ports._rpcServer }}"
+ - port: "{{ .Values.ports.apiServer }}"
resources: {}
# limits:
@@ -1339,8 +1334,6 @@ _rpcServer:
periodSeconds: 10
scheme: HTTP
- # Wait for at most 1 minute (6*10s) for the RPC server container to startup.
- # livenessProbe kicks in after the first successful startupProbe
startupProbe:
timeoutSeconds: 20
failureThreshold: 6
@@ -2491,8 +2484,7 @@ ports:
statsdScrape: 9102
pgbouncer: 6543
pgbouncerScrape: 9127
- # rpcServer support is experimental / dev purpose only and will later be renamed
- _rpcServer: 9080
+ apiServer: 9091
# Define any ResourceQuotas for namespace
quotas: {}
diff --git a/dev/breeze/src/airflow_breeze/commands/kubernetes_commands.py b/dev/breeze/src/airflow_breeze/commands/kubernetes_commands.py
index f97b6b573a4..2f027d5ad97 100644
--- a/dev/breeze/src/airflow_breeze/commands/kubernetes_commands.py
+++ b/dev/breeze/src/airflow_breeze/commands/kubernetes_commands.py
@@ -998,7 +998,6 @@ def _deploy_helm_chart(
get_console(output=output).print(f"[info]Copied chart sources to {tmp_chart_path}")
kubectl_context = get_kubectl_cluster_name(python=python, kubernetes_version=kubernetes_version)
params = BuildProdParams(python=python)
- airflow_kubernetes_image_name = params.airflow_image_kubernetes
helm_command = [
"helm",
"upgrade" if upgrade else "install",
@@ -1011,13 +1010,13 @@ def _deploy_helm_chart(
"--namespace",
HELM_AIRFLOW_NAMESPACE,
"--set",
- f"defaultAirflowRepository={airflow_kubernetes_image_name}",
+ f"defaultAirflowRepository={params.airflow_image_kubernetes}",
"--set",
"defaultAirflowTag=latest",
"-v",
"1",
"--set",
- f"images.airflow.repository={airflow_kubernetes_image_name}",
+ f"images.airflow.repository={params.airflow_image_kubernetes}",
"--set",
"images.airflow.tag=latest",
"-v",
@@ -1028,6 +1027,8 @@ def _deploy_helm_chart(
"config.logging.logging_level=DEBUG",
"--set",
f"executor={executor}",
+ "--set",
+ f"airflowVersion={params.airflow_semver_version}",
]
if multi_namespace_mode:
helm_command.extend(["--set", "multiNamespaceMode=true"])
diff --git a/dev/breeze/src/airflow_breeze/params/build_prod_params.py b/dev/breeze/src/airflow_breeze/params/build_prod_params.py
index 6fa5828b40f..71405680db8 100644
--- a/dev/breeze/src/airflow_breeze/params/build_prod_params.py
+++ b/dev/breeze/src/airflow_breeze/params/build_prod_params.py
@@ -63,6 +63,18 @@ class BuildProdParams(CommonBuildParams):
else:
return self._get_version_with_suffix()
+ @property
+ def airflow_semver_version(self) -> str:
+ """The airflow version in SemVer compatible form"""
+ from packaging.version import Version
+
+ pyVer = Version(self.airflow_version)
+
+ ver = pyVer.base_version
+ # if (dev := pyVer.dev) is not None:
+ # ver += f"-dev.{dev}"
+ return ver
+
@property
def image_type(self) -> str:
return "PROD"
diff --git a/helm_tests/airflow_aux/test_basic_helm_chart.py b/helm_tests/airflow_aux/test_basic_helm_chart.py
index 7d72a3205ee..c9dff5476e5 100644
--- a/helm_tests/airflow_aux/test_basic_helm_chart.py
+++ b/helm_tests/airflow_aux/test_basic_helm_chart.py
@@ -82,9 +82,8 @@ class TestBaseChartTest:
return OBJECT_COUNT_IN_BASIC_DEPLOYMENT + 1
return OBJECT_COUNT_IN_BASIC_DEPLOYMENT
- @pytest.mark.parametrize("version", ["2.3.2", "2.4.0", "default"])
+ @pytest.mark.parametrize("version", ["2.3.2", "2.4.0", "3.0.0", "default"])
def test_basic_deployments(self, version):
- expected_object_count_in_basic_deployment = self._get_object_count(version)
k8s_objects = render_chart(
"test-basic",
self._get_values_with_version(
@@ -140,10 +139,19 @@ class TestBaseChartTest:
}
if version == "2.3.2":
expected.add(("Secret", "test-basic-result-backend"))
- if version == "default":
+ if version == "3.0.0":
+ expected.update(
+ (
+ ("Deployment", "test-basic-api-server"),
+ ("Service", "test-basic-api-server"),
+ ("ServiceAccount", "test-basic-api-server"),
+ ("Service", "test-basic-triggerer"),
+ )
+ )
+ elif version == "default":
expected.add(("Service", "test-basic-triggerer"))
assert list_of_kind_names_tuples == expected
- assert len(k8s_objects) == expected_object_count_in_basic_deployment
+ assert len(k8s_objects) == len(expected)
for k8s_object in k8s_objects:
labels = jmespath.search("metadata.labels", k8s_object) or {}
if "helm.sh/chart" in labels:
@@ -165,24 +173,8 @@ class TestBaseChartTest:
actual = {(x["kind"], x["metadata"]["name"]) for x in k8s_objects}
assert actual == DEFAULT_OBJECTS_STD_NAMING
- def test_basic_deployment_with_rpc_server(self):
- extra_objects = {
- ("Deployment", "test-basic-airflow-rpc-server"),
- ("Service", "test-basic-airflow-rpc-server"),
- ("ServiceAccount", "test-basic-airflow-rpc-server"),
- }
- k8s_objects = render_chart(
- "test-basic",
- values={"_rpcServer": {"enabled": True}, "useStandardNaming": True},
- )
- actual = {(x["kind"], x["metadata"]["name"]) for x in k8s_objects}
- assert actual == (DEFAULT_OBJECTS_STD_NAMING | extra_objects)
-
@pytest.mark.parametrize("version", ["2.3.2", "2.4.0", "default"])
def test_basic_deployment_with_standalone_dag_processor(self, version):
- # Dag Processor creates two extra objects compared to the basic deployment
- object_count_in_basic_deployment = self._get_object_count(version)
- expected_object_count_with_standalone_scheduler = object_count_in_basic_deployment + 2
k8s_objects = render_chart(
"test-basic",
self._get_values_with_version(
@@ -244,7 +236,7 @@ class TestBaseChartTest:
if version == "default":
expected.add(("Service", "test-basic-triggerer"))
assert list_of_kind_names_tuples == expected
- assert expected_object_count_with_standalone_scheduler == len(k8s_objects)
+ assert len(k8s_objects) == len(expected)
for k8s_object in k8s_objects:
labels = jmespath.search("metadata.labels", k8s_object) or {}
if "helm.sh/chart" in labels:
@@ -522,11 +514,7 @@ class TestBaseChartTest:
for obj in objs_with_image:
image: str = obj["image"]
if image.startswith(image_repo):
- # Make sure that a command is not specified
- if obj["name"] == "rpc-server":
- assert obj["command"] == ["bash"]
- else:
- assert "command" not in obj
+ assert "command" not in obj
@pytest.mark.parametrize(
"executor",
@@ -704,6 +692,6 @@ class TestBaseChartTest:
@staticmethod
def default_trigger_obj(version):
- if version == "default":
+ if version in {"default", "3.0.0"}:
return "StatefulSet"
return "Deployment"
diff --git a/helm_tests/airflow_core/test_rpc_server.py b/helm_tests/airflow_core/test_api_server.py
similarity index 65%
rename from helm_tests/airflow_core/test_rpc_server.py
rename to helm_tests/airflow_core/test_api_server.py
index 7bbc944cfd6..91e6418f1db 100644
--- a/helm_tests/airflow_core/test_rpc_server.py
+++ b/helm_tests/airflow_core/test_api_server.py
@@ -21,162 +21,46 @@ from subprocess import CalledProcessError
import jmespath
import pytest
-from tests.charts.helm_template_generator import render_chart
+from tests.charts.helm_template_generator import render_chart as _render_chart
-class TestRPCServerDeployment:
- """Tests rpc-server deployment."""
+# Everything in here needcs to set airflowVersion to get the API server to render
+def render_chart(values=None, **kwargs):
+ values = values or {}
+ values.setdefault("airflowVersion", "3.0.0")
+ return _render_chart(values=values, **kwargs)
- def test_is_disabled_by_default(self):
- """
- RPC server should be disabled by default.
- """
- docs = render_chart(
- values={"_rpcServer": {}},
- show_only=["templates/rpc-server/rpc-server-deployment.yaml"],
- )
-
- assert len(docs) == 0
-
- def test_should_add_host_header_to_liveness_and_readiness_and_startup_probes(self):
- docs = render_chart(
- values={
- "_rpcServer": {"enabled": True},
- "config": {"core": {"internal_api_url": "https://example.com:21222/mypath/path"}},
- },
- show_only=["templates/rpc-server/rpc-server-deployment.yaml"],
- )
-
- assert {"name": "Host", "value": "example.com"} in jmespath.search(
- "spec.template.spec.containers[0].livenessProbe.httpGet.httpHeaders", docs[0]
- )
- assert {"name": "Host", "value": "example.com"} in jmespath.search(
- "spec.template.spec.containers[0].readinessProbe.httpGet.httpHeaders", docs[0]
- )
- assert {"name": "Host", "value": "example.com"} in jmespath.search(
- "spec.template.spec.containers[0].startupProbe.httpGet.httpHeaders", docs[0]
- )
- def test_should_add_path_to_liveness_and_readiness_and_startup_probes(self):
- docs = render_chart(
- values={
- "_rpcServer": {
- "enabled": True,
- },
- "config": {"core": {"internal_api_url": "https://example.com:21222/mypath/path"}},
- },
- show_only=["templates/rpc-server/rpc-server-deployment.yaml"],
- )
-
- assert (
- jmespath.search("spec.template.spec.containers[0].livenessProbe.httpGet.path", docs[0])
- == "/mypath/path/internal_api/v1/health"
- )
- assert (
- jmespath.search("spec.template.spec.containers[0].readinessProbe.httpGet.path", docs[0])
- == "/mypath/path/internal_api/v1/health"
- )
- assert (
- jmespath.search("spec.template.spec.containers[0].startupProbe.httpGet.path", docs[0])
- == "/mypath/path/internal_api/v1/health"
- )
+class TestAPIServerDeployment:
+ """Tests api-server deployment."""
@pytest.mark.parametrize(
"revision_history_limit, global_revision_history_limit",
[(8, 10), (10, 8), (8, None), (None, 10), (None, None)],
)
def test_revision_history_limit(self, revision_history_limit, global_revision_history_limit):
- values = {
- "_rpcServer": {
- "enabled": True,
- }
- }
+ values = {"apiServer": {}}
if revision_history_limit:
- values["_rpcServer"]["revisionHistoryLimit"] = revision_history_limit
+ values["apiServer"]["revisionHistoryLimit"] = revision_history_limit
if global_revision_history_limit:
values["revisionHistoryLimit"] = global_revision_history_limit
docs = render_chart(
values=values,
- show_only=["templates/rpc-server/rpc-server-deployment.yaml"],
+ show_only=["templates/api-server/api-server-deployment.yaml"],
)
expected_result = revision_history_limit if revision_history_limit else global_revision_history_limit
assert jmespath.search("spec.revisionHistoryLimit", docs[0]) == expected_result
- @pytest.mark.parametrize(
- "values",
- [
- {"_rpcServer": {"enabled": True}},
- {
- "_rpcServer": {"enabled": True},
- "config": {"core": {"internal_api_url": ""}},
- },
- ],
- )
- def test_should_not_contain_host_header(self, values):
- docs = render_chart(values=values, show_only=["templates/rpc-server/rpc-server-deployment.yaml"])
-
- assert (
- jmespath.search("spec.template.spec.containers[0].livenessProbe.httpGet.httpHeaders", docs[0])
- is None
- )
- assert (
- jmespath.search("spec.template.spec.containers[0].readinessProbe.httpGet.httpHeaders", docs[0])
- is None
- )
- assert (
- jmespath.search("spec.template.spec.containers[0].startupProbe.httpGet.httpHeaders", docs[0])
- is None
- )
-
- def test_should_use_templated_base_url_for_probes(self):
- docs = render_chart(
- values={
- "_rpcServer": {
- "enabled": True,
- },
- "config": {
- "core": {
- "internal_api_url": "https://{{ .Release.Name }}.com:21222/mypath/{{ .Release.Name }}/path"
- }
- },
- },
- show_only=["templates/rpc-server/rpc-server-deployment.yaml"],
- )
- container = jmespath.search("spec.template.spec.containers[0]", docs[0])
-
- assert {"name": "Host", "value": "release-name.com"} in jmespath.search(
- "livenessProbe.httpGet.httpHeaders", container
- )
- assert {"name": "Host", "value": "release-name.com"} in jmespath.search(
- "readinessProbe.httpGet.httpHeaders", container
- )
- assert {"name": "Host", "value": "release-name.com"} in jmespath.search(
- "startupProbe.httpGet.httpHeaders", container
- )
- assert (
- jmespath.search("livenessProbe.httpGet.path", container)
- == "/mypath/release-name/path/internal_api/v1/health"
- )
- assert (
- jmespath.search("readinessProbe.httpGet.path", container)
- == "/mypath/release-name/path/internal_api/v1/health"
- )
- assert (
- jmespath.search("startupProbe.httpGet.path", container)
- == "/mypath/release-name/path/internal_api/v1/health"
- )
-
def test_should_add_scheme_to_liveness_and_readiness_and_startup_probes(self):
docs = render_chart(
values={
- "_rpcServer": {
- "enabled": True,
+ "apiServer": {
"livenessProbe": {"scheme": "HTTPS"},
"readinessProbe": {"scheme": "HTTPS"},
"startupProbe": {"scheme": "HTTPS"},
}
},
- show_only=["templates/rpc-server/rpc-server-deployment.yaml"],
+ show_only=["templates/api-server/api-server-deployment.yaml"],
)
assert "HTTPS" in jmespath.search(
@@ -193,14 +77,13 @@ class TestRPCServerDeployment:
docs = render_chart(
values={
"executor": "CeleryExecutor",
- "_rpcServer": {
- "enabled": True,
+ "apiServer": {
"extraContainers": [
{"name": "{{.Chart.Name}}", "image": "test-registry/test-repo:test-tag"}
],
},
},
- show_only=["templates/rpc-server/rpc-server-deployment.yaml"],
+ show_only=["templates/api-server/api-server-deployment.yaml"],
)
assert jmespath.search("spec.template.spec.containers[-1]", docs[0]) == {
@@ -211,12 +94,11 @@ class TestRPCServerDeployment:
def test_should_add_extraEnvs(self):
docs = render_chart(
values={
- "_rpcServer": {
- "enabled": True,
+ "apiServer": {
"env": [{"name": "TEST_ENV_1", "value": "test_env_1"}],
},
},
- show_only=["templates/rpc-server/rpc-server-deployment.yaml"],
+ show_only=["templates/api-server/api-server-deployment.yaml"],
)
assert {"name": "TEST_ENV_1", "value": "test_env_1"} in jmespath.search(
@@ -226,15 +108,14 @@ class TestRPCServerDeployment:
def test_should_add_extra_volume_and_extra_volume_mount(self):
docs = render_chart(
values={
- "_rpcServer": {
- "enabled": True,
+ "apiServer": {
"extraVolumes": [{"name": "test-volume-{{ .Chart.Name }}", "emptyDir": {}}],
"extraVolumeMounts": [
{"name": "test-volume-{{ .Chart.Name }}", "mountPath": "/opt/test"}
],
},
},
- show_only=["templates/rpc-server/rpc-server-deployment.yaml"],
+ show_only=["templates/api-server/api-server-deployment.yaml"],
)
assert jmespath.search("spec.template.spec.volumes[-1].name", docs[0]) == "test-volume-airflow"
@@ -250,11 +131,10 @@ class TestRPCServerDeployment:
def test_should_add_global_volume_and_global_volume_mount(self):
docs = render_chart(
values={
- "_rpcServer": {"enabled": True},
"volumes": [{"name": "test-volume", "emptyDir": {}}],
"volumeMounts": [{"name": "test-volume", "mountPath": "/opt/test"}],
},
- show_only=["templates/rpc-server/rpc-server-deployment.yaml"],
+ show_only=["templates/api-server/api-server-deployment.yaml"],
)
assert jmespath.search("spec.template.spec.volumes[-1].name", docs[0]) == "test-volume"
@@ -266,35 +146,23 @@ class TestRPCServerDeployment:
def test_should_add_extraEnvs_to_wait_for_migration_container(self):
docs = render_chart(
values={
- "_rpcServer": {
- "enabled": True,
+ "apiServer": {
"waitForMigrations": {
"env": [{"name": "TEST_ENV_1", "value": "test_env_1"}],
},
},
},
- show_only=["templates/rpc-server/rpc-server-deployment.yaml"],
+ show_only=["templates/api-server/api-server-deployment.yaml"],
)
assert {"name": "TEST_ENV_1", "value": "test_env_1"} in jmespath.search(
"spec.template.spec.initContainers[0].env", docs[0]
)
- @pytest.mark.parametrize(
- "airflow_version, expected_arg",
- [
- ("2.0.0", ["airflow", "db", "check-migrations", "--migration-wait-timeout=60"]),
- ("2.1.0", ["airflow", "db", "check-migrations", "--migration-wait-timeout=60"]),
- ("1.10.2", ["python", "-c"]),
- ],
- )
- def test_wait_for_migration_airflow_version(self, airflow_version, expected_arg):
+ def test_wait_for_migration_airflow_version(self):
+ expected_arg = ["airflow", "db", "check-migrations", "--migration-wait-timeout=60"]
docs = render_chart(
- values={
- "_rpcServer": {"enabled": True},
- "airflowVersion": airflow_version,
- },
- show_only=["templates/rpc-server/rpc-server-deployment.yaml"],
+ show_only=["templates/api-server/api-server-deployment.yaml"],
)
# Don't test the full string, just the length of the expect matches
actual = jmespath.search("spec.template.spec.initContainers[0].args", docs[0])
@@ -303,12 +171,11 @@ class TestRPCServerDeployment:
def test_disable_wait_for_migration(self):
docs = render_chart(
values={
- "_rpcServer": {
- "enabled": True,
+ "apiServer": {
"waitForMigrations": {"enabled": False},
},
},
- show_only=["templates/rpc-server/rpc-server-deployment.yaml"],
+ show_only=["templates/api-server/api-server-deployment.yaml"],
)
actual = jmespath.search(
"spec.template.spec.initContainers[?name=='wait-for-airflow-migrations']", docs[0]
@@ -318,14 +185,13 @@ class TestRPCServerDeployment:
def test_should_add_extra_init_containers(self):
docs = render_chart(
values={
- "_rpcServer": {
- "enabled": True,
+ "apiServer": {
"extraInitContainers": [
{"name": "test-init-container", "image": "test-registry/test-repo:test-tag"}
],
},
},
- show_only=["templates/rpc-server/rpc-server-deployment.yaml"],
+ show_only=["templates/api-server/api-server-deployment.yaml"],
)
assert jmespath.search("spec.template.spec.initContainers[-1]", docs[0]) == {
@@ -336,12 +202,11 @@ class TestRPCServerDeployment:
def test_should_add_component_specific_labels(self):
docs = render_chart(
values={
- "_rpcServer": {
- "enabled": True,
+ "apiServer": {
"labels": {"test_label": "test_label_value"},
},
},
- show_only=["templates/rpc-server/rpc-server-deployment.yaml"],
+ show_only=["templates/api-server/api-server-deployment.yaml"],
)
assert "test_label" in jmespath.search("spec.template.metadata.labels", docs[0])
@@ -350,8 +215,7 @@ class TestRPCServerDeployment:
def test_should_create_valid_affinity_tolerations_and_node_selector(self):
docs = render_chart(
values={
- "_rpcServer": {
- "enabled": True,
+ "apiServer": {
"affinity": {
"nodeAffinity": {
"requiredDuringSchedulingIgnoredDuringExecution": {
@@ -371,7 +235,7 @@ class TestRPCServerDeployment:
"nodeSelector": {"diskType": "ssd"},
}
},
- show_only=["templates/rpc-server/rpc-server-deployment.yaml"],
+ show_only=["templates/api-server/api-server-deployment.yaml"],
)
assert jmespath.search("kind", docs[0]) == "Deployment"
@@ -403,8 +267,7 @@ class TestRPCServerDeployment:
def test_should_create_default_affinity(self):
docs = render_chart(
- values={"_rpcServer": {"enabled": True}},
- show_only=["templates/rpc-server/rpc-server-deployment.yaml"],
+ show_only=["templates/api-server/api-server-deployment.yaml"],
)
assert jmespath.search(
@@ -412,10 +275,10 @@ class TestRPCServerDeployment:
"preferredDuringSchedulingIgnoredDuringExecution[0]."
"podAffinityTerm.labelSelector.matchLabels",
docs[0],
- ) == {"component": "rpc-server"}
+ ) == {"component": "api-server"}
def test_affinity_tolerations_topology_spread_constraints_and_node_selector_precedence(self):
- """When given both global and rpc-server affinity etc, rpc-server affinity etc is used."""
+ """When given both global and api-server affinity etc, api-server affinity etc is used."""
expected_affinity = {
"nodeAffinity": {
"requiredDuringSchedulingIgnoredDuringExecution": {
@@ -437,8 +300,7 @@ class TestRPCServerDeployment:
}
docs = render_chart(
values={
- "_rpcServer": {
- "enabled": True,
+ "apiServer": {
"affinity": expected_affinity,
"tolerations": [
{"key": "dynamic-pods", "operator": "Equal", "value": "true", "effect": "NoSchedule"}
@@ -473,7 +335,7 @@ class TestRPCServerDeployment:
],
"nodeSelector": {"type": "not-me"},
},
- show_only=["templates/rpc-server/rpc-server-deployment.yaml"],
+ show_only=["templates/api-server/api-server-deployment.yaml"],
)
assert expected_affinity == jmespath.search("spec.template.spec.affinity", docs[0])
@@ -493,8 +355,8 @@ class TestRPCServerDeployment:
def test_scheduler_name(self):
docs = render_chart(
- values={"_rpcServer": {"enabled": True}, "schedulerName": "airflow-scheduler"},
- show_only=["templates/rpc-server/rpc-server-deployment.yaml"],
+ values={"schedulerName": "airflow-scheduler"},
+ show_only=["templates/api-server/api-server-deployment.yaml"],
)
assert (
@@ -515,8 +377,8 @@ class TestRPCServerDeployment:
)
def test_logs_persistence_adds_volume_and_mount(self, log_persistence_values, expected_claim_name):
docs = render_chart(
- values={"_rpcServer": {"enabled": True}, "logs": {"persistence": log_persistence_values}},
- show_only=["templates/rpc-server/rpc-server-deployment.yaml"],
+ values={"logs": {"persistence": log_persistence_values}},
+ show_only=["templates/api-server/api-server-deployment.yaml"],
)
if expected_claim_name:
@@ -536,8 +398,7 @@ class TestRPCServerDeployment:
def test_config_volumes(self):
docs = render_chart(
- values={"_rpcServer": {"enabled": True}},
- show_only=["templates/rpc-server/rpc-server-deployment.yaml"],
+ show_only=["templates/api-server/api-server-deployment.yaml"],
)
# default config
@@ -548,18 +409,17 @@ class TestRPCServerDeployment:
"subPath": "airflow.cfg",
} in jmespath.search("spec.template.spec.containers[0].volumeMounts", docs[0])
- def test_rpc_server_resources_are_configurable(self):
+ def testapi_server_resources_are_configurable(self):
docs = render_chart(
values={
- "_rpcServer": {
- "enabled": True,
+ "apiServer": {
"resources": {
"limits": {"cpu": "200m", "memory": "128Mi"},
"requests": {"cpu": "300m", "memory": "169Mi"},
},
},
},
- show_only=["templates/rpc-server/rpc-server-deployment.yaml"],
+ show_only=["templates/api-server/api-server-deployment.yaml"],
)
assert jmespath.search("spec.template.spec.containers[0].resources.limits.memory", docs[0]) == "128Mi"
assert jmespath.search("spec.template.spec.containers[0].resources.limits.cpu", docs[0]) == "200m"
@@ -584,11 +444,10 @@ class TestRPCServerDeployment:
jmespath.search("spec.template.spec.initContainers[0].resources.requests.cpu", docs[0]) == "300m"
)
- def test_rpc_server_security_contexts_are_configurable(self):
+ def test_api_server_security_contexts_are_configurable(self):
docs = render_chart(
values={
- "_rpcServer": {
- "enabled": True,
+ "apiServer": {
"securityContexts": {
"pod": {
"fsGroup": 1000,
@@ -603,7 +462,7 @@ class TestRPCServerDeployment:
},
},
},
- show_only=["templates/rpc-server/rpc-server-deployment.yaml"],
+ show_only=["templates/api-server/api-server-deployment.yaml"],
)
assert jmespath.search("spec.template.spec.containers[0].securityContext", docs[0]) == {
"allowPrivilegeEscalation": False,
@@ -617,12 +476,11 @@ class TestRPCServerDeployment:
"runAsNonRoot": True,
}
- def test_rpc_server_security_context_legacy(self):
+ def test_api_server_security_context_legacy(self):
with pytest.raises(CalledProcessError, match="Additional property securityContext is not allowed"):
render_chart(
values={
- "_rpcServer": {
- "enabled": True,
+ "apiServer": {
"securityContext": {
"fsGroup": 1000,
"runAsGroup": 1001,
@@ -631,61 +489,59 @@ class TestRPCServerDeployment:
},
},
},
- show_only=["templates/rpc-server/rpc-server-deployment.yaml"],
+ show_only=["templates/api-server/api-server-deployment.yaml"],
)
- def test_rpc_server_resources_are_not_added_by_default(self):
+ def test_api_server_resources_are_not_added_by_default(self):
docs = render_chart(
- values={"_rpcServer": {"enabled": True}},
- show_only=["templates/rpc-server/rpc-server-deployment.yaml"],
+ show_only=["templates/api-server/api-server-deployment.yaml"],
)
assert jmespath.search("spec.template.spec.containers[0].resources", docs[0]) == {}
assert jmespath.search("spec.template.spec.initContainers[0].resources", docs[0]) == {}
@pytest.mark.parametrize(
- "airflow_version, expected_strategy",
+ ("airflow_version", "strategy", "expected_strategy"),
[
- ("2.0.2", {"type": "RollingUpdate", "rollingUpdate": {"maxSurge": 1, "maxUnavailable": 0}}),
- ("1.10.14", {"type": "Recreate"}),
- ("1.9.0", {"type": "Recreate"}),
- ("2.1.0", {"type": "RollingUpdate", "rollingUpdate": {"maxSurge": 1, "maxUnavailable": 0}}),
+ pytest.param(
+ "3.0.0",
+ None,
+ {"type": "RollingUpdate", "rollingUpdate": {"maxSurge": 1, "maxUnavailable": 0}},
+ id="default",
+ ),
+ pytest.param(
+ "3.0.0",
+ {"type": "RollingUpdate", "rollingUpdate": {"maxUnavailable": 1}},
+ {"type": "RollingUpdate", "rollingUpdate": {"maxSurge": 1, "maxUnavailable": 0}},
+ id="custom-strategy",
+ ),
],
)
- def test_default_update_strategy(self, airflow_version, expected_strategy):
+ def test_update_strategy(self, airflow_version, strategy, expected_strategy):
docs = render_chart(
- values={"_rpcServer": {"enabled": True}, "airflowVersion": airflow_version},
- show_only=["templates/rpc-server/rpc-server-deployment.yaml"],
- )
-
- assert jmespath.search("spec.strategy", docs[0]) == expected_strategy
-
- def test_update_strategy(self):
- expected_strategy = {"type": "RollingUpdate", "rollingUpdate": {"maxUnavailable": 1}}
- docs = render_chart(
- values={"_rpcServer": {"enabled": True, "strategy": expected_strategy}},
- show_only=["templates/rpc-server/rpc-server-deployment.yaml"],
+ values={"airflowVersion": airflow_version, "apiServer": {"strategy": expected_strategy}},
+ show_only=["templates/api-server/api-server-deployment.yaml"],
)
assert jmespath.search("spec.strategy", docs[0]) == expected_strategy
def test_default_command_and_args(self):
docs = render_chart(
- values={"_rpcServer": {"enabled": True}},
- show_only=["templates/rpc-server/rpc-server-deployment.yaml"],
+ show_only=["templates/api-server/api-server-deployment.yaml"],
)
- assert jmespath.search("spec.template.spec.containers[0].command", docs[0]) == ["bash"]
+ assert jmespath.search("spec.template.spec.containers[0].command", docs[0]) is None
assert jmespath.search("spec.template.spec.containers[0].args", docs[0]) == [
+ "bash",
"-c",
- "exec airflow internal-api",
+ "exec airflow fastapi-api",
]
@pytest.mark.parametrize("command", [None, ["custom", "command"]])
@pytest.mark.parametrize("args", [None, ["custom", "args"]])
def test_command_and_args_overrides(self, command, args):
docs = render_chart(
- values={"_rpcServer": {"enabled": True, "command": command, "args": args}},
- show_only=["templates/rpc-server/rpc-server-deployment.yaml"],
+ values={"apiServer": {"command": command, "args": args}},
+ show_only=["templates/api-server/api-server-deployment.yaml"],
)
assert command == jmespath.search("spec.template.spec.containers[0].command", docs[0])
@@ -694,13 +550,12 @@ class TestRPCServerDeployment:
def test_command_and_args_overrides_are_templated(self):
docs = render_chart(
values={
- "_rpcServer": {
- "enabled": True,
+ "apiServer": {
"command": ["{{ .Release.Name }}"],
"args": ["{{ .Release.Service }}"],
}
},
- show_only=["templates/rpc-server/rpc-server-deployment.yaml"],
+ show_only=["templates/api-server/api-server-deployment.yaml"],
)
assert jmespath.search("spec.template.spec.containers[0].command", docs[0]) == ["release-name"]
@@ -708,57 +563,45 @@ class TestRPCServerDeployment:
def test_should_add_component_specific_annotations(self):
docs = render_chart(
- values={
- "_rpcServer": {
- "enabled": True,
- "annotations": {"test_annotation": "test_annotation_value"},
- },
- },
- show_only=["templates/rpc-server/rpc-server-deployment.yaml"],
+ values={"apiServer": {"annotations": {"test_annotation": "test_annotation_value"}}},
+ show_only=["templates/api-server/api-server-deployment.yaml"],
)
assert "annotations" in jmespath.search("metadata", docs[0])
assert jmespath.search("metadata.annotations", docs[0])["test_annotation"] == "test_annotation_value"
- def test_rpc_server_pod_hostaliases(self):
+ def test_api_server_pod_hostaliases(self):
docs = render_chart(
- values={
- "_rpcServer": {
- "enabled": True,
- "hostAliases": [{"ip": "127.0.0.1", "hostnames": ["foo.local"]}],
- },
- },
- show_only=["templates/rpc-server/rpc-server-deployment.yaml"],
+ values={"apiServer": {"hostAliases": [{"ip": "127.0.0.1", "hostnames": ["foo.local"]}]}},
+ show_only=["templates/api-server/api-server-deployment.yaml"],
)
assert jmespath.search("spec.template.spec.hostAliases[0].ip", docs[0]) == "127.0.0.1"
assert jmespath.search("spec.template.spec.hostAliases[0].hostnames[0]", docs[0]) == "foo.local"
-class TestRPCServerService:
- """Tests rpc-server service."""
+class TestAPIServerService:
+ """Tests api-server service."""
def test_default_service(self):
docs = render_chart(
- values={"_rpcServer": {"enabled": True}},
- show_only=["templates/rpc-server/rpc-server-service.yaml"],
+ show_only=["templates/api-server/api-server-service.yaml"],
)
- assert jmespath.search("metadata.name", docs[0]) == "release-name-rpc-server"
+ assert jmespath.search("metadata.name", docs[0]) == "release-name-api-server"
assert jmespath.search("metadata.annotations", docs[0]) is None
assert jmespath.search("spec.selector", docs[0]) == {
"tier": "airflow",
- "component": "rpc-server",
+ "component": "api-server",
"release": "release-name",
}
assert jmespath.search("spec.type", docs[0]) == "ClusterIP"
- assert {"name": "rpc-server", "port": 9080} in jmespath.search("spec.ports", docs[0])
+ assert {"name": "api-server", "port": 9091} in jmespath.search("spec.ports", docs[0])
def test_overrides(self):
docs = render_chart(
values={
- "ports": {"_rpcServer": 9000},
- "_rpcServer": {
- "enabled": True,
+ "ports": {"apiServer": 9000},
+ "apiServer": {
"service": {
"type": "LoadBalancer",
"loadBalancerIP": "127.0.0.1",
@@ -767,12 +610,12 @@ class TestRPCServerService:
},
},
},
- show_only=["templates/rpc-server/rpc-server-service.yaml"],
+ show_only=["templates/api-server/api-server-service.yaml"],
)
assert jmespath.search("metadata.annotations", docs[0]) == {"foo": "bar"}
assert jmespath.search("spec.type", docs[0]) == "LoadBalancer"
- assert {"name": "rpc-server", "port": 9000} in jmespath.search("spec.ports", docs[0])
+ assert {"name": "api-server", "port": 9000} in jmespath.search("spec.ports", docs[0])
assert jmespath.search("spec.loadBalancerIP", docs[0]) == "127.0.0.1"
assert jmespath.search("spec.loadBalancerSourceRanges", docs[0]) == ["10.123.0.0/16"]
@@ -785,19 +628,19 @@ class TestRPCServerService:
{
"name": "{{ .Release.Name }}",
"protocol": "UDP",
- "port": "{{ .Values.ports._rpcServer }}",
+ "port": "{{ .Values.ports.apiServer }}",
}
],
- [{"name": "release-name", "protocol": "UDP", "port": 9080}],
+ [{"name": "release-name", "protocol": "UDP", "port": 9091}],
),
([{"name": "only_sidecar", "port": "{{ int 9000 }}"}], [{"name": "only_sidecar", "port": 9000}]),
(
[
- {"name": "rpc-server", "port": "{{ .Values.ports._rpcServer }}"},
+ {"name": "api-server", "port": "{{ .Values.ports.apiServer }}"},
{"name": "sidecar", "port": 80, "targetPort": "sidecar"},
],
[
- {"name": "rpc-server", "port": 9080},
+ {"name": "api-server", "port": 9091},
{"name": "sidecar", "port": 80, "targetPort": "sidecar"},
],
),
@@ -805,23 +648,16 @@ class TestRPCServerService:
)
def test_ports_overrides(self, ports, expected_ports):
docs = render_chart(
- values={
- "_rpcServer": {"enabled": True, "service": {"ports": ports}},
- },
- show_only=["templates/rpc-server/rpc-server-service.yaml"],
+ values={"apiServer": {"service": {"ports": ports}}},
+ show_only=["templates/api-server/api-server-service.yaml"],
)
assert jmespath.search("spec.ports", docs[0]) == expected_ports
def test_should_add_component_specific_labels(self):
docs = render_chart(
- values={
- "_rpcServer": {
- "enabled": True,
- "labels": {"test_label": "test_label_value"},
- },
- },
- show_only=["templates/rpc-server/rpc-server-service.yaml"],
+ values={"apiServer": {"labels": {"test_label": "test_label_value"}}},
+ show_only=["templates/api-server/api-server-service.yaml"],
)
assert "test_label" in jmespath.search("metadata.labels", docs[0])
assert jmespath.search("metadata.labels", docs[0])["test_label"] == "test_label_value"
@@ -841,28 +677,20 @@ class TestRPCServerService:
)
def test_nodeport_service(self, ports, expected_ports):
docs = render_chart(
- values={
- "_rpcServer": {
- "enabled": True,
- "service": {
- "type": "NodePort",
- "ports": ports,
- },
- },
- },
- show_only=["templates/rpc-server/rpc-server-service.yaml"],
+ values={"apiServer": {"service": {"type": "NodePort", "ports": ports}}},
+ show_only=["templates/api-server/api-server-service.yaml"],
)
assert jmespath.search("spec.type", docs[0]) == "NodePort"
assert expected_ports == jmespath.search("spec.ports", docs[0])
-class TestRPCServerNetworkPolicy:
- """Tests rpc-server network policy."""
+class TestAPIServerNetworkPolicy:
+ """Tests api-server network policy."""
def test_off_by_default(self):
docs = render_chart(
- show_only=["templates/rpc-server/rpc-server-networkpolicy.yaml"],
+ show_only=["templates/api-server/api-server-networkpolicy.yaml"],
)
assert len(docs) == 0
@@ -870,8 +698,7 @@ class TestRPCServerNetworkPolicy:
docs = render_chart(
values={
"networkPolicies": {"enabled": True},
- "_rpcServer": {
- "enabled": True,
+ "apiServer": {
"networkPolicy": {
"ingress": {
"from": [{"namespaceSelector": {"matchLabels": {"release": "myrelease"}}}]
@@ -879,7 +706,7 @@ class TestRPCServerNetworkPolicy:
},
},
},
- show_only=["templates/rpc-server/rpc-server-networkpolicy.yaml"],
+ show_only=["templates/api-server/api-server-networkpolicy.yaml"],
)
assert len(docs) == 1
@@ -887,7 +714,7 @@ class TestRPCServerNetworkPolicy:
assert jmespath.search("spec.ingress[0].from", docs[0]) == [
{"namespaceSelector": {"matchLabels": {"release": "myrelease"}}}
]
- assert jmespath.search("spec.ingress[0].ports", docs[0]) == [{"port": 9080}]
+ assert jmespath.search("spec.ingress[0].ports", docs[0]) == [{"port": 9091}]
@pytest.mark.parametrize(
"ports, expected_ports",
@@ -895,11 +722,11 @@ class TestRPCServerNetworkPolicy:
([{"port": "sidecar"}], [{"port": "sidecar"}]),
(
[
- {"port": "{{ .Values.ports._rpcServer }}"},
+ {"port": "{{ .Values.ports.apiServer }}"},
{"port": 80},
],
[
- {"port": 9080},
+ {"port": 9091},
{"port": 80},
],
),
@@ -909,8 +736,7 @@ class TestRPCServerNetworkPolicy:
docs = render_chart(
values={
"networkPolicies": {"enabled": True},
- "_rpcServer": {
- "enabled": True,
+ "apiServer": {
"networkPolicy": {
"ingress": {
"from": [{"namespaceSelector": {"matchLabels": {"release": "myrelease"}}}],
@@ -919,7 +745,7 @@ class TestRPCServerNetworkPolicy:
},
},
},
- show_only=["templates/rpc-server/rpc-server-networkpolicy.yaml"],
+ show_only=["templates/api-server/api-server-networkpolicy.yaml"],
)
assert expected_ports == jmespath.search("spec.ingress[0].ports", docs[0])
@@ -928,30 +754,28 @@ class TestRPCServerNetworkPolicy:
docs = render_chart(
values={
"networkPolicies": {"enabled": True},
- "_rpcServer": {
- "enabled": True,
+ "apiServer": {
"labels": {"test_label": "test_label_value"},
},
},
- show_only=["templates/rpc-server/rpc-server-networkpolicy.yaml"],
+ show_only=["templates/api-server/api-server-networkpolicy.yaml"],
)
assert "test_label" in jmespath.search("metadata.labels", docs[0])
assert jmespath.search("metadata.labels", docs[0])["test_label"] == "test_label_value"
-class TestRPCServerServiceAccount:
- """Tests rpc-server service account."""
+class TestAPIServerServiceAccount:
+ """Tests api-server service account."""
def test_should_add_component_specific_labels(self):
docs = render_chart(
values={
- "_rpcServer": {
- "enabled": True,
+ "apiServer": {
"serviceAccount": {"create": True},
"labels": {"test_label": "test_label_value"},
},
},
- show_only=["templates/rpc-server/rpc-server-serviceaccount.yaml"],
+ show_only=["templates/api-server/api-server-serviceaccount.yaml"],
)
assert "test_label" in jmespath.search("metadata.labels", docs[0])
assert jmespath.search("metadata.labels", docs[0])["test_label"] == "test_label_value"
@@ -959,23 +783,21 @@ class TestRPCServerServiceAccount:
def test_default_automount_service_account_token(self):
docs = render_chart(
values={
- "_rpcServer": {
- "enabled": True,
+ "apiServer": {
"serviceAccount": {"create": True},
},
},
- show_only=["templates/rpc-server/rpc-server-serviceaccount.yaml"],
+ show_only=["templates/api-server/api-server-serviceaccount.yaml"],
)
assert jmespath.search("automountServiceAccountToken", docs[0]) is True
def test_overridden_automount_service_account_token(self):
docs = render_chart(
values={
- "_rpcServer": {
- "enabled": True,
+ "apiServer": {
"serviceAccount": {"create": True, "automountServiceAccountToken": False},
},
},
- show_only=["templates/rpc-server/rpc-server-serviceaccount.yaml"],
+ show_only=["templates/api-server/api-server-serviceaccount.yaml"],
)
assert jmespath.search("automountServiceAccountToken", docs[0]) is False
diff --git a/helm_tests/security/test_rbac.py b/helm_tests/security/test_rbac.py
index 75924684cda..d163a2ed683 100644
--- a/helm_tests/security/test_rbac.py
+++ b/helm_tests/security/test_rbac.py
@@ -34,7 +34,6 @@ DEPLOYMENT_NO_RBAC_NO_SA_KIND_NAME_TUPLES = [
("Service", "test-rbac-postgresql"),
("Service", "test-rbac-statsd"),
("Service", "test-rbac-webserver"),
- ("Service", "test-rbac-rpc-server"),
("Service", "test-rbac-flower"),
("Service", "test-rbac-pgbouncer"),
("Service", "test-rbac-redis"),
@@ -42,7 +41,6 @@ DEPLOYMENT_NO_RBAC_NO_SA_KIND_NAME_TUPLES = [
("Deployment", "test-rbac-scheduler"),
("Deployment", "test-rbac-statsd"),
("Deployment", "test-rbac-webserver"),
- ("Deployment", "test-rbac-rpc-server"),
("Deployment", "test-rbac-flower"),
("Deployment", "test-rbac-pgbouncer"),
("StatefulSet", "test-rbac-postgresql"),
@@ -70,7 +68,6 @@ SERVICE_ACCOUNT_NAME_TUPLES = [
("ServiceAccount", "test-rbac-cleanup"),
("ServiceAccount", "test-rbac-scheduler"),
("ServiceAccount", "test-rbac-webserver"),
- ("ServiceAccount", "test-rbac-rpc-server"),
("ServiceAccount", "test-rbac-worker"),
("ServiceAccount", "test-rbac-triggerer"),
("ServiceAccount", "test-rbac-pgbouncer"),
@@ -84,7 +81,7 @@ SERVICE_ACCOUNT_NAME_TUPLES = [
CUSTOM_SERVICE_ACCOUNT_NAMES = (
(CUSTOM_SCHEDULER_NAME := "TestScheduler"),
(CUSTOM_WEBSERVER_NAME := "TestWebserver"),
- (CUSTOM_RPC_SERVER_NAME := "TestRPCSserver"),
+ (CUSTOM_API_SERVER_NAME := "TestAPISserver"),
(CUSTOM_WORKER_NAME := "TestWorker"),
(CUSTOM_TRIGGERER_NAME := "TestTriggerer"),
(CUSTOM_CLEANUP_NAME := "TestCleanup"),
@@ -97,6 +94,8 @@ CUSTOM_SERVICE_ACCOUNT_NAMES = (
(CUSTOM_POSTGRESQL_NAME := "TestPostgresql"),
)
+parametrize_version = pytest.mark.parametrize("version", ["2.3.2", "2.4.0", "3.0.0", "default"])
+
class TestRBAC:
"""Tests RBAC."""
@@ -107,18 +106,27 @@ class TestRBAC:
return values
@staticmethod
- def _get_object_tuples(version):
+ def _get_object_tuples(version, sa: bool = True):
tuples = copy(DEPLOYMENT_NO_RBAC_NO_SA_KIND_NAME_TUPLES)
- if version == "default":
+ if version in {"default", "3.0.0"}:
tuples.append(("Service", "test-rbac-triggerer"))
tuples.append(("StatefulSet", "test-rbac-triggerer"))
else:
tuples.append(("Deployment", "test-rbac-triggerer"))
if version == "2.3.2":
tuples.append(("Secret", "test-rbac-result-backend"))
+ if version == "3.0.0":
+ tuples.extend(
+ (
+ ("Service", "test-rbac-api-server"),
+ ("Deployment", "test-rbac-api-server"),
+ )
+ )
+ if sa:
+ tuples.append(("ServiceAccount", "test-rbac-api-server"))
return tuples
- @pytest.mark.parametrize("version", ["2.3.2", "2.4.0", "default"])
+ @parametrize_version
def test_deployments_no_rbac_no_sa(self, version):
k8s_objects = render_chart(
"test-rbac",
@@ -141,7 +149,7 @@ class TestRBAC:
"redis": {"serviceAccount": {"create": False}},
"scheduler": {"serviceAccount": {"create": False}},
"webserver": {"serviceAccount": {"create": False}},
- "_rpcServer": {"enabled": True, "serviceAccount": {"create": False}},
+ "apiServer": {"serviceAccount": {"create": False}},
"workers": {"serviceAccount": {"create": False}},
"triggerer": {"serviceAccount": {"create": False}},
"statsd": {"serviceAccount": {"create": False}},
@@ -155,9 +163,9 @@ class TestRBAC:
list_of_kind_names_tuples = [
(k8s_object["kind"], k8s_object["metadata"]["name"]) for k8s_object in k8s_objects
]
- assert sorted(list_of_kind_names_tuples) == sorted(self._get_object_tuples(version))
+ assert sorted(list_of_kind_names_tuples) == sorted(self._get_object_tuples(version, sa=False))
- @pytest.mark.parametrize("version", ["2.3.2", "2.4.0", "default"])
+ @parametrize_version
def test_deployments_no_rbac_with_sa(self, version):
k8s_objects = render_chart(
"test-rbac",
@@ -168,7 +176,6 @@ class TestRBAC:
"cleanup": {"enabled": True},
"flower": {"enabled": True},
"pgbouncer": {"enabled": True},
- "_rpcServer": {"enabled": True},
},
version=version,
),
@@ -179,7 +186,7 @@ class TestRBAC:
real_list_of_kind_names = self._get_object_tuples(version) + SERVICE_ACCOUNT_NAME_TUPLES
assert sorted(list_of_kind_names_tuples) == sorted(real_list_of_kind_names)
- @pytest.mark.parametrize("version", ["2.3.2", "2.4.0", "default"])
+ @parametrize_version
def test_deployments_with_rbac_no_sa(self, version):
k8s_objects = render_chart(
"test-rbac",
@@ -194,7 +201,7 @@ class TestRBAC:
},
"scheduler": {"serviceAccount": {"create": False}},
"webserver": {"serviceAccount": {"create": False}},
- "_rpcServer": {"enabled": True, "serviceAccount": {"create": False}},
+ "apiServer": {"serviceAccount": {"create": False}},
"workers": {"serviceAccount": {"create": False}},
"triggerer": {"serviceAccount": {"create": False}},
"flower": {"enabled": True, "serviceAccount": {"create": False}},
@@ -215,10 +222,10 @@ class TestRBAC:
list_of_kind_names_tuples = [
(k8s_object["kind"], k8s_object["metadata"]["name"]) for k8s_object in k8s_objects
]
- real_list_of_kind_names = self._get_object_tuples(version) + RBAC_ENABLED_KIND_NAME_TUPLES
+ real_list_of_kind_names = self._get_object_tuples(version, sa=False) + RBAC_ENABLED_KIND_NAME_TUPLES
assert sorted(list_of_kind_names_tuples) == sorted(real_list_of_kind_names)
- @pytest.mark.parametrize("version", ["2.3.2", "2.4.0", "default"])
+ @parametrize_version
def test_deployments_with_rbac_with_sa(self, version):
k8s_objects = render_chart(
"test-rbac",
@@ -228,7 +235,6 @@ class TestRBAC:
"cleanup": {"enabled": True},
"flower": {"enabled": True},
"pgbouncer": {"enabled": True},
- "_rpcServer": {"enabled": True},
},
version=version,
),
@@ -245,6 +251,7 @@ class TestRBAC:
k8s_objects = render_chart(
"test-rbac",
values={
+ "airflowVersion": "3.0.0",
"fullnameOverride": "test-rbac",
"cleanup": {
"enabled": True,
@@ -254,7 +261,7 @@ class TestRBAC:
},
"scheduler": {"serviceAccount": {"name": CUSTOM_SCHEDULER_NAME}},
"webserver": {"serviceAccount": {"name": CUSTOM_WEBSERVER_NAME}},
- "_rpcServer": {"enabled": True, "serviceAccount": {"name": CUSTOM_RPC_SERVER_NAME}},
+ "apiServer": {"serviceAccount": {"name": CUSTOM_API_SERVER_NAME}},
"workers": {"serviceAccount": {"name": CUSTOM_WORKER_NAME}},
"triggerer": {"serviceAccount": {"name": CUSTOM_TRIGGERER_NAME}},
"flower": {"enabled": True, "serviceAccount": {"name": CUSTOM_FLOWER_NAME}},
@@ -282,6 +289,7 @@ class TestRBAC:
k8s_objects = render_chart(
"test-rbac",
values={
+ "airflowVersion": "3.0.0",
"fullnameOverride": "test-rbac",
"cleanup": {
"enabled": True,
@@ -291,7 +299,7 @@ class TestRBAC:
},
"scheduler": {"serviceAccount": {"name": CUSTOM_SCHEDULER_NAME}},
"webserver": {"serviceAccount": {"name": CUSTOM_WEBSERVER_NAME}},
- "_rpcServer": {"enabled": True, "serviceAccount": {"name": CUSTOM_RPC_SERVER_NAME}},
+ "apiServer": {"serviceAccount": {"name": CUSTOM_API_SERVER_NAME}},
"workers": {"serviceAccount": {"name": CUSTOM_WORKER_NAME}},
"triggerer": {"serviceAccount": {"name": CUSTOM_TRIGGERER_NAME}},
"flower": {"enabled": True, "serviceAccount": {"name": CUSTOM_FLOWER_NAME}},
@@ -327,6 +335,7 @@ class TestRBAC:
k8s_objects = render_chart(
"test-rbac",
values={
+ "airflowVersion": "3.0.0",
"fullnameOverride": "test-rbac",
"executor": "LocalExecutor",
"cleanup": {"enabled": False},
@@ -334,7 +343,6 @@ class TestRBAC:
"redis": {"enabled": False},
"flower": {"enabled": False},
"statsd": {"enabled": False},
- "_rpcServer": {"enabled": False},
"webserver": {"defaultUser": {"enabled": False}},
},
)
@@ -346,6 +354,7 @@ class TestRBAC:
service_account_names = [
"test-rbac-scheduler",
"test-rbac-webserver",
+ "test-rbac-api-server",
"test-rbac-triggerer",
"test-rbac-migrate-database-job",
]