# vSphere Quickstart Terraform configs for Debian-based operating system

The vSphere Quickstart Terraform configs can be used to create the needed
infrastructure for a Kubernetes HA cluster. Check out the following
[Creating Infrastructure guide][docs-infrastructure] to learn more about how to
use the configs and how to provision a Kubernetes cluster using KubeOne.

These Terraform configs are supposed to be used with Debian-based operating
systems that support vApp (e.g. Ubuntu). For more information on how to prepare
a template VM to be used with these configs, check out our [Ubuntu Template VM]
guide.

We also provide Terraform configs for [CentOS-based operating systems](../vsphere_centos)
and [Flatcar Linux](../vsphere_flatcar).

[Ubuntu Template VM]: https://docs.kubermatic.com/kubeone/main/guides/vsphere-template-vm/ubuntu/

## Required environment variables

* `VSPHERE_USER`
* `VSPHERE_PASSWORD`
* `VSPHERE_SERVER`
* `VSPHERE_ALLOW_UNVERIFIED_SSL`

## How to prepare a template

See <https://github.com/kubermatic/machine-controller/blob/main/docs/vsphere.md>

## Networking

KubeOne supports both IPv4 only and IPv4+IPv6 dual-stack clusters. With the given terraform configuration it is assumed that DHCP is supported and enabled on the network. If you want to use static IPs, you need to modify the terraform configuration accordingly.

Based on IP assignment in terraform, we assume that the first IP would be IPv4 and the second IP would be IPv6. As for IP assignment, the first address or the default address is the first IPv4 address that is reachable through the default gateway configured on the machine, then the first reachable IPv6 address, and then the first general discovered address if neither exist.

## Kubernetes API Server Load Balancing

See the [Terraform loadbalancers in examples document][docs-tf-loadbalancer].

[docs-infrastructure]: https://docs.kubermatic.com/kubeone/main/guides/using-terraform-configs/
[docs-tf-loadbalancer]: https://docs.kubermatic.com/kubeone/main/examples/ha-load-balancing/

