@@ -26,9 +26,6 @@ the monitored schemas and tables.
2626Spanner is only supported with RDI deployed on Kubernetes/Helm. RDI VM mode does not support Spanner as a source database.
2727{{< /note >}}
2828
29- You must have the necessary privileges to manage the database schema and create service accounts
30- with the appropriate permissions so that RDI can access the Spanner database.
31-
3229## 1. Prepare for snapshot
3330
3431During the snapshot phase, RDI executes multiple transactions to capture data at an exact point
@@ -67,50 +64,50 @@ To allow RDI to access the Spanner instance, you'll need to create a service acc
6764appropriate permissions. This service account will then be provided to RDI as a secret for
6865authentication.
6966
70- ### Step 1: Create the service account
67+ 1 . Create the service account
7168
72- ``` bash
73- gcloud iam service-accounts create spanner-reader-account \
74- --display-name=" Spanner Reader Service Account" \
75- --description=" Service account for reading from Spanner databases" \
76- --project=YOUR_PROJECT_ID
77- ```
69+ ``` bash
70+ gcloud iam service-accounts create spanner-reader-account \
71+ --display-name=" Spanner Reader Service Account" \
72+ --description=" Service account for reading from Spanner databases" \
73+ --project=YOUR_PROJECT_ID
74+ ```
7875
79- ### Step 2: Grant required roles
76+ 1. Grant required roles
8077
81- ** Database Reader** (read access to Spanner data):
78+ ** Database Reader** (read access to Spanner data):
8279
83- ``` bash
84- gcloud projects add-iam-policy-binding YOUR_PROJECT_ID \
85- --member=" serviceAccount:spanner-reader-account@YOUR_PROJECT_ID.iam.gserviceaccount.com" \
86- --role=" roles/spanner.databaseReader"
87- ```
80+ ` ` ` bash
81+ gcloud projects add-iam-policy-binding YOUR_PROJECT_ID \
82+ --member=" serviceAccount:spanner-reader-account@YOUR_PROJECT_ID.iam.gserviceaccount.com" \
83+ --role=" roles/spanner.databaseReader"
84+ ` ` `
8885
89- ** Database User** (query execution and metadata access):
86+ ** Database User** (query execution and metadata access):
9087
91- ``` bash
92- gcloud projects add-iam-policy-binding YOUR_PROJECT_ID \
93- --member=" serviceAccount:spanner-reader-account@YOUR_PROJECT_ID.iam.gserviceaccount.com" \
94- --role=" roles/spanner.databaseUser"
95- ```
88+ ` ` ` bash
89+ gcloud projects add-iam-policy-binding YOUR_PROJECT_ID \
90+ --member=" serviceAccount:spanner-reader-account@YOUR_PROJECT_ID.iam.gserviceaccount.com" \
91+ --role=" roles/spanner.databaseUser"
92+ ` ` `
9693
97- ** Viewer** (viewing instance and database configuration):
94+ ** Viewer** (viewing instance and database configuration):
9895
99- ``` bash
100- gcloud projects add-iam-policy-binding YOUR_PROJECT_ID \
101- --member=" serviceAccount:spanner-reader-account@YOUR_PROJECT_ID.iam.gserviceaccount.com" \
102- --role=" roles/spanner.viewer"
103- ```
96+ ` ` ` bash
97+ gcloud projects add-iam-policy-binding YOUR_PROJECT_ID \
98+ --member=" serviceAccount:spanner-reader-account@YOUR_PROJECT_ID.iam.gserviceaccount.com" \
99+ --role=" roles/spanner.viewer"
100+ ` ` `
104101
105- ### Step 3: Download the service account key
102+ 1. Download the service account key
106103
107- Save the credentials locally so they can be used later by RDI:
104+ Save the credentials locally so they can be used later by RDI:
108105
109- ``` bash
110- gcloud iam service-accounts keys create ~ /spanner-reader-account.json \
111- --iam-account=spanner-reader-account@YOUR_PROJECT_ID.iam.gserviceaccount.com \
112- --project=YOUR_PROJECT_ID
113- ```
106+ ` ` ` bash
107+ gcloud iam service-accounts keys create ~ /spanner-reader-account.json \
108+ --iam-account=spanner-reader-account@YOUR_PROJECT_ID.iam.gserviceaccount.com \
109+ --project=YOUR_PROJECT_ID
110+ ` ` `
114111
115112# # 4. Set up secrets for Kubernetes deployment
116113
0 commit comments