KubeOne can create the control plane VMs and the kube-apiserver load balancer on Azure itself, so you don’t have to create them with Terraform.
When controlPlane.nodeSets is set together with
cloudProvider.azure.controlPlane, kubeone apply:
apiEndpoint from the public IP address.The azure-managed-control-plane Terraform configs create this
infrastructure, but no control plane VMs or load balancer. Use the values of
the networking and vm Terraform outputs in cloudProviderSpec of the
nodeSets.
KubeOne reads the Azure credentials from the credentials file or from the environment:
ARM_CLIENT_ID: <client-id>
ARM_CLIENT_SECRET: <client-secret>
ARM_TENANT_ID: <tenant-id>
ARM_SUBSCRIPTION_ID: <subscription-id>
KubeOne passes them to machine-controller as the corresponding AZURE_*
variables.
apiVersion: kubeone.k8c.io/v1beta2
kind: KubeOneCluster
name: my-cluster
versions:
kubernetes: 1.36.2
cloudProvider:
external: true
azure:
controlPlane:
loadBalancer:
# Name of the load balancer. Default: "<CLUSTER_NAME>-kubeapi"
name: my-cluster-kubeapi
# Default: resourceGroup of the first nodeSet
resourceGroup: my-cluster-rg
# Default: location of the first nodeSet
location: westeurope
# "Standard" (default) or "Basic"
sku: Standard
# Name of the public IP. Default: "<LOAD_BALANCER_NAME>-pubip"
publicIPName: my-cluster-kubeapi-pubip
controlPlane:
nodeSets:
- name: cp
replicas: 3
operatingSystem: ubuntu
ssh:
publicKeys:
- ssh-ed25519 AAAA...
username: ubuntu
cloudProviderSpec:
# Values of the `networking` Terraform output
location: westeurope
resourceGroup: my-cluster-rg
vnetName: my-cluster-vpc
subnetName: my-cluster-subnet
securityGroupName: my-cluster-sg
routeTableName: my-cluster-rt
availabilitySet: my-cluster-avset
loadBalancerSku: Standard
# Values of the `vm` Terraform output
imageReference:
publisher: Canonical
offer: ubuntu-24_04-lts
sku: server-gen1
version: latest
vmSize: Standard_F2s_v2
assignPublicIP: true
publicIPSKU: Standard
The cloudProviderSpec is the machine-controller Azure provider
spec.
| Field | Default | Description |
|---|---|---|
name | <CLUSTER_NAME>-kubeapi | Name of the load balancer |
resourceGroup | resourceGroup of the first nodeSet | Resource group of the load balancer and the public IP |
location | location of the first nodeSet | Region of the load balancer and the public IP |
sku | Standard | Load balancer SKU: Standard or Basic |
publicIPName | <LOAD_BALANCER_NAME>-pubip | Name of the public IP of the load balancer |
During kubeone apply, KubeOne uses the Azure Network API to:
If apiEndpoint is already known from a previous run, KubeOne skips the load
balancer step.
kubeone apply --manifest kubeone.yaml --credentials credentials.yaml
kubeone reset --manifest kubeone.yaml --credentials credentials.yaml \
--destroy-control-plane \
--destroy-control-plane-load-balancer
This deletes the control plane VMs, the load balancer and its public IP. Then
delete the rest of the infrastructure with terraform destroy.