{"id":192,"date":"2019-06-24T14:29:25","date_gmt":"2019-06-24T21:29:25","guid":{"rendered":"http:\/\/www.nillsf.com\/?p=192"},"modified":"2019-06-24T14:29:28","modified_gmt":"2019-06-24T21:29:28","slug":"error-installing-helm-error-no-available-release-name-found","status":"publish","type":"post","link":"https:\/\/blog.nillsf.com\/index.php\/2019\/06\/24\/error-installing-helm-error-no-available-release-name-found\/","title":{"rendered":"Error installing helm: &#8220;Error: no available release name found&#8221;"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">I recently was trying to get Helm up and running on a new AKS (Azure Kubernetes Service) cluster, and got an error during the Tiller configuration step. If you&#8217;re reading this, you might have hit the same issue, and I&#8217;ll explain you how to resolve this.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The issue itself is related to RBAC<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">(at least in my case) the issue was related to RBAC. <a href=\"https:\/\/kubernetes.io\/docs\/reference\/access-authn-authz\/rbac\/\">RBAC in Kubernetes<\/a> is a mechanism to allow or deny specific users to take certain actions against the cluster. Those actions are describes in a role.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">There are two\nconcepts that are necessary for RBAC, a Role and an RoleBinding. Both are\navailable in either a namespace-specific version (Role and RoleBinding) or\ncluster-wide (ClusterRole and ClusterRoleBinding). A Role sets the permissions\nthat can be granted to a user &#8211; the RoleBinding links a user to a specific\nRole. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The server side component of helm (at least until helm v3, which will drop the Tiller comporent), needs <a href=\"https:\/\/helm.sh\/docs\/using_helm\/#role-based-access-control\">those RBAC permissions<\/a> to execute its deployments against the Kubernetes cluster. This role and role assignment needs to be created prior to installing Tiller on the cluster. So, let&#8217;s have a look at how to create this role and role assignment for Tiller to be able to install.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Solving the issue, the quick and dirty way<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">The easiest way to solve this problem is by executing the following 2 commands:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>kubectl create serviceaccount --namespace kube-system tiller<br>kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The first one will create a <code>serviceaccount<\/code>, the second one creates the <code>clusterrolebinding <\/code>to a built-in cluster role called cluster-admin (all access). And with that, you are able to install Tiller on your Kubernetes cluster.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>helm   init --service-account tiller   <\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Please be very mindful when doing this on your production clusters. Giving Tiller the cluster-admin role gives Tiller the full set of keys to your kingdom. It might make sense to setup <a href=\"https:\/\/helm.sh\/docs\/using_helm\/#example-deploy-tiller-in-a-namespace-restricted-to-deploying-resources-only-in-that-namespace\">Tiller per namespace<\/a> or give it <a href=\"https:\/\/helm.sh\/docs\/using_helm\/#example-deploy-tiller-in-a-namespace-restricted-to-deploying-resources-in-another-namespace\">limited access to certain namespaces.<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Solving the issue, the YAML way<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Who ever said yaml was hard? You can setup the service account and clusterrolebinding as well via <a href=\"https:\/\/helm.sh\/docs\/using_helm\/#example-service-account-with-cluster-admin-role\">Kubernetes YAML files<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>apiVersion: v1<br> kind: ServiceAccount<br> metadata:<br> \u00a0 name: tiller<br> \u00a0 namespace: kube-system<br> ---<br> apiVersion: rbac.authorization.k8s.io\/v1<br> kind: ClusterRoleBinding<br> metadata:<br> \u00a0 name: tiller<br> roleRef:<br> \u00a0 apiGroup: rbac.authorization.k8s.io<br> \u00a0 kind: ClusterRole<br> \u00a0 name: cluster-admin<br> subjects:<br> \u00a0 - kind: ServiceAccount<br> \u00a0\u00a0\u00a0 name: tiller<br> \u00a0\u00a0\u00a0 namespace: kube-system<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Afterwards, you can go ahead and apply this yaml file and get tiller installed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>kubectl create -f rbac-config.yaml<br>helm init --service-account tiller<\/code><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">In summary<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If you run into the issue I had while installing Helm\/Tiller, I hope you found a quick solution in this quick post. Please be mindful about assigning the cluster-admin role to Tiller as Tiller will be able to control everything across your cluster. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>I recently was trying to get Helm up and running on a new AKS (Azure Kubernetes Service) cluster, and got an error during the Tiller configuration step. If you&#8217;re reading this, you might have hit the same issue, and I&#8217;ll explain you how to resolve this. The issue itself is related to RBAC (at least [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-192","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/blog.nillsf.com\/index.php\/wp-json\/wp\/v2\/posts\/192","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.nillsf.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.nillsf.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.nillsf.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.nillsf.com\/index.php\/wp-json\/wp\/v2\/comments?post=192"}],"version-history":[{"count":1,"href":"https:\/\/blog.nillsf.com\/index.php\/wp-json\/wp\/v2\/posts\/192\/revisions"}],"predecessor-version":[{"id":193,"href":"https:\/\/blog.nillsf.com\/index.php\/wp-json\/wp\/v2\/posts\/192\/revisions\/193"}],"wp:attachment":[{"href":"https:\/\/blog.nillsf.com\/index.php\/wp-json\/wp\/v2\/media?parent=192"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.nillsf.com\/index.php\/wp-json\/wp\/v2\/categories?post=192"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.nillsf.com\/index.php\/wp-json\/wp\/v2\/tags?post=192"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}