Compare commits

..

No commits in common. "4d414c88f01ec29375c3e24b020405aa42e7b650" and "788136f4a825a9a9f2d5c540c609100d3a870716" have entirely different histories.

4 changed files with 104 additions and 59 deletions

View file

@ -1,11 +1,11 @@
init: init:
tofu init terraform init
plan: plan:
tofu plan -out tfplan terraform plan -out tfplan
apply:plan apply:plan
tofu apply tfplan terraform apply tfplan
refresh:plan refresh:plan
tofu apply tfplan -refresh-only terraform apply tfplan -refresh-only

View file

@ -20,23 +20,23 @@ locals {
# ignition = data.ignition_config.worker.rendered # ignition = data.ignition_config.worker.rendered
# } # }
#resource "matchbox_profile" "worker" { resource "matchbox_profile" "worker" {
# name = "worker" name = "worker"
# kernel = local.kernel kernel = local.kernel
# initrd = [ initrd = [
# "--name main ${local.initrd}" "--name main ${local.initrd}"
# ] ]
# args = [ args = [
# "ip=dhcp", "ip=dhcp",
# "initrd=main", "initrd=main",
# "coreos.live.rootfs_url=${local.rootfs}", "coreos.live.rootfs_url=${local.rootfs}",
# "coreos.inst.install_dev=/dev/vda", "coreos.inst.install_dev=/dev/vda",
# "coreos.inst.ignition_url=${var.matchbox_http_endpoint}/ignition?uuid=$${uuid}&mac=$${mac:hexhyp}", "coreos.inst.ignition_url=${var.matchbox_http_endpoint}/ignition?uuid=$${uuid}&mac=$${mac:hexhyp}",
# "console=tty0", "console=tty0",
# "console=ttyS0", "console=ttyS0",
# ] ]
# raw_ignition = data.ignition_config.worker.rendered raw_ignition = data.ignition_config.worker.rendered
#} }
resource "matchbox_profile" "nuc" { resource "matchbox_profile" "nuc" {
name = "nuc" name = "nuc"
@ -67,25 +67,25 @@ resource "matchbox_group" "nuc" {
} }
} }
#resource "matchbox_group" "slowworker" { resource "matchbox_group" "slowworker" {
# for_each = var.slowworkers for_each = var.slowworkers
#
# name = each.key
# profile = matchbox_profile.worker.name
# selector = {
# mac = each.value
# }
#
#}
#resource "matchbox_group" "worker" { name = each.key
# name = "worker" profile = matchbox_profile.worker.name
# profile = matchbox_profile.worker.name selector = {
# selector = { mac = each.value
# mac = "52:54:00:c3:51:e8" }
# }
# }
#}
resource "matchbox_group" "worker" {
name = "worker"
profile = matchbox_profile.worker.name
selector = {
mac = "52:54:00:c3:51:e8"
}
}
data "ignition_user" "core" { data "ignition_user" "core" {
name = "core" name = "core"
@ -95,23 +95,23 @@ data "ignition_user" "core" {
var.ssh_authorized_key var.ssh_authorized_key
] ]
} }
#
#data "ignition_config" "worker" { data "ignition_config" "worker" {
# users = [ users = [
# data.ignition_user.core.rendered data.ignition_user.core.rendered
# ] ]
# systemd = [ systemd = [
# data.ignition_systemd_unit.qemu_ga.rendered, data.ignition_systemd_unit.qemu_ga.rendered,
# data.ignition_systemd_unit.k3s_install.rendered, data.ignition_systemd_unit.k3s_install.rendered,
# data.ignition_systemd_unit.worker-images-clean-service.rendered, data.ignition_systemd_unit.worker-images-clean-service.rendered,
# data.ignition_systemd_unit.worker-images-clean-timer.rendered data.ignition_systemd_unit.worker-images-clean-timer.rendered
# ] ]
# files = [ files = [
# data.ignition_file.worker-options.rendered, data.ignition_file.worker-options.rendered,
# data.ignition_file.k3s_agent_install_script.rendered, data.ignition_file.k3s_agent_install_script.rendered,
# data.ignition_file.worker-images-clean.rendered data.ignition_file.worker-images-clean.rendered
# ] ]
#} }
data "ignition_config" "nuc" { data "ignition_config" "nuc" {
users = [ users = [
data.ignition_user.core.rendered data.ignition_user.core.rendered

45
10-pre-k8s/talos.tf Normal file
View file

@ -0,0 +1,45 @@
resource "matchbox_profile" "talos-controlplane" {
name = "talos-controlplane"
kernel = "http://matchbox.lab.cowley.tech:8080/assets/talos/1.6.2/vmlinuz-amd64"
initrd = [
"http://matchbox.lab.cowley.tech:8080/assets/talos/1.6.2/initramfs-amd64.xz"
]
args = [
"initrd=initramfs.xz",
"init_on_alloc=1",
"slab_nomerge",
"pti=on",
"console=tty0",
"console=ttyS0",
"printk.devkmsg=on",
"talos.platform=metal",
"talos.config=http://matchbox.lab.cowley.tech:8080/assets/talos/controlplane.yaml"
]
}
resource "matchbox_profile" "talos-worker" {
name = "talos-worker"
kernel = "http://matchbox.lab.cowley.tech:8080/assets/talos/1.6.2/vmlinuz-amd64"
initrd = [
"http://matchbox.lab.cowley.tech:8080/assets/talos/1.6.2/initramfs-amd64.xz"
]
args = [
"initrd=initramfs.xz",
"init_on_alloc=1",
"slab_nomerge",
"pti=on",
"console=tty0",
"console=ttyS0",
"printk.devkmsg=on",
"talos.platform=metal",
"talos.config=http://matchbox.lab.cowley.tech:8080/assets/talos/worker.yaml"
]
}
resource "matchbox_group" "controlplane" {
name = "controlplane"
profile = matchbox_profile.talos-controlplane.name
selector = {
mac = "52:54:00:25:b2:8e"
}
}

View file

@ -2,8 +2,8 @@ matchbox_http_endpoint = "http://192.168.6.3:8080"
matchbox_rpc_endpoint = "192.168.6.3:8081" matchbox_rpc_endpoint = "192.168.6.3:8081"
#matchbox_http_endpoint = "http://matchbox.lab.cowley.tech:8080" #matchbox_http_endpoint = "http://matchbox.lab.cowley.tech:8080"
#matchbox_rpc_endpoint = "matchbox.lab.cowley.tech:8081" #matchbox_rpc_endpoint = "matchbox.lab.cowley.tech:8081"
#os_version = "39.20240104.3.0" #os_version = "38.20231027.3.2"
os_version = "41.20250331.3.0" os_version = "39.20240104.3.0"
os_stream = "stable" os_stream = "stable"
ssh_authorized_key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMEpF8xS30j9n1a+0FegDYkDis8yHy2ZCj3gvWXmeu5z ccowley@pxe.lab.cowley.tech" ssh_authorized_key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMEpF8xS30j9n1a+0FegDYkDis8yHy2ZCj3gvWXmeu5z ccowley@pxe.lab.cowley.tech"
nucs = { nucs = {