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

optimize k8s config initialization #2602

Closed
wants to merge 1 commit into from

Conversation

karthikkurella
Copy link

@karthikkurella karthikkurella commented Jul 16, 2024

Fix: #2597

#Problem:

  • The LoadNodes function performs unnecessary Kubernetes (k8s) configuration loading routines even when the k8s driver is not in use, leading to performance overhead due to unnecessary YAML parsing.

Solution:

  • Modify the LoadNodes function to conditionally execute k8s-specific logic only when the k8s driver is being used.

Changes:

Add Conditional Check:

  • Check if the node's endpoint contains "kubernetes" before loading the k8s configuration.
  • Move k8s Config Loading Logic:

Encapsulate the k8s configuration loading within the conditional check to prevent unnecessary operations.
This ensures that k8s-specific logic is only executed when required, reducing unnecessary overhead.

Signed-off-by: K@rk <[email protected]>
@karthikkurella
Copy link
Author

@tonistiigi Please review the changes.

Thank you.

@crazy-max
Copy link
Member

Sorry I missed this PR, I think we want to tend for the implementation from #2606 that moves k8s config handling to the driver package. But thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

optimize k8s config initialization
2 participants