Terraform, Kubernetes and Helm – Setting Up CI for Deployments

4/22/2020

I currently have a cluster spun up by terraform, where I don't have kubeconfig generated, but I do have the info I need to pass a kubernetes block in.

provider "kubernetes" {  
load_config_file       = false
host                   = local.kubernetes_config.host
cluster_ca_certificate = local.kubernetes_config.cluster_ca_certificate
token                  = local.kubernetes_config.token
}

via terraform, I can use the helm integration to install helm packages easily.

  • I want to setup a CI pipeline to do helm upgrade
  • I do not have a kube-config, but I have the host, cluster_ca_certificate and token.
  • How should I setup helm upgrades from my CI server?

I think this is a pretty common usecase, but I can't figure out how to integrate helm and my CI server, since terraform doesn't give me a kubeconfig I can pass through my system, only the host, cluster_ca_certificate and token.

I tried working with the helm --token integration, but this strategy didn't work for me.

-- Ken Mazaika
docker
kubernetes
kubernetes-helm
terraform

0 Answers