github.com/openshift/installer@v1.4.17/upi/gcp/04_bootstrap.py (about)

     1  def GenerateConfig(context):
     2  
     3      resources = [{
     4          'name': context.properties['infra_id'] + '-bootstrap-public-ip',
     5          'type': 'compute.v1.address',
     6          'properties': {
     7              'region': context.properties['region']
     8          }
     9      }, {
    10          'name': context.properties['infra_id'] + '-bootstrap',
    11          'type': 'compute.v1.instance',
    12          'properties': {
    13              'disks': [{
    14                  'autoDelete': True,
    15                  'boot': True,
    16                  'initializeParams': {
    17                      'diskSizeGb': context.properties['root_volume_size'],
    18                      'sourceImage': context.properties['image']
    19                  }
    20              }],
    21              'machineType': 'zones/' + context.properties['zone'] + '/machineTypes/' + context.properties['machine_type'],
    22              'metadata': {
    23                  'items': [{
    24                      'key': 'user-data',
    25                      'value': '{"ignition":{"config":{"replace":{"source":"' + context.properties['bootstrap_ign'] + '"}},"version":"3.2.0"}}',
    26                  }]
    27              },
    28              'networkInterfaces': [{
    29                  'subnetwork': context.properties['control_subnet'],
    30                  'accessConfigs': [{
    31                      'natIP': '$(ref.' + context.properties['infra_id'] + '-bootstrap-public-ip.address)'
    32                  }]
    33              }],
    34              'tags': {
    35                  'items': [
    36                      context.properties['infra_id'] + '-master',
    37                      context.properties['infra_id'] + '-bootstrap'
    38                  ]
    39              },
    40              'zone': context.properties['zone']
    41          }
    42      }, {
    43          'name': context.properties['infra_id'] + '-bootstrap-ig',
    44          'type': 'compute.v1.instanceGroup',
    45          'properties': {
    46              'namedPorts': [
    47                  {
    48                      'name': 'ignition',
    49                      'port': 22623
    50                  }, {
    51                      'name': 'https',
    52                      'port': 6443
    53                  }
    54              ],
    55              'network': context.properties['cluster_network'],
    56              'zone': context.properties['zone']
    57          }
    58      }]
    59  
    60      return {'resources': resources}