Skip to content

Instantly share code, notes, and snippets.

@yogesh174
Created June 5, 2021 18:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yogesh174/2b9c51e2efaf38c0f405d44d825621b5 to your computer and use it in GitHub Desktop.
Save yogesh174/2b9c51e2efaf38c0f405d44d825621b5 to your computer and use it in GitHub Desktop.
Multi-cloud K8s cluster with Terraform and Ansible
#########################################
######## Create k8s worker nodes ########
#########################################
resource "google_compute_instance" "k8s_worker" {
count = var.gcp_nodes
name = "gcp-k8s-worker-${count.index}"
machine_type = var.gcp_machine_type
zone = var.gcp_zone
boot_disk {
initialize_params {
image = "debian-cloud/debian-9"
}
}
network_interface {
network = "default"
access_config {}
}
# Created after and destroyed before master node
depends_on = [
aws_instance.k8s_master,
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment