github.com/openshift/installer@v1.4.17/upi/gcp/01_vpc.py (about) 1 def GenerateConfig(context): 2 3 resources = [{ 4 'name': context.properties['infra_id'] + '-network', 5 'type': 'compute.v1.network', 6 'properties': { 7 'region': context.properties['region'], 8 'autoCreateSubnetworks': False 9 } 10 }, { 11 'name': context.properties['infra_id'] + '-master-subnet', 12 'type': 'compute.v1.subnetwork', 13 'properties': { 14 'region': context.properties['region'], 15 'network': '$(ref.' + context.properties['infra_id'] + '-network.selfLink)', 16 'ipCidrRange': context.properties['master_subnet_cidr'] 17 } 18 }, { 19 'name': context.properties['infra_id'] + '-worker-subnet', 20 'type': 'compute.v1.subnetwork', 21 'properties': { 22 'region': context.properties['region'], 23 'network': '$(ref.' + context.properties['infra_id'] + '-network.selfLink)', 24 'ipCidrRange': context.properties['worker_subnet_cidr'] 25 } 26 }, { 27 'name': context.properties['infra_id'] + '-router', 28 'type': 'compute.v1.router', 29 'properties': { 30 'region': context.properties['region'], 31 'network': '$(ref.' + context.properties['infra_id'] + '-network.selfLink)', 32 'nats': [{ 33 'name': context.properties['infra_id'] + '-nat-master', 34 'natIpAllocateOption': 'AUTO_ONLY', 35 'minPortsPerVm': 7168, 36 'sourceSubnetworkIpRangesToNat': 'LIST_OF_SUBNETWORKS', 37 'subnetworks': [{ 38 'name': '$(ref.' + context.properties['infra_id'] + '-master-subnet.selfLink)', 39 'sourceIpRangesToNat': ['ALL_IP_RANGES'] 40 }] 41 }, { 42 'name': context.properties['infra_id'] + '-nat-worker', 43 'natIpAllocateOption': 'AUTO_ONLY', 44 'minPortsPerVm': 512, 45 'sourceSubnetworkIpRangesToNat': 'LIST_OF_SUBNETWORKS', 46 'subnetworks': [{ 47 'name': '$(ref.' + context.properties['infra_id'] + '-worker-subnet.selfLink)', 48 'sourceIpRangesToNat': ['ALL_IP_RANGES'] 49 }] 50 }] 51 } 52 }] 53 54 return {'resources': resources}