首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用Helm安装nginx-ingress返回"Error:呈现清单包含已经存在的资源“

使用Helm安装nginx-ingress返回"Error:呈现清单包含已经存在的资源“
EN

Stack Overflow用户
提问于 2022-03-16 10:51:56
回答 1查看 987关注 0票数 0

我有一个使用Terraform在Azure上部署Kubernetes集群的GitLab管道。我第一次使用管道的时候一切都很好。当我完成测试后,我运行了销毁阶段,所有的东西都被销毁了。昨天,我重新运行了创建集群的管道,除了使用helm安装nginx入口的最后一个阶段外,所有阶段都进行得很顺利。

代码语言:javascript
复制
install_nginx_ingress:
  stage: install_dependencies
  image:  alpine/helm:3.1.1
  script:
    - helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
    - helm repo update
    - >
      helm install nginx-ingress ingress-nginx/ingress-nginx
      --namespace default
      --set controller.replicaCount=2
  dependencies:
    - apply
  rules:
    - if: $CI_COMMIT_BRANCH ==  $CI_DEFAULT_BRANCH && $PHASE == "DEPLOY"

当这个阶段被执行时,这就是我在GitLab控制台中拥有的:

代码语言:javascript
复制
$ helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
"ingress-nginx" has been added to your repositories
$ helm repo update
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "ingress-nginx" chart repository
Update Complete. ⎈ Happy Helming!⎈ 
$ helm install nginx-ingress ingress-nginx/ingress-nginx --namespace default --set controller.replicaCount=2
Error: rendered manifests contain a resource that already exists. 
Unable to continue with install: could not get information about the resource: poddisruptionbudgets.policy "nginx-ingress-ingress-nginx-controller" is forbidden: User "system:serviceaccount:gitlab-managed-apps:default" cannot get resource "poddisruptionbudgets" in API group "policy" in the namespace "default"
Cleaning up project directory and file based variables
ERROR: Job failed: command terminated with exit code 1

怎么回事!?

EN

回答 1

Stack Overflow用户

发布于 2022-03-21 16:11:46

检查这条错误行。这就解释了这个问题。

代码语言:javascript
复制
Unable to continue with install: could not get information about the resource: poddisruptionbudgets.policy "nginx-ingress-ingress-nginx-controller" is forbidden: User "system:serviceaccount:gitlab-managed-apps:default" cannot get resource "poddisruptionbudgets" in API group "policy" in the namespace "default"

对于nginx-ingress-ingress-nginx-controller资源上的get操作,您的poddisruptionbudgets没有RBAC权限。

看起来,kubernetes/ingress-nginx图表已经定义了PodDisruptionBudget,但是ClusterRole不包含对poddisruptionbudgets资源的任何权限。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71495774

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档