google / anthos-microk8s

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

while hit terraform apply plan.out got error

rohan-199 opened this issue · comments

while i run terrform apply i got below error
Error: Error creating instance: googleapi: Error 400: Invalid value for field 'resource.networkInterfaces[0].network': 'projects/anthos-lb/global/networks/microk8s-network'. The referenced network resource cannot be found., invalid

with module.microk8s.google_compute_instance.microk8s_instances["microk8s-us-central1-b-01"],
on modules/microk8s/main.tf line 84, in resource "google_compute_instance" "microk8s_instances":
84: resource "google_compute_instance" "microk8s_instances" {

new

I changed line 76 to use the "default" network. I didn't debug the terraform script, but suspect that the vpc is not correctly provisioned for the referenced network; /microk8s-network.

This was done at the root level of the project containing the terraform.tfvars.

Look for:

instanceInfo = {
microk8s-us-central1-b = {
name = "microk8s-us-central1-b"
network = "default"
zone = "us-central1-b"
machineType = "e2-small"
imageProject = "ubuntu-os-cloud"
imageFamily = "ubuntu-2004-lts"
instanceCount = 1
}
}