Keep getting the following warning when issuing kubectl
commands
Warning: Use tokens from the TokenRequest API or manually created secret-based tokens instead of auto-generated secret-based tokens.
At first, I thought that ~/.kube/cache
was to blame, but apparently is not.
Cluster information:
Client Version: v1.27.7
Server Version: v1.27.7
I also see this message, even if I did generate manually created secret-based tokens.
I am on v1.28.6
What is the solution for this issue? I am also facing it from last 10 days
There is truly nothing we can do 
For real, I hate when big software make a change and try to dictate how the industry should do things.
LegacyServiceAccountTokenTracking
is a feature added to kube-apiserver
and enabled by default since k8s 1.27. (upstream KEPs)
When kube-apiserver detects an auto-generated secret-based service account token, it issues a warning and updates the label kubernetes.io/legacy-token-last-used
on that secret.
You can check it on k8s:
kubectl get secrets -A | grep service-account-token
But there seems to be no way to turn off the reminder.