Skip to content

Commit

Permalink
moving toward one AZ per cluster
Browse files Browse the repository at this point in the history
- updated etcd and worker to take a single AZ / subnet
  • Loading branch information
wellsie committed Apr 21, 2017
1 parent ab44f45 commit 56ae92c
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 10 deletions.
11 changes: 8 additions & 3 deletions modules.tf
Original file line number Diff line number Diff line change
@@ -1,3 1,8 @@
resource "aws_cloudwatch_log_group" "k8s" {
name = "kz8s-${ var.name }"
retention_in_days = 3
}

module "s3" {
source = "./modules/s3"

Expand Down Expand Up @@ -119,8 124,8 @@ module "etcd" {
external-elb-security-group-id = "${ module.security.external-elb-id }"
instance-profile-name = "${ module.iam.instance-profile-name-master }"
s3-bucket = "${ module.s3.bucket }"
subnet-ids-private = "${ module.vpc.subnet-ids-private }"
subnet-ids-public = "${ module.vpc.subnet-ids-public }"
subnet-id-private = "${ element( split(",", module.vpc.subnet-ids-private), 0 ) }"
subnet-id-public = "${ element( split(",", module.vpc.subnet-ids-public), 0 ) }"
vpc-id = "${ module.vpc.id }"
}

Expand Down Expand Up @@ -152,6 157,6 @@ module "worker" {
instance-profile-name = "${ module.iam.instance-profile-name-worker }"
s3-bucket = "${ module.s3.bucket }"
security-group-id = "${ module.security.worker-id }"
subnet-ids = "${ module.vpc.subnet-ids-private }"
subnet-id = "${ element( split(",", module.vpc.subnet-ids-private), 0 ) }"
vpc-id = "${ module.vpc.id }"
}
2 changes: 1 addition & 1 deletion modules/etcd/ec2.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 14,7 @@ resource "aws_instance" "etcd" {
}

source_dest_check = false
subnet_id = "${ element( split(",", var.subnet-ids-private), 0 ) }"
subnet_id = "${ var.subnet-id-private }"

tags {
builtWith = "terraform"
Expand Down
4 changes: 2 additions & 2 deletions modules/etcd/elb.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 22,11 @@ resource "aws_elb" "external" {
}

security_groups = [ "${ var.external-elb-security-group-id }" ]
subnets = [ "${ split(",", var.subnet-ids-public) }" ]
subnets = [ "${ var.subnet-id-public }" ]

tags {
builtWith = "terraform"
kz8s = "${ var.name }"
kz8s = "${ var.name }i"
Name = "kz8s-apiserver"
role = "apiserver"
version = "${ var.k8s["hyperkube-tag"] }"
Expand Down
4 changes: 2 additions & 2 deletions modules/etcd/io.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 22,8 @@ variable "name" {}
variable "s3-bucket" {}
variable "pod-ip-range" {}
variable "service-cluster-ip-range" {}
variable "subnet-ids-private" {}
variable "subnet-ids-public" {}
variable "subnet-id-private" {}
variable "subnet-id-public" {}
variable "vpc-id" {}

output "depends-id" { value = "${ null_resource.dummy_dependency.id }" }
Expand Down
2 changes: 1 addition & 1 deletion modules/worker/ec2.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 37,7 @@ resource "aws_autoscaling_group" "worker" {
launch_configuration = "${ aws_launch_configuration.worker.name }"
max_size = "${ var.capacity["max"] }"
min_size = "${ var.capacity["min"] }"
vpc_zone_identifier = [ "${ split(",", var.subnet-ids) }" ]
vpc_zone_identifier = [ "${ var.subnet-id }" ]

tag {
key = "builtWith"
Expand Down
2 changes: 1 addition & 1 deletion modules/worker/io.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 21,7 @@ variable "k8s" {
variable "name" {}
variable "s3-bucket" {}
variable "security-group-id" {}
variable "subnet-ids" {}
variable "subnet-id" {}
variable "volume_size" {
default = {
ebs = 250
Expand Down

0 comments on commit 56ae92c

Please sign in to comment.