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

Add support for kubeconfig context. #121

Merged
merged 1 commit into from
Feb 6, 2025

Conversation

ryanlovett
Copy link
Contributor

The kubeconfig cluster provider enables hubploy to use a kubeconfig file to talk to a cluster. However if there are multiple contexts defined in the file, hubploy can only use the default context. This PR lets you specify the context in cluster.kubeconfig.context, either as the literal value of what you provide, or it can template in the value of namespace.

This is to support the deploying of hubs to NRP Nautilus where, if you're using service accounts to connect, they will have (or should have) different credentials between namespaces. The idea would be we can define two contexts in a single kubeconfig: one for a service account that connects to the staging namespace and one for a different service account that connects to the prod namespace.

One might theoretically add support for hubploy to read multiple kubeconfig files from cluster.provider.kubconfig.filename, however this would still require the ability to choose a context.

I've tested this manually with kubeconfig and gcloud providers.

@ryanlovett ryanlovett requested a review from shaneknapp February 6, 2025 20:13
Copy link
Contributor

@shaneknapp shaneknapp left a comment

Choose a reason for hiding this comment

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

LGTM

@ryanlovett ryanlovett merged commit 15d85dc into berkeley-dsep-infra:main Feb 6, 2025
1 check passed
ryanlovett added a commit to ryanlovett/datahub that referenced this pull request Feb 6, 2025
The kubeconfig file contains contexts for both staging and prod namespaces. This required [a change](berkeley-dsep-infra/hubploy#121) to hubploy.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants