diff --git a/aws/container-linux/kubernetes/controllers.tf b/aws/container-linux/kubernetes/controllers.tf index 951f6de9..6f52b295 100644 --- a/aws/container-linux/kubernetes/controllers.tf +++ b/aws/container-linux/kubernetes/controllers.tf @@ -78,4 +78,5 @@ data "ct_config" "controller_ign" { count = "${var.controller_count}" content = "${element(data.template_file.controller_config.*.rendered, count.index)}" pretty_print = false + snippets = ["${var.controller_clc_snippets}"] } diff --git a/aws/container-linux/kubernetes/variables.tf b/aws/container-linux/kubernetes/variables.tf index 273f537e..9dcf980e 100644 --- a/aws/container-linux/kubernetes/variables.tf +++ b/aws/container-linux/kubernetes/variables.tf @@ -60,6 +60,18 @@ variable "worker_type" { description = "Worker EC2 instance type" } +variable "controller_clc_snippets" { + type = "list" + description = "Controller Container Linux Config snippets" + default = [] +} + +variable "worker_clc_snippets" { + type = "list" + description = "Worker Container Linux Config snippets" + default = [] +} + # bootkube assets variable "asset_dir" { diff --git a/aws/container-linux/kubernetes/workers.tf b/aws/container-linux/kubernetes/workers.tf index 4add5b46..aa790608 100644 --- a/aws/container-linux/kubernetes/workers.tf +++ b/aws/container-linux/kubernetes/workers.tf @@ -16,4 +16,5 @@ module "workers" { ssh_authorized_key = "${var.ssh_authorized_key}" service_cidr = "${var.service_cidr}" cluster_domain_suffix = "${var.cluster_domain_suffix}" + clc_snippets = "${var.worker_clc_snippets}" } diff --git a/aws/container-linux/kubernetes/workers/variables.tf b/aws/container-linux/kubernetes/workers/variables.tf index 93f00704..ac49bc65 100644 --- a/aws/container-linux/kubernetes/workers/variables.tf +++ b/aws/container-linux/kubernetes/workers/variables.tf @@ -71,3 +71,9 @@ variable "cluster_domain_suffix" { type = "string" default = "cluster.local" } + +variable "clc_snippets" { + type = "list" + description = "Container Linux Config snippets" + default = [] +} diff --git a/aws/container-linux/kubernetes/workers/workers.tf b/aws/container-linux/kubernetes/workers/workers.tf index 1a9cfeeb..7a8c2173 100644 --- a/aws/container-linux/kubernetes/workers/workers.tf +++ b/aws/container-linux/kubernetes/workers/workers.tf @@ -71,4 +71,5 @@ data "template_file" "worker_config" { data "ct_config" "worker_ign" { content = "${data.template_file.worker_config.rendered}" pretty_print = false + snippets = ["${var.clc_snippets}"] } diff --git a/digital-ocean/container-linux/kubernetes/controllers.tf b/digital-ocean/container-linux/kubernetes/controllers.tf index 5e36562f..03014da7 100644 --- a/digital-ocean/container-linux/kubernetes/controllers.tf +++ b/digital-ocean/container-linux/kubernetes/controllers.tf @@ -90,4 +90,6 @@ data "ct_config" "controller_ign" { count = "${var.controller_count}" content = "${element(data.template_file.controller_config.*.rendered, count.index)}" pretty_print = false + + snippets = ["${var.controller_clc_snippets}"] } diff --git a/digital-ocean/container-linux/kubernetes/variables.tf b/digital-ocean/container-linux/kubernetes/variables.tf index 41c69d62..d136d247 100644 --- a/digital-ocean/container-linux/kubernetes/variables.tf +++ b/digital-ocean/container-linux/kubernetes/variables.tf @@ -48,6 +48,18 @@ variable "ssh_fingerprints" { description = "SSH public key fingerprints. (e.g. see `ssh-add -l -E md5`)" } +variable "controller_clc_snippets" { + type = "list" + description = "Controller Container Linux Config snippets" + default = [] +} + +variable "worker_clc_snippets" { + type = "list" + description = "Worker Container Linux Config snippets" + default = [] +} + # bootkube assets variable "asset_dir" { diff --git a/digital-ocean/container-linux/kubernetes/workers.tf b/digital-ocean/container-linux/kubernetes/workers.tf index a3a3bdda..c2b5a266 100644 --- a/digital-ocean/container-linux/kubernetes/workers.tf +++ b/digital-ocean/container-linux/kubernetes/workers.tf @@ -51,4 +51,5 @@ data "template_file" "worker_config" { data "ct_config" "worker_ign" { content = "${data.template_file.worker_config.rendered}" pretty_print = false + snippets = ["${var.worker_clc_snippets}"] } diff --git a/google-cloud/container-linux/kubernetes/cluster.tf b/google-cloud/container-linux/kubernetes/cluster.tf index 6e9a26fe..cd8a0841 100644 --- a/google-cloud/container-linux/kubernetes/cluster.tf +++ b/google-cloud/container-linux/kubernetes/cluster.tf @@ -17,6 +17,7 @@ module "controllers" { ssh_authorized_key = "${var.ssh_authorized_key}" service_cidr = "${var.service_cidr}" cluster_domain_suffix = "${var.cluster_domain_suffix}" + clc_snippets = "${var.controller_clc_snippets}" } module "workers" { @@ -37,4 +38,5 @@ module "workers" { ssh_authorized_key = "${var.ssh_authorized_key}" service_cidr = "${var.service_cidr}" cluster_domain_suffix = "${var.cluster_domain_suffix}" + clc_snippets = "${var.worker_clc_snippets}" } diff --git a/google-cloud/container-linux/kubernetes/controllers/controllers.tf b/google-cloud/container-linux/kubernetes/controllers/controllers.tf index 1b882c87..df6d683d 100644 --- a/google-cloud/container-linux/kubernetes/controllers/controllers.tf +++ b/google-cloud/container-linux/kubernetes/controllers/controllers.tf @@ -87,4 +87,5 @@ data "ct_config" "controller_ign" { count = "${var.count}" content = "${element(data.template_file.controller_config.*.rendered, count.index)}" pretty_print = false + snippets = ["${var.clc_snippets}"] } diff --git a/google-cloud/container-linux/kubernetes/controllers/variables.tf b/google-cloud/container-linux/kubernetes/controllers/variables.tf index ee4e2570..4e7e0da1 100644 --- a/google-cloud/container-linux/kubernetes/controllers/variables.tf +++ b/google-cloud/container-linux/kubernetes/controllers/variables.tf @@ -3,9 +3,9 @@ variable "cluster_name" { description = "Unique cluster name" } -variable "ssh_authorized_key" { +variable "region" { type = "string" - description = "SSH public key for logging in as user 'core'" + description = "Google Cloud region (e.g. us-central1, see `gcloud compute regions list`)." } variable "network" { @@ -30,11 +30,6 @@ variable "count" { description = "Number of controller compute instances the instance group should manage" } -variable "region" { - type = "string" - description = "Google Cloud region (e.g. us-central1, see `gcloud compute regions list`)." -} - variable "machine_type" { type = "string" description = "Machine type for compute instances (e.g. gcloud compute machine-types list)" @@ -51,12 +46,22 @@ variable "disk_size" { description = "The size of the disk in gigabytes." } -// configuration +# configuration variable "networking" { description = "Choice of networking provider (flannel or calico)" type = "string" - default = "flannel" + default = "calico" +} + +variable "kubeconfig" { + type = "string" + description = "Generated Kubelet kubeconfig" +} + +variable "ssh_authorized_key" { + type = "string" + description = "SSH public key for logging in as user 'core'" } variable "service_cidr" { @@ -75,7 +80,8 @@ variable "cluster_domain_suffix" { default = "cluster.local" } -variable "kubeconfig" { - type = "string" - description = "Generated Kubelet kubeconfig" +variable "clc_snippets" { + type = "list" + description = "Container Linux Config snippets" + default = [] } diff --git a/google-cloud/container-linux/kubernetes/variables.tf b/google-cloud/container-linux/kubernetes/variables.tf index 552349be..76183cf1 100644 --- a/google-cloud/container-linux/kubernetes/variables.tf +++ b/google-cloud/container-linux/kubernetes/variables.tf @@ -52,6 +52,18 @@ variable "worker_preemptible" { description = "If enabled, Compute Engine will terminate workers randomly within 24 hours" } +variable "controller_clc_snippets" { + type = "list" + description = "Controller Container Linux Config snippets" + default = [] +} + +variable "worker_clc_snippets" { + type = "list" + description = "Worker Container Linux Config snippets" + default = [] +} + # bootkube assets variable "asset_dir" { diff --git a/google-cloud/container-linux/kubernetes/workers/variables.tf b/google-cloud/container-linux/kubernetes/workers/variables.tf index 8cafc4d8..fa0f85a7 100644 --- a/google-cloud/container-linux/kubernetes/workers/variables.tf +++ b/google-cloud/container-linux/kubernetes/workers/variables.tf @@ -59,7 +59,7 @@ variable "kubeconfig" { variable "ssh_authorized_key" { type = "string" - description = "SSH public key for logging in as user 'core'" + description = "SSH public key for user 'core'" } variable "service_cidr" { @@ -78,16 +78,22 @@ variable "cluster_domain_suffix" { default = "cluster.local" } +variable "clc_snippets" { + type = "list" + description = "Container Linux Config snippets" + default = [] +} + # unofficial, undocumented, unsupported, temporary variable "accelerator_type" { - type = "string" - default = "" + type = "string" + default = "" description = "Google Compute Engine accelerator type (e.g. nvidia-tesla-k80, see gcloud compute accelerator-types list)" } variable "accelerator_count" { - type = "string" - default = "0" + type = "string" + default = "0" description = "Number of compute engine accelerators" } diff --git a/google-cloud/container-linux/kubernetes/workers/workers.tf b/google-cloud/container-linux/kubernetes/workers/workers.tf index d1bf82ec..149c6b42 100644 --- a/google-cloud/container-linux/kubernetes/workers/workers.tf +++ b/google-cloud/container-linux/kubernetes/workers/workers.tf @@ -32,6 +32,7 @@ data "template_file" "worker_config" { data "ct_config" "worker_ign" { content = "${data.template_file.worker_config.rendered}" pretty_print = false + snippets = ["${var.clc_snippets}"] } resource "google_compute_instance_template" "worker" { @@ -63,11 +64,11 @@ resource "google_compute_instance_template" "worker" { } can_ip_forward = true - tags = ["worker", "${var.cluster_name}-worker", "${var.name}-worker"] + tags = ["worker", "${var.cluster_name}-worker", "${var.name}-worker"] guest_accelerator { count = "${var.accelerator_count}" - type = "${var.accelerator_type}" + type = "${var.accelerator_type}" } lifecycle {