New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AIRFLOW-6062 Watch worker pods from all namespaces #8546
Conversation
Awesome work, congrats on your first merged pull request! |
Thank you for adding this @mppetkov! |
[Not a contribution] Hi folks, This PR is going to break some Airflow deployments that do not have cluster-scoped RBAC to list all pods in all namespaces. Are there any active discussions around how to handle this better, or are we going to expect all Airflow KubernetesExecutor-based deployments to have cluster-scoped roles to list across all namespaces? This is a change to our security model and will probably prevent us from being able to pick up 1.10.11. |
@hcheng4 that's a really good point I noticed that in the tests. We need to have a larger discussion (maybe make this a "multi-namespace" mode) |
[Not a contribution] @dimberman a multi-namespace mode sounds like a great idea. Is there a discussion already ongoing? If there's agreement design-wise, I can see if there's appetite and bandwidth here for a patch contribution. It may be the case that longer-term the restrictions of an in-namespace Kubernetes deployment are too much and it's undesirable to support that going forward, but that doesn't feel like the type of compatibility-breaking change that's appropriate for a patch release IMHO. |
One more vote for the generic multi-namespace approach, it would be amazing if we have functionality like that. Actually, that's why I have contributed the fix. In my company we need to run each worker Pod into a specific namespace based on a condition. From what I understand, Airflow needs to provide the following options in the airflow.cfg to make this approach generic. - default_namespace: 'namespace1' - allowed_namespaces: ['*'] - allowed_namespaces: ['namespace1', 'namespace2', 'namespace3'] - denied_namespaces: ['namespace4', 'namespace5', 'namespace6'] What do you think about this approach? |
The scheduler currently monitors pods only from the Kubernetes namespace provided in the configuration. The initial fix has been implemented in this PR - #7123 but it looks like it was not actually a complete fix.
I am extending the previous fix with additional change in the
KubernetesJobWatcher
to watch all namespaces in the Kubernetes cluster.Make sure to mark the boxes below before creating PR: [x]
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.
Read the Pull Request Guidelines for more information.