From fc22f04dd6db11b6c5391862ee89cbc623873b5d Mon Sep 17 00:00:00 2001 From: Dalton Hubble Date: Mon, 16 Oct 2017 00:39:58 -0700 Subject: [PATCH] Add temporary variables for multi-nic testing * Accept ordered lists of controller and worker networkd configs * Do not rely on these variables. They will be replaced with a cleaner mechanism at a future date --- .../kubernetes/cl/controller.yaml.tmpl | 2 ++ .../kubernetes/cl/worker.yaml.tmpl | 2 ++ .../container-linux/kubernetes/profiles.tf | 2 ++ .../container-linux/kubernetes/variables.tf | 17 ++++++++++++++++- .../container-linux/pxe-worker/variables.tf | 3 +-- 5 files changed, 23 insertions(+), 3 deletions(-) diff --git a/bare-metal/container-linux/kubernetes/cl/controller.yaml.tmpl b/bare-metal/container-linux/kubernetes/cl/controller.yaml.tmpl index ea336ccf..f546e439 100644 --- a/bare-metal/container-linux/kubernetes/cl/controller.yaml.tmpl +++ b/bare-metal/container-linux/kubernetes/cl/controller.yaml.tmpl @@ -172,6 +172,8 @@ storage: --net=host \ --dns=host \ --exec=/bootkube -- start --asset-dir=/assets "$@" +networkd: + ${networkd_content} passwd: users: - name: core diff --git a/bare-metal/container-linux/kubernetes/cl/worker.yaml.tmpl b/bare-metal/container-linux/kubernetes/cl/worker.yaml.tmpl index fddf92f7..af570c80 100644 --- a/bare-metal/container-linux/kubernetes/cl/worker.yaml.tmpl +++ b/bare-metal/container-linux/kubernetes/cl/worker.yaml.tmpl @@ -108,6 +108,8 @@ storage: contents: inline: | fs.inotify.max_user_watches=16184 +networkd: + ${networkd_content} passwd: users: - name: core diff --git a/bare-metal/container-linux/kubernetes/profiles.tf b/bare-metal/container-linux/kubernetes/profiles.tf index a769eb91..66f88d24 100644 --- a/bare-metal/container-linux/kubernetes/profiles.tf +++ b/bare-metal/container-linux/kubernetes/profiles.tf @@ -87,6 +87,7 @@ data "template_file" "controller-configs" { etcd_initial_cluster = "${join(",", formatlist("%s=https://%s:2380", var.controller_names, var.controller_domains))}" k8s_dns_service_ip = "${module.bootkube.kube_dns_service_ip}" ssh_authorized_key = "${var.ssh_authorized_key}" + networkd_content = "${element(var.controller_networkds, count.index)}" } } @@ -106,5 +107,6 @@ data "template_file" "worker-configs" { domain_name = "${element(var.worker_domains, count.index)}" k8s_dns_service_ip = "${module.bootkube.kube_dns_service_ip}" ssh_authorized_key = "${var.ssh_authorized_key}" + networkd_content = "${element(var.worker_networkds, count.index)}" } } diff --git a/bare-metal/container-linux/kubernetes/variables.tf b/bare-metal/container-linux/kubernetes/variables.tf index d4cc8df7..5bbe802f 100644 --- a/bare-metal/container-linux/kubernetes/variables.tf +++ b/bare-metal/container-linux/kubernetes/variables.tf @@ -111,7 +111,22 @@ variable "container_linux_oem" { } variable "kernel_args" { - description = "Additional kernel arguments the servers should boot with." + description = "Additional kernel arguments to provide at PXE boot." type = "list" default = [] } + +# unofficial, undocumented, unsupported, temporary + +variable "controller_networkds" { + type = "list" + description = "Controller Container Linux config networkd section" + default = [] +} + +variable "worker_networkds" { + type = "list" + description = "Worker Container Linux config networkd section" + default = [] +} + diff --git a/bare-metal/container-linux/pxe-worker/variables.tf b/bare-metal/container-linux/pxe-worker/variables.tf index 0b534735..a67b92f2 100644 --- a/bare-metal/container-linux/pxe-worker/variables.tf +++ b/bare-metal/container-linux/pxe-worker/variables.tf @@ -57,9 +57,8 @@ variable "kube_dns_service_ip" { # optional variable "kernel_args" { - description = "Additional kernel arguments the server should boot with." + description = "Additional kernel arguments to provide at PXE boot." type = "list" - default = [ "root=/dev/sda1", ]