An open API service indexing awesome lists of open source software.

https://github.com/stuttgart-things/provider-vspherevm

Crossplane Provider for VMware vSphere Virtual Machines, built with Upjet from the terraform-provider-vsphere
https://github.com/stuttgart-things/provider-vspherevm

crossplane crossplane-provider terraform upjet vsphere

Last synced: 1 day ago
JSON representation

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

Awesome Lists containing this project

README

          

# provider-vspherevm

Crossplane Provider for VMware vSphere Virtual Machines, built with [Upjet](https://github.com/crossplane/upjet) from [terraform-provider-vsphere](https://github.com/vmware/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

```bash
# 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](examples/install.yaml) for the latest tested release version.

## Configure Credentials

Create a Secret with vSphere credentials:

```bash
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:

```yaml
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

```yaml
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](docs/index.md) -- features, architecture, credential mapping
- [Development](docs/dev.md) -- code generation, prerequisites, gotchas
- [Deployment](docs/deployment.md) -- container image, xpkg, local dev
- [CI/CD](docs/cicd.md) -- GitHub Actions workflows, semantic-release
- [Testing](docs/testing.md) -- Kind cluster, e2e tests

## Development

Run code generation:
```console
go run cmd/generator/main.go "$PWD"
```

Build:
```console
go build ./...
```

## Report a Bug

Open an [issue](https://github.com/stuttgart-things/provider-vspherevm/issues).