Menu Close

4.11.12. Creating the bootstrap machine in GCP

You must create the bootstrap machine in Google Cloud Platform (GCP) to use during OpenShift Container Platform cluster initialization. One way to create this machine is to modify the provided Deployment Manager template.


If you do not use the provided Deployment Manager 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.


  • Configure a GCP account.
  • Generate the Ignition config files for your cluster.
  • Create and configure a VPC and associated subnets in GCP.
  • Create and configure networking and load balancers in GCP.
  • Create control plane and compute roles.
  • Ensure pyOpenSSL is installed.


  1. Copy the template from the Deployment Manager template for the bootstrap machine section of this topic and save it as on your computer. This template describes the bootstrap machine that your cluster requires.
  2. Export the location of the Red Hat Enterprise Linux CoreOS (RHCOS) image that the installation program requires:

    $ export CLUSTER_IMAGE=(`gcloud compute images describe ${INFRA_ID}-rhcos-image --format json | jq -r .selfLink`)
  3. Create a bucket and upload the bootstrap.ign file:

    $ gsutil mb gs://${INFRA_ID}-bootstrap-ignition
    $ gsutil cp <installation_directory>/bootstrap.ign gs://${INFRA_ID}-bootstrap-ignition/
  4. Create a signed URL for the bootstrap instance to use to access the Ignition config. Export the URL from the output as a variable:

    $ export BOOTSTRAP_IGN=`gsutil signurl -d 1h service-account-key.json gs://${INFRA_ID}-bootstrap-ignition/bootstrap.ign | grep "^gs:" | awk '{print $5}'`
  5. Create a 04_bootstrap.yaml resource definition file:

    $ cat <<EOF >04_bootstrap.yaml
    - path:
    - name: cluster-bootstrap
        infra_id: '${INFRA_ID}' 1
        region: '${REGION}' 2
        zone: '${ZONE_0}' 3
        cluster_network: '${CLUSTER_NETWORK}' 4
        control_subnet: '${CONTROL_SUBNET}' 5
        image: '${CLUSTER_IMAGE}' 6
        machine_type: 'n1-standard-4' 7
        root_volume_size: '128' 8
        bootstrap_ign: '${BOOTSTRAP_IGN}' 9
    infra_id is the INFRA_ID infrastructure name from the extraction step.
    region is the region to deploy the cluster into, for example us-central1.
    zone is the zone to deploy the bootstrap instance into, for example us-central1-b.
    cluster_network is the selfLink URL to the cluster network.
    control_subnet is the selfLink URL to the control subnet.
    image is the selfLink URL to the RHCOS image.
    machine_type is the machine type of the instance, for example n1-standard-4.
    root_volume_size is the boot disk size for the bootstrap machine.
    bootstrap_ign is the URL output when creating a signed URL.
  6. Create the deployment by using the gcloud CLI:

    $ gcloud deployment-manager deployments create ${INFRA_ID}-bootstrap --config 04_bootstrap.yaml
  7. The templates do not manage load balancer membership due to limitations of Deployment Manager, so you must add the bootstrap machine manually.

    1. Add the bootstrap instance to the internal load balancer instance group:

      $ gcloud compute instance-groups unmanaged add-instances \
          ${INFRA_ID}-bootstrap-instance-group --zone=${ZONE_0} --instances=${INFRA_ID}-bootstrap
    2. Add the bootstrap instance group to the internal load balancer backend service:

      $ gcloud compute backend-services add-backend \
          ${INFRA_ID}-api-internal-backend-service --region=${REGION} --instance-group=${INFRA_ID}-bootstrap-instance-group --instance-group-zone=${ZONE_0} Deployment Manager template for the bootstrap machine

You can use the following Deployment Manager template to deploy the bootstrap machine that you need for your OpenShift Container Platform cluster:

例4.25 Deployment Manager template

def GenerateConfig(context):

    resources = [{
        'name':['infra_id'] + '-bootstrap-public-ip',
        'type': 'compute.v1.address',
        'properties': {
    }, {
        'name':['infra_id'] + '-bootstrap',
        'type': 'compute.v1.instance',
        'properties': {
            'disks': [{
                'autoDelete': True,
                'boot': True,
                'initializeParams': {
            'machineType': 'zones/' +['zone'] + '/machineTypes/' +['machine_type'],
            'metadata': {
                'items': [{
                    'key': 'user-data',
                    'value': '{"ignition":{"config":{"replace":{"source":"' +['bootstrap_ign'] + '","verification":{}}},"timeouts":{},"version":"2.1.0"},"networkd":{},"passwd":{},"storage":{},"systemd":{}}',
            'networkInterfaces': [{
                'accessConfigs': [{
                    'natIP': '$(ref.' +['infra_id'] + '-bootstrap-public-ip.address)'
            'tags': {
                'items': [
          ['infra_id'] + '-master',
          ['infra_id'] + '-bootstrap'
    }, {
        'name':['infra_id'] + '-bootstrap-instance-group',
        'type': 'compute.v1.instanceGroup',
        'properties': {
            'namedPorts': [
                    'name': 'ignition',
                    'port': 22623
                }, {
                    'name': 'https',
                    'port': 6443

    return {'resources': resources}