我在 gitlab ci 中遇到问题,当在terraform apply本地执行时一切正常(kubectl 在 gitlab ci 容器和本地中正常工作),但是在 gitlab ci 中执行相同的脚本时会抛出如下所示的错误
本地 terraform 版本v0.12.24
gitlab ci 容器中的 terraform 版本v0.12.25
主.tf
provider "google" {
project = "profiline-russia"
region = "us-central1"
zone = "us-central1-c"
}
resource "google_container_cluster" "primary" {
name = "main-cluster"
location = "europe-west3"
remove_default_node_pool = true
initial_node_count = 1
}
resource "google_container_node_pool" "primary_nodes" {
name = "node-pool"
location = "europe-west3"
cluster = google_container_cluster.primary.name
node_count = 1
node_config {
machine_type = "n1-standard-1"
}
}
# dashboard …Run Code Online (Sandbox Code Playgroud)