github.com/openshift/installer@v1.4.17/upi/gcp/06_worker.py (about)

     1  def GenerateConfig(context):
     2  
     3      resources = [{
     4          'name': context.properties['infra_id'] + '-' + context.env['name'],
     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                      'sourceImage': context.properties['image']
    13                  }
    14              }],
    15              'machineType': 'zones/' + context.properties['zone'] + '/machineTypes/' + context.properties['machine_type'],
    16              'metadata': {
    17                  'items': [{
    18                      'key': 'user-data',
    19                      'value': context.properties['ignition']
    20                  }]
    21              },
    22              'networkInterfaces': [{
    23                  'subnetwork': context.properties['compute_subnet']
    24              }],
    25              'serviceAccounts': [{
    26                  'email': context.properties['service_account_email'],
    27                  'scopes': ['https://www.googleapis.com/auth/cloud-platform']
    28              }],
    29              'tags': {
    30                  'items': [
    31                      context.properties['infra_id'] + '-worker',
    32                  ]
    33              },
    34              'zone': context.properties['zone']
    35          }
    36      }]
    37  
    38      return {'resources': resources}