Skip to content
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

Make template compatible with Proxmox 8.2.4, fix issues across template #94

Conversation

oreze
Copy link
Contributor

@oreze oreze commented Jul 9, 2024

List of changes:

  • fix, chore: upgrade providers, add proxmox >8.1 compatibility, fix breaking changes, adjust disk sizes and names of the templates
  • fix: add missing cloudinit drive, enable automatic_reboot on modify operation
  • fix: update docker script to wait if apt-get is locked
  • fix: add missing quotes around ssh_private_key in kubespray setup
  • chore: bump kubespray_image, kube_version, argocd_version versions, add explicit sesnitive properties to ssh keys variables

Basically, I've just upgraded providers, fixed some compatibility and other issues. It worked for me with Proxmox 8.2.4 with ubuntu 24.04 template.

I had to fix docker install script, it failed a few times because of apt-get lock, change in setup_kubespray.sh script should be reverted after merging this PR: docker/docker-install#431

Supersededs #90

*.tfvars

# Exclude example.tfvars from being ignored
!example.tfvars
Copy link
Contributor Author

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

@@ -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
Copy link
Contributor Author

Choose a reason for hiding this comment

The 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


dynamic "disk" {
for_each = var.add_worker_node_data_disk ? [var.worker_node_data_disk_size] : []
disks {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new disks structure in updated provider

}
}
}
ide {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

previous config missed cloudinit drive, therefore VMs were not initialized properly

@@ -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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added simple script adding lock timeout, otherwise script would fail sometimes

@@ -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"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new naming convention, - is forbidden

@@ -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",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added missing "key" quotes, fails without it

    fix, chore: upgrade providers, add proxmox >8.1 compatibility, fix breaking changes, adjust disk sizes and names of the templates
    fix: add missing cloudinit drive, enable automatic_reboot on modify operation
    fix: update docker script to wait if apt-get is locked
    fix: add missing quotes around ssh_private_key in kubespray setup
    chore: bump kubespray_image, kube_version, argocd_version versions, add explicit sesnitive properties to ssh keys variables
@oreze oreze force-pushed the fix/make-compatible-with-proxmox-8.4-and-fix-scripts branch from dc3f471 to ae1a1e0 Compare July 9, 2024 11:09
@khanh-ph khanh-ph merged commit 8de8cb7 into khanh-ph:develop Aug 24, 2024
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants