Skip to content

Commit

Permalink
Support extra ignition files and systemd units in elastikube and supp…
Browse files Browse the repository at this point in the history
…ort load balancers in worker module
  • Loading branch information
Alan Chen committed Jul 24, 2018
1 parent 224e2fd commit 506d9f9
Show file tree
Hide file tree
Showing 11 changed files with 89 additions and 6 deletions.
4 changes: 3 additions & 1 deletion aws/elastikube/etcd.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@ module "etcd" {
zone_id = "${aws_route53_zone.private.zone_id}"
s3_bucket = "${aws_s3_bucket.ignition.id}"

extra_tags = "${var.extra_tags}"
extra_ignition_file_ids = ["${var.extra_etcd_ignition_file_ids}"]
extra_ignition_systemd_unit_ids = ["${var.extra_etcd_ignition_systemd_unit_ids}"]
extra_tags = "${var.extra_tags}"
}
4 changes: 3 additions & 1 deletion aws/elastikube/master.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ module "master" {
))}",
]

s3_bucket = "${aws_s3_bucket.ignition.id}"
s3_bucket = "${aws_s3_bucket.ignition.id}"
extra_ignition_file_ids = ["${var.extra_ignition_file_ids}"]
extra_ignition_systemd_unit_ids = ["${var.extra_ignition_systemd_unit_ids}"]

extra_tags = "${var.extra_tags}"
}
24 changes: 24 additions & 0 deletions aws/elastikube/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,30 @@ variable "extra_master_node_taints" {
EOF
}

variable "extra_etcd_ignition_file_ids" {
type = "list"
default = []
description = "(Optional) Additional ignition file IDs for etcds. See https://www.terraform.io/docs/providers/ignition/d/file.html for more details."
}

variable "extra_etcd_ignition_systemd_unit_ids" {
type = "list"
default = []
description = "(Optional) Additional ignition systemd unit IDs for etcds. See https://www.terraform.io/docs/providers/ignition/d/systemd_unit.html for more details."
}

variable "extra_ignition_file_ids" {
type = "list"
default = []
description = "(Optional) Additional ignition file IDs for masters. See https://www.terraform.io/docs/providers/ignition/d/file.html for more details."
}

variable "extra_ignition_systemd_unit_ids" {
type = "list"
default = []
description = "(Optional) Additional ignition systemd unit IDs for masters. See https://www.terraform.io/docs/providers/ignition/d/systemd_unit.html for more details."
}

variable "extra_tags" {
description = "(Optional) Extra AWS tags to be applied to the resources."
type = "map"
Expand Down
2 changes: 2 additions & 0 deletions aws/kube-etcd/ignition.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@ data "ignition_config" "main" {
module.ignition_docker.files,
module.ignition_etcd.files,
module.ignition_node_exporter.files,
var.extra_ignition_file_ids,
))}"]

systemd = ["${compact(concat(
module.ignition_docker.systemd_units,
module.ignition_etcd.systemd_units,
module.ignition_node_exporter.systemd_units,
var.extra_ignition_systemd_unit_ids,
))}"]
}

Expand Down
12 changes: 12 additions & 0 deletions aws/kube-etcd/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,18 @@ variable "s3_bucket" {
EOF
}

variable "extra_ignition_file_ids" {
type = "list"
default = []
description = "(Optional) Additional ignition file IDs. See https://www.terraform.io/docs/providers/ignition/d/file.html for more details."
}

variable "extra_ignition_systemd_unit_ids" {
type = "list"
default = []
description = "(Optional) Additional ignition systemd unit IDs. See https://www.terraform.io/docs/providers/ignition/d/systemd_unit.html for more details."
}

variable "extra_tags" {
type = "map"
default = {}
Expand Down
3 changes: 3 additions & 0 deletions aws/kube-master/ign-ipvs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module "ignition_ipvs" {
source = "../ignitions/ipvs"
}
2 changes: 2 additions & 0 deletions aws/kube-master/ignition.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ data "ignition_config" "main" {
module.ignition_kube_addon_dns.files,
module.ignition_kube_addon_proxy.files,
module.ignition_kube_addon_manager.files,
var.extra_ignition_file_ids,
))}"]

systemd = ["${compact(concat(
Expand All @@ -42,6 +43,7 @@ data "ignition_config" "main" {
module.ignition_kube_addon_dns.systemd_units,
module.ignition_kube_addon_proxy.systemd_units,
module.ignition_kube_addon_manager.systemd_units,
var.extra_ignition_systemd_unit_ids,
))}"]
}

Expand Down
16 changes: 12 additions & 4 deletions aws/kube-master/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ variable "etcd_endpoints" {

variable "etcd_certs_config" {
type = "map"

default = {
# ca_cert_pem = "" # client_key_pem = "" # client_cert_pem = ""
}
}

variable "certs_validity_period_hours" {
Expand Down Expand Up @@ -120,6 +116,18 @@ variable "s3_bucket" {
EOF
}

variable "extra_ignition_file_ids" {
type = "list"
default = []
description = "(Optional) Additional ignition file IDs. See https://www.terraform.io/docs/providers/ignition/d/file.html for more details."
}

variable "extra_ignition_systemd_unit_ids" {
type = "list"
default = []
description = "(Optional) Additional ignition systemd unit IDs. See https://www.terraform.io/docs/providers/ignition/d/systemd_unit.html for more details."
}

variable "extra_tags" {
type = "map"
default = {}
Expand Down
2 changes: 2 additions & 0 deletions aws/kube-worker-general/ignition.tf
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@ data "ignition_config" "main" {
module.ignition_docker.files,
module.ignition_kubelet.files,
module.ignition_kube_config.files,
var.extra_ignition_file_ids,
))}"]

systemd = ["${compact(concat(
module.ignition_docker.systemd_units,
module.ignition_kubelet.systemd_units,
module.ignition_kube_config.systemd_units,
var.extra_ignition_systemd_unit_ids,
))}"]
}

Expand Down
24 changes: 24 additions & 0 deletions aws/kube-worker-general/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,30 @@ variable "s3_bucket" {
EOF
}

variable "extra_ignition_file_ids" {
type = "list"
default = []
description = "(Optional) Additional ignition file IDs. See https://www.terraform.io/docs/providers/ignition/d/file.html for more details."
}

variable "extra_ignition_systemd_unit_ids" {
type = "list"
default = []
description = "(Optional) Additional ignition systemd unit IDs. See https://www.terraform.io/docs/providers/ignition/d/systemd_unit.html for more details."
}

variable "load_balancer_ids" {
type = "list"
default = []
description = "(Optional) A list of elastic load balancer names to add to the autoscaling group names. Only valid for classic load balancers. For ALBs, use target_group_arns instead."
}

variable "target_group_arns" {
type = "list"
default = []
description = "(Optional) A list of aws_alb_target_group ARNs, for use with Application Load Balancing."
}

variable "extra_tags" {
type = "map"
default = {}
Expand Down
2 changes: 2 additions & 0 deletions aws/kube-worker-general/worker.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ resource "aws_autoscaling_group" "worker" {
min_size = "${var.worker_config["instance_count"]}"
launch_configuration = "${aws_launch_configuration.worker.id}"
vpc_zone_identifier = ["${var.subnet_ids}"]
load_balancers = ["${var.load_balancer_ids}"]
target_group_arns = ["${var.target_group_arns}"]

tags = [
{
Expand Down

0 comments on commit 506d9f9

Please sign in to comment.