k8s部署报错
secret list is :
get deployment resources at current namespace
get pods at current namespace
error: the server doesn't have a resource type "secret"
error: unable to recognize "secret.yaml": Unauthorized
unable to recognize "deployment.yaml": Unauthorized
unable to recognize "deployment.yaml": Unauthorized
unable to recognize "deployment.yaml": Unauthorized
unable to recognize "deployment.yaml": Unauthorized
error: the server doesn't have a resource type "deployments"
error: the server doesn't have a resource type "pods"
这个错误消息表明在当前命名空间中无法找到资源类型 "secret", "deployments" 和 "pods"。这可能是由于几个原因引起的:
该命名空间并没有被创建或者没有被您授权。确保该命名空间已经被创建并且您拥有相应的权限。
您在使用的 yaml 文件中资源类型名称可能有误,请确认所有的 yaml 文件都是正确的
您的 kubeconfig 文件中的配置可能有误。确保您使用正确的 kubeconfig 文件,并且它包含了您要访问的集群和命名空间的信息。
您可能没有对集群有足够的权限去操作资源,需要确认账号权限。
确保这些都正确之后再次执行部署命令,如果还是遇到问题需要更详细的调查,可以尝试使用 kubectl describe 查看具体的错误信息。