From feeea7e5123fc5b66227fe86b9247d5e49e34498 Mon Sep 17 00:00:00 2001 From: Vasubabu <3358152+vasubabu@users.noreply.github.com> Date: Mon, 22 May 2023 06:02:19 +0530 Subject: [PATCH] Enabled module_name in provider meta for Equinix (#10044) --- .gitlab-ci/terraform.yml | 4 ++-- contrib/terraform/equinix/kubespray.tf | 8 ++++---- contrib/terraform/equinix/provider.tf | 6 +++++- contrib/terraform/equinix/sample-inventory/cluster.tfvars | 4 ++-- contrib/terraform/equinix/variables.tf | 4 ++-- docs/ci-setup.md | 2 +- 6 files changed, 16 insertions(+), 12 deletions(-) diff --git a/.gitlab-ci/terraform.yml b/.gitlab-ci/terraform.yml index 9d1b9abe9..ffdd226ed 100644 --- a/.gitlab-ci/terraform.yml +++ b/.gitlab-ci/terraform.yml @@ -110,7 +110,7 @@ tf-validate-upcloud: # TF_VAR_number_of_k8s_nodes: "1" # TF_VAR_plan_k8s_masters: t1.small.x86 # TF_VAR_plan_k8s_nodes: t1.small.x86 -# TF_VAR_facility: ewr1 +# TF_VAR_metro: ny # TF_VAR_public_key_path: "" # TF_VAR_operating_system: ubuntu_16_04 # @@ -124,7 +124,7 @@ tf-validate-upcloud: # TF_VAR_number_of_k8s_nodes: "1" # TF_VAR_plan_k8s_masters: t1.small.x86 # TF_VAR_plan_k8s_nodes: t1.small.x86 -# TF_VAR_facility: ams1 +# TF_VAR_metro: am # TF_VAR_public_key_path: "" # TF_VAR_operating_system: ubuntu_18_04 diff --git a/contrib/terraform/equinix/kubespray.tf b/contrib/terraform/equinix/kubespray.tf index 47831a5b7..d6bd166a3 100644 --- a/contrib/terraform/equinix/kubespray.tf +++ b/contrib/terraform/equinix/kubespray.tf @@ -10,7 +10,7 @@ resource "equinix_metal_device" "k8s_master" { count = var.number_of_k8s_masters hostname = "${var.cluster_name}-k8s-master-${count.index + 1}" plan = var.plan_k8s_masters - facilities = [var.facility] + metro = var.metro operating_system = var.operating_system billing_cycle = var.billing_cycle project_id = var.equinix_metal_project_id @@ -23,7 +23,7 @@ resource "equinix_metal_device" "k8s_master_no_etcd" { count = var.number_of_k8s_masters_no_etcd hostname = "${var.cluster_name}-k8s-master-${count.index + 1}" plan = var.plan_k8s_masters_no_etcd - facilities = [var.facility] + metro = var.metro operating_system = var.operating_system billing_cycle = var.billing_cycle project_id = var.equinix_metal_project_id @@ -36,7 +36,7 @@ resource "equinix_metal_device" "k8s_etcd" { count = var.number_of_etcd hostname = "${var.cluster_name}-etcd-${count.index + 1}" plan = var.plan_etcd - facilities = [var.facility] + metro = var.metro operating_system = var.operating_system billing_cycle = var.billing_cycle project_id = var.equinix_metal_project_id @@ -49,7 +49,7 @@ resource "equinix_metal_device" "k8s_node" { count = var.number_of_k8s_nodes hostname = "${var.cluster_name}-k8s-node-${count.index + 1}" plan = var.plan_k8s_nodes - facilities = [var.facility] + metro = var.metro operating_system = var.operating_system billing_cycle = var.billing_cycle project_id = var.equinix_metal_project_id diff --git a/contrib/terraform/equinix/provider.tf b/contrib/terraform/equinix/provider.tf index 74bf0c305..61c0aba12 100644 --- a/contrib/terraform/equinix/provider.tf +++ b/contrib/terraform/equinix/provider.tf @@ -1,9 +1,13 @@ terraform { required_version = ">= 1.0.0" + + provider_meta "equinix" { + module_name = "kubespray" + } required_providers { equinix = { source = "equinix/equinix" - version = ">=1.11.0" + version = "~> 1.14" } } } diff --git a/contrib/terraform/equinix/sample-inventory/cluster.tfvars b/contrib/terraform/equinix/sample-inventory/cluster.tfvars index 4e583f1a6..039f20878 100644 --- a/contrib/terraform/equinix/sample-inventory/cluster.tfvars +++ b/contrib/terraform/equinix/sample-inventory/cluster.tfvars @@ -9,8 +9,8 @@ equinix_metal_project_id = "Example-Project-Id" # Terraform will complain if the public key is setup in Equinix Metal public_key_path = "~/.ssh/id_rsa.pub" -# cluster location -facility = "ewr1" +# Equinix interconnected bare metal across our global metros. +metro = "da" # operating_system operating_system = "ubuntu_22_04" diff --git a/contrib/terraform/equinix/variables.tf b/contrib/terraform/equinix/variables.tf index 82c701508..9417388e3 100644 --- a/contrib/terraform/equinix/variables.tf +++ b/contrib/terraform/equinix/variables.tf @@ -19,8 +19,8 @@ variable "billing_cycle" { default = "hourly" } -variable "facility" { - default = "dfw2" +variable "metro" { + default = "da" } variable "plan_k8s_masters" { diff --git a/docs/ci-setup.md b/docs/ci-setup.md index defd23c10..604706c79 100644 --- a/docs/ci-setup.md +++ b/docs/ci-setup.md @@ -48,7 +48,7 @@ equinix_metal_project_id = "_redacted_" public_key_path = "~/.ssh/id_rsa.pub" # cluster location -facility = "am6" +metro = "da" # standalone etcds number_of_etcd = 0