diff --git a/README.md b/README.md index b700a93..7b8853a 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,14 @@ Ensure you have the dependencies installed: `brew install terraform` +Run the following commands to initialize and apply the Terraform configuration: + +```bash + terraform init + terraform plan + terraform apply +``` + # Development Environment Setup `brew install minikube` diff --git a/main.tf b/main.tf index 2eee390..c3bcfd1 100644 --- a/main.tf +++ b/main.tf @@ -57,10 +57,10 @@ resource "libvirt_network" "talos_network" { # Generate machine secrets resource "talos_machine_secrets" "this" {} -# Create control plane configuration with correct endpoint -resource "talos_machine_configuration" "controlplane" { +# Create control plane configuration +data "talos_machine_configuration" "controlplane" { cluster_name = var.cluster_name - cluster_endpoint = "https://10.5.0.0:6443" # Fixed endpoint IP + cluster_endpoint = "https://10.5.0.2:6443" machine_type = "controlplane" machine_secrets = talos_machine_secrets.this.machine_secrets @@ -70,14 +70,6 @@ resource "talos_machine_configuration" "controlplane" { install = { disk = "/dev/vda" } - network = { - interfaces = [ - { - interface = "eth0" - addresses = ["10.5.0.0/24"] - } - ] - } } }) ] @@ -86,7 +78,7 @@ resource "talos_machine_configuration" "controlplane" { # Download Talos kernel and initramfs resource "null_resource" "download_talos_files" { triggers = { - version = "v1.6.4" # Change to your preferred version + version = "v1.6.4" } provisioner "local-exec" { @@ -98,19 +90,19 @@ resource "null_resource" "download_talos_files" { } } -# Create a cloud-init disk for configuration -resource "libvirt_cloudinit_disk" "commoninit" { - name = "commoninit.iso" - user_data = <