Cluster API configuration options for {azure-full}
You can change the configuration of your Microsoft Azure Cluster API machines by updating values in the Cluster API custom resource manifests.
Important
Managing machines with the Cluster API is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.
For more information about the support scope of Red Hat Technology Preview features, see Technology Preview Features Support Scope.
Sample YAML for configuring Microsoft Azure clusters
The following example YAML files show configurations for an Azure cluster.
Sample YAML for a Cluster API machine template resource on Microsoft Azure
The machine template resource is provider-specific and defines the basic properties of the machines that a compute machine set creates. The compute machine set references this template when creating machines.
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: AzureMachineTemplate
metadata:
name: <template_name>
namespace: openshift-cluster-api
spec:
template:
spec:
disableExtensionOperations: true
identity: UserAssigned
image:
id: /subscriptions/<subscription_id>/resourceGroups/<cluster_name>-rg/providers/Microsoft.Compute/galleries/gallery_<compliant_cluster_name>/images/<cluster_name>-gen2/versions/latest
networkInterfaces:
- acceleratedNetworking: true
privateIPConfigs: 1
subnetName: <cluster_name>-worker-subnet
osDisk:
diskSizeGB: 128
managedDisk:
storageAccountType: Premium_LRS
osType: Linux
sshPublicKey: <ssh_key_value>
userAssignedIdentities:
- providerID: 'azure:///subscriptions/<subscription_id>/resourcegroups/<cluster_name>-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/<cluster_name>-identity'
vmSize: Standard_D4s_v3
- Specify the machine template kind. This value must match the value for your platform.
- Specify a name for the machine template.
- Specify the details for your environment. The values here are examples.
- Specify an image that is compatible with your instance type.
The Hyper-V generation V2 images created by the installation program have a
-gen2suffix, while V1 images have the same name without the suffix.Note
Default OpenShift Container Platform cluster names contain hyphens (
-), which are not compatible with Azure gallery name requirements. The value of<compliant_cluster_name>in this configuration must use underscores (_) instead of hyphens to comply with these requirements. Other instances of<cluster_name>do not change.For example, a cluster name of
jdoe-test-2m2nptransforms tojdoe_test_2m2np. The full string forgallery_<compliant_cluster_name>in this example isgallery_jdoe_test_2m2np, notgallery_jdoe-test-2m2np. The complete value ofspec.template.spec.image.idfor this example value is/subscriptions/<subscription_id>/resourceGroups/jdoe-test-2m2np-rg/providers/Microsoft.Compute/galleries/gallery_jdoe_test_2m2np/images/jdoe-test-2m2np-gen2/versions/latest.
Sample YAML for a Cluster API compute machine set resource on Microsoft Azure
The compute machine set resource defines additional properties of the machines that it creates. The compute machine set also references the cluster resource and machine template when creating machines.
apiVersion: cluster.x-k8s.io/v1beta1
kind: MachineSet
metadata:
name: <machine_set_name>
namespace: openshift-cluster-api
labels:
cluster.x-k8s.io/cluster-name: <cluster_name>
spec:
clusterName: <cluster_name>
replicas: 1
selector:
matchLabels:
test: example
cluster.x-k8s.io/cluster-name: <cluster_name>
cluster.x-k8s.io/set-name: <machine_set_name>
template:
metadata:
labels:
test: example
cluster.x-k8s.io/cluster-name: <cluster_name>
cluster.x-k8s.io/set-name: <machine_set_name>
node-role.kubernetes.io/<role>: ""
spec:
bootstrap:
dataSecretName: worker-user-data
clusterName: <cluster_name>
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: AzureMachineTemplate
name: <template_name>
- Specify a name for the compute machine set.
The cluster ID, machine role, and region form a typical pattern for this value in the following format:
<cluster_name>-<role>-<region>. - Specify the cluster ID as the name of the cluster.
- Specify the machine template kind. This value must match the value for your platform.
- Specify the machine template name.