-
Environmental Info: rke2 version v1.31.1+rke2r1 (909d20d) Node(s) CPU architecture, OS, and Version: x86_64, Ubuntu 20.04 Cluster Configuration: 3 master, 7 worker
Describe the bug: I try to create the following with kubectl apply
I get the following error:
Steps To Reproduce:
Expected behavior: Documentation says that TokenRequest is in v1.22 and later version of k8s: https://kubernetes.io/docs/concepts/security/service-accounts/#assign-to-pod
Actual behavior: error message: no matches for kind "TokenRequest" in version "authentication.k8s.io/v1" Additional context / logs:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This is not an RKE2 issue. The TokenRequest API does not have a separate api resource that you can create via kubectl or view in the api resource list. As you can see from the api docs, it is exposed as a subresource of the ServiceAccount API:
You need to post your request to that endpoint targeting a specific ServiceAccount, you can't just In the future, questions about use of core Kubernetes APIs are probably better directed to the upstream project. |
Beta Was this translation helpful? Give feedback.
This is not an RKE2 issue. The TokenRequest API does not have a separate api resource that you can create via kubectl or view in the api resource list. As you can see from the api docs, it is exposed as a subresource of the ServiceAccount API:
https://kubernetes.io/docs/reference/kubernetes-api/authentication-resources/token-request-v1/#Operations
You need to post your request to that endpoint targeting a specific ServiceAccount, you can't just
kubectl create
it.In the future, questions about use of core Kubernetes APIs are probably better directed to the upstream project.