Skip to content

Commit

Permalink
Standalone esx (kubernetes-sigs#264)
Browse files Browse the repository at this point in the history
* add standalone esx support

* move all glog to klog

* Fixed machine provisioning on ESXi.

- fixed boot sequence on some images (e.g. xenial)
- fixed sudo on machines without DNS access
- fixed cloud provider bootstrap
- fixed rbac role preventing machine deletion
- refactored templates.go and the esx cloning code

Fixed boot sequence on some images by adding a serial port to allow random
number initialization.  This affect some images like Xenial.  It currently
adds a serial port to all machines if it doesn't already in the vm spec.
Fixed sudo access for machines without DNS access, which for most development
scenarios in nested ESXi on dev laptops.  Fixed cloud provider bootstrapping
on infrastructure that do not have cloud provider support (e.g. ESXi)

issue kubernetes-sigs#177
  • Loading branch information
Loc Nguyen authored and k8s-ci-robot committed Jun 3, 2019
1 parent 0ec7a86 commit b5f2a28
Show file tree
Hide file tree
Showing 20 changed files with 4,086 additions and 629 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.10.3 as builder
FROM golang:1.12 as builder

# Copy in the go src
WORKDIR /go/src/sigs.k8s.io/cluster-api-provider-vsphere
Expand Down
2 changes: 1 addition & 1 deletion cmd/clusterctl/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the cluster binary
FROM golang:1.10.3 as builder
FROM golang:1.12 as builder

# Copy in the go src
WORKDIR /go/src/sigs.k8s.io/cluster-api-provider-vsphere
Expand Down
8 changes: 8 additions & 0 deletions config/rbac/rbac_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,11 @@ rules:
- update
- patch
- delete
- apiGroups:
- ""
resources:
- nodes
verbs:
- list
- get
- watch
7 changes: 4 additions & 3 deletions docs/self-service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@

The following is a quick how-to-use guide on using the cluster api on a vCenter infrastructure. Before beginning, make sure you have the following requirements:

1. vCenter 6.5 cluster
1. vCenter 6.5+ cluster or ESXi 6.5+
- You will need to gather some information about the cluster, described below.
2. golang 1.10+
- [ESXi provisioning](./esx_provisioning.md) should be used for development purposes only.
2. golang 1.12+
3. a type 2 desktop hypervisor (Vmware Fusion/Workstation or VirtualBox)
4. GOPATH environment set
5. dep installed (https://github.com/golang/dep)
6. kustomize V2 installed (https://github.com/kubernetes-sigs/kustomize/blob/master/docs/INSTALL.md)
7. kubebuilder installed (https://book.kubebuilder.io/quick_start.html)

**Be aware, the current repo supports deploying Kubernetes 1.11.x and above. Older versions maybe supported in the future.**
**Be aware, the current repo supports deploying Kubernetes 1.11.x and above.**

### Decide on whether to use minikube or kind as your bootstrapper

Expand Down
27 changes: 27 additions & 0 deletions docs/self-service/esx_provisioning.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Provisioning on ESXi

This cluster api provider is capable of provisioning clusters on ESXi with some limitations. It was written as a
productivity tool for developers of this provider. Some of the limitations are as follows,

1. The vSphere cloud provider is not available on ESXi. All features provided by the cloud provider will be
unavailable to clusters provisioned to ESXi.
2. VM cloning is available on vCenter but not on ESXi. The VM creation process currently is unable to resize the
machine's disk yet. This may change in the future.

Provioning on ESXi is very similar to provisioning on vCenter. Make sure to read the [main Quickstart intro](
./README.md) to learn the basics. This page will discuss the differences, which are simple changes to the cluster
and machine definition files. The vSphere Cluster API provider will automatically detect whether the infrastructure
is vCenter or ESXi; however, some of the changes to the definition files will ensure the cluster is properly
functioning once it is provisioned.

### Cluster definition files

The cluster definition file remain largely the same as for deploying to vCenter. The one thing to watch out for is
to make sure the cidr ranges do not overlap with the subnet of your ESXi's network. If the pod cidr ranges overlap,
the CNI plugin may fail to deploy correctly. As an example, suppose a developer deploys an ESXi host and uses the
internal gateway server as the DNS server, make sure the pod CIDR does not overlap with the ESXi host's DHCP IP range.

### Machine definition files

The machine definition files remain largely the same. Make sure to leave `datacenter` and `resourcePool` empty.
These fields are irrelevant for ESXi.
Loading

0 comments on commit b5f2a28

Please sign in to comment.