kubectl --token=$TOKEN doesn't run with the permissions of the token
问题 When I am using the command kubectl with the --token flag and specify a token, it still uses the administrator credentials from the kubeconfig file. This is what I did: NAMESPACE="default" SERVICE_ACCOUNT_NAME="sa1" kubectl create sa $SERVICE_ACCOUNT_NAME kubectl create clusterrolebinding list-pod-clusterrolebinding \ --clusterrole=list-pod-clusterrole \ --serviceaccount="$NAMESPACE":"$SERVICE_ACCOUNT_NAME" kubectl create clusterrole list-pod-clusterrole \ --verb=list \ --resource=pods TOKEN=