forked from cloudfoundry/docs-bosh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgoogle-required-permissions.html.md.erb
179 lines (133 loc) · 5.53 KB
/
google-required-permissions.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
---
title: Required Service Account Permissions
---
This topic describes how to configure BOSH with the minimum set of permissions on Google Cloud Engine.
## <a id="bosh-director"></a> Google CPI and Director
This section will guide you through how to configure the Google Cloud CPI and Director with the default blobstore.
<p class="note">Note: If you wish to configure BOSH to use GCS blobstore also follow [these steps](google-required-permissions.html#director-with-gcs-blobstore)</p>
1. Download and install the [Google Cloud CLI](https://cloud.google.com/sdk/) and [BOSH CLI v2](cli-v2.html#install).
2. Create a file called `bosh-director-role.yml`.
```yaml
title: BOSH Director
stage: BETA
description: Allows BOSH Google CPI to perform all BOSH Director actions
name: projects/((project_id))/roles/bosh.director
included_permissions:
# addresses
- compute.addresses.get
- compute.addresses.list
# backend services
- compute.backendServices.get
- compute.backendServices.list
# disk types
- compute.diskTypes.get
# disks
- compute.disks.delete
- compute.disks.list
- compute.disks.get
- compute.disks.createSnapshot
- compute.snapshots.create
- compute.disks.create
- compute.images.useReadOnly
# global operations
- compute.globalOperations.get
# images
- compute.images.delete
- compute.images.get
- compute.images.create
# instance groups
- compute.instanceGroups.get
- compute.instanceGroups.list
- compute.instanceGroups.update
# instances
- compute.instances.setMetadata
- compute.instances.setLabels
- compute.instances.setTags
- compute.instances.reset
- compute.instances.start
- compute.instances.list
- compute.instances.get
- compute.instances.delete
- compute.instances.create
- compute.subnetworks.use
- compute.subnetworks.useExternalIp
- compute.instances.detachDisk
- compute.instances.attachDisk
- compute.disks.use
- compute.instances.deleteAccessConfig
- compute.instances.addAccessConfig
- compute.addresses.use
# machine type
- compute.machineTypes.get
# region operations
- compute.regionOperations.get
# zone operations
- compute.zoneOperations.get
# networks
- compute.networks.get
# subnetworks
- compute.subnetworks.get
# snapshots
- compute.snapshots.delete
- compute.snapshots.get
# target pool
- compute.targetPools.list
- compute.targetPools.get
- compute.targetPools.addInstance
- compute.targetPools.removeInstance
- compute.instances.use
# Storage services - used when uploading heavy stemcells
- storage.buckets.create
- storage.objects.create
```
3. Create the BOSH Director role:
```bash
gcloud beta iam roles --project <project-id> create bosh.director \
--file <( bosh int -v project_id=<project-id> bosh-director-role.yml )
```
4. On Google Cloud navigate go to `IAM & admin` > `Service accounts` and click on `CREATE SERVICE ACCOUNT`.
Give your service account a name, check `Furnish a new private key` and select the aforementioned role.
<%= image_tag("images/gcp-service-account.png") %>
## <a id="director-with-gcs-blobstore"></a>Minimum permissions for GCS blobstore
In addition to configuring the Google CPI and Director with the previous permissions, in order to allow them to use GCS blobstore you need to grant additional permissions.
<p class="note">Note: We highly recommend creating separate service accounts.</p>
This configuration is similar to the previous one except that it's used when the Director and the Agents use GCS as their [blobstore](bosh-components.html#blobstore) instead of an internal blobstore provided by the bosh release.
1. Download and install the [Google Cloud CLI](https://cloud.google.com/sdk/) and [BOSH CLI v2](cli-v2.html#install).
2. Create a file called `director-blobstore-role.yml`.
```yaml
title: BOSH Director GCS Blobstore
stage: BETA
description: Allows BOSH Director GCS Blobstore client to perform necessary operations to the blobstore
name: projects/((project_id))/roles/blobstore.director
included_permissions:
- storage.buckets.get
- storage.objects.get
- storage.objects.create
- storage.objects.delete
```
and `agent-blobstore-role.yml`.
```yaml
title: BOSH Agent GCS Blobstore
stage: BETA
description: Allows BOSH Agent GCS Blobstore client to perform necessary operations to the blobstore
name: projects/((project_id))/roles/blobstore.agent
included_permissions:
- storage.buckets.get
- storage.objects.get
- storage.objects.create
```
<p class="note">Note: The agent does not need to delete files from the blobstore</p>
4. Configure roles.
```bash
gcloud beta iam roles --project <project-id> create blobstore.director \
--file <( bosh int -v project_id=<project-id> director-blobstore-role.yml )
gcloud beta iam roles --project <project-id> create blobstore.agent \
--file <( bosh int -v project_id=<project-id> agent-blobstore-role.yml )
```
5. On Google Cloud navigate go to `IAM & admin` > `Service accounts` and click on `CREATE SERVICE ACCOUNT`.
Give your service account a name, check `Furnish a new private key` and select the aforementioned roles.
<%= image_tag("images/gcp-service-account.png") %>
6. Configure [GCS Blobstore](director-configure-blobstore.html#gcs)
---
Next: [RackHD](rackhd-cpi.html)
Previous: [Google Compute Engine](google-cpi.html)