-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Use default connection id for KubernetesPodOperator #28848
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
Conversation
c0bef5e to
76ff473
Compare
|
@dstandish, do you remember why we didn't do this initially? |
My question exactly. |
Backward compatibility. Previously, KPO did not use airflow conn. If we now use default, this will break things for users. We can do but must be major release. |
So it was using the bult-in "local" kubernetes (basically whatever kubectl sees ?) if None is used? Maybe we can check for existence of the connection and fallback to default behaviour when it is not available? What's the likelihood someone will have default k8s connection set and would not want to use it ? (still likely requring major version bump and technically breaking but with far less radius blast) |
i think quite likely: Lines 364 to 370 in 6d09fc7
|
it was using the settings from core, i.e. |
Let me modify it slightly. Why don't we fall-back to |
|
Hard no with falling back to get_kube_client -- no reason to bring that back. The kube hook with works with no conn Id and it's fully back compat with get kube client Now should we ever disregard the default connection? Not sure about that |
dstandish
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just want to block merge (for now) to allow some time for debate to play out re whether this is good idea. ultimately i do not veto this just want to take a moment
|
Hey @dstandish @potiuk can we restart this conversation? I wouldn't want this PR to fall into the abyss just because we're unsure. FWIW I think it's fine for us to make this breaking change and then do a major update. to me this is where the magic of providers exists. If we want to release a version before that contains a deprecation warning/write a warning somewhere just in case I'm not against that, but I'd love to bring the KPO more in line with the rest of the operators. |
That is preferred |
|
I'm fine with using |
|
So if decided to go with major release directly (which is OK) |
db2ce17 to
f442cc5
Compare
|
Needs conflict resolution now, I am afraid |
|
@lwyszomi can you rebase and resolve conflicts? |
1d770ec to
556e8f1
Compare
|
Has this change actually got into 2.6.0 release? I had to change KPO conf to include |
This is not a core PR It's not released with apache-airlfow it's released with Kubernetes provider: |
|
Ok but apparently it was bundled with 2.6.0 https://raw.githubusercontent.com/apache/airflow/constraints-2.6.0/constraints-3.10.txt |
From you message it's not clear if you have problem with or not. and what you are asking for. But no matter what - if you think you have a problem and needs older version of the provider, you can alwas build your own custom image where the provider is downgraded. The image we publish is the reference image and you are free to extend it as you see fit. What's your ask really @iJanki-gr ? Since you've already checked the constraints? Is your question answered or do you expect something else here? |
|
This is a breaking change that replaces the default value of the parameter. hence why it was released in a major version (6.0.0) so yet if you don't have |
|
Yes that's ok, but in the release notes of airflow 2.6.0 there was no mention of cncf kubernetes provider upgrade. |
|
I fixed my issue, next time i'll check the providers release notes too. Thanks |
Because the image bundles airflow 2.6.0 AND providers. The image is a reference one that contains airflow and latest providers, but you are in control on which providers you want to keep or use. As @eladkal mentioned, if you chose to use the image, you need to check the release notes of the providers. |
|
I will thank you and sorry for the bother. |
|
@iJanki-gr don't be sorry, i also just hit the same point exactly. My deployment broke updating the bundled image to airflow==2.6.0 and i didn't figure out directly checking in the cncf provider release notes. In defense of @iJanki-gr, the breaking change announcement on the release notes does not announce the change needed to make older dags compatible, or at least i couldn't directly find it. Since i got here only via a few corners, for the sake of google results: My dags were breaking for KubernetesPodOperator with Adding |
|
2.6.0 KubernetesPodOperator is not working when running my dag.. |
|
It works for me. Can you provide more details? |
|
Here's the error log Im going to test |
|
Yes that should fix it kubernetes_conn_id=None |
|
The kubernetes provider as of 6.0.0 releases uses kubernetes connection to be defined https://airflow.apache.org/docs/apache-airflow-providers-cncf-kubernetes/stable/index.html#breaking-changes and you should switch to it. That was a breaking change in the provider. Have you checked the release notes ? |
|
And your error tells exactly this: |
|
The whole discussion above explaines all about this in case you have not read it @bmoon4 |
|
I am getting this error too. |
|
i added |
|
@karunpoudel-chr breaking change is something which stops the code from compiling / running, so this is normal. If you want to avoid adding |
It's common when using KPO / K8s hook to want to simply use the RBAC of the cluster. This was the default behavior prior to apache#28848. After that change, users are forced to add a k8s connection or their dags will break. To fix this, in the special case where conn_id=="kubernetes_default", if the conn is missing, we ignore the failure.
|
I offer a solution in #31187 If kubernetes_default doesn't exist, ignore it. If other conn id doesn't exist, fail. |
It's common when using KPO / K8s hook to want to simply use the RBAC of the cluster. This was the default behavior prior to #28848. After that change, users are forced to add a k8s connection or their dags will break. To fix this, in the special case where conn_id=="kubernetes_default", if the conn is missing, we ignore the failure.
Fixes: #30324
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an 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 a newsfragment file, named
{pr_number}.significant.rstor{issue_number}.significant.rst, in newsfragments.