-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[terraform] use modern day equinix metal provider (#8748)
* [terraform] use modern day equinix metal provider * [CI] ensure packet job tests metal
- Loading branch information
1 parent
e6c4330
commit 6cc5b38
Showing
11 changed files
with
58 additions
and
59 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
File renamed without changes.
29 changes: 14 additions & 15 deletions
29
contrib/terraform/packet/kubespray.tf → contrib/terraform/metal/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,63 +1,62 @@ | ||
# Configure the Equinix Metal Provider | ||
provider "packet" { | ||
version = "~> 2.0" | ||
provider "metal" { | ||
} | ||
|
||
resource "packet_ssh_key" "k8s" { | ||
resource "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 "packet_device" "k8s_master" { | ||
depends_on = [packet_ssh_key.k8s] | ||
resource "metal_device" "k8s_master" { | ||
depends_on = [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.packet_project_id | ||
project_id = var.metal_project_id | ||
tags = ["cluster-${var.cluster_name}", "k8s_cluster", "kube_control_plane", "etcd", "kube_node"] | ||
} | ||
|
||
resource "packet_device" "k8s_master_no_etcd" { | ||
depends_on = [packet_ssh_key.k8s] | ||
resource "metal_device" "k8s_master_no_etcd" { | ||
depends_on = [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.packet_project_id | ||
project_id = var.metal_project_id | ||
tags = ["cluster-${var.cluster_name}", "k8s_cluster", "kube_control_plane"] | ||
} | ||
|
||
resource "packet_device" "k8s_etcd" { | ||
depends_on = [packet_ssh_key.k8s] | ||
resource "metal_device" "k8s_etcd" { | ||
depends_on = [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.packet_project_id | ||
project_id = var.metal_project_id | ||
tags = ["cluster-${var.cluster_name}", "etcd"] | ||
} | ||
|
||
resource "packet_device" "k8s_node" { | ||
depends_on = [packet_ssh_key.k8s] | ||
resource "metal_device" "k8s_node" { | ||
depends_on = [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.packet_project_id | ||
project_id = var.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 = metal_device.k8s_master.*.access_public_ipv4 | ||
} | ||
|
||
output "k8s_masters_no_etc" { | ||
value = metal_device.k8s_master_no_etcd.*.access_public_ipv4 | ||
} | ||
|
||
output "k8s_etcds" { | ||
value = metal_device.k8s_etcd.*.access_public_ipv4 | ||
} | ||
|
||
output "k8s_nodes" { | ||
value = 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
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 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 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