Unable to install kubernetes charts on specified namespace

随声附和 提交于 2019-11-30 07:17:00

As your cluster is RBAC enabled, seems like your tiller Pod do not have enough permission.

You are using default ServiceAccount which lacks enough RBAC permission, tiller requires.

All you need to create ClusterRole, ClusterRoleBinding and ServiceAccount. With them you can provide necessary permission to your Pod.

Follow this steps

_1. Create ClusterRole tiller

kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
  name: tiller
rules:
- apiGroups: ["*"]
  resources: ["*"]
  verbs: ["*"]

Note: I have used full permission here.

_2. Create ServiceAccount tiller in kube-system namespace

$ kubectl create sa tiller -n kube-system

_3. Create ClusterRoleBinding tiller

kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
  name: tiller
subjects:
- kind: ServiceAccount
  name: tiller
  namespace: kube-system
  apiGroup: ""
roleRef:
  kind: ClusterRole
  name: tiller
  apiGroup: rbac.authorization.k8s.io

Now you need to use this ServiceAccount in your tiller Deployment.

As you already have one, edit that

$ kubectl edit deployment -n kube-system tiller-deploy

Set serviceAccountName to tiller under PodSpec

Read more about RBAC

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!