Tiller (Helm v2) deployed in a Kubernetes environment

Remove unsupported Helm v2 Tiller components and migrate to a supported deployment workflow.

Description

The Helm 2 tiller-deploy server manages releases with the Kubernetes permissions granted to its service account. Helm 2 has reached end of support.

Potential impact

Access to Tiller’s management endpoint can put workloads and cluster resources within that account’s permissions at risk.

Remediation

Back up release records and values and plan recovery. Migrate to a supported Helm version without Tiller and verify release management and application health. Then remove the old Deployment, Service, dedicated accounts and RBAC bindings. Check for remaining access paths.

Examples

The placeholder tiller-image and old nginx image illustrate two different Deployments. Use maintained images for deployment.

Before

hcl
resource "kubernetes_deployment" "helm_server" {
  metadata {
    name = "tiller-deploy"
    labels = {
      app = "helm"
    }
  }

  spec {
    replicas = 1

    selector {
      match_labels = {
        app = "helm"
      }
    }

    template {
      metadata {
        labels = {
          app = "helm"
        }
      }

      spec {
        container {
          name  = "helm-server"
          image = "tiller-image"
        }
      }
    }
  }
}

After

hcl
resource "kubernetes_deployment" "app" {
  metadata {
    name = "service-deploy"
    labels = {
      app = "web"
    }
  }

  spec {
    replicas = 1

    selector {
      match_labels = {
        app = "web"
      }
    }

    template {
      metadata {
        labels = {
          app = "web"
        }
      }

      spec {
        container {
          name  = "web"
          image = "nginx:1.7.8"
        }
      }
    }
  }
}

Adding kubernetes_deployment.app leaves Tiller running. Removing the tracked kubernetes_deployment.helm_server block can make Terraform plan to destroy it. Keep that block until the migration is verified, then review the removal plan.

References