From a7557559115825fb2f42dced38ed1b7fb076ea05 Mon Sep 17 00:00:00 2001 From: Khue Doan Date: Mon, 20 Jul 2020 14:20:11 +0700 Subject: [PATCH] Attach controllers and workers to network --- terraform/main.tf | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/terraform/main.tf b/terraform/main.tf index 47215940..fca99239 100644 --- a/terraform/main.tf +++ b/terraform/main.tf @@ -3,7 +3,7 @@ provider "lxd" { accept_remote_certificate = true } -resource "lxd_network" "kubernetes_subnetwork" { +resource "lxd_network" "kubernetes_network" { name = "kubernetes" config = { @@ -25,6 +25,16 @@ resource "lxd_container" "kubernetes_controllers" { limits = { cpu = 2 } + + device { + name = "eth0" + type = "nic" + + properties = { + nictype = "bridged" + parent = "${lxd_network.kubernetes_network.name}" + } + } } resource "lxd_container" "kubernetes_workers" { @@ -40,4 +50,14 @@ resource "lxd_container" "kubernetes_workers" { limits = { cpu = 2 } + + device { + name = "eth0" + type = "nic" + + properties = { + nictype = "bridged" + parent = "${lxd_network.kubernetes_network.name}" + } + } }