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

[k8s] Use service acccount based auth instead of copying over kubeconfig #3277

Closed
romilbhardwaj opened this issue Mar 5, 2024 · 3 comments
Closed
Labels
k8s Kubernetes related items

Comments

@romilbhardwaj
Copy link
Collaborator

User feedback (paraphrased):

It is brittle to assume that I want my application to have the same SA/kubeconfig as the one I am using to interact with the cluster. I want the ability to use a specific service account for my pods/controller.

We can let users specifying their SA in config.yaml and use that instead of Kubeconfig to authenticate.

@romilbhardwaj romilbhardwaj added the k8s Kubernetes related items label Mar 5, 2024
@romilbhardwaj
Copy link
Collaborator Author

Update - the recommended way of doing this on a k8s cluster is to attach a service account with a Kubernetes pod at creation and use config.load_incluster_config.

However, when the controller is running outside the cluster (e.g., on a GCP VM), we would need to use a static kubeconfig file (generated with a script similar to the one in serve_k8s_playground branch) to authenticate.

Note that if the user wants to use their own SA, they need to provide the SA name, the token and the CA certificate in our config.yaml.

To keep things simple, I'm leaning towards always generating a static kubeconfig where necessary (e.g., if using exec based auth). If the SA, token and CA certificate are specified in config.yaml, we use those else we generate new ones.

@romilbhardwaj
Copy link
Collaborator Author

Fixed in #3109.

@romilbhardwaj
Copy link
Collaborator Author

Closed with #3377.

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

No branches or pull requests

1 participant