Skip to content

Commit

Permalink
cluster with worker nodes in differenz az
Browse files Browse the repository at this point in the history
  • Loading branch information
Jnig committed Nov 27, 2017
1 parent e427bd0 commit ba25659
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module "kubernetes" {
node_instance_type = "t2.large"
node_asg_min = 1
node_asg_max = 2
node_asg_desired = 1
node_asg_desired = 2
vpc = "<vpc>"
ntp_servers = "<comma seperated list>"
Expand Down
12 changes: 11 additions & 1 deletion autoscaling_nodes.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@

data "aws_subnet" "region_1b" {
vpc_id = "${var.vpc}"
availability_zone = "eu-central-1b"
}

data "aws_subnet" "region_1c" {
vpc_id = "${var.vpc}"
availability_zone = "eu-central-1c"
}

data "template_file" "nodes" {
template = "${file("${path.module}/scripts/userdata.tpl")}"

Expand Down Expand Up @@ -77,7 +87,7 @@ resource "aws_autoscaling_group" "nodes" {
desired_capacity = "${var.node_asg_desired}"
force_delete = true
launch_configuration = "${aws_launch_configuration.nodes.name}"
vpc_zone_identifier = ["${data.aws_subnet_ids.vpc.ids}"]
vpc_zone_identifier = ["${data.aws_subnet.region_1b.id}", "${data.aws_subnet.region_1c.id}"]

tags = [
{
Expand Down
3 changes: 0 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
data "aws_subnet_ids" "vpc" {
vpc_id = "${var.vpc}"
}

data "aws_ami" "ubuntu" {
most_recent = true
Expand Down

0 comments on commit ba25659

Please sign in to comment.