forked from cloudfoundry/docs-bosh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgoogle-cpi.html.md.erb
210 lines (169 loc) · 7.16 KB
/
google-cpi.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
---
title: Google CPI
---
This topic describes cloud properties for different resources created by the Google CPI.
## <a id='azs'></a> AZs
Schema for `cloud_properties` section:
* **zone** [String, required]: [Zone](https://cloud.google.com/compute/docs/regions-zones/regions-zones) to use for creating VMs. Example: `us-central1-f`.
Example:
```yaml
azs:
- name: z1
cloud_properties:
zone: us-central1-f
```
---
## <a id='networks'></a> Networks
Schema for `cloud_properties` section used by dynamic network or manual network subnet:
* **network_name** [String, optional]: The name of the [Network](https://cloud.google.com/compute/docs/networking#networks) used when creating VMs. Default: `default`. Example: `boshnet`.
* **subnetwork_name** [String, optional]: The name of the [Subnet Network](https://cloud.google.com/compute/docs/networking#subnet_network) the CPI will use when creating VMs. If the network is in legacy mode, do not set subnetwork name. If the network is in auto subnet mode, providing the subnetwork is optional. If the network is in custom subnet mode, then it's required.
* **ephemeral\_external\_ip** [Boolean, optional]: If VMs on this network must have an [ephemeral external IP](https://cloud.google.com/compute/docs/instances-and-network#externaladdresses). Default: `false`.
* **ip_forwarding** [Boolean, optional]: If VMs on this network must have [IP forwarding](https://cloud.google.com/compute/docs/networking#canipforward) enabled. Default: `false`.
* **tags** [Array, optional]: A list of [tags](https://cloud.google.com/compute/docs/instances/managing-instances#tags) to apply to the VMs, useful if you want to apply firewall or routes rules based on tags. Default: `[]`. Example: `[bosh, internal]`.
Example of manual network:
```yaml
networks:
- name: default
type: manual
subnets:
- range: 10.10.0.0/24
gateway: 10.10.0.1
dns: [8.8.8.8, 8.8.4.4]
azs: [z1, z2]
cloud_properties:
network_name: cf
ephemeral_external_ip: true
tags: [internal, concourse]
```
Example of dynamic network spanning two zones:
```yaml
networks:
- name: default
type: dynamic
subnets:
- azs: [z1, z2]
dns: [8.8.8.8, 8.8.4.4]
cloud_properties:
network_name: cf
ephemeral_external_ip: true
tags: [internal, concourse]
```
Example of vip network:
```yaml
networks:
- name: default
type: vip
```
---
## <a id='vm-types'></a> VM Types
Schema for `cloud_properties` section:
* **machine_type** [String, required]: Predefined type of the [VM](https://cloud.google.com/compute/docs/machine-types). Required unless custom CPU and RAM values are set. Example: `n1-standard-2`.
* **cpu** [Integer, required]: Number of vCPUs the CPI will use when creating the instance. Required if not using predefined machine type. Example: `2`.
* **ram** [Integer, required]: Amount of memory the CPI will use when creating the instance. Required if not using predefined machine type. Example: `2048`.
* **root\_disk\_size\_gb** [Integer, optional]: The size (in GB) of the VM root disk. Default: `10`.
* **root\_disk\_type** [String, optional]: Disk type the CPI will use when creating the VM root disk.
* **target_pool** [String, optional]: Place VM into specified [target pool](https://cloud.google.com/compute/docs/load-balancing/network/target-pools). No default.
* **backend_service** [String/Map<String,String>, optional]: Place VM into specified [backend service](https://cloud.google.com/compute/docs/load-balancing/http/backend-service). VM will be placed into one of the backend service's instance groups that matches VM's zone. No default. To set up [Internal Load Balancing](https://cloud.google.com/compute/docs/load-balancing/internal/) use a map and set `scheme` to `INTERNAL` and `name` to the name of the backend service.
* **automatic_restart** [Boolean, optional]: If the instances should be [restarted automatically](https://cloud.google.com/compute/docs/instances/setting-instance-scheduling-options#autorestart) if they are terminated for non-user-initiated reasons. Provided by the GCE and different from the Resurrector. Default: `false`.
* **on\_host\_maintenance** [String, optional]: [Instance behavior](https://cloud.google.com/compute/docs/instances/setting-instance-scheduling-options#onhostmaintenance) on infrastructure maintenance that may temporarily impact instance performance. Possible values: `MIGRATE` or `TERMINATE`. Default: `MIGRATE`.
* **preemptible** [Boolean, optional]: If the VM should be [preemptible](https://cloud.google.com/preemptible-vms/). Default: `false`.
* **service_scopes** [Array, optional]: [Authorization scope](https://cloud.google.com/docs/authentication#oauth_scopes) names for your default service account that determine the level of access your VM has to other Google services. Default: `[]` (no scope is assigned to the VM by default).
Example of an `n1-standard-2` VM:
```yaml
vm_types:
- name: default
cloud_properties:
instance_type: n1-standard-2
root_disk_size_gb: 20
root_disk_type: pd-ssd
service_scopes:
- compute.readonly
- devstorage.read_write
```
Example of an `INTERNAL` backend service:
```yaml
vm_extensions:
- name: backend-pool
cloud_properties:
ephemeral_external_ip: true
backend_service:
name: name-of-backend-service
scheme: INTERNAL
```
Example of an `EXTERNAL` backend service:
```yaml
vm_extensions:
- name: backend-pool
cloud_properties:
backend_service:
name: name-of-backend-service
```
The above backend-service cloud configuration examples are referenced within the deployment manifest as such:
```yaml
instance_groups:
- name: proxy
instances: 2
azs: [z1, z2]
networks: [{name: default}]
vm_type: default
stemcell: default
jobs:
- name: proxy
release: default
vm_extensions: [backend-pool]
```
---
## <a id='disk-types'></a> Disk Types
Schema for `cloud_properties` section:
* **type** [String, optional]: Type of the [disk](https://cloud.google.com/compute/docs/disks/#overview): `pd-standard`, `pd-ssd`. Defaults to `pd-standard`.
Persistent disks are created in the zone of a VM that disk will be attached.
Example of 10GB disk:
```yaml
disk_types:
- name: default
disk_size: 10_240
```
---
## <a id='global'></a> Global Configuration
The CPI can only talk to a single Google Compute Engine region.
See [all configuration options](https://bosh.io/jobs/google_cpi?source=github.com/cloudfoundry-incubator/bosh-google-cpi-release).
---
## <a id='cloud-config'></a> Example Cloud Config
```yaml
azs:
- name: z1
cloud_properties: {zone: us-central1-f}
- name: z2
cloud_properties: {zone: us-central1-a}
vm_types:
- name: default
cloud_properties:
machine_type: n1-standard-4
root_disk_size_gb: 20
root_disk_type: pd-ssd
disk_types:
- name: default
disk_size: 3000
networks:
- name: default
type: manual
subnets:
- range: 10.10.0.0/24
gateway: 10.10.0.1
dns: [8.8.8.8, 8.8.4.4]
azs: [z1, z2]
cloud_properties:
network_name: cf
ephemeral_external_ip: true
tags: [internal, concourse]
- name: vip
type: vip
compilation:
workers: 3
reuse_compilation_vms: true
az: z1
vm_type: default
network: default
```
---
[Back to Table of Contents](index.html#cpi-config)