Skip to content

can't create kind: TokenRequest declaratively v1.31.1+rke2r1 #7079

Closed Answered by brandond
ktzsolt asked this question in Q&A
Discussion options

You must be logged in to vote

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

POST /api/v1/namespaces/{namespace}/serviceaccounts/{name}/token

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.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ktzsolt
Comment options

Answer selected by brandond
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #7078 on October 18, 2024 22:59.