kubernetes 尝试安装私人市场应用程序时出现AKS错误

eoxn13cs  于 2024-01-06  发布在  Kubernetes
关注(0)|答案(1)|浏览(185)

我已在Azure上的私人商店中创建了一个应用。我尝试从Marketplace安装应用时收到以下错误:

  1. Error: [ InnerError: [Helm installation failed : Unable to build the Kubernetes resources in the extension based on the cluster : InnerError [unable to build kubernetes objects from release manifest: error validating "": error validating data: failed to check CRD: failed to list CRDs: customresourcedefinitions.apiextensions.k8s.io is forbidden: User "system:serviceaccount:kube-system:ext-installer-ssdeploy1" cannot list resource "customresourcedefinitions" in API group "apiextensions.k8s.io" at the cluster scope]]] occurred while doing the operation : [Patch] on the config, For general troubleshooting visit: https://aka.ms/k8s-extensions-TSG

字符串
这里是我尝试过的角色和角色绑定yamls,但没有工作。我是K8的新手,所以有些事情我不明白。

role.yaml

  1. apiVersion: rbac.authorization.k8s.io/v1
  2. kind: Role
  3. metadata:
  4. namespace: default
  5. name: default
  6. rules:
  7. - apiGroups: ["apiextensions.k8s.io"]
  8. resources: ["customresourcedefinitions"]
  9. verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]

角色绑定.yaml

  1. apiVersion: rbac.authorization.k8s.io/v1
  2. kind: RoleBinding
  3. metadata:
  4. name: ext-installer-ssdeploy1
  5. namespace: default
  6. subjects:
  7. - kind: ServiceAccount
  8. name: default
  9. namespace: default
  10. roleRef:
  11. kind: Role
  12. name: ext-installer-ssdeploy1
  13. apiGroup: rbac.authorization.k8s.io


任何帮助都非常感谢。

unguejic

unguejic1#

您的错误指示服务帐户ext-installer-ssdeploy1没有列出apiextensions.k8s.io API组中的自定义资源定义所需的权限。若要解决此问题,您需要向服务帐户授予必要的RBAC权限。还需要修改角色中的name属性。yaml

  1. apiVersion: rbac.authorization.k8s.io/v1
  2. kind: Role
  3. metadata:
  4. namespace: default
  5. name: ext-installer-ssdeploy1
  6. rules:
  7. - apiGroups: ["apiextensions.k8s.io"]
  8. resources: ["customresourcedefinitions"]
  9. verbs: ["get", "list", "watch", "create"]

个字符
授予必要的权限后,尝试再次安装Helm chart,它应该工作。
参考文件-Official K8s Role Example

相关问题