bpleines opened a new issue #17197:
URL: https://github.com/apache/airflow/issues/17197


   **Apache Airflow version**: 1.10.15
   
   
   **Kubernetes version (if you are using kubernetes)** (use `kubectl 
version`): v1.19.3
   
   **Environment**:
   
   - **Cloud provider or hardware configuration**: AWS
   - **OS** (e.g. from /etc/os-release): Flatcar OS
   - **Kernel** (e.g. `uname -a`): Linx airflow-webserver-xxxxxxx-yyyyyy 
5.4.92-flatcar x86_64 GNU/Linux
   - **Install tools**: jsonnet/docker/kubernetes
   - **Others**: 
   
   **What happened**:
   
   When running the upgrade_check, it fails on `Users must set a 
kubernetes.pod_template_file value` despite me having a value supplied.
   ```
   airflow upgrade_check
   
   
   
   
=====================================================================================================================
 STATUS 
====================================================================================================================
   
   
   
   Check for latest versions of apache-airflow and 
checker................................................................................................................................................................................SUCCESS
   
   Remove airflow.AirflowMacroPlugin 
class................................................................................................................................................................................................SUCCESS
   
   Ensure users are not using custom metaclasses in custom 
operators......................................................................................................................................................................SUCCESS
   
   Chain between DAG and operator not 
allowed.............................................................................................................................................................................................SUCCESS
   
   Connection.conn_type is not 
nullable...................................................................................................................................................................................................SUCCESS
   
   Custom Executors now require full 
path.................................................................................................................................................................................................SUCCESS
   
   Check versions of PostgreSQL, MySQL, and SQLite to ease upgrade to Airflow 
2.0.........................................................................................................................................................SUCCESS
   
   Hooks that run DB functions must inherit from 
DBApiHook................................................................................................................................................................................SUCCESS
   
   Fernet is enabled by 
default...........................................................................................................................................................................................................SUCCESS
   
   GCP service account key 
deprecation....................................................................................................................................................................................................SUCCESS
   
   Unify hostname_callable option in core 
section.........................................................................................................................................................................................SUCCESS
   
   Changes in import paths of hooks, operators, sensors and 
others........................................................................................................................................................................SUCCESS
   
   Legacy UI is deprecated by 
default.....................................................................................................................................................................................................SUCCESS
   
   Logging configuration has been moved to new 
section....................................................................................................................................................................................SUCCESS
   
   Removal of Mesos 
Executor..............................................................................................................................................................................................................SUCCESS
   
   No additional argument allowed in 
BaseOperator.........................................................................................................................................................................................SUCCESS
   
   Rename max_threads to 
parsing_processes................................................................................................................................................................................................SUCCESS
   
   Users must set a kubernetes.pod_template_file 
value....................................................................................................................................................................................FAIL
   
   Ensure Users Properly Import conf from 
Airflow.........................................................................................................................................................................................SUCCESS
   
   SendGrid email uses old airflow.contrib 
module.........................................................................................................................................................................................SUCCESS
   
   Check Spark JDBC Operator default connection 
name......................................................................................................................................................................................SUCCESS
   
   Changes in import path of remote task 
handlers.........................................................................................................................................................................................SUCCESS
   
   Connection.conn_id is not 
unique.......................................................................................................................................................................................................SUCCESS
   
   Use CustomSQLAInterface instead of SQLAInterface for custom data 
models................................................................................................................................................................SUCCESS
   
   Found 1 problem.
   
   
   
   
================================================================================================================
 RECOMMENDATIONS 
================================================================================================================
   
   
   
   Users must set a kubernetes.pod_template_file value
   
   ---------------------------------------------------
   
   In Airflow 2.0, KubernetesExecutor Users need to set a pod_template_file as 
a base
   
   value for all pods launched by the KubernetesExecutor. Many Kubernetes 
configs are no longer
   
   needed once this pod_template_file has been generated.
   
   
   
   
   
   Problems:
   
   
   
     1.  The following invalid keys were found in your airflow.cfg:             
       
   
   
   
   airflow_configmap
   
   airflow_local_settings_configmap
   
   dags_in_image
   
   dags_volume_subpath
   
   dags_volume_mount_point
   
   dags_volume_claim
   
   logs_volume_subpath
   
   logs_volume_claim
   
   dags_volume_host
   
   logs_volume_host
   
   env_from_configmap_ref
   
   env_from_secret_ref
   
   git_repo
   
   git_branch
   
   git_sync_depth
   
   git_subpath
   
   git_sync_rev
   
   git_user
   
   git_password
   
   git_sync_root
   
   git_sync_dest
   
   git_dags_folder_mount_point
   
   git_ssh_key_secret_name
   
   git_ssh_known_hosts_configmap_name
   
   git_sync_credentials_secret
   
   git_sync_container_repository
   
   git_sync_container_tag
   
   git_sync_init_container_name
   
   git_sync_run_as_user
   
   worker_service_account_name
   
   image_pull_secrets
   
   gcp_service_account_keys
   
   affinity
   
   tolerations
   
   run_as_user
   
   fs_group
   
   
   
                       Now that you have a pod_template_file, these keys no 
longer do anything.
   
                      Please delete these keys.
   ```
   
   **What you expected to happen**:
   
   The `airflow upgrade_check` test `Users must set a 
kubernetes.pod_template_file value` succeeds because I have a valid 
`pod_template_file` implementation without supplying any of the flagged 
`[kubernetes]` configs.
   
   My initial run of the `airflow upgrade_check` command performed on my 
airflow webserver pod where I only supply the following [kubernetes] 
airflow.cfg values directly in `airflow.cfg` or as env vars:
   
   - AIRFLOW__KUBERNETES__NAMESPACE
   - AIRFLOW__KUBERNETES__WORKER_CONTAINER_REPOSITORY
   - AIRFLOW__KUBERNETES__CONTAINER_TAG
   - AIRFLOW__KUBERNETES__POD_TEMPLATE_FILE
   - AIRFLOW__KUBERNETES__DELETE_WORKER_PODS
   - AIRFLOW__KUBERNETES__DELETE_WORKER_PODS_ON_FAILURE
   
   I followed this up with a test that stripped all other [kubernetes] 
airflow.cfg configs above from the container so I was only supplying 
`AIRFLOW__KUBERNETES__POD_TEMPLATE_FILE` and I got the same result.
   
   **How to reproduce it**:
   Create a 1.10.15 airflow deployment using the KubernetesExecutor with *only* 
`airflow.kubernetes.pod_template_file` defined in the [kubernetes] section and 
run `airflow upgrade_check`.
   
   **Anything else we need to know**:
   
   Because the current implementation is [grabbing the airflow config values 
and iterating through the airflow.cfg keys to see what is 
present](https://github.com/apache/airflow/blob/v1-10-test/airflow/upgrade/rules/pod_template_file_rule.py#L69-L75),
 I'm thinking that it is possible that `airflow upgrade_check` is returning a 
false positive based on defaults for airflow.cfg [kubernetes] values in 
`1.10.15` even when a user is not supplying them.
   
   If this is indeed the issue, perhaps an alternative check could be to verify 
that the file supplied to `AIRFLOW__KUBERNETES__POD_TEMPLATE_FILE` is a valid 
airflow/k8s pod spec?
   
   I double checked that 
https://github.com/apache/airflow/blob/v1-10-test/airflow/upgrade/rules/pod_template_file_rule.py#L61
 != None for my environment also.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to