Skip to content

Commit

Permalink
platforms/aws: configure root block device settings (coreos#256)
Browse files Browse the repository at this point in the history
... for masters, workers and etcd nodes.

Fixes coreos#209
  • Loading branch information
Sergiusz Urbaniak authored and alexsomesan committed Apr 18, 2017
1 parent 0213903 commit 73ff290
Show file tree
Hide file tree
Showing 8 changed files with 129 additions and 0 deletions.
6 changes: 6 additions & 0 deletions modules/aws/etcd/nodes.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,10 @@ resource "aws_instance" "etcd_node" {
"Name", "${var.cluster_name}-etcd-${count.index}",
"KubernetesCluster", "${var.cluster_name}"
), var.extra_tags)}"

root_block_device {
volume_type = "${var.root_volume_type}"
volume_size = "${var.root_volume_size}"
iops = "${var.root_volume_iops}"
}
}
15 changes: 15 additions & 0 deletions modules/aws/etcd/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,18 @@ variable "extra_tags" {
type = "map"
default = {}
}

variable "root_volume_type" {
type = "string"
description = "The type of volume for the root block device."
}

variable "root_volume_size" {
type = "string"
description = "The size of the volume in gigabytes for the root block device."
}

variable "root_volume_iops" {
type = "string"
description = "The amount of provisioned IOPS for the root block device."
}
6 changes: 6 additions & 0 deletions modules/aws/master-asg/master.tf
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ resource "aws_launch_configuration" "master_conf" {
lifecycle {
create_before_destroy = true
}

root_block_device {
volume_type = "${var.root_volume_type}"
volume_size = "${var.root_volume_size}"
iops = "${var.root_volume_iops}"
}
}

resource "aws_security_group" "master_sec_group" {
Expand Down
15 changes: 15 additions & 0 deletions modules/aws/master-asg/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,18 @@ variable "custom_dns_name" {
default = ""
description = "DNS prefix used to construct the console and API server endpoints."
}

variable "root_volume_type" {
type = "string"
description = "The type of volume for the root block device."
}

variable "root_volume_size" {
type = "string"
description = "The size of the volume in gigabytes for the root block device."
}

variable "root_volume_iops" {
type = "string"
description = "The amount of provisioned IOPS for the root block device."
}
15 changes: 15 additions & 0 deletions modules/aws/worker-asg/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,18 @@ variable "autoscaling_group_extra_tags" {
type = "list"
default = []
}

variable "root_volume_type" {
type = "string"
description = "The type of volume for the root block device."
}

variable "root_volume_size" {
type = "string"
description = "The size of the volume in gigabytes for the root block device."
}

variable "root_volume_iops" {
type = "string"
description = "The amount of provisioned IOPS for the root block device."
}
6 changes: 6 additions & 0 deletions modules/aws/worker-asg/worker.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ resource "aws_launch_configuration" "worker_conf" {
lifecycle {
create_before_destroy = true
}

root_block_device {
volume_type = "${var.root_volume_type}"
volume_size = "${var.root_volume_size}"
iops = "${var.root_volume_iops}"
}
}

resource "aws_autoscaling_group" "workers" {
Expand Down
12 changes: 12 additions & 0 deletions platforms/aws/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ module "etcd" {

external_endpoints = ["${compact(var.tectonic_etcd_servers)}"]
extra_tags = "${var.tectonic_aws_extra_tags}"

root_volume_type = "${var.tectonic_aws_etcd_root_volume_type}"
root_volume_size = "${var.tectonic_aws_etcd_root_volume_size}"
root_volume_iops = "${var.tectonic_aws_etcd_root_volume_iops}"
}

module "ignition-masters" {
Expand Down Expand Up @@ -71,6 +75,10 @@ module "masters" {
extra_tags = "${var.tectonic_aws_extra_tags}"
autoscaling_group_extra_tags = "${var.tectonic_autoscaling_group_extra_tags}"
custom_dns_name = "${var.tectonic_dns_name}"

root_volume_type = "${var.tectonic_aws_master_root_volume_type}"
root_volume_size = "${var.tectonic_aws_master_root_volume_size}"
root_volume_iops = "${var.tectonic_aws_master_root_volume_iops}"
}

module "ignition-workers" {
Expand Down Expand Up @@ -102,4 +110,8 @@ module "workers" {
user_data = "${module.ignition-workers.ignition}"
extra_tags = "${var.tectonic_aws_extra_tags}"
autoscaling_group_extra_tags = "${var.tectonic_autoscaling_group_extra_tags}"

root_volume_type = "${var.tectonic_aws_master_root_volume_type}"
root_volume_size = "${var.tectonic_aws_master_root_volume_size}"
root_volume_iops = "${var.tectonic_aws_master_root_volume_iops}"
}
54 changes: 54 additions & 0 deletions platforms/aws/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,57 @@ variable "tectonic_dns_name" {
default = ""
description = "DNS prefix used to construct the console and API server endpoints."
}

variable "tectonic_aws_etcd_root_volume_type" {
type = "string"
default = "gp2"
description = "The type of volume for the root block device of etcd nodes."
}

variable "tectonic_aws_etcd_root_volume_size" {
type = "string"
default = "30"
description = "The size of the volume in gigabytes for the root block device of etcd nodes."
}

variable "tectonic_aws_etcd_root_volume_iops" {
type = "string"
default = "0"
description = "The amount of provisioned IOPS for the root block device of etcd nodes."
}

variable "tectonic_aws_master_root_volume_type" {
type = "string"
default = "gp2"
description = "The type of volume for the root block device of master nodes."
}

variable "tectonic_aws_master_root_volume_size" {
type = "string"
default = "30"
description = "The size of the volume in gigabytes for the root block device of master nodes."
}

variable "tectonic_aws_master_root_volume_iops" {
type = "string"
default = "0"
description = "The amount of provisioned IOPS for the root block device of master nodes."
}

variable "tectonic_aws_worker_root_volume_type" {
type = "string"
default = "gp2"
description = "The type of volume for the root block device of worker nodes."
}

variable "tectonic_aws_worker_root_volume_size" {
type = "string"
default = "30"
description = "The size of the volume in gigabytes for the root block device of worker nodes."
}

variable "tectonic_aws_worker_root_volume_iops" {
type = "string"
default = "0"
description = "The amount of provisioned IOPS for the root block device of worker nodes."
}

0 comments on commit 73ff290

Please sign in to comment.