Terraform

#Provider using .kube/config

#Current shell

complete -C /usr/local/bin/terraform terraform


#Target

terraform apply -target='helm_release.heapster'

terraform destroy -target='helm_release.heapster'


#Importing existing resources

terraform import kubernetes_persistent_volume.workspace-data-nfs-pvc workspace-data-nfs-pvc

terraform import kubernetes_persistent_volume_claim.workspace-data-nfs-pvc default/workspace-data-nfs-pvc

terraform import kubernetes_pod.workspace default/workspace


NOTES:

  • Preferred over tools like ansible because it's slow and kustomize just manages k8s because we need to manage GCP infrastructure as well