This document describes some possible approaches for managing the infrastructure needed for a Kubernetes cluster.
It’s the user’s responsibility to create and manage the infrastructure for the control plane. In order to help with this, KubeOne integrates with Terraform by reading the information about the infrastructure from the Terraform state, and provides example Terraform configurations that can be used to get started. The example Terraform configs can be found in the KubeOne’s GitHub repository.
The example Terraform configurations are optimized for the CI and might not be production-ready out of the box. We advise checking the Production Recommendations document for more details about making the example configurations suitable for the production usage.
If you’re using our example Terraform configs, KubeOne’s infrastructure requirements are satisfied out of the box.
The following infrastructure requirements must be satisfied to successfully provision a Kubernetes cluster using KubeOne:
ip link
or ifconfig -a
sudo cat /sys/class/dmi/id/product_uuid
6443
, 2379
, 2380
, 10250
, 10251
, 10252
Depending on the environment, you may need additional objects, such as VPCs, firewall rules, or images. For officially-supported providers, we recommended checking our example Terraform configs as a reference what objects you should be created. In addition, options for multi-zone deployments are shown for selected providers.
Instances for worker nodes can be managed in two ways:
Using Kubermatic machine-controller is highly advised if your provider is officially-supported. Otherwise, KubeOne Static Workers are recommended instead. More details about the machine-controller and the Cluster-API can be found in the Concepts document.
The requirements for the worker instances are similar as for the control plane instances:
ip link
or ifconfig -a
sudo cat /sys/class/dmi/id/product_uuid
10250
, and optionally 30000-32767
for
NodePort ServicesSome providers have specific requirements for Kubernetes to work properly. Those are set automatically by the machine-controller or the provided Terraform examples, therefore this section is only relevant when machines are created manually.
For the vSphere CSI driver to work correctly, machines created in vSphere need to meet the CSI driver prerequisites.
Make sure that all VMs have the disk.enableUUID
flag set to 1. This can be done using the govc tool with the following command:
govc vm.change -e="disk.enableUUID=1" -vm='/PATH/TO/VM'
The vSphere CSI driver requires that the Virtual Machine Hardware Version is 15 or newer, and the VMware Tools are installed.
KubeOne integrates with Terraform by reading the Terraform state for the information about the cluster, including:
To use the integration, you need to generate a Terraform state file using the
terraform output -json
command. KubeOne consumes the generated Terraform
state file and reads the needed information. Therefore, the generated file
must strictly follow the format used by KubeOne. To accomplish this, you
must have the appropriate output.tf
file co-located with other Terraform
files. The output.tf
file defines the template for generating the state file, including where to look for the information about the infrastructure.
For more information about how the output.tf
file should look like, you can
check our example Terraform configs and the
Terraform Integration Reference.
The needed output.tf
file already comes with all our
example Terraform configs.