2015-07-12 04:04:52 +00:00
<!-- BEGIN MUNGE: UNVERSIONED_WARNING -->
<!-- BEGIN STRIP_FOR_RELEASE -->
2015-07-16 17:02:26 +00:00
< img src = "http://kubernetes.io/img/warning.png" alt = "WARNING"
width="25" height="25">
< img src = "http://kubernetes.io/img/warning.png" alt = "WARNING"
width="25" height="25">
< img src = "http://kubernetes.io/img/warning.png" alt = "WARNING"
width="25" height="25">
< img src = "http://kubernetes.io/img/warning.png" alt = "WARNING"
width="25" height="25">
< img src = "http://kubernetes.io/img/warning.png" alt = "WARNING"
width="25" height="25">
< h2 > PLEASE NOTE: This document applies to the HEAD of the source tree< / h2 >
If you are using a released version of Kubernetes, you should
refer to the docs that go with that version.
2015-12-14 18:37:38 +00:00
<!-- TAG RELEASE_LINK, added by the munger automatically -->
2015-07-16 17:02:26 +00:00
< strong >
2015-11-03 18:17:57 +00:00
The latest release of this document can be found
[here ](http://releases.k8s.io/release-1.1/docs/getting-started-guides/vagrant.md ).
2015-07-16 17:02:26 +00:00
Documentation for other releases can be found at
[releases.k8s.io ](http://releases.k8s.io ).
< / strong >
--
2015-07-13 22:15:35 +00:00
2015-07-12 04:04:52 +00:00
<!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING -->
2015-07-17 22:35:41 +00:00
2014-08-03 19:44:33 +00:00
## Getting started with Vagrant
2015-07-20 20:45:36 +00:00
Running Kubernetes with Vagrant (and VirtualBox) is an easy way to run/test/develop on your local machine (Linux, Mac OS X).
2015-03-05 00:04:00 +00:00
2015-06-22 19:39:35 +00:00
**Table of Contents**
2015-06-22 18:56:19 +00:00
2015-06-23 15:20:31 +00:00
- [Prerequisites ](#prerequisites )
- [Setup ](#setup )
- [Interacting with your Kubernetes cluster with Vagrant. ](#interacting-with-your-kubernetes-cluster-with-vagrant )
- [Authenticating with your master ](#authenticating-with-your-master )
- [Running containers ](#running-containers )
- [Troubleshooting ](#troubleshooting )
- [I keep downloading the same (large) box all the time! ](#i-keep-downloading-the-same-large-box-all-the-time )
2015-10-07 19:02:11 +00:00
- [I am getting timeouts when trying to curl the master from my host! ](#i-am-getting-timeouts-when-trying-to-curl-the-master-from-my-host )
2015-06-23 15:20:31 +00:00
- [I just created the cluster, but I am getting authorization errors! ](#i-just-created-the-cluster-but-i-am-getting-authorization-errors )
- [I just created the cluster, but I do not see my container running! ](#i-just-created-the-cluster-but-i-do-not-see-my-container-running )
- [I want to make changes to Kubernetes code! ](#i-want-to-make-changes-to-kubernetes-code )
- [I have brought Vagrant up but the nodes cannot validate! ](#i-have-brought-vagrant-up-but-the-nodes-cannot-validate )
- [I want to change the number of nodes! ](#i-want-to-change-the-number-of-nodes )
- [I want my VMs to have more memory! ](#i-want-my-vms-to-have-more-memory )
- [I ran vagrant suspend and nothing works! ](#i-ran-vagrant-suspend-and-nothing-works )
2015-07-01 19:30:22 +00:00
- [I want vagrant to sync folders via nfs! ](#i-want-vagrant-to-sync-folders-via-nfs )
2015-06-22 18:56:19 +00:00
2014-08-03 19:44:33 +00:00
### Prerequisites
2015-07-17 22:35:41 +00:00
2015-10-21 00:56:18 +00:00
1. Install latest version >= 1.7.4 of vagrant from http://www.vagrantup.com/downloads.html
2015-04-15 23:07:50 +00:00
2. Install one of:
2015-09-26 03:04:54 +00:00
1. The latest version of Virtual Box from https://www.virtualbox.org/wiki/Downloads
2015-04-15 23:07:50 +00:00
2. [VMWare Fusion ](https://www.vmware.com/products/fusion/ ) version 5 or greater as well as the appropriate [Vagrant VMWare Fusion provider ](https://www.vagrantup.com/vmware )
3. [VMWare Workstation ](https://www.vmware.com/products/workstation/ ) version 9 or greater as well as the [Vagrant VMWare Workstation provider ](https://www.vagrantup.com/vmware )
4. [Parallels Desktop ](https://www.parallels.com/products/desktop/ ) version 9 or greater as well as the [Vagrant Parallels provider ](https://parallels.github.io/vagrant-parallels/ )
2015-07-19 05:58:13 +00:00
5. libvirt with KVM and enable support of hardware virtualisation. [Vagrant-libvirt ](https://github.com/pradels/vagrant-libvirt ). For fedora provided official rpm, and possible to use `yum install vagrant-libvirt`
2014-08-03 19:44:33 +00:00
### Setup
2015-03-13 00:30:32 +00:00
Setting up a cluster is as simple as running:
2015-04-15 23:07:50 +00:00
```sh
2015-03-13 00:30:32 +00:00
export KUBERNETES_PROVIDER=vagrant
2015-03-22 05:50:29 +00:00
curl -sS https://get.k8s.io | bash
2015-03-13 00:30:32 +00:00
```
2015-09-03 14:10:11 +00:00
Alternatively, you can download [Kubernetes release ](https://github.com/kubernetes/kubernetes/releases ) and extract the archive. To start your local cluster, open a shell and run:
2014-08-03 19:44:33 +00:00
2015-04-15 23:07:50 +00:00
```sh
2014-08-03 19:44:33 +00:00
cd kubernetes
2014-12-15 06:23:48 +00:00
2014-12-12 19:08:22 +00:00
export KUBERNETES_PROVIDER=vagrant
2015-04-15 23:07:50 +00:00
./cluster/kube-up.sh
2014-08-03 19:44:33 +00:00
```
2015-07-14 02:26:52 +00:00
The `KUBERNETES_PROVIDER` environment variable tells all of the various cluster management scripts which variant to use. If you forget to set this, the assumption is you are running on Google Compute Engine.
2015-09-24 12:07:53 +00:00
By default, the Vagrant setup will create a single master VM (called kubernetes-master) and one node (called kubernetes-node-1). Each VM will take 1 GB, so make sure you have at least 2GB to 4GB of free memory (plus appropriate free disk space).
2015-07-14 02:26:52 +00:00
2014-10-01 23:17:51 +00:00
Vagrant will provision each machine in the cluster with all the necessary components to run Kubernetes. The initial setup can take a few minutes to complete on each machine.
2014-08-03 19:44:33 +00:00
2015-04-15 23:07:50 +00:00
If you installed more than one Vagrant provider, Kubernetes will usually pick the appropriate one. However, you can override which one Kubernetes will use by setting the [`VAGRANT_DEFAULT_PROVIDER` ](https://docs.vagrantup.com/v2/providers/default.html ) environment variable:
```sh
export VAGRANT_DEFAULT_PROVIDER=parallels
export KUBERNETES_PROVIDER=vagrant
./cluster/kube-up.sh
```
2015-06-25 18:34:48 +00:00
By default, each VM in the cluster is running Fedora.
2014-08-03 19:44:33 +00:00
2015-07-13 04:15:58 +00:00
To access the master or any node:
2014-08-03 19:44:33 +00:00
2015-04-15 23:07:50 +00:00
```sh
2014-08-03 19:44:33 +00:00
vagrant ssh master
2015-09-24 12:07:53 +00:00
vagrant ssh node-1
2015-01-09 18:00:48 +00:00
```
2015-07-13 04:15:58 +00:00
If you are running more than one node, you can access the others by:
2015-01-09 18:00:48 +00:00
2015-04-15 23:07:50 +00:00
```sh
2015-09-24 12:07:53 +00:00
vagrant ssh node-2
vagrant ssh node-3
2014-08-03 19:44:33 +00:00
```
2015-06-25 18:34:48 +00:00
Each node in the cluster installs the docker daemon and the kubelet.
The master node instantiates the Kubernetes master components as pods on the machine.
2014-08-03 19:44:33 +00:00
To view the service status and/or logs on the kubernetes-master:
2015-06-25 18:34:48 +00:00
2015-07-19 01:51:04 +00:00
```console
[vagrant@kubernetes-master ~] $ vagrant ssh master
2015-06-25 18:34:48 +00:00
[vagrant@kubernetes-master ~] $ sudo su
2014-08-03 19:44:33 +00:00
2015-06-25 18:34:48 +00:00
[root@kubernetes-master ~] $ systemctl status kubelet
[root@kubernetes-master ~] $ journalctl -ru kubelet
2014-08-03 19:44:33 +00:00
2015-06-25 18:34:48 +00:00
[root@kubernetes-master ~] $ systemctl status docker
[root@kubernetes-master ~] $ journalctl -ru docker
[root@kubernetes-master ~] $ tail -f /var/log/kube-apiserver.log
[root@kubernetes-master ~] $ tail -f /var/log/kube-controller-manager.log
[root@kubernetes-master ~] $ tail -f /var/log/kube-scheduler.log
2014-08-03 19:44:33 +00:00
```
2015-07-13 04:15:58 +00:00
To view the services on any of the nodes:
2015-07-17 02:01:02 +00:00
2015-07-19 01:51:04 +00:00
```console
2015-09-24 12:07:53 +00:00
[vagrant@kubernetes-master ~] $ vagrant ssh node-1
2015-06-25 18:34:48 +00:00
[vagrant@kubernetes-master ~] $ sudo su
[root@kubernetes-master ~] $ systemctl status kubelet
[root@kubernetes-master ~] $ journalctl -ru kubelet
[root@kubernetes-master ~] $ systemctl status docker
[root@kubernetes-master ~] $ journalctl -ru docker
2014-08-03 19:44:33 +00:00
```
2014-09-19 13:26:34 +00:00
### Interacting with your Kubernetes cluster with Vagrant.
With your Kubernetes cluster up, you can manage the nodes in your cluster with the regular Vagrant commands.
2014-08-03 19:44:33 +00:00
To push updates to new Kubernetes code after making source changes:
2015-07-17 02:01:02 +00:00
2015-04-15 23:07:50 +00:00
```sh
./cluster/kube-push.sh
2014-08-03 19:44:33 +00:00
```
2014-09-19 13:26:34 +00:00
To stop and then restart the cluster:
2015-07-17 02:01:02 +00:00
2015-04-15 23:07:50 +00:00
```sh
2014-08-03 19:44:33 +00:00
vagrant halt
2015-04-15 23:07:50 +00:00
./cluster/kube-up.sh
2014-08-03 19:44:33 +00:00
```
To destroy the cluster:
2015-07-17 02:01:02 +00:00
2015-04-15 23:07:50 +00:00
```sh
2014-09-19 13:26:34 +00:00
vagrant destroy
2014-08-03 19:44:33 +00:00
```
2014-12-19 23:28:15 +00:00
Once your Vagrant machines are up and provisioned, the first thing to do is to check that you can use the `kubectl.sh` script.
2014-09-26 21:52:03 +00:00
2015-07-19 05:58:13 +00:00
You may need to build the binaries first, you can do this with `make`
2014-08-03 19:44:33 +00:00
2015-07-19 01:51:04 +00:00
```console
2015-06-08 15:41:28 +00:00
$ ./cluster/kubectl.sh get nodes
2014-12-19 23:28:15 +00:00
NAME LABELS
10.245.1.4 < none >
10.245.1.5 < none >
10.245.1.3 < none >
2014-09-19 13:26:34 +00:00
```
2014-08-12 19:43:35 +00:00
### Authenticating with your master
2014-12-04 22:56:40 +00:00
When using the vagrant provider in Kubernetes, the `cluster/kubectl.sh` script will cache your credentials in a `~/.kubernetes_vagrant_auth` file so you will not be prompted for them in the future.
2014-08-12 19:43:35 +00:00
2015-04-15 23:07:50 +00:00
```sh
2014-11-10 18:56:13 +00:00
cat ~/.kubernetes_vagrant_auth
2015-07-19 01:51:04 +00:00
```
```json
2014-09-19 13:26:34 +00:00
{ "User": "vagrant",
2015-04-29 09:04:37 +00:00
"Password": "vagrant",
2014-12-19 23:28:15 +00:00
"CAFile": "/home/k8s_user/.kubernetes.vagrant.ca.crt",
"CertFile": "/home/k8s_user/.kubecfg.vagrant.crt",
"KeyFile": "/home/k8s_user/.kubecfg.vagrant.key"
}
2014-09-19 13:26:34 +00:00
```
2015-06-08 15:41:28 +00:00
You should now be set to use the `cluster/kubectl.sh` script. For example try to list the nodes that you have started with:
2014-08-12 19:43:35 +00:00
2015-04-15 23:07:50 +00:00
```sh
2015-06-08 15:41:28 +00:00
./cluster/kubectl.sh get nodes
2014-09-19 13:26:34 +00:00
```
### Running containers
2015-06-08 15:41:28 +00:00
Your cluster is running, you can list the nodes in your cluster:
2014-09-19 13:26:34 +00:00
2015-07-19 01:51:04 +00:00
```console
2015-06-08 15:41:28 +00:00
$ ./cluster/kubectl.sh get nodes
2014-12-04 22:56:40 +00:00
NAME LABELS
2014-11-24 23:41:11 +00:00
10.245.2.4 < none >
10.245.2.3 < none >
10.245.2.2 < none >
2014-08-12 19:43:35 +00:00
```
2014-09-19 13:26:34 +00:00
Now start running some containers!
2015-04-15 23:07:50 +00:00
You can now use any of the `cluster/kube-*.sh` commands to interact with your VM machines.
2014-09-19 13:26:34 +00:00
Before starting a container there will be no pods, services and replication controllers.
2015-07-19 01:51:04 +00:00
```console
2015-04-15 23:07:50 +00:00
$ ./cluster/kubectl.sh get pods
2015-07-08 18:01:09 +00:00
NAME READY STATUS RESTARTS AGE
2014-09-19 13:26:34 +00:00
2015-04-15 23:07:50 +00:00
$ ./cluster/kubectl.sh get services
2015-08-08 04:08:43 +00:00
NAME CLUSTER_IP EXTERNAL_IP PORT(S) SELECTOR AGE
2014-09-19 13:26:34 +00:00
2015-05-21 00:17:01 +00:00
$ ./cluster/kubectl.sh get replicationcontrollers
2015-07-08 18:01:09 +00:00
CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS
2014-08-12 19:43:35 +00:00
```
2014-12-04 22:56:40 +00:00
Start a container running nginx with a replication controller and three replicas
2014-09-19 13:26:34 +00:00
2015-07-19 01:51:04 +00:00
```console
2015-05-21 20:53:10 +00:00
$ ./cluster/kubectl.sh run my-nginx --image=nginx --replicas=3 --port=80
2014-09-19 13:26:34 +00:00
```
2014-08-03 19:44:33 +00:00
2014-09-19 13:26:34 +00:00
When listing the pods, you will see that three containers have been started and are in Waiting state:
2014-08-03 19:44:33 +00:00
2015-07-19 01:51:04 +00:00
```console
2015-04-15 23:07:50 +00:00
$ ./cluster/kubectl.sh get pods
2015-07-08 18:01:09 +00:00
NAME READY STATUS RESTARTS AGE
my-nginx-5kq0g 0/1 Pending 0 10s
my-nginx-gr3hh 0/1 Pending 0 10s
my-nginx-xql4j 0/1 Pending 0 10s
2014-09-19 13:26:34 +00:00
```
2014-08-03 19:44:33 +00:00
2015-06-08 15:41:28 +00:00
You need to wait for the provisioning to complete, you can monitor the nodes by doing:
2014-09-19 13:26:34 +00:00
2015-07-19 01:51:04 +00:00
```console
2015-09-24 12:07:53 +00:00
$ vagrant ssh node-1 -c 'sudo docker images'
kubernetes-node-1:
2014-11-14 16:01:59 +00:00
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
< none > < none > 96864a7d2df3 26 hours ago 204.4 MB
google/cadvisor latest e0575e677c50 13 days ago 12.64 MB
kubernetes/pause latest 6c4579af347b 8 weeks ago 239.8 kB
2014-09-19 13:26:34 +00:00
```
Once the docker image for nginx has been downloaded, the container will start and you can list it:
2015-07-19 01:51:04 +00:00
```console
2015-09-24 12:07:53 +00:00
$ vagrant ssh node-1 -c 'sudo docker ps'
kubernetes-node-1:
2014-11-14 16:01:59 +00:00
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
2015-04-16 16:11:47 +00:00
dbe79bf6e25b nginx:latest "nginx" 21 seconds ago Up 19 seconds k8s--mynginx.8c5b8a3a--7813c8bd_-_3ffe_-_11e4_-_9036_-_0800279696e1.etcd--7813c8bd_-_3ffe_-_11e4_-_9036_-_0800279696e1--fcfa837f
2014-11-14 16:01:59 +00:00
fa0e29c94501 kubernetes/pause:latest "/pause" 8 minutes ago Up 8 minutes 0.0.0.0:8080->80/tcp k8s--net.a90e7ce4--7813c8bd_-_3ffe_-_11e4_-_9036_-_0800279696e1.etcd--7813c8bd_-_3ffe_-_11e4_-_9036_-_0800279696e1--baf5b21b
2015-06-09 12:53:11 +00:00
aa2ee3ed844a google/cadvisor:latest "/usr/bin/cadvisor" 38 minutes ago Up 38 minutes k8s--cadvisor.9e90d182--cadvisor_-_agent.file--4626b3a2
2014-11-14 16:01:59 +00:00
65a3a926f357 kubernetes/pause:latest "/pause" 39 minutes ago Up 39 minutes 0.0.0.0:4194->8080/tcp k8s--net.c5ba7f0e--cadvisor_-_agent.file--342fd561
2014-09-19 13:26:34 +00:00
```
2015-05-21 00:17:01 +00:00
Going back to listing the pods, services and replicationcontrollers, you now have:
2014-09-19 13:26:34 +00:00
2015-07-19 01:51:04 +00:00
```console
2015-04-15 23:07:50 +00:00
$ ./cluster/kubectl.sh get pods
2015-07-08 18:01:09 +00:00
NAME READY STATUS RESTARTS AGE
my-nginx-5kq0g 1/1 Running 0 1m
my-nginx-gr3hh 1/1 Running 0 1m
my-nginx-xql4j 1/1 Running 0 1m
2014-09-19 13:26:34 +00:00
2015-04-15 23:07:50 +00:00
$ ./cluster/kubectl.sh get services
2015-08-08 04:08:43 +00:00
NAME CLUSTER_IP EXTERNAL_IP PORT(S) SELECTOR AGE
2015-11-12 08:28:55 +00:00
$ ./cluster/kubectl.sh get replicationcontrollers
CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS AGE
my-nginx my-nginx nginx run=my-nginx 3 1m
2014-08-03 19:44:33 +00:00
```
2014-12-04 22:56:40 +00:00
We did not start any services, hence there are none listed. But we see three replicas displayed properly.
2014-10-28 19:57:15 +00:00
Check the [guestbook ](../../examples/guestbook/README.md ) application to learn how to create a service.
2015-05-21 21:10:25 +00:00
You can already play with scaling the replicas with:
2014-08-03 19:44:33 +00:00
2015-07-19 01:51:04 +00:00
```console
2015-05-21 21:10:25 +00:00
$ ./cluster/kubectl.sh scale rc my-nginx --replicas=2
2015-04-15 23:07:50 +00:00
$ ./cluster/kubectl.sh get pods
2015-07-08 18:01:09 +00:00
NAME READY STATUS RESTARTS AGE
my-nginx-5kq0g 1/1 Running 0 2m
my-nginx-gr3hh 1/1 Running 0 2m
2014-08-03 19:44:33 +00:00
```
Congratulations!
### Troubleshooting
2014-12-12 19:08:22 +00:00
#### I keep downloading the same (large) box all the time!
2015-04-15 23:07:50 +00:00
By default the Vagrantfile will download the box from S3. You can change this (and cache the box locally) by providing a name and an alternate URL when calling `kube-up.sh`
2014-12-12 19:08:22 +00:00
2015-04-15 23:07:50 +00:00
```sh
export KUBERNETES_BOX_NAME=choose_your_own_name_for_your_kuber_box
2014-12-12 19:08:22 +00:00
export KUBERNETES_BOX_URL=path_of_your_kuber_box
export KUBERNETES_PROVIDER=vagrant
2015-04-15 23:07:50 +00:00
./cluster/kube-up.sh
2014-12-12 19:08:22 +00:00
```
2015-10-07 19:02:11 +00:00
#### I am getting timeouts when trying to curl the master from my host!
During provision of the cluster, you may see the following message:
```sh
2015-11-09 07:08:58 +00:00
Validating node-1
2015-10-07 19:02:11 +00:00
.............
2015-11-09 07:08:58 +00:00
Waiting for each node to be registered with cloud provider
2015-10-07 19:02:11 +00:00
error: couldn't read version from server: Get https://10.245.1.2/api: dial tcp 10.245.1.2:443: i/o timeout
```
Some users have reported VPNs may prevent traffic from being routed to the host machine into the virtual machine network.
To debug, first verify that the master is binding to the proper IP address:
```
$ vagrant ssh master
2015-11-09 07:08:58 +00:00
$ ifconfig | grep eth1 -C 2
eth1: flags=4163< UP , BROADCAST , RUNNING , MULTICAST > mtu 1500 inet 10.245.1.2 netmask
255.255.255.0 broadcast 10.245.1.255
2015-10-07 19:02:11 +00:00
```
Then verify that your host machine has a network connection to a bridge that can serve that address:
```sh
$ ifconfig | grep 10.245.1 -C 2
vboxnet5: flags=4163< UP , BROADCAST , RUNNING , MULTICAST > mtu 1500
inet 10.245.1.1 netmask 255.255.255.0 broadcast 10.245.1.255
inet6 fe80::800:27ff:fe00:5 prefixlen 64 scopeid 0x20< link >
ether 0a:00:27:00:00:05 txqueuelen 1000 (Ethernet)
```
If you do not see a response on your host machine, you will most likely need to connect your host to the virtual network created by the virtualization provider.
If you do see a network, but are still unable to ping the machine, check if your VPN is blocking the request.
2014-08-12 19:43:35 +00:00
#### I just created the cluster, but I am getting authorization errors!
2014-11-10 18:56:13 +00:00
You probably have an incorrect ~/.kubernetes_vagrant_auth file for the cluster you are attempting to contact.
2014-08-12 19:43:35 +00:00
2015-04-15 23:07:50 +00:00
```sh
2014-11-10 18:56:13 +00:00
rm ~/.kubernetes_vagrant_auth
2014-08-12 19:43:35 +00:00
```
2015-02-10 18:25:07 +00:00
After using kubectl.sh make sure that the correct credentials are set:
2014-08-12 19:43:35 +00:00
2015-04-15 23:07:50 +00:00
```sh
2014-10-01 23:17:51 +00:00
cat ~/.kubernetes_vagrant_auth
2015-07-19 01:51:04 +00:00
```
```json
2014-09-19 13:26:34 +00:00
{
"User": "vagrant",
"Password": "vagrant"
}
2014-08-12 19:43:35 +00:00
```
2015-04-15 23:07:50 +00:00
#### I just created the cluster, but I do not see my container running!
2014-08-03 19:44:33 +00:00
2015-07-13 04:15:58 +00:00
If this is your first time creating the cluster, the kubelet on each node schedules a number of docker pull requests to fetch prerequisite images. This can take some time and as a result may delay your initial pod getting provisioned.
2014-08-03 19:44:33 +00:00
2015-04-15 23:07:50 +00:00
#### I want to make changes to Kubernetes code!
2014-08-03 19:44:33 +00:00
2015-03-13 00:30:32 +00:00
To set up a vagrant cluster for hacking, follow the [vagrant developer guide ](../devel/developer-guides/vagrant.md ).
2014-09-19 13:26:34 +00:00
2015-06-09 12:53:11 +00:00
#### I have brought Vagrant up but the nodes cannot validate!
2014-11-03 03:27:43 +00:00
2015-09-24 12:07:53 +00:00
Log on to one of the nodes (`vagrant ssh node-1`) and inspect the salt minion log (`sudo cat /var/log/salt/minion`).
2014-11-03 03:27:43 +00:00
2015-06-08 15:41:28 +00:00
#### I want to change the number of nodes!
2014-09-19 13:26:34 +00:00
2015-11-24 03:06:36 +00:00
You can control the number of nodes that are instantiated via the environment variable `NUM_NODES` on your host machine. If you plan to work with replicas, we strongly encourage you to work with enough nodes to satisfy your largest intended replica size. If you do not plan to work with replicas, you can save some system resources by running with a single node. You do this, by setting `NUM_NODES` to 1 like so:
2014-09-19 13:26:34 +00:00
2015-04-15 23:07:50 +00:00
```sh
2015-11-24 03:06:36 +00:00
export NUM_NODES=1
2014-09-26 21:52:03 +00:00
```
2014-12-18 06:04:04 +00:00
2015-04-15 23:07:50 +00:00
#### I want my VMs to have more memory!
2015-02-08 23:53:35 +00:00
You can control the memory allotted to virtual machines with the `KUBERNETES_MEMORY` environment variable.
Just set it to the number of megabytes you would like the machines to have. For example:
2015-04-15 23:07:50 +00:00
```sh
2015-02-08 23:53:35 +00:00
export KUBERNETES_MEMORY=2048
```
2015-06-08 15:41:28 +00:00
If you need more granular control, you can set the amount of memory for the master and nodes independently. For example:
2015-04-15 23:07:50 +00:00
```sh
export KUBERNETES_MASTER_MEMORY=1536
2015-11-24 03:01:03 +00:00
export KUBERNETES_NODE_MEMORY=2048
2015-04-15 23:07:50 +00:00
```
2014-12-18 06:04:04 +00:00
#### I ran vagrant suspend and nothing works!
2015-07-17 22:35:41 +00:00
2015-07-19 05:58:13 +00:00
`vagrant suspend` seems to mess up the network. This is not supported at this time.
2015-05-14 22:12:45 +00:00
2015-07-01 19:30:22 +00:00
#### I want vagrant to sync folders via nfs!
You can ensure that vagrant uses nfs to sync folders with virtual machines by setting the KUBERNETES_VAGRANT_USE_NFS environment variable to 'true'. nfs is faster than virtualbox or vmware's 'shared folders' and does not require guest additions. See the [vagrant docs ](http://docs.vagrantup.com/v2/synced-folders/nfs.html ) for details on configuring nfs on the host. This setting will have no effect on the libvirt provider, which uses nfs by default. For example:
```sh
export KUBERNETES_VAGRANT_USE_NFS=true
```
2015-05-14 22:12:45 +00:00
2015-07-14 00:13:09 +00:00
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
2015-05-14 22:12:45 +00:00
[![Analytics ](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/getting-started-guides/vagrant.md?pixel )]()
2015-07-14 00:13:09 +00:00
<!-- END MUNGE: GENERATED_ANALYTICS -->