Skip to content

stuttgart-things/provider-vspherevm

Repository files navigation

provider-vspherevm

Crossplane Provider for VMware vSphere Virtual Machines, built with Upjet from terraform-provider-vsphere (v2.16.1).

Managed Resources

Kind API Group Terraform Resource Scope
VirtualMachine virtualmachine.vspherevm.stuttgart-things.com vsphere_virtual_machine Cluster + Namespaced
MachineSnapshot virtual.vspherevm.stuttgart-things.com vsphere_virtual_machine_snapshot Cluster + Namespaced
MachineClass virtual.vspherevm.stuttgart-things.com vsphere_virtual_machine_class Cluster + Namespaced

Namespaced variants use *.vspherevm.m.stuttgart-things.com API groups.

Install

# Install latest
kubectl apply -f https://raw.githubusercontent.com/stuttgart-things/provider-vspherevm/main/examples/install.yaml

# Or apply manually with a specific version
kubectl apply -f - <<'EOF'
apiVersion: pkg.crossplane.io/v1
kind: Provider
metadata:
  name: provider-vspherevm
spec:
  package: ghcr.io/stuttgart-things/provider-vspherevm-xpkg:latest
EOF

Pinned version: See examples/install.yaml for the latest tested release version.

Configure Credentials

Create a Secret with vSphere credentials:

kubectl create secret generic vsphere-creds -n crossplane-system \
  --from-literal=credentials='{"user":"administrator@vsphere.local","password":"...","server":"vcenter.example.com","allow_unverified_ssl":"true"}'

Apply a ProviderConfig:

apiVersion: vspherevm.stuttgart-things.com/v1beta1
kind: ProviderConfig
metadata:
  name: default
spec:
  credentials:
    source: Secret
    secretRef:
      name: vsphere-creds
      namespace: crossplane-system
      key: credentials

Example: Create a VM

apiVersion: virtualmachine.vspherevm.stuttgart-things.com/v1alpha1
kind: VirtualMachine
metadata:
  name: my-vm
spec:
  forProvider:
    name: my-crossplane-vm
    resourcePoolId: "${RESOURCE_POOL_ID}"
    datastoreId: "${DATASTORE_ID}"
    numCpus: 2
    memory: 4096
    guestId: ubuntu64Guest
    networkInterface:
      - networkId: "${NETWORK_ID}"
    disk:
      - size: 40
        thinProvisioned: true
  providerConfigRef:
    name: default

Documentation

  • Overview -- features, architecture, credential mapping
  • Development -- code generation, prerequisites, gotchas
  • Deployment -- container image, xpkg, local dev
  • CI/CD -- GitHub Actions workflows, semantic-release
  • Testing -- Kind cluster, e2e tests

Development

Run code generation:

go run cmd/generator/main.go "$PWD"

Build:

go build ./...

Report a Bug

Open an issue.

About

Crossplane Provider for VMware vSphere Virtual Machines, built with Upjet from the terraform-provider-vsphere

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

 
 
 

Contributors