1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 21:46:22 +01:00
Files
openshift-docs/modules/capi-creating-machine-template.adoc
2024-06-13 18:53:17 +00:00

70 lines
2.0 KiB
Plaintext

// Module included in the following assemblies:
//
// * machine_management/cluster_api_machine_management/cluster-api-configuration.adoc
:_mod-docs-content-type: PROCEDURE
[id="capi-creating-machine-template_{context}"]
= Creating a Cluster API machine template
You can create a provider-specific machine template resource by creating a YAML manifest file and applying it with the {oc-first}.
.Prerequisites
* You have deployed an {product-title} cluster.
* You have enabled the use of the Cluster API.
* You have access to the cluster using an account with `cluster-admin` permissions.
* You have installed the {oc-first}.
* You have created and applied the cluster and infrastructure resources.
.Procedure
. Create a YAML file similar to the following. This procedure uses `<machine_template_resource_file>.yaml` as an example file name.
+
--
[source,yaml]
----
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: <machine_template_kind> # <1>
metadata:
name: <template_name> # <2>
namespace: openshift-cluster-api
spec:
template:
spec: # <3>
----
<1> Specify the machine template kind. This value must match the value for your platform. The following values are valid:
* `AWSMachineTemplate`: The cluster is running on {aws-first}.
* `GCPMachineTemplate`: The cluster is running on {gcp-first}.
* `VSphereMachineTemplate`: The cluster is running on {vmw-first}.
<2> Specify a name for the machine template.
<3> Specify the details for your environment. These parameters are provider specific. For more information, see the sample Cluster API machine template YAML for your provider.
--
. Create the machine template CR by running the following command:
+
[source,terminal]
----
$ oc create -f <machine_template_resource_file>.yaml
----
.Verification
* Confirm that the machine template CR is created by running the following command:
+
[source,terminal]
----
$ oc get <machine_template_kind>
----
+
where `<machine_template_kind>` is the value that corresponds to your platform.
+
.Example output
[source,text]
----
NAME AGE
<template_name> 77m
----