我有服务帐户名:myservice
$ kubectl get serviceaccount
NAME SECRETS AGE
default 1 15d
myservice 1 15d
$ kubectl get serviceaccount myservice -o yaml
apiVersion: v1
kind: ServiceAccount
metadata:
creationTimestamp: 2018-06-13T12:41:18Z
name: myservice
namespace: default
...我想将服务的命名空间default更改为development。
我试着用:
kubectl edit serviceaccount myservice
保存后,我收到了:
A copy of your changes has been stored to "/tmp/kubectl-edit-gjae6.yaml"
error: the namespace from the provided object "development" does not match the namespace "default". You must pass '--namespace=development' to perform this operation.所以我试了一下,就像他们写的一样,但还是没有用:
$ kubectl edit serviceaccount myservice --namespace=development
Error from server (NotFound): serviceaccounts "myservice" not found名称空间development是存在的,服务myservice也存在。
发布于 2018-06-28 22:19:11
似乎您应该在开发中创建新的myservice SA,NS,而不是修改默认命名空间中的现有SA。在开发NS中创建新的myservice,然后删除默认NS中的一个。错误导致不存在的我的服务甚至在发展中NS。
https://stackoverflow.com/questions/51087230
复制相似问题