Working lxd container

This commit is contained in:
Khue Doan 2021-02-12 21:51:19 +07:00
parent 9348de351f
commit 6d32436039
2 changed files with 34 additions and 1 deletions

13
infra/lxd/cluster.tf Normal file
View File

@ -0,0 +1,13 @@
resource "lxd_container" "test1" {
name = "test1"
image = "ubuntu:20.04"
ephemeral = false
config = {
"boot.autostart" = true
}
limits = {
cpu = 2
}
}

View File

@ -1,6 +1,26 @@
terraform {
backend "etcdv3" {
endpoints = [ "localhost:2379" ]
endpoints = ["localhost:2379"]
lock = true
}
required_providers {
lxd = {
source = "terraform-lxd/lxd"
version = "1.5.0"
}
}
}
provider "lxd" {
generate_client_certificates = true
accept_remote_certificate = true
lxd_remote {
name = "local"
scheme = "https"
address = "192.168.64.4"
password = "1"
default = true
}
}