karbon-platform-services icon indicating copy to clipboard operation
karbon-platform-services copied to clipboard

[SHLK-2608] Split Terraform config into sub-configs

Open heiko-koehler opened this issue 3 years ago • 0 comments

Split TF config into three modules:

  1. karbon_cluster: Creates Karbon cluster
  2. karbon_kube_config: Retrieves kube config which can become stale!
  3. helm_chart: KPS PaaS stack as helm chart

karbon_kube_config module might have to be explicitly refreshed by targeting only this module on apply:

$ terraform apply -auto-approve -var-file yoshi.tfvars -target module.karbon_kube_config

Next the rest of the config can be either applied or destroyed:

$ terraform apply -auto-approve -var-file yoshi.tfvars
$ terraform destroy -auto-approve -var-file yoshi.tfvars

It's worth mentioning that karbon_kube_config produced kube.config which can be used by kubectl or any other Kubernetes tool.

$ terraform apply -auto-approve -var-file yoshi.tfvars -target module.karbon_kube_config
$ kubectl --kubeconfig kube.config get pod

heiko-koehler avatar Apr 14 '21 18:04 heiko-koehler