You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@cerebralmind hey! I stumbled upon the same thing. I addressed it by having a "sidecar" that would get the token and create a kubeconfig that is mounted in the mkp container.
This is a little manual and not ideal, so I wonder what would be a solution to make this easier. The mkp container is as minimal as it gets: no shell, no package manager, just the golang binary. Which is great for security and running in a k8s cluster, but it can get challenging to use if you need another CLI like aws.
Let me give this a little thought, I really want to make this easier for you.
thv run --volume $HOME/.kube:/home/nonroot/.kube:ro k8s -- --kubeconfig=/home/nonroot/.kube/kubeconfig-eks-token
I'd imagine this might have been a little more obvious to someone more familar with thv, but it took me a little while to track down the argument and how to pass it, --env didn't work for me for some reason, may have been a typo on my part.
Finally I forgot to override the CLUSTER_NAME used in the token refresh script, which I should have noticed in the logs much earlier.
Activity
JAORMX commentedon Jun 5, 2025
@cerebralmind hey! I stumbled upon the same thing. I addressed it by having a "sidecar" that would get the token and create a kubeconfig that is mounted in the
mkpcontainer.https://gist.github.com/JAORMX/ed718481606ea1cbf4b3f201ec693e49
This is a little manual and not ideal, so I wonder what would be a solution to make this easier. The
mkpcontainer is as minimal as it gets: no shell, no package manager, just the golang binary. Which is great for security and running in a k8s cluster, but it can get challenging to use if you need another CLI likeaws.Let me give this a little thought, I really want to make this easier for you.
cerebralmind commentedon Jun 19, 2025
Hey thanks @JAORMX!
Sorry about the delay on my part, but after playing around with it for a bit I got it to work!
For anyone else that comes along I had to modify your GIST to get it to work for me:
Line 76:
users.$USER_NAME.user.exec->users.$USER_NAME.execAfter that I modified my
thv runas follows:thv run --volume $HOME/.kube:/home/nonroot/.kube:ro k8s -- --kubeconfig=/home/nonroot/.kube/kubeconfig-eks-tokenI'd imagine this might have been a little more obvious to someone more familar with thv, but it took me a little while to track down the argument and how to pass it,
--envdidn't work for me for some reason, may have been a typo on my part.Finally I forgot to override the
CLUSTER_NAMEused in the token refresh script, which I should have noticed in the logs much earlier.rdimitrov commentedon Jun 25, 2025
@cerebralmind - hey, happy to hear it all worked out! 🚀
Can you share how you set the env var? I'd be happy to check in case it's a bug on our side 😃