在 Kubernetes 上使用 Helm 创建服务帐户时出错

Error creating service account using Helm on Kubernetes

我正尝试按照此处所述在 Kubernetes 上使用 helm 创建服务帐户:

https://tutorials.kevashcraft.com/k8s/install-helm/

当我执行以下行时:

kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'

我收到一个错误:

服务器错误 (BadRequest):无效字符 's' 正在寻找对象键字符串的开头

有人能给我一些指导吗?

谢谢!

尝试 kubectl patch deploy --namespace kube-system tiller-deploy -p "{\"spec\":{\"template\":{\"spec\":{\"serviceAccount\":\"tiller\"}}}}" 即使用外部双引号并转义内部双引号。有一个 github issue 有人在不同的上下文中遇到相同的错误并且能够像这样解决它。

编辑:Touya 先生确定在这种情况下有效的是 kubectl patch deploy --namespace kube-system tiller-deploy -p '{\"spec\":{\"template\":{\"spec\":{\"serviceAccount\":\"tiller\"}}}}'