1.2 additions for getting-started-guides/ and new non-Markdown files for user-guides
This commit is contained in:
@@ -8,9 +8,9 @@ Running Kubernetes with Vagrant (and VirtualBox) is an easy way to run/test/deve
|
||||
|
||||
### Prerequisites
|
||||
|
||||
1. Install latest version >= 1.6.2 of vagrant from http://www.vagrantup.com/downloads.html
|
||||
1. Install latest version >= 1.7.4 of vagrant from http://www.vagrantup.com/downloads.html
|
||||
2. Install one of:
|
||||
1. Version 4.3.28 of Virtual Box from https://www.virtualbox.org/wiki/Download_Old_Builds_4_3
|
||||
1. The latest version of Virtual Box from https://www.virtualbox.org/wiki/Downloads
|
||||
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/)
|
||||
@@ -36,11 +36,11 @@ export KUBERNETES_PROVIDER=vagrant
|
||||
|
||||
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.
|
||||
|
||||
By default, the Vagrant setup will create a single master VM (called kubernetes-master) and one node (called kubernetes-minion-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).
|
||||
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).
|
||||
|
||||
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.
|
||||
|
||||
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) environment variable:
|
||||
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:
|
||||
|
||||
```shell
|
||||
export VAGRANT_DEFAULT_PROVIDER=parallels
|
||||
@@ -54,14 +54,14 @@ To access the master or any node:
|
||||
|
||||
```shell
|
||||
vagrant ssh master
|
||||
vagrant ssh minion-1
|
||||
vagrant ssh node-1
|
||||
```
|
||||
|
||||
If you are running more than one node, you can access the others by:
|
||||
|
||||
```shell
|
||||
vagrant ssh minion-2
|
||||
vagrant ssh minion-3
|
||||
vagrant ssh node-2
|
||||
vagrant ssh node-3
|
||||
```
|
||||
|
||||
Each node in the cluster installs the docker daemon and the kubelet.
|
||||
@@ -88,7 +88,7 @@ To view the service status and/or logs on the kubernetes-master:
|
||||
To view the services on any of the nodes:
|
||||
|
||||
```shell
|
||||
[vagrant@kubernetes-master ~] $ vagrant ssh minion-1
|
||||
[vagrant@kubernetes-master ~] $ vagrant ssh node-1
|
||||
[vagrant@kubernetes-master ~] $ sudo su
|
||||
|
||||
[root@kubernetes-master ~] $ systemctl status kubelet
|
||||
@@ -205,8 +205,8 @@ my-nginx-xql4j 0/1 Pending 0 10s
|
||||
You need to wait for the provisioning to complete, you can monitor the nodes by doing:
|
||||
|
||||
```shell
|
||||
$ vagrant ssh minion-1 -c 'sudo docker images'
|
||||
kubernetes-minion-1:
|
||||
$ vagrant ssh node-1 -c 'sudo docker images'
|
||||
kubernetes-node-1:
|
||||
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
|
||||
@@ -216,8 +216,8 @@ kubernetes-minion-1:
|
||||
Once the docker image for nginx has been downloaded, the container will start and you can list it:
|
||||
|
||||
```shell
|
||||
$ vagrant ssh minion-1 -c 'sudo docker ps'
|
||||
kubernetes-minion-1:
|
||||
$ vagrant ssh node-1 -c 'sudo docker ps'
|
||||
kubernetes-node-1:
|
||||
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
||||
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
|
||||
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
|
||||
@@ -236,7 +236,10 @@ my-nginx-xql4j 1/1 Running 0 1m
|
||||
|
||||
$ ./cluster/kubectl.sh get services
|
||||
NAME CLUSTER_IP EXTERNAL_IP PORT(S) SELECTOR AGE
|
||||
my-nginx 10.0.0.1 <none> 80/TCP run=my-nginx 1h
|
||||
|
||||
$ ./cluster/kubectl.sh get replicationcontrollers
|
||||
CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS AGE
|
||||
my-nginx my-nginx nginx run=my-nginx 3 1m
|
||||
```
|
||||
|
||||
We did not start any services, hence there are none listed. But we see three replicas displayed properly.
|
||||
@@ -266,6 +269,43 @@ export KUBERNETES_PROVIDER=vagrant
|
||||
./cluster/kube-up.sh
|
||||
```
|
||||
|
||||
#### I am getting timeouts when trying to curl the master from my host!
|
||||
|
||||
During provision of the cluster, you may see the following message:
|
||||
|
||||
```shell
|
||||
Validating node-1
|
||||
.............
|
||||
Waiting for each node to be registered with cloud provider
|
||||
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
|
||||
$ 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
|
||||
```
|
||||
|
||||
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.
|
||||
|
||||
#### I just created the cluster, but I am getting authorization errors!
|
||||
|
||||
You probably have an incorrect ~/.kubernetes_vagrant_auth file for the cluster you are attempting to contact.
|
||||
@@ -297,14 +337,14 @@ To set up a vagrant cluster for hacking, follow the [vagrant developer guide](ht
|
||||
|
||||
#### I have brought Vagrant up but the nodes cannot validate!
|
||||
|
||||
Log on to one of the nodes (`vagrant ssh minion-1`) and inspect the salt minion log (`sudo cat /var/log/salt/minion`).
|
||||
Log on to one of the nodes (`vagrant ssh node-1`) and inspect the salt minion log (`sudo cat /var/log/salt/minion`).
|
||||
|
||||
#### I want to change the number of nodes!
|
||||
|
||||
You can control the number of nodes that are instantiated via the environment variable `NUM_MINIONS` 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_MINIONS` to 1 like so:
|
||||
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:
|
||||
|
||||
```shell
|
||||
export NUM_MINIONS=1
|
||||
export NUM_NODES=1
|
||||
```
|
||||
|
||||
#### I want my VMs to have more memory!
|
||||
@@ -320,7 +360,7 @@ If you need more granular control, you can set the amount of memory for the mast
|
||||
|
||||
```shell
|
||||
export KUBERNETES_MASTER_MEMORY=1536
|
||||
export KUBERNETES_MINION_MEMORY=2048
|
||||
export KUBERNETES_NODE_MEMORY=2048
|
||||
```
|
||||
|
||||
#### I ran vagrant suspend and nothing works!
|
||||
@@ -329,8 +369,8 @@ export KUBERNETES_MINION_MEMORY=2048
|
||||
|
||||
#### 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) 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:
|
||||
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:
|
||||
|
||||
```shell
|
||||
export KUBERNETES_VAGRANT_USE_NFS=true
|
||||
```
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user