执行kubectl命令报错:Error from server (Forbidden), can only create tokens for individual service accounts

问题现象描述

执行kubectl命令出现以下报错:

Error from server (Forbidden): error when deleting "device-plugin-310P-volcano-v6.0.RC2.yaml": serviceaccounts "ascend-device-plugin-sa-310p" is forbidden: User "system:node:worker-2" cannot delete resource "serviceaccounts" in API group "" in the namespace "kube-system": can only create tokens for individual service accounts

原因分析

以上命令未在管理节点执行,所以命令执行失败。

解决方案

在管理节点执行以上命令。示例如下。