https://rancher.com/ logo
Title
g

gray-hamburger-78209

09/22/2022, 4:21 PM
Hi all ! any one knows how to create a user token for rancher desktop ? I need this token for a k8s HTTP API client app that can only authenticate with a Bearer Token. I'm not sure to explain right the token I need, so if it can helps : once generated, this kind of token can be defined in kubectl ~/.kube/config file as a users.user.token entry).
q

quick-sandwich-76600

09/22/2022, 4:52 PM
The standard service account model should work for what you need. You can see an example here: https://app.cnvrg.io/docs/guides/ssh.html#edit-your-local-kubeconfig. Just be aware that the example limits access just to resources of type pod, so just adapt it for your specific needs. Hope it helps.
👍 1
g

gray-hamburger-78209

09/22/2022, 11:18 PM
Thanks Juan !
the given page by Juan had some errors at this steps: 1. append to permissions.yaml following lines --- apiVersion: v1 kind: Secret metadata: name: cnvrg-port-secret annotations: kubernetes.io/service-account.name: cnvrg-port- type: kubernetes.io/service-account-token --- 2. use kubectl -n kube-system apply -f permissions.yaml --- Retrieve the access token. use kubectl -n kube-system describe secret $(kubectl -n kube-system get serviceaccount | grep cnvrg-port- | awk '{print $1}')| grep token:
👍 2
q

quick-sandwich-76600

09/23/2022, 11:19 AM
Thanks for the fixes. They'll be helpful for anyone else with the same needs.