forked from cloudfoundry/docs-cf-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
routing-is.html.md.erb
698 lines (589 loc) · 28 KB
/
routing-is.html.md.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
---
title: Routing for Isolation Segments
owner: CF for VMs Networking
---
<div class="quick-links">
<ul>
<li><a href="#overview">Overview</a></li>
<li><a href="#create-networks">Step 1: Create Networks</a></li>
<li><a href="#config-networks">Step 2: Configure Networks for Gorouters</a></li>
<li><a href="#config-instance-group">Step 3: Configure Additional Gorouters</a></li>
<li><a href="#add-router">Step 4: Add Gorouters to Load Balancers</a></li>
<li><a href="#config-dns-lb">Step 5: Configure DNS and Load Balancers</a></li>
<li><a href="#config-firewall">Step 6: Configure Firewall Rules</a></li>
<li><a href="#gcp-implementation">Additional GCP Information</a></li>
<li><a href="#sharding-routers-isolation-segment">Sharding Gorouters for Isolation Segments</a></li>
<li><a href="#isolation-segments-metrics">Metrics for Gorouters Associated with Isolation</a></li>
</ul>
</div>
This topic describes how operators can configure and manage routing for isolation segments in <%= vars.app_runtime_first %>. Operators can deploy an additional set of Gorouters for each isolation segment to handle requests for apps within the segment.
For more information about how isolation segments work, see [Isolation Segments](../concepts/security.html#isolation-segments) in _<%= vars.app_runtime_abbr %> Security_. <%= vars.install_isolation_segments %>
<p class="note"><strong>Note:</strong> The instructions in this topic assume you are using Google Cloud Platform (GCP). The procedures may differ on other IaaSes, but the concepts should be transferable.</p>
## <a name='overview'></a> Overview
Isolation segments isolate the compute resources for one group of apps from another. However, these apps still share the same network resources. Requests for apps on all isolation segments, as well as for system components, transit the same load balancers, <%= vars.app_runtime_abbr %> Gorouters, and <%= vars.app_runtime_abbr %> TCP Routers.
When you use isolation segments, <%= vars.app_runtime_abbr %> designates its Diego Cells as belonging to an isolation segment called `shared`. This isolation segment is the default isolation segment assigned to every org and space. This can be overwritten by assigning an explicit default for an organization. <%= vars.install_isolation_segments %>
The illustration below shows isolation segments sharing the same network resources:
<%= image_tag("routing-is.png", :alt => "Diagram shows, using arrows and boxes, two isolation segments that share Gorouter, TCP Router, load balancer, and other CF components. See long description below.") %>
The two isolation segments each contain a single Diego Cell. These isolation segments use the same Gorouter, TCP Router, and load balancers.
Operators who want to prevent all isolation segments and system components from using the same network resources can deploy an additional set of Gorouters for each isolation segment:
<%= image_tag("is-distinct-domains.png", :alt => "Diagram shows, using arrows and boxes, a set of Gorouters deployed for each isolation segment, while sharing other network resources. See long description below.") %>
The two isolation segments each use separate Gorouters and Diego Cells. However, the use of an isolated TCP router in this scenario is not supported.
Use cases include:
* Requests for apps in an isolation segment must not share networking resources with requests for other apps.
* The <%= vars.app_runtime_abbr %> management plane should only be accessible from a private network. As multiple IaaS load balancers cannot typically share the same pool of back ends, such as <%= vars.app_runtime_abbr %> Gorouters, each load balancer requires an additional deployment of Gorouters.
## <a name='create-networks'></a> Step 1: Create Networks
Create a network or subnet for each isolation segment on your infrastructure. For example, an operator who wants one isolation segment separated from their <%= vars.app_runtime_abbr %> Diego Cells could create one network named `sample-network` with two subnets named `sample-subnet-<%= vars.app_runtime_abbr_lc %>` and `sample-subnet-is1`.
The diagram below describes the network topology:
```
IaaS network: sample-network
|
|_____ IaaS subnet: sample-subnet-<%= vars.app_runtime_abbr_lc %>
|
|_____ IaaS subnet: sample-subnet-is1
```
Subnets do not generally span IaaS availability zones (AZs), so the same operator with two AZs needs four subnets.
```
IaaS network: sample-network
|
|_____ IaaS subnet: sample-subnet-<%= vars.app_runtime_abbr_lc %>-az1
|
|_____ IaaS subnet: sample-subnet-<%= vars.app_runtime_abbr_lc %>-az2
|
|_____ IaaS subnet: sample-subnet-is1-az1
|
|_____ IaaS subnet: sample-subnet-is1-az2
```
For more information about networks and subnets in GCP, see [Using Networks and Firewalls](https://cloud.google.com/compute/docs/networking) in the GCP documentation.
## <a name='config-networks'></a> Step 2: Configure Networks for Gorouters
To configure the subnets with BOSH, use BOSH cloud config subnets. Each subnet in the IaaS should correspond to a BOSH subnet that is labeled with the correct isolation segment. For more information, see [Usage](https://bosh.io/docs/cloud-config.html) in the BOSH documentation.
<% if vars.platform_code == 'CF' %>
Below are examples of cloud config for GCP and AWS for the four example subnets described in [Step 1: Create Networks](#create-networks).
### GCP Cloud Config
```
azs:
- name: z1
cloud_properties:
zone: us-east1-b
- name: z2
cloud_properties:
zone: us-east1-c
- name: z3
cloud_properties:
zone: us-east1-b
- name: z4
cloud_properties:
zone: us-east1-c
networks:
- name: default
type: manual
subnets:
- range: 10.0.0.0/16
gateway: 10.0.0.1
reserved:
- 10.0.16.2-10.0.16.3
- 10.0.31.255
static:
- 10.0.31.190-10.0.31.254
<strong>az: z1</strong>
cloud_properties:
ephemeral_external_ip: true
<strong>network_name: sample-network</strong>
<strong>subnetwork_name: sample-subnet-<%= vars.app_runtime_abbr_lc %>-az1</strong>
tags:
- <strong>sample-<%= vars.app_runtime_abbr_lc %>-is</strong>
- range: 10.1.16.0/20
gateway: 10.1.16.1
reserved:
- 10.1.16.2-10.1.16.3
- 10.1.31.255
static:
- 10.1.31.190-10.1.31.254
<strong>az: z2</strong>
cloud_properties:
ephemeral_external_ip: true
<strong>network_name: sample-network</strong>
<strong>subnetwork_name: sample-subnet-<%= vars.app_runtime_abbr_lc %>-az2</strong>
tags:
- <strong>sample-<%= vars.app_runtime_abbr_lc %>-is</strong>
- range: 10.0.200.0/28
gateway: 10.0.200.1
reserved:
- 10.0.200.2-10.0.200.3
- 10.0.200.15
static:
- 10.0.200.11-10.0.200.15
<strong>az: z3</strong>
cloud_properties:
ephemeral_external_ip: true
<strong>network_name: sample-network</strong>
<strong>subnetwork_name: sample-subnet-is1-az1</strong>
tags:
- <strong>sample-is1</strong>
- range: 10.1.200.0/28
gateway: 10.1.200.1
reserved:
- 10.1.200.2-10.1.200.3
- 10.1.200.15
static:
- 10.1.200.11-10.1.200.15
<strong>az: z4</strong>
cloud_properties:
ephemeral_external_ip: true
<strong>network_name: sample-network</strong>
<strong>subnetwork_name: sample-subnet-is1-az2</strong>
tags:
- <strong>sample-is1</strong>
```
### AWS Cloud Config
<p class="note"><strong>Note:</strong> AWS networking requires security groups, which need to be created separately. In the below example, the operator must create the <strong>sample-<%= vars.app_runtime_abbr_lc %>-is</strong> and <strong>sample-is1</strong> security groups.</p>
```
azs:
- name: z1
cloud_properties:
zone: us-east1-b
- name: z2
cloud_properties:
zone: us-east1-c
- name: z3
cloud_properties:
zone: us-east1-b
- name: z4
cloud_properties:
zone: us-east1-c
networks:
- name: default
type: manual
subnets:
- range: 10.0.0.0/16
gateway: 10.0.0.1
reserved:
- 10.0.16.2-10.0.16.3
- 10.0.31.255
static:
- 10.0.31.190-10.0.31.254
<strong>az: z1</strong>
cloud_properties:
security_groups:
- <strong>sample-<%= vars.app_runtime_abbr_lc %>-is</strong>
# with bbl, there will also be a cf internal security group
subnet: <strong>sample-subnet-<%= vars.app_runtime_abbr_lc %>-az1</strong>
- range: 10.1.16.0/20
gateway: 10.1.16.1
reserved:
- 10.1.16.2-10.1.16.3
- 10.1.31.255
static:
- 10.1.31.190-10.1.31.254
<strong>az: z2</strong>
cloud_properties:
security_groups:
- <strong>sample-<%= vars.app_runtime_abbr_lc %>-is</strong>
# with bbl, there will also be a cf internal security group
subnet: <strong>sample-subnet-<%= vars.app_runtime_abbr_lc %>-az2</strong>
- range: 10.0.200.0/28
gateway: 10.0.200.1
reserved:
- 10.0.200.2-10.0.200.3
- 10.0.200.15
static:
- 10.0.200.11-10.0.200.15
<strong>az: z3</strong>
cloud_properties:
security_groups:
- <strong>sample-is1</strong>
subnet: <strong>sample-subnet-is1-az1</strong>
- range: 10.1.200.0/28
gateway: 10.1.200.1
reserved:
- 10.1.200.2-10.1.200.3
- 10.1.200.15
static:
- 10.1.200.11-10.1.200.15
<strong>az: z4</strong>
cloud_properties:
security_groups:
- <strong>sample-is1</strong>
subnet: <strong>sample-subnet-is1-az2</strong>
```
<% else %>
<%= vars.pcf_networking_is1 %>
<% end %>
## <a name='config-instance-group'></a> Step 3: Configure Additional Gorouters
<% if vars.platform_code == 'CF' %>
You must edit the BOSH deployment manifest to include an instance group for each set of Gorouters.
The sample BOSH manifest snippet below includes an additional instance group for the isolated Gorouters, associated with the isolated BOSH AZs. As a result, Gorouter instances are configured with IP addresses from the isolated subnets. For more information about BOSH manifests, see [Deployment Config](https://bosh.io/docs/manifest-v2.html) in the BOSH documentation.
<p class="note"><strong>Note:</strong> For a high-availability deployment, assign each instance group to at least two BOSH AZs that correspond to different IaaS AZs. Use at least two instances of each instance group.</p>
<p class="note"><strong>Note:</strong> When deploying with a BOSH v2-style manifest that leverages <code>instance_groups</code>, you must enable UAA to differentiate between links exported by the Gorouters, as it only accepts connections from one instance group of Gorouters. As you may have multiple isolation segments, <%= vars.company_name %> recommends renaming the instance group used for the system domain. You must also to specify the name of the link from which UAA consumes the link.</p>
```
instance_groups:
- name: router
instances: 2
azs: [z1,z2]
networks:
- name: default
jobs:
- name: gorouter
provides:
gorouter: {as: router_primary}
- name: uaa
jobs:
- name: uaa
consumes:
router: {from: router_primary}
- name: router-is1
instances: 2
azs: [z3,z4]
networks:
- name: default
- name: cell-is1
instances: 2
azs: [z3,z4]
networks:
- name: default
```
<% else %>
<%= vars.pcf_networking_is2 %>
<% end %>
## <a name='add-routers'></a> Step 4: Add Gorouters to Load Balancer
<% if vars.platform_code == 'CF' %>
For some IaaSes such as AWS and GCP, the BOSH cloud config and deployment manifest can be used to instruct BOSH to add Gorouters to the IaaS load balancers automatically. For others, operators must assign static IPs to the Gorouters in the manifest and assign these IPs to the load balancers out of band.
To automatically add load balancers to Gorouters, the `vm_extensions` property is available in BOSH manifests. For example:
```
instance_groups:
- name: router-is1
instances: 2
azs: [z3,z4]
networks:
- name: default
vm_extensions:
- cf-router-sample-is1-network-properties
```
The `vm_extension` is IaaS-specific and defined in the cloud config. Below is an example AWS cloud config:
```
vm_extensions:
- name: cf-router-sample-is1-network-properties
elbs: [sample-is1-elb]
security_groups:
- sample-is1
- cf-router-lb-security-group # to allow traffic to the load balancer
```
<p class="note"><strong>Note:</strong> The load balancer <code>sample-is1-elb</code> must be created separately.</p>
<p class="note"><strong>Note:</strong> If necessary, configure a firewall rule to allow traffic from your load balancer to the Gorouters.</p>
<% else %>
<%= vars.pcf_networking_is3 %>
<% end %>
## <a name='config-dns-lb'> </a> Step 5: Configure DNS and Load Balancers
Create a separate domain name for each Gorouter instance group, and configure DNS to resolve these domain names to a load balancer that routes requests to the matching Gorouters.
<p class="note"><strong>Note:</strong> You must configure your load balancers to forward requests for a given domain to one Gorouter instance group only.</p>
As Gorouter instance groups may be responsible for separate isolation segments, and an app may be deployed to only one isolation segment, requests should only reach a Gorouter that has access to the apps for that domain name. Load balancing requests for a domain across more than Gorouter instance group can result in request failures unless all the Gorouter instance groups have access to the isolation segments where apps for that domain are deployed.
### <a name='sharing-domain'></a> Shared Domain Name
It is a common requirement for apps on separate isolation segments to be accessible at domain names that share a domain, such as `private-domain.com`. To achieve this configuration while also obeying the guideline for forwarding requests for a domain to only one Gorouter instance group, create a new <%= vars.app_runtime_abbr %> domain for a needed subdomain, such as `*.foo.private-domain.com.`
The diagrams illustrate a topology with separate load balancers, but you could also use one load balancer with multiple interfaces. In this configuration:
* Requests for system domain `*.cf-system.com` and the shared domain `*.shared-apps.com` are forwarded to the Gorouters for the <%= vars.app_runtime_abbr %> Diego Cells.
* Requests for private domain `*.foo.private-domain.com` are forwarded to the Gorouters for IS1. Requests for private domain `*.private-domain.com` are forwarded to the Gorouters for IS2.
<%= image_tag("is-sharing-domains.png", :alt => "Diagram showing an example shared domain. The example includes three isolation segments and three Gorouters. See long description below.") %>
The three isolation segments each use separate Gorouters and load balancers.
## <a name='config-firewall'></a> Step 6: Configure Firewall Rules
Configure firewall rules to allow for necessary ingress and egress traffic for isolation segments and <%= vars.app_runtime_abbr %> Diego Cells. Assuming a default deny-all rule, properly configuring firewall rules prevents a request with a spoofed Host header from being forwarded by a Gorouter to an app in a different isolation segment.
To configure firewall rules for isolation segment traffic:
1. Configure the firewall rules in the table below:
<p class="note"><strong>Note:</strong> Firewall rules are specific to each IaaS, so the exact definition of <code>Source</code> and <code>Destination</code> depends on the IaaS. For example, on GCP, a <code>Source</code> is a subnet and a <code>Destination</code> is a tag. On AWS, both <code>Source</code> and <code>Destination</code> are security groups.</p>
For information about the processes that use these ports and their corresponding manifest properties, see <a href="#port-reference">Port Reference Table</a>.
<table>
<tr>
<th width="20%">Rule Name</th>
<th width="20%">Source</th>
<th width="20%">Allowed Protocols/Ports</th>
<th width="20%">Destination</th>
<th width="20%">Reason</th>
</tr>
<tr>
<td><code><%= vars.app_runtime_abbr_lc %>-to-bosh</code></td>
<td><%= vars.app_runtime_abbr %> Diego Cells</td>
<td><code>tcp:4222, 25250, 25777</code></td>
<td>BOSH Director</td>
<td>BOSH Agent on VMs in the <%= vars.app_runtime_abbr %> Diego Cells to reach BOSH Director</td>
</tr>
<tr>
<td><code><%= vars.app_runtime_abbr_lc %>-internal</code></td>
<td><%= vars.app_runtime_abbr %> Diego Cells</td>
<td><code>tcp:any, udp:any, icmp:any</code></td>
<td><%= vars.app_runtime_abbr %> Diego Cells</td>
<td>VMs within the <%= vars.app_runtime_abbr %> Diego Cells to reach one another</td>
</tr>
<tr>
<td><code><%= vars.app_runtime_abbr_lc %>-to-is1</code></td>
<td><%= vars.app_runtime_abbr %> Diego Cells</td>
<td><code>tcp:1801, 8853, 9100</code></td>
<td>Isolation segment</td>
<td>Diego BBS in <%= vars.app_runtime_abbr %> Diego Cells to reach Diego Cells in isolation segment</td>
</tr>
<tr>
<td><code>is1-to-bosh</code></td>
<td>Isolation segment</td>
<td><code>tcp:4222, 25250, 25777</code></td>
<td>BOSH Director</td>
<td>BOSH Agent on VMs in isolation segment to reach BOSH Director</td>
</tr>
<tr>
<td><code>is1-internal</code></td>
<td>Isolation segment</td>
<td><code>tcp:all, udp:all, icmp:all</code></td>
<td>Isolation segment</td>
<td>VMs within isolation segment to reach one another</td>
</tr>
<tr>
<td><code>is1-to-<%= vars.app_runtime_abbr_lc %></code></td>
<td>Isolation segment</td>
<td><code>tcp:3000, 3001, 4003, 4103, 4222, 4224, 4443, 6067, 8080, 8082, 8083, 8443, 8447, 8844, 8853, 8889, 8891, 9000, 9022, 9023, 9090, 9091</code></td>
<td><%= vars.app_runtime_abbr %> Diego Cells</td>
<td>Diego Cells in isolation segment to reach Diego BBS, Diego Auctioneer, and CredHub in <%= vars.app_runtime_abbr %>. Loggregator Agent to reach Doppler. Syslog Agent to reach Log Cache Syslog Server. Gorouters to reach NATS, UAA, and Routing API. Metrics Discovery Registrar to reach NATS.</td>
</tr>
</table>
1. (Optional) Configure the firewall rules in the table below:
<table>
<tr>
<th width="20%">Rule Name</th>
<th width="20%">Source</th>
<th width="20%">Allowed Protocols/Ports</th>
<th width="20%">Destination</th>
<th width="20%">Reason</th>
</tr>
<tr>
<td><code>jumpbox-to-is1</code></td>
<td>Jumpbox VM</td>
<td><code>tcp:22</code></td>
<td>Isolation segment</td>
<td>Jumpbox VMs to reach isolation segment through SSH or BOSH SSH.</td>
</tr>
<tr>
<td><code>diego-cell-egress</code></td>
<td>Diego Cell VM on isolation segment</td>
<td><code>tcp:any, udp:any</code></td>
<td>Internet</td>
<td>If Diego Cells must download buildpacks to stage apps, allow egress traffic from all Diego Cell VMs on isolation segments to reach the Internet.</td>
</tr>
</table>
For more information about ports used by agents to communicate with BOSH, see the [bosh-deployment](https://github.com/cloudfoundry/bosh-deployment) repository on GitHub.
For more information about networks and firewall rules for GCP, see [Using Subnetworks](https://cloud.google.com/compute/docs/subnetworks) in the GCP documentation.
### <a name='port-reference'></a> Port Reference Table
To understand which protocols and ports map to which processes and manifest properties for the rules above, see the table below:
<table>
<tr>
<th>Protocol</th>
<th width="80px">Port</th>
<th>Process</th>
<th>Manifest Property</th>
</tr>
<tr>
<td><code>tcp</code></td>
<td><code>1801</code></td>
<td>Diego Rep</td>
<td><code>diego.rep.listen_addr_securable</code></td>
</tr>
<tr>
<td><code>tcp</code></td>
<td><code>3000</code></td>
<td>Routing API</td>
<td><code>routing_api.port</code></td>
</tr>
<tr>
<td><code>tcp</code></td>
<td><code>3001</code></td>
<td>Routing API</td>
<td><code>routing_api.mtls_port</code></td>
</tr>
<tr>
<td><code>tcp</code></td>
<td><code>4003</code></td>
<td>VXLAN Policy Agent</td>
<td><code>cf_networking.policy_server.internal_listen_port</code></td>
</tr>
<tr>
<td><code>tcp</code></td>
<td><code>4103</code></td>
<td>Silk Controller</td>
<td><code>cf_networking.silk_controller.listen_port</code></td>
</tr>
<tr>
<td><code>tcp</code></td>
<td><code>4222</code></td>
<td>NATS</td>
<td><code>nats.nats.port</code></td>
</tr>
<tr>
<td><code>tcp</code></td>
<td><code>4224</code></td>
<td>NATS</td>
<td><code>nats-tls.nats.port</code></td>
</tr>
<tr>
<td><code>tcp</code></td>
<td><code>4443</code></td>
<td>CAPI Blobstore Port - HTTPS</td>
<td><code>capi.blobstore.tls.port</code></td>
</tr>
<tr>
<td><code>tcp</code></td>
<td><code>6067</code></td>
<td>Log Cache Syslog Server</td>
<td><code>log-cache.log-cache-syslog-server.syslog_port</code></td>
</tr>
<tr>
<td><code>tcp</code></td>
<td><code>8080</code></td>
<td>CAPI Blobstore Port - HTTP, Diego file server - HTTP</td>
<td><code>capi.blobstore.port, diego.file_server.listen_addr</code></td>
</tr>
<tr>
<td><code>tcp</code></td>
<td><code>8082</code></td>
<td>Doppler gRPC, Reverse Log Proxy Gateway</td>
<td><code>loggregator.doppler.grpc_port, loggregator.reverse_log_proxy.egress.port</code></td>
</tr>
<tr>
<td><code>tcp</code></td>
<td><code>8083</code></td>
<td>Log Cache cf-auth-proxy</td>
<td><code>log-cache.log-cache-cf-auth-proxy.proxy_port</code></td>
</tr>
<tr>
<td><code>tcp</code></td>
<td><code>8084</code></td>
<td>Diego file server - HTTP</td>
<td><code>diego.file_server.listen_addr</code></td>
</tr>
<tr>
<td><code>tcp</code></td>
<td><code>8443</code></td>
<td>UAA</td>
<td><code>uaa.uaa.ssl.port</code></td>
</tr>
<tr>
<td><code>tcp</code></td>
<td><code>8447</code></td>
<td>Diego file server - HTTPS</td>
<td><code>diego.file_server.https_listen_addr</code></td>
</tr>
<tr>
<td><code>tcp</code></td>
<td><code>8844</code></td>
<td>CredHub</td>
<td><code>credhub.credhub.port</code></td>
</tr>
<tr>
<td><code>tcp</code></td>
<td><code>8853</code></td>
<td>BOSH DNS health</td>
<td><code>health.server.port</code> from <code>bosh-dns-release</code></td>
</tr>
<tr>
<td><code>tcp</code></td>
<td><code>8889</code></td>
<td>Diego BBS</td>
<td><code>diego.rep.bbs.api_location</code></td>
</tr>
<tr>
<td><code>tcp</code></td>
<td><code>8891</code></td>
<td>Diego Database (Locket)</td>
<td><code>diego.locket.listen_addr</code></td>
</tr>
<tr>
<td><code>tcp</code></td>
<td><code>9000</code></td>
<td>Loggregator Syslog Binding Cache</td>
<td><code>loggr-syslog-binding-cache.external_port</code></td>
</tr>
<tr>
<td><code>tcp</code></td>
<td><code>9022</code></td>
<td>Cloud Controller Stager</td>
<td><code>capi.stager.cc.external_port</code></td>
</tr>
<tr>
<td><code>tcp</code></td>
<td><code>9023</code></td>
<td>Cloud Controller TPS</td>
<td><code>capi.tps.cc.external_port</code></td>
</tr>
<tr>
<td><code>tcp</code></td>
<td><code>9090</code></td>
<td>Cloud Controller Uploader</td>
<td><code>capi.cc_uploader.http_port</code></td>
</tr>
<tr>
<td><code>tcp</code></td>
<td><code>9091</code></td>
<td>Cloud Controller Uploader</td>
<td><code>capi.cc_uploader.https_port</code></td>
</tr>
<tr>
<td><code>tcp</code></td>
<td><code>9100</code></td>
<td>System Metrics Scraper</td>
<td><code>system-metrics-scraper.loggr-system-metric-scraper.scrape_port</code></td>
</tr>
<tr>
<td><code>tcp</code></td>
<td><code>25250</code></td>
<td>BOSH Blobstore</td>
<td><code>bosh.blobstore.port</code></td>
</tr>
<tr>
<td><code>tcp</code></td>
<td><code>25777</code></td>
<td>BOSH Registry</td>
<td><code>bosh.registry.port</code></td>
</tr>
</table>
## <a name='gcp-implementation'></a> Additional GCP Information
For more information, see [Understanding backend services](https://cloud.google.com/compute/docs/load-balancing/http/backend-service) in the GCP documentation and the [BOSH Google CPI Release](https://github.com/cloudfoundry-incubator/bosh-google-cpi-release/tree/master/src/bosh-google-cpi) repository on GitHub.
## <a name='sharding-routers-isolation-segment'></a> Sharding Gorouters for Isolation Segments
<% if vars.platform_code == 'CF' %>
To provide security guarantees in addition to the firewall rules described above, an operator can configure sharding of the Gorouter's routing table, resulting in a Gorouter dedicated for an isolation segment having knowledge only of routes for apps in the same isolation segment. The flexibility of the configuration also supports deployment of a Gorouter that is responsible for multiple isolation segments, or that excludes all isolation segments.
### Bypass Cloud Controller Bridge
Support for Gorouter sharding depends on bypassing the Cloud Controller Bridge (CC Bridge), which is now the default behavior of [cf-deployment](https://github.com/cloudfoundry/cf-deployment). To manually bypass the CC bridge, set `cc.diego.temporary_local_apps: true` in your `cloud_controller_ng`, `cloud_controller_worker`, and `cloud_controller_clock` jobs in your deployment manifest. This enables the Cloud Controller to send app creation requests containing routing isolation segment information directly to the Diego BBS, rather than through the CC Bridge.
For more information about the CC Bridge, see [Diego Components and Architecture](../concepts/diego/diego-architecture.html).
### Configure Gorouters for Sharding
You can configure Gorouters for sharding using two manifest properties, `routing_table_sharding_mode` and `isolation_segments`.
The three supported values of `routing_table_sharding_mode` are `all`, `<%= vars.app_runtime_abbr_lc %>-and-segments`, and `segments`.
* `all`: All routes are registered. This is the default mode to preserve the Gorouter's existing behavior.
* `<%= vars.app_runtime_abbr_lc %>-and-segments`: Both routes configured with manifest property `isolation_segments` and routes without an isolation segment specified are registered.
* `segments`: Only routes for the configured isolation segments are registered.
You can provide a list of isolation segments using the manifest property `isolation_segments`.
The table below describes the behaviors that you can achieve with these two properties:
| Sharding Mode | Isolation Segments | Routes Registered |
| ------------- | ------------------ | ----------------- |
| `all` | `none` | All routes. |
| `all` | `provided` | All routes. |
| `<%= vars.app_runtime_abbr_lc %>-and-segments` | `none` | Routes that are not associated with an isolation segment. |
| `<%= vars.app_runtime_abbr_lc %>-and-segments` | `provided` | Routes that are not associated with an isolation segment, as well as routes for the specified isolation segments. Routes for other isolation segment are excluded. |
| `segments` | `none` | Invalid combination. Deploy fails. |
| `segments` | `provided` | Routes for specified isolation segments only. |
For example, the following configuration in a deployment manifest describes a deployment with one Gorouter in the <%= vars.app_runtime_abbr %> Diego Cells and another Gorouter in a separate isolation segment `is1`:
```
jobs:
- name: router_<%= vars.app_runtime_abbr_lc %>
properties:
router:
isolation_segments: []
routing_table_sharding_mode: <%= vars.app_runtime_abbr_lc %>-and-segments
...
- name: router_is1
properties:
router:
isolation_segments:
- is1
routing_table_sharding_mode: segments
```
The `router_<%= vars.app_runtime_abbr_lc %>` Gorouter registers all routes that do not have an `isolation_segment` value. The `router_is1` Gorouter only registers routes that have an `isolation_segment` value of `is1`.
<% else %>
<%= partial vars.sharding %>
<% end %>
## <a name='isolation-segments-metrics'></a> Metrics for Gorouters Associated with Isolation Segments
For metrics emitted by the Gorouter, metrics can be distinguished by the name of the job. For example, this line is a metric emitted on `uptime`:
```
origin:"gorouter" eventType:ValueMetric timestamp:1491338040750977602 deployment:"superman.cf-app.com" job:"router_is1" index:"9a4b639c-8f0e-4b2b-b332-4161ee4646e6" ip:"10.0.16.23" valueMetric:<name:"uptime" value:118 unit:"seconds" >
```