Skip to content

mylesagray/vspherecompute-operator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bridging Infrastructure and Applications (BIA) - vSphereCompute

A very rough K8s operator and CRD scheme for creating and deleting vSphere compute types (VMs).

Setup

Config

Requires Kubernetes 1.13+

Update the value field for the following in deploy/operator.yaml to reflect your environment:

- name: GOVC_URL
  value: "https://username:password@vCenterFQDNorIP"

Import the vSphereCompute CRDs

kubectl create -f deploy/crds/bia_v1alpha1_vspherecompute_crd.yaml

Import the operator

kubectl create -f deploy/

Usage

Create a vSphereCompute object reflecting the VM(s) you want created, an example can be found at deploy/crds/bia_v1alpha1_vspherecompute_cr.yaml

Import the vSphereCompute object into K8s:

kubectl create -f deploy/crds/bia_v1alpha1_vspherecompute_cr.yaml

A VM will be spun up on the environment as specified in deploy/operator.yaml.

Get the current BIA deployed and managed VMs

$ kubectl get vc
NAME          VMNAME        STATUS      CPUS   MEMORY   IP    HOST
hello-world   hello-world   poweredOn   2      2048           host-28

Cleanup

kubectl delete -f deploy/crds/
kubectl delete -f deploy/

Known Issues

  • Lots of hard coded values. Tons.
  • Uses a hammer-solution of govc instead of govmomi to interact with VC via os.exec
  • Doesn't use the VMware VCP settings set on the cluster - relies on it's own ENV vars
  • Only CPU, Memory and VMName implemented from CR spec so far.
  • Doesnt resolve VC moref-ids to human-relatable names.
  • Does not update VMs with patched changes.
  • Likely uses the wrong call for deleting VMs.

Future work

  • Deploy nodes with Cluster API?
  • FCD and SPBM policy
  • Create a network and use Cluster API to bootstrap.

About

K8s Operator for vSphere VMs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors