Skip to content
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

Hook prefect-kubernetes into setting framework #15888

Merged
merged 7 commits into from
Oct 31, 2024
Merged

Conversation

desertaxle
Copy link
Member

@desertaxle desertaxle commented Oct 31, 2024

This PR creates settings models for prefect-kubernetes that allow settings for prefect-kubernetes to be set in via the same methods as core prefect. This PR establishes a pattern for integrations settings to be located under the integrations table in TOML files or use the PREFECT_INTEGRATIONS_ prefix for environment variable based sources.

For example, you can toggle the TCP keepalive setting via a prefect.toml file like this:

[integrations.kubernetes]
worker.add_tcp_keepalive = false

or via a pyproject.toml like this:

[tool.prefect]
integrations.kubernetes.worker.add_tcp_keepalive = false

or via an environment variables like this:

export PREFECT_INTEGRATIONS_KUBERENTES_WORKER_ADD_TCP_KEEPALIVE = "false"

This PR also adds a new setting to be able to specify an existing k8s secret to give to created jobs for the Prefect API key. The plan is to add this to the k8s worker helm chart since that chart create a secret for the Prefect API key by default.

This will need to be merged after the next release because it relies on some unreleased utilities.

Closes #7185

@github-actions github-actions bot added enhancement An improvement of an existing feature security Related to application or infrastructure security labels Oct 31, 2024
@desertaxle desertaxle changed the title Add settings model for prefect-kubernetes Hook prefect-kubernetes into setting framework Oct 31, 2024
@desertaxle desertaxle marked this pull request as ready for review October 31, 2024 16:21
Copy link
Member

@cicdw cicdw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤯 this is great

@desertaxle desertaxle added the DONT MERGE This PR shouldn't be merged (yet) label Oct 31, 2024
@desertaxle desertaxle merged commit 3f31e13 into main Oct 31, 2024
12 checks passed
@desertaxle desertaxle deleted the kubernetes-settings branch October 31, 2024 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DONT MERGE This PR shouldn't be merged (yet) enhancement An improvement of an existing feature security Related to application or infrastructure security
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Agent should pass API key to KubernetesJob as a secret
2 participants