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/vsphere.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-06-22 19:39:35 +00:00
|
|
|
Getting started with vSphere
|
|
|
|
-------------------------------
|
2014-08-25 03:19:28 +00:00
|
|
|
|
2014-10-11 04:23:12 +00:00
|
|
|
The example below creates a Kubernetes cluster with 4 worker node Virtual
|
|
|
|
Machines and a master Virtual Machine (i.e. 5 VMs in your cluster). This
|
|
|
|
cluster is set up and controlled from your workstation (or wherever you find
|
|
|
|
convenient).
|
|
|
|
|
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)
|
|
|
|
- [Starting a cluster](#starting-a-cluster)
|
|
|
|
- [Extra: debugging deployment failure](#extra-debugging-deployment-failure)
|
2015-06-22 18:56:19 +00:00
|
|
|
|
2014-08-25 03:19:28 +00:00
|
|
|
### Prerequisites
|
|
|
|
|
|
|
|
1. You need administrator credentials to an ESXi machine or vCenter instance.
|
2015-12-02 17:54:21 +00:00
|
|
|
2. You must have Go (see [here](../devel/development.md#go-versions) for supported versions) installed: [www.golang.org](http://www.golang.org).
|
2014-08-25 17:01:25 +00:00
|
|
|
3. You must have your `GOPATH` set up and include `$GOPATH/bin` in your `PATH`.
|
|
|
|
|
|
|
|
```sh
|
|
|
|
export GOPATH=$HOME/src/go
|
|
|
|
mkdir -p $GOPATH
|
|
|
|
export PATH=$PATH:$GOPATH/bin
|
|
|
|
```
|
|
|
|
|
|
|
|
4. Install the govc tool to interact with ESXi/vCenter:
|
2014-08-25 03:19:28 +00:00
|
|
|
|
|
|
|
```sh
|
|
|
|
go get github.com/vmware/govmomi/govc
|
|
|
|
```
|
2014-08-25 17:01:25 +00:00
|
|
|
|
2014-10-11 04:23:12 +00:00
|
|
|
5. Get or build a [binary release](binary_release.md)
|
2014-08-25 03:19:28 +00:00
|
|
|
|
|
|
|
### Setup
|
|
|
|
|
2016-01-13 21:29:16 +00:00
|
|
|
Download a prebuilt Debian 8.2 VMDK that we'll use as a base image:
|
2014-08-25 03:19:28 +00:00
|
|
|
|
|
|
|
```sh
|
2016-01-13 21:29:16 +00:00
|
|
|
curl --remote-name-all https://storage.googleapis.com/govmomi/vmdk/2016-01-08/kube.vmdk.gz{,.md5}
|
2014-08-25 03:19:28 +00:00
|
|
|
md5sum -c kube.vmdk.gz.md5
|
|
|
|
gzip -d kube.vmdk.gz
|
|
|
|
```
|
|
|
|
|
2014-11-12 00:12:16 +00:00
|
|
|
Import this VMDK into your vSphere datastore:
|
2014-08-25 03:19:28 +00:00
|
|
|
|
|
|
|
```sh
|
2016-01-13 21:29:16 +00:00
|
|
|
export GOVC_URL='hostname' # hostname of the vc
|
|
|
|
export GOVC_USER='username' # username for logging into the vsphere.
|
|
|
|
export GOVC_PASSWORD='password' # password for the above username
|
|
|
|
export GOVC_NETWORK='Network Name' # Name of the network the vms should join. Many times it could be "VM Network"
|
2014-09-10 00:17:41 +00:00
|
|
|
export GOVC_INSECURE=1 # If the host above uses a self-signed cert
|
2014-08-25 03:19:28 +00:00
|
|
|
export GOVC_DATASTORE='target datastore'
|
2014-09-10 00:17:41 +00:00
|
|
|
export GOVC_RESOURCE_POOL='resource pool or cluster with access to datastore'
|
2014-08-25 03:19:28 +00:00
|
|
|
|
2014-09-10 00:17:41 +00:00
|
|
|
govc import.vmdk kube.vmdk ./kube/
|
2014-08-25 03:19:28 +00:00
|
|
|
```
|
|
|
|
|
2014-11-12 00:12:16 +00:00
|
|
|
Verify that the VMDK was correctly uploaded and expanded to ~3GiB:
|
2014-08-25 03:19:28 +00:00
|
|
|
|
|
|
|
```sh
|
2014-09-10 00:17:41 +00:00
|
|
|
govc datastore.ls ./kube/
|
2014-08-25 03:19:28 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
Take a look at the file `cluster/vsphere/config-common.sh` fill in the required
|
|
|
|
parameters. The guest login for the image that you imported is `kube:kube`.
|
|
|
|
|
2014-10-11 04:23:12 +00:00
|
|
|
### Starting a cluster
|
2014-08-25 03:19:28 +00:00
|
|
|
|
2014-10-11 04:23:12 +00:00
|
|
|
Now, let's continue with deploying Kubernetes.
|
2016-01-13 21:29:16 +00:00
|
|
|
This process takes about ~20-30 minutes depending on your network.
|
2014-08-25 03:19:28 +00:00
|
|
|
|
2014-10-11 04:23:12 +00:00
|
|
|
```sh
|
2014-10-29 20:00:47 +00:00
|
|
|
cd kubernetes # Extracted binary release OR repository root
|
2014-08-25 03:19:28 +00:00
|
|
|
export KUBERNETES_PROVIDER=vsphere
|
|
|
|
cluster/kube-up.sh
|
|
|
|
```
|
|
|
|
|
|
|
|
Refer to the top level README and the getting started guide for Google Compute
|
|
|
|
Engine. Once you have successfully reached this point, your vSphere Kubernetes
|
|
|
|
deployment works just as any other one!
|
|
|
|
|
|
|
|
**Enjoy!**
|
2014-10-11 04:23:12 +00:00
|
|
|
|
|
|
|
### Extra: debugging deployment failure
|
|
|
|
|
|
|
|
The output of `kube-up.sh` displays the IP addresses of the VMs it deploys. You
|
|
|
|
can log into any VM as the `kube` user to poke around and figure out what is
|
|
|
|
going on (find yourself authorized with your SSH key, or use the password
|
|
|
|
`kube` otherwise).
|
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/vsphere.md?pixel)]()
|
2015-07-14 00:13:09 +00:00
|
|
|
<!-- END MUNGE: GENERATED_ANALYTICS -->
|