We've seen airflow scheduler pods with a high restart count in all deployments:
root@deploy2002:~# kubectl get pod -A -l app=airflow,component=scheduler NAMESPACE NAME READY STATUS RESTARTS AGE airflow-analytics-test airflow-scheduler-797f597794-2mbk4 2/2 Running 60 (7h14m ago) 35d airflow-ml airflow-scheduler-85b68dc7fd-zh86v 2/2 Running 90 (10h ago) 33d airflow-research airflow-scheduler-84788bfc99-krg77 2/2 Running 25 (3m46s ago) 5d16h airflow-search airflow-scheduler-584d8f8dfc-4tpvp 2/2 Running 62 (49m ago) 4d16h airflow-test-k8s airflow-scheduler-7c556d89df-rlldm 2/2 Running 63 (3h53m ago) 35d airflow-wmde airflow-scheduler-b76565995-kjnr5 2/2 Running 152 (3h21m ago) 41d
The restart is always accompanied by the following error message:
psycopg2.OperationalError: could not translate host name "postgresql-airflow-search-pooler-rw.airflow-search" to address: Name or service not known
That would seem to indicate that all pgbouncer pods are somehow un-ready, and thus the RW pooler service name cannot be resolved (which we need to investigate).
However, this only happens because the scheduler healthcheck calls out to the database, cf https://github.com/apache/airflow/blob/454e63fd6684d31e5a662aa48d82e2bba8896cac/airflow/utils/scheduler_health.py#L36-L55
I'd much rather we have as much of a self-contained healthcheck as possible, without any interaction with an external system. In the absence of an API handler running something akin to return 'OK', I think we should revert the scheduler healthchecks back to a tcpSocket probe.


