Skip to content

Latest commit

 

History

History
94 lines (72 loc) · 2.8 KB

capi-modifying-machine-template.adoc

File metadata and controls

94 lines (72 loc) · 2.8 KB

Modifying a Cluster API machine template

You can update the machine template resource for your cluster by modifying the YAML manifest file and applying it with the {oc-first}.

Prerequisites
  • You have deployed an {product-title} cluster that uses the Cluster API.

  • You have access to the cluster using an account with cluster-admin permissions.

  • You have installed the {oc-first}.

Procedure
  1. List the machine template resource for your cluster by running the following command:

    $ oc get <machine_template_kind> (1)
    1. Specify the value that corresponds to your platform. The following values are valid:

      Cluster cloud provider Value

      {aws-full}

      AWSMachineTemplate

      {gcp-full}

      GCPMachineTemplate

      {azure-first}

      AzureMachineTemplate

      {rh-openstack}

      OpenStackMachineTemplate

      {vmw-full}

      VSphereMachineTemplate

    Example output
    NAME              AGE
    <template_name>   77m
  2. Write the machine template resource for your cluster to a file that you can edit by running the following command:

    $ oc get <machine_template_kind> <template_name> -o yaml > <template_name>.yaml

    where <template_name> is the name of the machine template resource for your cluster.

  3. Make a copy of the <template_name>.yaml file with a different name. This procedure uses <modified_template_name>.yaml as an example file name.

  4. Use a text editor to make changes to the <modified_template_name>.yaml file that defines the updated machine template resource for your cluster. When editing the machine template resource, observe the following:

    • The parameters in the spec stanza are provider specific. For more information, see the sample Cluster API machine template YAML for your provider.

    • You must use a value for the metadata.name parameter that differs from any existing values.

      Important

      For any Cluster API compute machine sets that reference this template, you must update the spec.template.spec.infrastructureRef.name parameter to match the metadata.name value in the new machine template resource.

  5. Apply the machine template CR by running the following command:

    $ oc apply -f <modified_template_name>.yaml (1)
    1. Use the edited YAML file with a new name.

Next steps
  • For any Cluster API compute machine sets that reference this template, update the spec.template.spec.infrastructureRef.name parameter to match the metadata.name value in the new machine template resource. For more information, see "Updating compute machine configurations."