Created
June 5, 2021 18:52
-
-
Save yogesh174/2b9c51e2efaf38c0f405d44d825621b5 to your computer and use it in GitHub Desktop.
Multi-cloud K8s cluster with Terraform and Ansible
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######################################### | |
######## 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