Add haproxy node

This commit is contained in:
Khue Doan 2020-07-25 14:50:45 +07:00
parent b82b38b792
commit ad4b19b2f7

View File

@ -77,3 +77,36 @@ resource "lxd_container" "kubernetes_workers" {
EXEC
}
}
resource "lxd_container" "haproxy" {
count = 1
name = "haproxy"
image = "images:ubuntu/18.04"
ephemeral = false
config = {
"boot.autostart" = true
}
limits = {
cpu = 2
}
device {
name = "eth0"
type = "nic"
properties = {
nictype = "bridged"
parent = "${lxd_network.kubernetes_network.name}"
}
}
provisioner "local-exec" {
command = <<EXEC
lxc exec ${self.name} -- bash -xe -c '
touch /hello
'
EXEC
}
}