简体   繁体   English

无法使用Helm在AWS的kops集群上安装Nginx

[英]Not able to install nginx on kops cluster on AWS using helm

i have set up a two node kops cluster. 我已经建立了两个节点的kops集群。 Where i have installed helm tool. 我在哪里安装了头盔工具。

I created my own application specific helm package and installed it through helm and everything works fine. 我创建了自己的应用程序特定的头盔包,并通过头盔安装了它,一切正常。

but when i tried to install nginx through stable helm charts(as specified in standard instructions) i am getting below error, 但是,当我尝试通过稳定的头盔图表(如标准说明中指定的那样)安装nginx时,出现以下错误,

root@ip-172-31-27-86:~/helm# helm install --name my-nginx stable/nginx-ingress
Error: release tinseled-billygoat failed: clusterroles.rbac.authorization.k8s.io "tinseled-billygoat-nginx-ingress" is forbidden: attempt to grant extra privileges: [PolicyRule{Resources:["configmaps"], APIGroups:[""], Verbs:["list"]} PolicyRule{Resources:["configmaps"], APIGroups:[""], Verbs:["watch"]} PolicyRule{Resources:["endpoints"], APIGroups:[""], Verbs:["list"]} PolicyRule{Resources:["endpoints"], APIGroups:[""], Verbs:["watch"]} PolicyRule{Resources:["nodes"], APIGroups:[""], Verbs:["list"]} PolicyRule{Resources:["nodes"], APIGroups:[""], Verbs:["watch"]} PolicyRule{Resources:["pods"], APIGroups:[""], Verbs:["list"]} PolicyRule{Resources:["pods"], APIGroups:[""], Verbs:["watch"]} PolicyRule{Resources:["secrets"], APIGroups:[""], Verbs:["list"]} PolicyRule{Resources:["secrets"], APIGroups:[""], Verbs:["watch"]} PolicyRule{Resources:["nodes"], APIGroups:[""], Verbs:["get"]} PolicyRule{Resources:["services"], APIGroups:[""], Verbs:["get"]} PolicyRule{Resources:["services"], APIGroups:[""], Verbs:["list"]} PolicyRule{Resources:["services"], APIGroups:[""], Verbs:["update"]} PolicyRule{Resources:["services"], APIGroups:[""], Verbs:["watch"]} PolicyRule{Resources:["ingresses"], APIGroups:["extensions"], Verbs:["get"]} PolicyRule{Resources:["ingresses"], APIGroups:["extensions"], Verbs:["list"]} PolicyRule{Resources:["ingresses"], APIGroups:["extensions"], Verbs:["watch"]} PolicyRule{Resources:["events"], APIGroups:[""], Verbs:["create"]} PolicyRule{Resources:["events"], APIGroups:[""], Verbs:["patch"]} PolicyRule{Resources:["ingresses/status"], APIGroups:["extensions"], Verbs:["update"]}] user=&{system:serviceaccount:kube-system:default bdf8f2bc-84e2-11e8-8fa3-02f0fae19e8e [system:serviceaccounts system:serviceaccounts:kube-system system:authenticated] map[]} ownerrules=[] ruleResolutionErrors=[]

helm list, containing chart details. 舵列表,包含图表详细信息。

root@ip-172-31-27-86:/home/appHome/HelmPackages# helm list
NAME            REVISION        UPDATED                         STATUS          CHART                   NAMESPACE
my-nginx        1               Wed Jul 11 11:02:37 2018        FAILED          nginx-ingress-0.22.1    default
nodeapp1        1               Wed Jul 11 10:36:23 2018        DEPLOYED        nodeapp-helm-0.1.0      default

It seems some kind of rbac issue, however i had successfully deployed nginx similary before. 看来是某种rbac问题,但是我之前已经成功部署了nginx类似。 But now i am facing this for first time, So not exactly sure where it might be wrong. 但是现在我第一次面对这个问题,所以不完全确定哪里可能是错误的。

Any help appreciated 任何帮助表示赞赏

Sounds like your helm service account does not have some privileges granted that your nginx ingress chart tries to create. 听起来您的头盔服务帐户没有授予您的nginx入口图尝试创建的某些特权。 RBAC does not allow creation of particular access if user that is doing so does not have this access on it's own, which is pretty logical for avoiding privilege escalation when delegating access. 如果执行此操作的用户自己没有该访问权限,则RBAC不允许创建特定的访问权限,这在避免委派访问权限时避免特权升级是很合乎逻辑的。

I tried by re-installing helm with service account, 我尝试通过使用服务帐户重新安装头盔,

kubectl create serviceaccount --namespace kube-system tiller kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller helm init --service-account tiller kubectl创建serviceaccount --namespace kube-system分er kubectl创建clusterrolebinding分er-cluster-rule --clusterrole = cluster-admin --serviceaccount = kube-system:tiller helm init --service-account分er

yet, it was not helpful still faced the same issue. 然而,它仍然没有遇到同样的问题。

But as a quick fix for test env, i set this property while installing nginx 但是作为测试环境的快速修复,我在安装nginx时设置了此属性

--set rbac.create=false

and now Nginx is working fine, but this is not recommended for production servers. 现在Nginx可以正常工作,但是不建议将其用于生产服务器。

helm install --name my-nginx stable/nginx-ingress --set rbac.create=false

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM