1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/installation-creating-azure-bootstrap.adoc
2024-11-28 14:22:03 +00:00

131 lines
4.8 KiB
Plaintext

// Module included in the following assemblies:
//
// * installing/installing_azure/installing-azure-user-infra.adoc
// * installing/installing_azure_stack_hub/installing-azure-stack-hub-user-infra.adoc
// * installing/installing_azure/installing-restricted-networks-azure-user-provisioned.adoc
ifeval::["{context}" == "installing-azure-user-infra"]
:azure:
:cp: Azure
endif::[]
ifeval::["{context}" == "installing-azure-stack-hub-user-infra"]
:ash:
:cp: Azure Stack Hub
endif::[]
ifeval::["{context}" == "installing-restricted-networks-azure-user-provisioned"]
:azure:
:cp: Azure
endif::[]
:_mod-docs-content-type: PROCEDURE
[id="installation-creating-azure-bootstrap_{context}"]
= Creating the bootstrap machine in {cp}
You must create the bootstrap machine in Microsoft {cp} to use during
{product-title} cluster initialization. One way to create this machine is to
modify the provided Azure Resource Manager (ARM) template.
[NOTE]
====
If you do not use the provided ARM template to create your bootstrap machine,
you must review the provided information and manually create the infrastructure.
If your cluster does not initialize correctly, you might have to contact Red Hat
support with your installation logs.
====
.Prerequisites
* Create and configure networking and load balancers in {cp}.
ifndef::ash[]
* Create the {cp} identity and grant the appropriate roles.
endif::ash[]
.Procedure
. Copy the template from the *ARM template for the bootstrap machine* section of
this topic and save it as `04_bootstrap.json` in your cluster's installation directory. This template
describes the bootstrap machine that your cluster requires.
. Export the bootstrap URL variable:
+
[source,terminal]
----
$ bootstrap_url_expiry=`date -u -d "10 hours" '+%Y-%m-%dT%H:%MZ'`
----
+
[source,terminal]
----
$ export BOOTSTRAP_URL=`az storage blob generate-sas -c 'files' -n 'bootstrap.ign' --https-only --full-uri --permissions r --expiry $bootstrap_url_expiry --account-name ${CLUSTER_NAME}sa --account-key ${ACCOUNT_KEY} -o tsv`
----
. Export the bootstrap ignition variable:
ifdef::azure[]
+
[source,terminal]
----
$ export BOOTSTRAP_IGNITION=`jq -rcnM --arg v "3.2.0" --arg url ${BOOTSTRAP_URL} '{ignition:{version:$v,config:{replace:{source:$url}}}}' | base64 | tr -d '\n'`
----
endif::azure[]
ifdef::ash[]
.. If your environment uses a public certificate authority (CA), run this command:
+
[source,terminal]
----
$ export BOOTSTRAP_IGNITION=`jq -rcnM --arg v "3.2.0" --arg url ${BOOTSTRAP_URL} '{ignition:{version:$v,config:{replace:{source:$url}}}}' | base64 | tr -d '\n'`
----
.. If your environment uses an internal CA, you must add your PEM encoded bundle to the bootstrap ignition stub so that your bootstrap virtual machine can pull the bootstrap ignition from the storage account. Run the following commands, which assume your CA is in a file called `CA.pem`:
+
[source,terminal]
----
$ export CA="data:text/plain;charset=utf-8;base64,$(cat CA.pem |base64 |tr -d '\n')"
----
+
[source,terminal]
----
$ export BOOTSTRAP_IGNITION=`jq -rcnM --arg v "3.2.0" --arg url "$BOOTSTRAP_URL" --arg cert "$CA" '{ignition:{version:$v,security:{tls:{certificateAuthorities:[{source:$cert}]}},config:{replace:{source:$url}}}}' | base64 | tr -d '\n'`
----
endif::ash[]
. Create the deployment by using the `az` CLI:
+
ifdef::azure[]
[source,terminal]
----
$ az deployment group create -g ${RESOURCE_GROUP} \
--template-file "<installation_directory>/04_bootstrap.json" \
--parameters bootstrapIgnition="${BOOTSTRAP_IGNITION}" \ <1>
--parameters baseName="${INFRA_ID}" \ <2>
--parameter bootstrapVMSize="Standard_D4s_v3" <3>
----
<1> The bootstrap Ignition content for the bootstrap cluster.
<2> The base name to be used in resource names; this is usually the cluster's infrastructure ID.
<3> Optional: Specify the size of the bootstrap VM. Use a VM size compatible with your specified architecture. If this value is not defined, the default value from the template is set.
endif::azure[]
ifdef::ash[]
[source,terminal]
----
$ az deployment group create --verbose -g ${RESOURCE_GROUP} \
--template-file "<installation_directory>/04_bootstrap.json" \
--parameters bootstrapIgnition="${BOOTSTRAP_IGNITION}" \ <1>
--parameters baseName="${INFRA_ID}" \ <2>
--parameters diagnosticsStorageAccountName="${CLUSTER_NAME}sa" <3>
----
<1> The bootstrap Ignition content for the bootstrap cluster.
<2> The base name to be used in resource names; this is usually the cluster's infrastructure ID.
<3> The name of the storage account for your cluster.
endif::ash[]
ifeval::["{context}" == "installing-azure-user-infra"]
:!azure:
:!cp: Azure
endif::[]
ifeval::["{context}" == "installing-azure-stack-hub-user-infra"]
:!ash:
:!cp: Azure Stack Hub
endif::[]
ifeval::["{context}" == "installing-restricted-networks-azure-user-provisioned"]
:!azure:
:!cp: Azure
endif::[]