How to use Workload Identity with Go client-go library? #170
Unanswered
akselleirv
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello!
I'm trying to authenticate using Workload Identity, but I'm having difficulties finding documentation of how to do it with using the k8s client-go library. I have created a the following azure resources using Terraform:
And I have created this application which uses the projected tokens:
In the image I have included the KubeLogin binary, but the next steps are unclear for me. I have looked into this example from Kubernetes: https://github.com/kubernetes/client-go/tree/master/examples/out-of-cluster-client-configuration
There they use the local kubeconfig to authenticate, but what would I need to change out in order to make it work with Workload Identity? Any links to some documentation which describes how to do this?
UPDATE:
I managed to figure out the requirements for the kubeconfig, but I have not solved the authorization to the kube api. I have created this kubeconfig:
My program looks like the following:
It is able to create the clientset, but when I try to list pods I get
Unauthorizedback. I have tried to create the following rolebinding:But it does not seem to work. How can I debug this further?
Beta Was this translation helpful? Give feedback.
All reactions