You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Failed to find exact match for authentication.k8s.io/v1.TokenRequest by [kind, name, singularName, shortNames]"}
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Failed to find exact match for authentication.k8s.io/v1.TokenRequest by [kind, name, singularName, shortNames]"}
The text was updated successfully, but these errors were encountered:
Suppose you will apply the same definition with kubectl apply -f <file.yaml> you will have the same result.
It seems that the request of a service account token is not supported yet in kubernetes.core collections, you can create Feature request or make with requested feathere a PR by yourself with official kubernetes python client.
As @yurnov pointed out, you cannot create a TokenRequest resource using apply. The TokenRequest is a subresource of a ServiceAccount. This would have to be implemented as a new module that uses the token attribute in a similar way to how we implement the k8s_scale module:
SUMMARY
Unable to find any way to create a Kubernetes dashboard token. Typically with kubectl, this is done with the following command:
If you add -o yaml to this command, you get output similar to the following:
So I tried creating this task:
But it just generates the following error:
ISSUE TYPE
COMPONENT NAME
kubernetes.core.k8s
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
Darwin -***.local 23.6.0 Darwin Kernel Version 23.6.0: Mon Jul 29 21:13:04 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T6020 arm64
STEPS TO REPRODUCE
Set the kubeconfig fact to the path to a valid kubeconfig file for the cluster, then run the following task.
EXPECTED RESULTS
Create and output the dashboard token.
ACTUAL RESULTS
Fails with this error:
The text was updated successfully, but these errors were encountered: