-
Notifications
You must be signed in to change notification settings - Fork 432
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
Mount host cluster service account to pod #1883
Comments
Hey @tsipinakis ! Could you provide full |
We deploy vcluster using helm directly on an on-premise host Kubernetes cluster, this is the configuration:
We are trying to authenticate to Vault using the Kubernetes and/or JWT auth method. We have configured the host cluster as the authentication provider and we want to use the namespace field as the user identifier to identify the vcluster that is being authenticated. Then we want to give the token to an ArgoCD instance that'll be running in the vcluster to deploy our software stack. However the show-stopper is that I cannot see how to mount a token from the host cluster inside the vcluster. |
@tsipinakis in vCluster v0.20 we do have an option to sync resources from host cluster to vCluster instance, did you try this approach? This requires multi-namespace mode to be enabled: experimental:
multiNamespaceMode:
enabled: true
genericSync:
import:
- kind: ServiceAccount
apiVersion: v1
- kind: Secret
apiVersion: v1 This will import ServiceAccounts and Secrets created in host cluster in namespaces that are part of given vCluster deployment into vCluster. You can specify selectors for each kind to import only specific resources. More info on this can be found here in docs |
Reading the docs I'm not sure that this would work, this would sync the service accounts from the host cluster into the vcluster, but still the ArgoCD pod will have a service account token generated by vcluster, not one generated by the host cluster. What I'm looking for is a way to mount a service account of the host cluster in a pod running in vcluster. aka, the token should be signed by the host clusters signing key. |
@tsipinakis in that case solution would be to instead of using volume projection for mounting the Secret, to create a |
Looking at multi-namespace mode currently,
Seems like quite a big breaking feature to use for such a simple use-case. Additionally, having multiple different namespaces would break the ability to authenticate to Vault with the method mentioned above i.e. using the namespace name as the username |
Is your feature request related to a problem?
I am trying to authenticate vcluster workloads to external services that use the kubernetes OIDC method and trust the host clusters service accounts, however even if I enable serviceAccount syncing to the host the token that is mounted in the pod is using the vcluster internal accounts and not the hosts one.
Which solution do you suggest?
I am not aware of any way currently to mount a token from the host cluster in the vclusters pods, (is there one?) If not it'd be nice to have a configuration option for that.
I tried to use
instead of the automounted token but it looks like vcluster is overriding that as well.
Which alternative solutions exist?
No response
Additional context
For this only need a single service account is needed to be mountable, so a filter to only allow one would be nice.
The text was updated successfully, but these errors were encountered: