-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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-5117] support refreshing EKS api tokens #5731
Conversation
upstream patch for swagger-codegen: swagger-api/swagger-codegen#9624. I will work the PR for k8s client once the swagger-codegen PR is approved and merged. |
107cdbe
to
d5c474f
Compare
@ashb tests added, ready for review :) |
Looks like upstream k8s client is moving to a new openapi code generator, I have sent my code gen fix to openapi-generator as well. It will probably take awhile for the fix to land in upstream k8s client given they are still in the process of migrating to openapi-generator. All my upstream fix activities can be tracked at kubernetes-client/python#741. |
@houqp I'm a bit conflicted about this. On the one hand this is a very important bug that we need to address, on the other hand I'd want to minimize how much k8s logic is in airflow. Would it be possible to further isolate this so it would be easier to remove once the necessary fixes are implemented? |
856fedd
to
e4f6d7a
Compare
@dimberman my original patch added comment for every function and Class that can be safely removed once patch lands in upstream. I have pushed a new change to move most of the patching logic into a separate module to make it easier to follow. |
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.
Other than @ashb 's pylint comment and a a nit on my end this LGTM
5e4bcb1
to
7e2cf64
Compare
A workaround was added (apache#5731) to handle the refreshing of EKS tokens. It was necessary because of an upstream bug. It has since been fixed (kubernetes-client/python-base@70b78cd) and released in v21.7.0 (https://github.com/kubernetes-client/python/blob/master/CHANGELOG.md#v2170).
A workaround was added (apache#5731) to handle the refreshing of EKS tokens. It was necessary because of an upstream bug. It has since been fixed (kubernetes-client/python-base@70b78cd) and released in v21.7.0 (https://github.com/kubernetes-client/python/blob/master/CHANGELOG.md#v2170).
A workaround was added (#5731) to handle the refreshing of EKS tokens. It was necessary because of an upstream bug. It has since been fixed (kubernetes-client/python-base@70b78cd) and released in v21.7.0 (https://github.com/kubernetes-client/python/blob/master/CHANGELOG.md#v2170).
…he#20759) A workaround was added (apache#5731) to handle the refreshing of EKS tokens. It was necessary because of an upstream bug. It has since been fixed (kubernetes-client/python-base@70b78cd) and released in v21.7.0 (https://github.com/kubernetes-client/python/blob/master/CHANGELOG.md#v2170).
A workaround was added (#5731) to handle the refreshing of EKS tokens. It was necessary because of an upstream bug. It has since been fixed (kubernetes-client/python-base@70b78cd) and released in v21.7.0 (https://github.com/kubernetes-client/python/blob/master/CHANGELOG.md#v2170). (cherry picked from commit 7bd165f)
A workaround was added (#5731) to handle the refreshing of EKS tokens. It was necessary because of an upstream bug. It has since been fixed (kubernetes-client/python-base@70b78cd) and released in v21.7.0 (https://github.com/kubernetes-client/python/blob/master/CHANGELOG.md#v2170). (cherry picked from commit 7bd165f)
A workaround was added (#5731) to handle the refreshing of EKS tokens. It was necessary because of an upstream bug. It has since been fixed (kubernetes-client/python-base@70b78cd) and released in v21.7.0 (https://github.com/kubernetes-client/python/blob/master/CHANGELOG.md#v2170). (cherry picked from commit 7bd165f)
A workaround was added (#5731) to handle the refreshing of EKS tokens. It was necessary because of an upstream bug. It has since been fixed (kubernetes-client/python-base@70b78cd) and released in v21.7.0 (https://github.com/kubernetes-client/python/blob/master/CHANGELOG.md#v2170). (cherry picked from commit 7bd165f)
A workaround was added (apache/airflow#5731) to handle the refreshing of EKS tokens. It was necessary because of an upstream bug. It has since been fixed (kubernetes-client/python-base@70b78cd) and released in v21.7.0 (https://github.com/kubernetes-client/python/blob/master/CHANGELOG.md#v2170). (cherry picked from commit 7bd165fbe2cbbfa8208803ec352c5d16ca2bd3ec) GitOrigin-RevId: d39197fd13b0d96c2ab84ca3f1f13391dbf59572
A workaround was added (apache/airflow#5731) to handle the refreshing of EKS tokens. It was necessary because of an upstream bug. It has since been fixed (kubernetes-client/python-base@70b78cd) and released in v21.7.0 (https://github.com/kubernetes-client/python/blob/master/CHANGELOG.md#v2170). GitOrigin-RevId: 7bd165fbe2cbbfa8208803ec352c5d16ca2bd3ec
A workaround was added (apache/airflow#5731) to handle the refreshing of EKS tokens. It was necessary because of an upstream bug. It has since been fixed (kubernetes-client/python-base@70b78cd) and released in v21.7.0 (https://github.com/kubernetes-client/python/blob/master/CHANGELOG.md#v2170). GitOrigin-RevId: 7bd165fbe2cbbfa8208803ec352c5d16ca2bd3ec
A workaround was added (apache/airflow#5731) to handle the refreshing of EKS tokens. It was necessary because of an upstream bug. It has since been fixed (kubernetes-client/python-base@70b78cd) and released in v21.7.0 (https://github.com/kubernetes-client/python/blob/master/CHANGELOG.md#v2170). GitOrigin-RevId: 7bd165fbe2cbbfa8208803ec352c5d16ca2bd3ec
A workaround was added (apache/airflow#5731) to handle the refreshing of EKS tokens. It was necessary because of an upstream bug. It has since been fixed (kubernetes-client/python-base@70b78cd) and released in v21.7.0 (https://github.com/kubernetes-client/python/blob/master/CHANGELOG.md#v2170). GitOrigin-RevId: 7bd165fbe2cbbfa8208803ec352c5d16ca2bd3ec
A workaround was added (apache/airflow#5731) to handle the refreshing of EKS tokens. It was necessary because of an upstream bug. It has since been fixed (kubernetes-client/python-base@70b78cd) and released in v21.7.0 (https://github.com/kubernetes-client/python/blob/master/CHANGELOG.md#v2170). GitOrigin-RevId: 7bd165fbe2cbbfa8208803ec352c5d16ca2bd3ec
A workaround was added (apache/airflow#5731) to handle the refreshing of EKS tokens. It was necessary because of an upstream bug. It has since been fixed (kubernetes-client/python-base@70b78cd) and released in v21.7.0 (https://github.com/kubernetes-client/python/blob/master/CHANGELOG.md#v2170). GitOrigin-RevId: 7bd165fbe2cbbfa8208803ec352c5d16ca2bd3ec
A workaround was added (apache/airflow#5731) to handle the refreshing of EKS tokens. It was necessary because of an upstream bug. It has since been fixed (kubernetes-client/python-base@70b78cd) and released in v21.7.0 (https://github.com/kubernetes-client/python/blob/master/CHANGELOG.md#v2170). GitOrigin-RevId: 7bd165fbe2cbbfa8208803ec352c5d16ca2bd3ec
A workaround was added (apache/airflow#5731) to handle the refreshing of EKS tokens. It was necessary because of an upstream bug. It has since been fixed (kubernetes-client/python-base@70b78cd) and released in v21.7.0 (https://github.com/kubernetes-client/python/blob/master/CHANGELOG.md#v2170). GitOrigin-RevId: 7bd165fbe2cbbfa8208803ec352c5d16ca2bd3ec
A workaround was added (apache/airflow#5731) to handle the refreshing of EKS tokens. It was necessary because of an upstream bug. It has since been fixed (kubernetes-client/python-base@70b78cd) and released in v21.7.0 (https://github.com/kubernetes-client/python/blob/master/CHANGELOG.md#v2170). GitOrigin-RevId: 7bd165fbe2cbbfa8208803ec352c5d16ca2bd3ec
Make sure you have checked all steps below.
Jira
Description
This PR patches upstream k8s client to check for EKS api token refresh. Without this, Airflow K8S integration won't work if not deployed in cluster.
When Airflow scheduler or worker is not deployed in K8S cluster, all K8S API call will fail with 401 error after running for about 14min.
This is due to EKS enforces a 15min timeout for all API tokens but the official k8S python client doesn't support token refresh.
Tests
see: tests/kubernetes/test_client.py
Commits
Documentation
Code Quality
flake8