github.com/openshift/installer@v1.4.17/upi/gcp/05_control_plane.py (about)

     1  def GenerateConfig(context):
     2  
     3      resources = [{
     4          'name': context.properties['infra_id'] + '-master-0',
     5          'type': 'compute.v1.instance',
     6          'properties': {
     7              'disks': [{
     8                  'autoDelete': True,
     9                  'boot': True,
    10                  'initializeParams': {
    11                      'diskSizeGb': context.properties['root_volume_size'],
    12                      'diskType': 'zones/' + context.properties['zones'][0] + '/diskTypes/pd-ssd',
    13                      'sourceImage': context.properties['image']
    14                  }
    15              }],
    16              'machineType': 'zones/' + context.properties['zones'][0] + '/machineTypes/' + context.properties['machine_type'],
    17              'metadata': {
    18                  'items': [{
    19                      'key': 'user-data',
    20                      'value': context.properties['ignition']
    21                  }]
    22              },
    23              'networkInterfaces': [{
    24                  'subnetwork': context.properties['control_subnet']
    25              }],
    26              'serviceAccounts': [{
    27                  'email': context.properties['service_account_email'],
    28                  'scopes': ['https://www.googleapis.com/auth/cloud-platform']
    29              }],
    30              'tags': {
    31                  'items': [
    32                      context.properties['infra_id'] + '-master',
    33                  ]
    34              },
    35              'zone': context.properties['zones'][0]
    36          }
    37      }, {
    38          'name': context.properties['infra_id'] + '-master-1',
    39          'type': 'compute.v1.instance',
    40          'properties': {
    41              'disks': [{
    42                  'autoDelete': True,
    43                  'boot': True,
    44                  'initializeParams': {
    45                      'diskSizeGb': context.properties['root_volume_size'],
    46                      'diskType': 'zones/' + context.properties['zones'][1] + '/diskTypes/pd-ssd',
    47                      'sourceImage': context.properties['image']
    48                  }
    49              }],
    50              'machineType': 'zones/' + context.properties['zones'][1] + '/machineTypes/' + context.properties['machine_type'],
    51              'metadata': {
    52                  'items': [{
    53                      'key': 'user-data',
    54                      'value': context.properties['ignition']
    55                  }]
    56              },
    57              'networkInterfaces': [{
    58                  'subnetwork': context.properties['control_subnet']
    59              }],
    60              'serviceAccounts': [{
    61                  'email': context.properties['service_account_email'],
    62                  'scopes': ['https://www.googleapis.com/auth/cloud-platform']
    63              }],
    64              'tags': {
    65                  'items': [
    66                      context.properties['infra_id'] + '-master',
    67                  ]
    68              },
    69              'zone': context.properties['zones'][1]
    70          }
    71      }, {
    72          'name': context.properties['infra_id'] + '-master-2',
    73          'type': 'compute.v1.instance',
    74          'properties': {
    75              'disks': [{
    76                  'autoDelete': True,
    77                  'boot': True,
    78                  'initializeParams': {
    79                      'diskSizeGb': context.properties['root_volume_size'],
    80                      'diskType': 'zones/' + context.properties['zones'][2] + '/diskTypes/pd-ssd',
    81                      'sourceImage': context.properties['image']
    82                  }
    83              }],
    84              'machineType': 'zones/' + context.properties['zones'][2] + '/machineTypes/' + context.properties['machine_type'],
    85              'metadata': {
    86                  'items': [{
    87                      'key': 'user-data',
    88                      'value': context.properties['ignition']
    89                  }]
    90              },
    91              'networkInterfaces': [{
    92                  'subnetwork': context.properties['control_subnet']
    93              }],
    94              'serviceAccounts': [{
    95                  'email': context.properties['service_account_email'],
    96                  'scopes': ['https://www.googleapis.com/auth/cloud-platform']
    97              }],
    98              'tags': {
    99                  'items': [
   100                      context.properties['infra_id'] + '-master',
   101                  ]
   102              },
   103              'zone': context.properties['zones'][2]
   104          }
   105      }]
   106  
   107      return {'resources': resources}