Configuring Kubernetes on Vagrant

Dec 15 2015

One of the most frequent questions I see about setting up Kubernetes is how one can modify the configuration of a Vagrant/VirtualBox cluster. This, for example, is required to set up an insecure Docker registry or to use Kubernetes extensions like DaemonSets.

Running Kubernetes on Vagrant

Running Kubernetes on Vagrant is straightforward, and the directions for this are on the site. The really short version goes like this:

  • Go to the place where you installed Kubernetes
  • Run a couple of commands
$ export KUBERNETES_PROVIDER=vagrant
$ cluster/

After several minutes (or more), you'll have a local 2-node Kubernetes cluster running.

Modifying Config

Kubernetes is not tremendously consistent when it comes to modifying configuration. Configuration data is spread all over the place, and different clusters expose different configuration.

The Vagrant configuration is no exception. However, a number of configuration options are set in a file called cluster/vagrant/

If you need to set up Docker to use an insecure registry or enable additional API server features like DaemonSets, this file defines the information that you need to modify.

However, instead of modifying the file, you should copy it and then set an additional environment variable:

$ cd cluster/vagrant
$ cp
$ export

It is important to note that the config file is loaded relative to the cluster/vagrant directory.

Editing the Configuration

With that done, we can now edit the configuration file. For example, to set an insecure registry, we could change the line that says this:


Or to enable DaemonSets, we could find the RUNTIME_CONFIG and set it to this:


Note that any time you change this file, you will have to stop and start your cluster again using the cluster/ and cluster/ scripts.

comments powered by Disqus