cancel
Showing results for 
Search instead for 
Did you mean: 
Ramash
Cadet
Cadet
  • 318 Views

Issue Running K3s After Importing Custom OVF Built with Packer

Jump to solution

Hello everyone,

I'm trying to build a custom image using Packer where K3s runs inside the exported OVF file. During the Packer build process, the installation completes successfully, and K3s is running as expected.

However, after exporting the OVF file and importing it into VMware, K3s is no longer working. I'm getting a connection refused error on port 6443. Even after disabling the firewall, the issue persists.

For K3s installation, I'm using the following shell script with the curl command during the build process:
curl -sfL https://get.k3s.io | sh -
Could someone please guide me on what might be going wrong or what I might be missing?

Here is the Packer code I’m using: https://pastebin.com/M9mC1Drg

Thank you!

1 Solution

Accepted Solutions
shashi01
Moderator
Moderator
  • 311 Views

@Ramash 

Just install the K3s binary and create a systemd service to install it on the VM's first boot. This way, K3s will initialize properly with the VM’s real IP and hostname. That’s why port 6443 works after import.

If you run it during the build, it binds to the wrong environment and breaks after cloning.

View solution in original post

1 Reply
shashi01
Moderator
Moderator
  • 312 Views

@Ramash 

Just install the K3s binary and create a systemd service to install it on the VM's first boot. This way, K3s will initialize properly with the VM’s real IP and hostname. That’s why port 6443 works after import.

If you run it during the build, it binds to the wrong environment and breaks after cloning.

Join the discussion
You must log in to join this conversation.