terraform: extend kubernetes a little bit

This commit is contained in:
Jan Novak
2026-01-02 23:17:43 +01:00
parent bdf82c7e49
commit d3697c8132
14 changed files with 610 additions and 10 deletions

View File

@@ -10,10 +10,11 @@ locals {
resource "libvirt_volume" "ubuntu_disk" {
provider = libvirt.kvm-homer
name = "${local.master_vm_name}.qcow2"
pool = "default"
backing_store = {
path = libvirt_volume.ubuntu_base.path
path = libvirt_volume.ubuntu_base_homer.path
format = {
type = "qcow2"
}
@@ -123,6 +124,10 @@ locals {
---
apiVersion: kubeadm.k8s.io/v1beta3
kind: ClusterConfiguration
extraArgs:
oidc-issuer-url: "https://idm.home.hrajfrisbee.cz/oauth2/openid/k8s"
oidc-client-id: "k8s"
oidc-signing-algs: "ES256"
networking:
podSubnet: "10.244.0.0/16"
---
@@ -198,6 +203,7 @@ locals {
}
resource "libvirt_cloudinit_disk" "commoninit" {
provider = libvirt.kvm-homer
name = "${local.master_vm_name}-cloudinit.iso"
user_data = local.user_data
meta_data = yamlencode({
@@ -209,6 +215,7 @@ resource "libvirt_cloudinit_disk" "commoninit" {
# Create a volume from the cloud-init ISO
resource "libvirt_volume" "cloudinit" {
provider = libvirt.kvm-homer
name = "${local.master_vm_name}-cloudinit.iso"
pool = "default"
create = {
@@ -220,6 +227,7 @@ resource "libvirt_volume" "cloudinit" {
resource "libvirt_domain" "master" {
provider = libvirt.kvm-homer
name = local.master_vm_name
memory = "2048"
memory_unit = "MiB"