Due to minikube
issues 13841 and 13872 (which I believe to be the same), I have to use minikube
1.23.2. I try using minikube start --kubernetes-version v...
with version 1.24+ but none works (not sure why). Thus, I cannot use the convenient command kubectl -n ... create token ...
. Seba's answer to this question shows how to generate the token with this older kubectl
version:
$ export secret=$(kubectl get serviceaccount default -o jsonpath='{.secrets[0].name}')
$ kubectl get secret $secret -o jsonpath='{.data.token}' | base64 --decode
Apparently, the command is only good for service account default
. How can I rewrite that script so it can be used for other users as follows?
$ export my_script=....
$ my_script another_account