forked from kubernetes-sigs/kubespray
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update equinox terraform code to fix kubespray CI (kubernetes-sigs#9702)
* add terraform lock files to ignore list * move contrib/terraform/metal to contrib/terraform/equinix to reflect upstream change
- Loading branch information
1 parent
6881398
commit 64dbf2e
Showing
13 changed files
with
85 additions
and
66 deletions.
There are no files selected for viewing
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
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
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
File renamed without changes.
31 changes: 13 additions & 18 deletions
31
contrib/terraform/metal/kubespray.tf → contrib/terraform/equinix/kubespray.tf
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,57 @@ | ||
# Configure the Equinix Metal Provider | ||
provider "metal" { | ||
} | ||
|
||
resource "metal_ssh_key" "k8s" { | ||
resource "equinix_metal_ssh_key" "k8s" { | ||
count = var.public_key_path != "" ? 1 : 0 | ||
name = "kubernetes-${var.cluster_name}" | ||
public_key = chomp(file(var.public_key_path)) | ||
} | ||
|
||
resource "metal_device" "k8s_master" { | ||
depends_on = [metal_ssh_key.k8s] | ||
resource "equinix_metal_device" "k8s_master" { | ||
depends_on = [equinix_metal_ssh_key.k8s] | ||
|
||
count = var.number_of_k8s_masters | ||
hostname = "${var.cluster_name}-k8s-master-${count.index + 1}" | ||
plan = var.plan_k8s_masters | ||
facilities = [var.facility] | ||
operating_system = var.operating_system | ||
billing_cycle = var.billing_cycle | ||
project_id = var.metal_project_id | ||
project_id = var.equinix_metal_project_id | ||
tags = ["cluster-${var.cluster_name}", "k8s_cluster", "kube_control_plane", "etcd", "kube_node"] | ||
} | ||
|
||
resource "metal_device" "k8s_master_no_etcd" { | ||
depends_on = [metal_ssh_key.k8s] | ||
resource "equinix_metal_device" "k8s_master_no_etcd" { | ||
depends_on = [equinix_metal_ssh_key.k8s] | ||
|
||
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] | ||
operating_system = var.operating_system | ||
billing_cycle = var.billing_cycle | ||
project_id = var.metal_project_id | ||
project_id = var.equinix_metal_project_id | ||
tags = ["cluster-${var.cluster_name}", "k8s_cluster", "kube_control_plane"] | ||
} | ||
|
||
resource "metal_device" "k8s_etcd" { | ||
depends_on = [metal_ssh_key.k8s] | ||
resource "equinix_metal_device" "k8s_etcd" { | ||
depends_on = [equinix_metal_ssh_key.k8s] | ||
|
||
count = var.number_of_etcd | ||
hostname = "${var.cluster_name}-etcd-${count.index + 1}" | ||
plan = var.plan_etcd | ||
facilities = [var.facility] | ||
operating_system = var.operating_system | ||
billing_cycle = var.billing_cycle | ||
project_id = var.metal_project_id | ||
project_id = var.equinix_metal_project_id | ||
tags = ["cluster-${var.cluster_name}", "etcd"] | ||
} | ||
|
||
resource "metal_device" "k8s_node" { | ||
depends_on = [metal_ssh_key.k8s] | ||
resource "equinix_metal_device" "k8s_node" { | ||
depends_on = [equinix_metal_ssh_key.k8s] | ||
|
||
count = var.number_of_k8s_nodes | ||
hostname = "${var.cluster_name}-k8s-node-${count.index + 1}" | ||
plan = var.plan_k8s_nodes | ||
facilities = [var.facility] | ||
operating_system = var.operating_system | ||
billing_cycle = var.billing_cycle | ||
project_id = var.metal_project_id | ||
project_id = var.equinix_metal_project_id | ||
tags = ["cluster-${var.cluster_name}", "k8s_cluster", "kube_node"] | ||
} | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
output "k8s_masters" { | ||
value = equinix_metal_device.k8s_master.*.access_public_ipv4 | ||
} | ||
|
||
output "k8s_masters_no_etc" { | ||
value = equinix_metal_device.k8s_master_no_etcd.*.access_public_ipv4 | ||
} | ||
|
||
output "k8s_etcds" { | ||
value = equinix_metal_device.k8s_etcd.*.access_public_ipv4 | ||
} | ||
|
||
output "k8s_nodes" { | ||
value = equinix_metal_device.k8s_node.*.access_public_ipv4 | ||
} | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
terraform { | ||
required_version = ">= 1.0.0" | ||
required_providers { | ||
equinix = { | ||
source = "equinix/equinix" | ||
version = ">=1.11.0" | ||
} | ||
} | ||
} | ||
|
||
# Configure the Equinix Metal Provider | ||
provider "equinix" { | ||
} |
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
File renamed without changes.
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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