You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 30, 2023. It is now read-only.
* How to use the Cloud SQL Proxy to offload the work of connecting to your
40
44
Cloud SQL instance and reduce your applications knowledge of your infrastructure
41
45
42
-
####Unprivileged service accounts
46
+
### Unprivileged service accounts
43
47
44
48
By default all Kubernetes Engine nodes are assigned the default Compute Engine
45
49
service account. This service account is fairly high privilege and has access
@@ -51,15 +55,15 @@ a least-privilege service account for our Kubernetes Engine nodes and then
51
55
create more specific (but still least-privilege) service accounts for our
52
56
containers.
53
57
54
-
####Privileged service accounts in containers
58
+
### Privileged service accounts in containers
55
59
56
60
The only two ways to get service account credentials are 1.) through your host
57
61
instance, which as we discussed we don't want, or 2.) through a credentials
58
62
file. This demo will show you how to get this credentials file into your
59
63
container running in Kubernetes Engine so your application has the privileges
60
64
it needs.
61
65
62
-
####Cloud SQL Proxy
66
+
### Cloud SQL Proxy
63
67
64
68
The Cloud SQL Proxy allows you to offload the burden of creating and
65
69
maintaining a connection to your Cloud SQL instance to the Cloud SQL Proxy
@@ -91,14 +95,6 @@ with a Cloud SQL Proxy instance](docs/architecture-diagram.png)
91
95
92
96
## Prerequisites
93
97
94
-
### Supported Operating Systems
95
-
96
-
* macOS
97
-
* Linux
98
-
* Google Cloud Shell
99
-
100
-
## Prerequisites
101
-
102
98
A Google Cloud account and project is required for this. Access to an existing Google Cloud
103
99
project with the Kubernetes Engine service enabled If you do not have a Google Cloud account
104
100
please signup for a free trial [here](https://cloud.google.com).
@@ -110,7 +106,8 @@ Click the button below to run the demo in a [Google Cloud Shell](https://cloud.g
110
106
[](https://console.cloud.google.com/cloudshell/open?git_repo=https%3A%2F%2Fgithub.com%2FGoogleCloudPlatform%2Fgke-cloud-sql-postgres-demo&page=editor&tutorial=README.md)
111
107
112
108
All the tools for the demo are installed. When using Cloud Shell execute the following
113
-
command in order to setup gcloud cli.
109
+
command in order to setup gcloud cli. When executing this command please setup your region
110
+
and zone.
114
111
115
112
```console
116
113
gcloud init
@@ -124,14 +121,32 @@ This project will run on macOS, Linux, or in a [Google Cloud Shell](https://clou
124
121
125
122
When not using Cloud Shell, the following tools are required.
126
123
127
-
1.gcloud (Google Cloud SDK version >= 200.0.0)
128
-
2. kubectl >= 1.8.6
124
+
1.[Google Cloud SDK (200.0.0 or later)](https://cloud.google.com/sdk/downloads)
Prior to running this demo, ensure you have authenticated your gcloud client by running the following command:
145
+
146
+
```console
147
+
gcloud auth application-default login
148
+
```
149
+
135
150
If you don't have a Google Cloud account you can sign up for a [free account](https://cloud.google.com/).
136
151
137
152
## Deployment
@@ -176,15 +191,32 @@ password you created earlier to connect to 127.0.0.1:5432.
176
191
177
192
Validation is fully automated. The validation script checks for the existence
178
193
of the Cloud SQL instance, the Kubernetes Engine cluster, and the running pod.
179
-
All of these resources should exist after the deployment script completes. In
180
-
order to validate you need to run **validate.sh**. The script takes the
181
-
following parameters, in order:
194
+
All of these resources should exist after the deployment script completes. Now that the application is deployed, we can validate these three deployments by executing:
195
+
196
+
```console
197
+
make validate
198
+
```
199
+
The script takes the following parameters, in order:
182
200
* INSTANCE_NAME - the name of the existing Cloud SQL instance
183
201
202
+
A successful output will look like this:
203
+
```console
204
+
Cloud SQL instance exists
205
+
GKE cluster exists
206
+
pgAdmin4 Deployment object exists
207
+
```
208
+
184
209
## Teardown
185
210
186
211
Teardown is fully automated. The teardown script deletes every resource created
187
-
in the deployment script. In order to teardown you need to run **teardown.sh**.
212
+
in the deployment script. In order to teardown you need to run,
213
+
214
+
```console
215
+
make teardown
216
+
```
217
+
218
+
It will run **teardown.sh** which will destroy all of the resources created for this demonstration.
219
+
188
220
The script takes the following parameters, in order:
189
221
* INSTANCE_NAME - the name of the existing Cloud SQL instance
0 commit comments