-
Notifications
You must be signed in to change notification settings - Fork 70
Make template compatible with Proxmox 8.2.4, fix issues across template #94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,7 @@ terraform { | |
| required_providers { | ||
| proxmox = { | ||
| source = "telmate/proxmox" | ||
| version = "2.9.14" | ||
| version = "3.0.1-rc3" | ||
| } | ||
| } | ||
| } | ||
|
|
@@ -27,27 +27,37 @@ resource "proxmox_vm_qemu" "ubuntu_vm" { | |
| scsihw = "virtio-scsi-single" | ||
| hotplug = "network,disk,usb,memory,cpu" | ||
| numa = true | ||
| automatic_reboot = false | ||
| automatic_reboot = true | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there were a problems with modify operations without this property set to true |
||
| desc = "This VM is managed by Terraform, cloned from an Cloud-init Ubuntu image, configured with an internal network and supports CPU hotplug/hot unplug and memory hotplug capabilities." | ||
| tags = var.vm_tags | ||
|
|
||
| disk { | ||
| slot = 0 | ||
| type = "virtio" | ||
| storage = var.vm_os_disk_storage | ||
| size = "${var.vm_os_disk_size_gb}G" | ||
| iothread = 1 | ||
| } | ||
|
|
||
| dynamic "disk" { | ||
| for_each = var.add_worker_node_data_disk ? [var.worker_node_data_disk_size] : [] | ||
| disks { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. new disks structure in updated provider |
||
| virtio { | ||
| virtio0 { | ||
| disk { | ||
| size = "${var.vm_os_disk_size_gb}G" | ||
| storage = var.vm_os_disk_storage | ||
| iothread = true | ||
| } | ||
| } | ||
|
|
||
| content { | ||
| slot = 1 | ||
| type = "virtio" | ||
| storage = var.worker_node_data_disk_storage | ||
| size = "${var.worker_node_data_disk_size}G" | ||
| iothread = 1 | ||
| dynamic "virtio1" { | ||
| for_each = var.add_worker_node_data_disk ? [var.worker_node_data_disk_size] : [] | ||
| content { | ||
| disk { | ||
| size = "${var.worker_node_data_disk_size}G" | ||
| storage = var.worker_node_data_disk_storage | ||
| iothread = true | ||
| } | ||
| } | ||
| } | ||
| } | ||
| ide { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. previous config missed cloudinit drive, therefore VMs were not initialized properly |
||
| ide0 { | ||
| cloudinit { | ||
| storage = var.vm_os_disk_storage | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,6 +42,16 @@ if ! command -v docker &> /dev/null; then | |
| exit 1 | ||
| fi | ||
|
|
||
| # Check and add DPkg::Lock::Timeout=600 to apt-get install if not already present | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added simple script adding lock timeout, otherwise script would fail sometimes |
||
| if ! grep -q 'apt-get install.*DPkg::Lock::Timeout=600' get-docker.sh; then | ||
| sed -i 's/apt-get install/apt-get install -o DPkg::Lock::Timeout=600/g' get-docker.sh | ||
| fi | ||
|
|
||
| # Check and add DPkg::Lock::Timeout=600 to apt-get update if not already present | ||
| if ! grep -q 'apt-get update.*DPkg::Lock::Timeout=600' get-docker.sh; then | ||
| sed -i 's/apt-get update/apt-get update -o DPkg::Lock::Timeout=600/g' get-docker.sh | ||
| fi | ||
|
|
||
| # Install Docker | ||
| if ! sudo sh get-docker.sh; then | ||
| echo "Error installing Docker. Exiting." >&2 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,7 +16,7 @@ module "k8s_control_plane_nodes" { | |
| vm_net_subnet_cidr = var.internal_net_subnet_cidr | ||
| vm_host_number = 10 | ||
| vm_user = var.vm_user | ||
| vm_tags = "${var.env_name};terraform;k8s-control-plane" | ||
| vm_tags = "${var.env_name};terraform;k8s_control_plane" | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. new naming convention, - is forbidden |
||
| ssh_public_keys = var.ssh_public_keys | ||
| use_legacy_naming_convention = var.use_legacy_naming_convention | ||
| } | ||
|
|
@@ -39,7 +39,7 @@ module "k8s_worker_nodes" { | |
| vm_net_subnet_cidr = var.internal_net_subnet_cidr | ||
| vm_host_number = 20 | ||
| vm_user = var.vm_user | ||
| vm_tags = "${var.env_name};terraform;k8s-worker" | ||
| vm_tags = "${var.env_name};terraform;k8s_worker" | ||
| ssh_public_keys = var.ssh_public_keys | ||
| add_worker_node_data_disk = var.add_worker_node_data_disk | ||
| worker_node_data_disk_storage = var.worker_node_data_disk_storage | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -80,7 +80,7 @@ resource "null_resource" "setup_kubespray" { | |
| provisioner "remote-exec" { | ||
| inline = [ | ||
| local.setup_kubespray_script_content, | ||
| "echo ${var.ssh_private_key} | base64 -d > ${local.kubespray_data_dir}/id_rsa", | ||
| "echo \"${var.ssh_private_key}\" | base64 -d > ${local.kubespray_data_dir}/id_rsa", | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added missing "key" quotes, fails without it |
||
| <<-EOT | ||
| cat <<EOF > ${local.kubespray_data_dir}/inventory.ini | ||
| ${local.kubespray_inventory_content} | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wanted to exclude all .tfvars files from being checked, just in case