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).
GOPATH
set up and include $GOPATH/bin
in your PATH
.export GOPATH=$HOME/src/go
mkdir -p $GOPATH
export PATH=$PATH:$GOPATH/bin
go get github.com/vmware/govmomi/govc
Download a prebuilt Debian 8.2 VMDK that we’ll use as a base image:
curl --remote-name-all https://storage.googleapis.com/govmomi/vmdk/2016-01-08/kube.vmdk.gz{,.md5}
md5sum -c kube.vmdk.gz.md5
gzip -d kube.vmdk.gz
Import this VMDK into your vSphere datastore:
export GOVC_URL='hostname' # hostname of the vc
export GOVC_USERNAME='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"
export GOVC_INSECURE=1 # If the host above uses a self-signed cert
export GOVC_DATASTORE='target datastore'
export GOVC_RESOURCE_POOL='resource pool or cluster with access to datastore'
export GOVC_GUEST_LOGIN='kube:kube' # Used for logging into kube.vmdk during deployment.
govc import.vmdk kube.vmdk ./kube/
Verify that the VMDK was correctly uploaded and expanded to ~3GiB:
govc datastore.ls ./kube/
If you need to debug any part of the deployment, the guest login for
the image that you imported is kube:kube
. It is normally specified
in the GOVC_GUEST_LOGIN parameter above.
Also take a look at the file cluster/vsphere/config-default.sh
and
make any needed changes. You can configure the number of nodes
as well as the IP subnets you have made available to Kubernetes, pods,
and services.
Now, let’s continue with deploying Kubernetes. This process takes about ~20-30 minutes depending on your network.
cd kubernetes
KUBERNETES_PROVIDER=vsphere cluster/kube-up.sh
cd kubernetes
make release
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!
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).
IaaS Provider | Config. Mgmt | OS | Networking | Docs | Conforms | Support Level |
---|---|---|---|---|---|---|
Vmware vSphere | Saltstack | Debian | OVS | docs | Community (@imkin) |
For support level information on all solutions, see the Table of solutions chart.