You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "kosteev (via GitHub)" <gi...@apache.org> on 2025/12/17 13:16:42 UTC
[I] AirflowProviderDeprecationWarning: Configuration 'namespace' is deprecated. [airflow]
kosteev opened a new issue, #59563:
URL: https://github.com/apache/airflow/issues/59563
### Apache Airflow Provider(s)
cncf-kubernetes
### Versions of Apache Airflow Providers
In one of the latest cncf-kubernetes provider we emit warning message:
"""
/opt/python3.11/lib/python3.11/site-packages/airflow/providers/cncf/kubernetes/executors/kubernetes_executor.py:155 AirflowProviderDeprecationWarning: Configuration 'namespace' is deprecated. Use 'pod_template_file' to specify the namespace instead.
"""
https://github.com/apache/airflow/blob/875a427ab3f1cc06bf470a9cebdd27aa8d9528a5/providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/kube_config.py#L85
However it is still needed/used in kubernetex_executor_utils.py:
https://github.com/apache/airflow/blob/875a427ab3f1cc06bf470a9cebdd27aa8d9528a5/providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/executors/kubernetes_executor_utils.py#L523C53-L523C67
So, this property is actually needed and shouldn't be deprecated?
### Apache Airflow version
3.1.0
### Operating System
Linux
### Deployment
Google Cloud Composer
### Deployment details
_No response_
### What happened
_No response_
### What you think should happen instead
_No response_
### How to reproduce
Use latest cncf-kubernetes provider and run Airflow with KubernetesExecutor
### Anything else
_No response_
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [x] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
--
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: commits-unsubscribe@airflow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] AirflowProviderDeprecationWarning: Configuration 'namespace' is deprecated. [airflow]
Posted by "romsharon98 (via GitHub)" <gi...@apache.org>.
romsharon98 commented on issue #59563:
URL: https://github.com/apache/airflow/issues/59563#issuecomment-3665410233
Hi @kosteev ,
This is the [motivation](https://github.com/apache/airflow/issues/36389) for the change.
They are still there because we still don't want to make a breaking change in the package.
This is a warning for the user to know in the future versions those parameters will be removed.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] AirflowProviderDeprecationWarning: Configuration 'namespace' is deprecated. [airflow]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on issue #59563:
URL: https://github.com/apache/airflow/issues/59563#issuecomment-3666559534
100% with @kosteev -> I think this parameter was deprecated by mistake and deprecation should be reverted.
This is the places where it is used:
```python
if self.kube_config.multi_namespace_mode:
if self.kube_config.multi_namespace_mode_namespace_list:
namespaces = self.kube_config.multi_namespace_mode_namespace_list
else:
namespaces = [None]
else:
namespaces = [self.kube_config.kube_namespace]
```
and:
```python
class AirflowKubernetesScheduler(LoggingMixin):
"""Airflow Scheduler for Kubernetes."""
def __init__(
self,
kube_config: Any,
result_queue: Queue[KubernetesResults],
kube_client: client.CoreV1Api,
scheduler_job_id: str,
):
super().__init__()
self.log.debug("Creating Kubernetes executor")
self.kube_config = kube_config
self.result_queue = result_queue
self.namespace = self.kube_config.kube_namespace
self.log.debug("Kubernetes using namespace %s", self.namespace)
self.kube_client = kube_client
self._manager = multiprocessing.Manager()
self.watcher_queue = self._manager.Queue()
self.scheduler_job_id = scheduler_job_id
self.kube_watchers = self._make_kube_watchers()
```
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] AirflowProviderDeprecationWarning: Configuration 'namespace' is deprecated. [airflow]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk closed issue #59563: AirflowProviderDeprecationWarning: Configuration 'namespace' is deprecated.
URL: https://github.com/apache/airflow/issues/59563
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] AirflowProviderDeprecationWarning: Configuration 'namespace' is deprecated. [airflow]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on issue #59563:
URL: https://github.com/apache/airflow/issues/59563#issuecomment-3671385160
> agree about the namespace but what about
> `worker_container_repository` and `worker_container_tag` ([#59556](https://github.com/apache/airflow/issues/59556)) those could get from the pod_tamplate_file no?
I believe - as @kosteev wrote - thy are also uised in KubeConfig - they are simply "read" by KubeConfig - so the deprecation warnings will be trigged by sheer fact that KubeConfig reads them - without explicitly reading them by the user. So there is **no way** to remove them effectively - because no user action can ever remove those warnings.
We should either:
a) not depracate it
or
b) not read them from deprecated value in Airflow when running regular code - without action from the user.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] AirflowProviderDeprecationWarning: Configuration 'namespace' is deprecated. [airflow]
Posted by "romsharon98 (via GitHub)" <gi...@apache.org>.
romsharon98 commented on issue #59563:
URL: https://github.com/apache/airflow/issues/59563#issuecomment-3665420679
close as deprecated
#59556
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] AirflowProviderDeprecationWarning: Configuration 'namespace' is deprecated. [airflow]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on issue #59563:
URL: https://github.com/apache/airflow/issues/59563#issuecomment-3719430922
I am all for accepting this change if someone contributes it BTW.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] AirflowProviderDeprecationWarning: Configuration 'namespace' is deprecated. [airflow]
Posted by "romsharon98 (via GitHub)" <gi...@apache.org>.
romsharon98 closed issue #59563: AirflowProviderDeprecationWarning: Configuration 'namespace' is deprecated.
URL: https://github.com/apache/airflow/issues/59563
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] AirflowProviderDeprecationWarning: Configuration 'namespace' is deprecated. [airflow]
Posted by "romsharon98 (via GitHub)" <gi...@apache.org>.
romsharon98 commented on issue #59563:
URL: https://github.com/apache/airflow/issues/59563#issuecomment-3670333989
agree about the namespace but what about
`worker_container_repository` and `worker_container_tag` (https://github.com/apache/airflow/issues/59556) those could get from the pod_tamplate_file no?
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] AirflowProviderDeprecationWarning: Configuration 'namespace' is deprecated. [airflow]
Posted by "kosteev (via GitHub)" <gi...@apache.org>.
kosteev commented on issue #59563:
URL: https://github.com/apache/airflow/issues/59563#issuecomment-3665784766
Wait, I didn't get it.
The `namespace` parameter will be removed in favor of what?
I get that you can define namespace parameter in the spec of pod_template file, but this parameter also needed for KubernetesExecutor to watch for pod events (as I mentioned in the issue). So, how KubernetesExecutor will know from which namespace to listen for events?
Or let me rephrase the question. What should I do as a user when I see this deprecation warning message? If I stop providing namespace property, KubernetesExecutor then fails for me with permission error message, because it tries to use "default" namespace, not the custom namespace that I want it to use.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org