Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions images/installer/Dockerfile.upi.ci
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ RUN yum install --setopt=tsflags=nodocs -y \
yum clean all && rm -rf /var/cache/yum/* && \
chmod g+w /etc/passwd

ENV TERRAFORM_VERSION=0.11.11
ENV TERRAFORM_VERSION=0.12.24
RUN curl -O https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip && \
unzip terraform_${TERRAFORM_VERSION}_linux_amd64.zip -d /bin/
ENV MATCHBOX_VERSION=v0.2.3
RUN curl -L -O https://github.com/poseidon/terraform-provider-matchbox/releases/download/${MATCHBOX_VERSION}/terraform-provider-matchbox-${MATCHBOX_VERSION}-linux-amd64.tar.gz && \
tar xzf terraform-provider-matchbox-${MATCHBOX_VERSION}-linux-amd64.tar.gz && \
mv terraform-provider-matchbox-${MATCHBOX_VERSION}-linux-amd64/terraform-provider-matchbox /bin/terraform-provider-matchbox
ENV MATCHBOX_PROVIDER_VERSION=v0.3.0
RUN curl -L -O https://github.com/poseidon/terraform-provider-matchbox/releases/download/${MATCHBOX_PROVIDER_VERSION}/terraform-provider-matchbox-${MATCHBOX_PROVIDER_VERSION}-linux-amd64.tar.gz && \
tar xzf terraform-provider-matchbox-${MATCHBOX_PROVIDER_VERSION}-linux-amd64.tar.gz && \
mv terraform-provider-matchbox-${MATCHBOX_PROVIDER_VERSION}-linux-amd64/terraform-provider-matchbox /bin/terraform-provider-matchbox
RUN curl -L -O https://github.com/vmware/govmomi/releases/download/v0.20.0/govc_linux_amd64.gz && \
gzip -d govc_linux_amd64.gz && \
chmod +x govc_linux_amd64 && mv govc_linux_amd64 /bin/govc
Expand Down
20 changes: 10 additions & 10 deletions upi/metal/bootstrap/matchbox.tf
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
resource "matchbox_profile" "bootstrap" {
name = "${var.cluster_id}-bootstrap"
kernel = "${var.pxe_kernel}"
kernel = var.pxe_kernel

initrd = [
"${var.pxe_initrd}",
var.pxe_initrd,
]

args = [
"${var.pxe_kernel_args}",
"coreos.inst.ignition_url=${var.matchbox_http_endpoint}/ignition?cluster_id=${var.cluster_id}&role=bootstrap",
]
args = concat(
var.pxe_kernel_args,
["coreos.inst.ignition_url=${var.matchbox_http_endpoint}/ignition?cluster_id=${var.cluster_id}&role=bootstrap"],
)

raw_ignition = "${var.igntion_config_content}"
raw_ignition = var.igntion_config_content
}

resource "matchbox_group" "bootstrap" {
name = "${var.cluster_id}-bootstrap"
profile = "${matchbox_profile.bootstrap.name}"
profile = matchbox_profile.bootstrap.name

selector {
cluster_id = "${var.cluster_id}"
selector = {
cluster_id = var.cluster_id
role = "bootstrap"
}
}
6 changes: 3 additions & 3 deletions upi/metal/bootstrap/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
output "device_ip" {
value = "${packet_device.bootstrap.network.0.address}"
value = packet_device.bootstrap.network[0].address
}

output "device_hostname" {
value = "${packet_device.bootstrap.hostname}"
value = packet_device.bootstrap.hostname
}

output "device_id" {
value = "${packet_device.bootstrap.id}"
value = packet_device.bootstrap.id
}
6 changes: 3 additions & 3 deletions upi/metal/bootstrap/packet.tf
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
resource "packet_device" "bootstrap" {
hostname = "${var.cluster_id}-bootstrap"
plan = "c1.small.x86"
facilities = ["${var.packet_facility}"]
facilities = [var.packet_facility]
operating_system = "custom_ipxe"
ipxe_script_url = "${var.matchbox_http_endpoint}/ipxe?cluster_id=${var.cluster_id}&role=bootstrap"
billing_cycle = "hourly"
project_id = "${var.packet_project_id}"
project_id = var.packet_project_id

depends_on = ["matchbox_group.bootstrap"]
depends_on = [matchbox_group.bootstrap]
}
16 changes: 8 additions & 8 deletions upi/metal/bootstrap/variables.tf
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
variable "pxe_kernel" {
type = "string"
type = string
}

variable "pxe_initrd" {
type = "string"
type = string
}

variable "pxe_kernel_args" {
type = "list"
type = list(string)
}

variable "matchbox_http_endpoint" {
type = "string"
type = string
}

variable "cluster_id" {
type = "string"
type = string
}

variable "igntion_config_content" {
type = "string"
type = string
}

variable "packet_facility" {
type = "string"
type = string
}

variable "packet_project_id" {
type = "string"
type = string
}
52 changes: 35 additions & 17 deletions upi/metal/config.tf
Original file line number Diff line number Diff line change
@@ -1,51 +1,56 @@
# ================COMMON=====================

variable "cluster_id" {
type = "string"
type = string

description = <<EOF
(internal) This is an identifier that can uniquely identify the cluster.

All the resources created include `cluster_id` for uniquness purposes.
EOF

}

variable "cluster_domain" {
type = "string"
type = string

description = <<EOF
The domain of the cluster.
All the records for the cluster are created under this domain.
Note: This field MUST be set manually prior to creating the cluster.
EOF

}

variable "bootstrap_ign_file" {
type = "string"
type = string

description = <<EOF
The file that contains the Ignition config used to configure the RHCOS based bootstrap machine.
EOF

}

variable "master_ign_file" {
type = "string"
type = string

description = <<EOF
The file that contains the Ignition config used to configure the RHCOS based control plane machines.
EOF

}

variable "worker_ign_file" {
type = "string"
type = string

description = <<EOF
The file that contains the Ignition config used to configure the RHCOS based worker machines.
EOF

}

variable "master_count" {
type = "string"
type = string
default = "1"

description = <<EOF
Expand All @@ -54,120 +59,132 @@ The number of control plane machines required.
Since etcd is colocated on control plane machines, suggested number is 3 or 5.
Default: 1
EOF

}

variable "worker_count" {
type = "string"
type = string
default = "1"

description = <<EOF
The number of worker machines required.

Default: 1
EOF

}

# ================MATCHBOX=====================

variable "matchbox_rpc_endpoint" {
type = "string"
type = string

description = <<EOF
RPC endpoint for matchbox.

For more info: https://godoc.org/github.com/coreos/matchbox/matchbox/client
EOF

}

variable "matchbox_http_endpoint" {
type = "string"
type = string

description = <<EOF
HTTPS endpoint for matchbox. This must include the scheme

For more info: https://github.com/coreos/matchbox/blob/master/Documentation/api.md
EOF

}

variable "matchbox_trusted_ca_cert" {
type = "string"
type = string
default = "matchbox/tls/ca.crt"

description = <<EOF
Certificate Authority certificate to trust the matchbox endpoint.
EOF

}

variable "matchbox_client_cert" {
type = "string"
type = string
default = "matchbox/tls/client.crt"

description = <<EOF
Client certificate used to authenticate with the matchbox RPC API.

For more info: https://github.com/coreos/matchbox/blob/master/Documentation/api.md
EOF

}

variable "matchbox_client_key" {
type = "string"
type = string
default = "matchbox/tls/client.key"

description = <<EOF
Client certificate's key used to authenticate with the matchbox RPC API.

For more info: https://github.com/coreos/matchbox/blob/master/Documentation/api.md
EOF

}

variable "pxe_os_image_url" {
type = "string"
type = string

description = <<EOF
URL to the OS image for RHCOS that should be installed on machines.

For more info: https://github.com/coreos/coreos-installer#kernel-command-line-options-for-coreos-installer-running-in-the-initramfs
EOF

}

variable "pxe_kernel_url" {
type = "string"
type = string

description = <<EOF
URL to the kernel image that should be used to PXE machines.

This can be a fully-qualified URL or URL relative to matchbox_http_endpoint to use Matchbox assets (https://github.com/coreos/matchbox/blob/master/Documentation/matchbox.md#assets).
EOF

}

variable "pxe_initrd_url" {
type = "string"
type = string

description = <<EOF
URL to the initrd image that should be used to PXE machines.

This can be a fully-qualified URL or URL relative to matchbox_http_endpoint to use Matchbox assets (https://github.com/coreos/matchbox/blob/master/Documentation/matchbox.md#assets).
EOF

}

# ================PACKET=====================

variable "packet_project_id" {
type = "string"
type = string

description = <<EOF
The Project ID for Packet.net where servers will be deployed.
EOF

}

# ================AWS=====================

variable "public_r53_zone" {
type = "string"
type = string

description = <<EOF
The name of the public route53 zone that should be used to create DNS records for the cluster.
EOF

}

variable "bootstrap_dns" {
Expand All @@ -178,4 +195,5 @@ variable "bootstrap_dns" {

Default: true
EOF

}
Loading