> ## Content Index
> Fetch the complete content index at: https://scriptcrunch.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# [Solved] Vagrant Kubeadm Cluster Crashes on Reboot
- URL: https://scriptcrunch.com/solved-vagrant-kubeadm-cluster-crashes-on-reboot/
- Published: 2022-04-05T17:03:55.000Z
- Updated: 2026-06-23T08:56:02.000Z
- Author: Scriptcrunch Editorial
- Tags: Troubleshooting, #Migrated-1758801465347, #wp, #wp-post, #Import 2025-09-25 11:57

**Issue**: If you set up a [kubernetes](https://scriptcrunch.com/tag/kubernetes/) cluster in [Vagrant](https://scriptcrunch.com/tag/vagrant/) using kubeadm on a Ubuntu box, the cluster master node service may fail to start on a VM reboot.

If you check the `kublet` logs, you will see connection refused errors for etcd service.

This issue is primarily due to `swapoff` issue.

Kubeadm needs the swap to be off to function properly. Sometimes, even if you make the `fstab` entry to disable the swap, it might not work as expected.

When you set up the cluster you might have run the following command. It will disable swap only for the running session. If you restart the VM, it gets enabled again.

```
swapoff -a
```

## Solution

To solve the `swapoff` issue, here is what you can do.

Create a crontab entry that disables swap on reboot. You can add the crontab entry using the following command.

```
(crontab -l 2>/dev/null; echo "@reboot /sbin/swapoff -a") | crontab -
```

If you restart the VM after setting the crontab, your kubernetes master services will come up automatically.

If you want an automated kubeadm cluster on Vagrant, check out this [Kubeadm vagrant Github Repository.](https://github.com/scriptcamp/vagrant-kubeadm-kubernetes?ref=scriptcrunch.com)

Also, check the [Vagrant networking issue.](https://scriptcrunch.com/solved-vboxmanage-error-component-machinewrap/)

If you using Vagrant for [Kubernetes Certification](https://scriptcrunch.com/tag/kubernetes-certifications/) preparation, check out the [Linux Foundation Coupons](https://scriptcrunch.com/linux-foundation-coupon/) to save up to 50% on certifications.