Skip to content

AWS EKS Token Support #51

Open
Open

Description

@cerebralmind

I have my kubeconfig setup to use the aws eks command to fetch tokens. Is there a way to get this to work when running within toolhive?

I can see the MKP mcp server complaining about not having the aws cli:

getting credentials: exec: executable aws not found

I'd imagine this has to do with the aws cli not being available within the docker container running MKP.

Thanks

Activity

  1. JAORMX commented on Jun 5, 2025

    @JAORMX
    Collaborator

    @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.

    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 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.

  2. cerebralmind commented on Jun 19, 2025

    @cerebralmind
    Author

    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.exec

        kubectl config unset "users.$USER_NAME.exec" --kubeconfig="$MODIFIED_KUBECONFIG"  2>/dev/null || true

    After that I modified my thv run as follows:

    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.

  3. rdimitrov commented on Jun 25, 2025

    @rdimitrov
    Member

    @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 😃

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions