File tree Expand file tree Collapse file tree 6 files changed +224
-0
lines changed
Expand file tree Collapse file tree 6 files changed +224
-0
lines changed Original file line number Diff line number Diff line change 1+ # Copyright 2021 Google LLC
2+ #
3+ # Licensed under the Apache License, Version 2.0 (the "License");
4+ # you may not use this file except in compliance with the License.
5+ # You may obtain a copy of the License at
6+ #
7+ # http://www.apache.org/licenses/LICENSE-2.0
8+ #
9+ # Unless required by applicable law or agreed to in writing, software
10+ # distributed under the License is distributed on an "AS IS" BASIS,
11+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ # See the License for the specific language governing permissions and
13+ # limitations under the License.
14+
15+ # [START cloud_sql_mysql_java_gke_quickstart_deployment]
16+ apiVersion : apps/v1
17+ kind : Deployment
18+ metadata :
19+ name : gke-cloud-sql-quickstart
20+ spec :
21+ selector :
22+ matchLabels :
23+ app : gke-cloud-sql-app
24+ template :
25+ metadata :
26+ labels :
27+ app : gke-cloud-sql-app
28+ spec :
29+ serviceAccountName : <YOUR-KSA-NAME>
30+ containers :
31+ - name : gke-cloud-sql-app
32+ # Replace <LOCATION> with your Artifact Registry location (e.g., us-central1).
33+ # Replace <YOUR_PROJECT_ID> with your project ID.
34+ image : <LOCATION>-docker.pkg.dev/<YOUR_PROJECT_ID>/gke-cloud-sql-repo/gke-sql:latest
35+ # This app listens on port 8080 for web traffic by default.
36+ ports :
37+ - containerPort : 8080
38+ env :
39+ - name : PORT
40+ value : " 8080"
41+ - name : INSTANCE_CONNECTION_NAME
42+ value : <INSTANCE_CONNECTION_NAME>
43+ - name : DB_HOST
44+ value : " 127.0.0.1"
45+ - name : DB_PORT
46+ value : " 3306"
47+ - name : DB_USER
48+ valueFrom :
49+ secretKeyRef :
50+ name : <YOUR-DB-SECRET>
51+ key : username
52+ - name : DB_PASS
53+ valueFrom :
54+ secretKeyRef :
55+ name : <YOUR-DB-SECRET>
56+ key : password
57+ - name : DB_NAME
58+ valueFrom :
59+ secretKeyRef :
60+ name : <YOUR-DB-SECRET>
61+ key : database
62+ # [END cloud_sql_mysql_java_gke_quickstart_deployment]
Original file line number Diff line number Diff line change 1+ # Copyright 2021 Google LLC
2+ #
3+ # Licensed under the Apache License, Version 2.0 (the "License");
4+ # you may not use this file except in compliance with the License.
5+ # You may obtain a copy of the License at
6+ #
7+ # http://www.apache.org/licenses/LICENSE-2.0
8+ #
9+ # Unless required by applicable law or agreed to in writing, software
10+ # distributed under the License is distributed on an "AS IS" BASIS,
11+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ # See the License for the specific language governing permissions and
13+ # limitations under the License.
14+
15+ # [START cloud_sql_mysql_java_gke_quickstart_sa]
16+ apiVersion : v1
17+ kind : ServiceAccount
18+ metadata :
19+ name : <YOUR-KSA-NAME> # TODO(developer): replace this value.
20+ # [END cloud_sql_mysql_java_gke_quickstart_sa]
Original file line number Diff line number Diff line change 1+ # Copyright 2021 Google LLC
2+ #
3+ # Licensed under the Apache License, Version 2.0 (the "License");
4+ # you may not use this file except in compliance with the License.
5+ # You may obtain a copy of the License at
6+ #
7+ # http://www.apache.org/licenses/LICENSE-2.0
8+ #
9+ # Unless required by applicable law or agreed to in writing, software
10+ # distributed under the License is distributed on an "AS IS" BASIS,
11+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ # See the License for the specific language governing permissions and
13+ # limitations under the License.
14+
15+ # [START cloud_sql_mysql_java_gke_quickstart_service]
16+ # The service provides a load-balancing proxy over the gke-cloud-sql-app
17+ # pods. By specifying the type as a 'LoadBalancer', Kubernetes Engine will
18+ # create an external HTTP load balancer.
19+ apiVersion : v1
20+ kind : Service
21+ metadata :
22+ name : gke-cloud-sql-app
23+ spec :
24+ type : LoadBalancer
25+ selector :
26+ app : gke-cloud-sql-app
27+ ports :
28+ - port : 80
29+ targetPort : 8080
30+ # [END cloud_sql_mysql_java_gke_quickstart_service]
Original file line number Diff line number Diff line change 1+ # Copyright 2021 Google LLC
2+ #
3+ # Licensed under the Apache License, Version 2.0 (the "License");
4+ # you may not use this file except in compliance with the License.
5+ # You may obtain a copy of the License at
6+ #
7+ # http://www.apache.org/licenses/LICENSE-2.0
8+ #
9+ # Unless required by applicable law or agreed to in writing, software
10+ # distributed under the License is distributed on an "AS IS" BASIS,
11+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ # See the License for the specific language governing permissions and
13+ # limitations under the License.
14+
15+ # [START cloud_sql_postgres_java_gke_quickstart_deployment]
16+ apiVersion : apps/v1
17+ kind : Deployment
18+ metadata :
19+ name : gke-cloud-sql-quickstart
20+ spec :
21+ selector :
22+ matchLabels :
23+ app : gke-cloud-sql-app
24+ template :
25+ metadata :
26+ labels :
27+ app : gke-cloud-sql-app
28+ spec :
29+ serviceAccountName : <YOUR-KSA-NAME>
30+ containers :
31+ - name : gke-cloud-sql-app
32+ # Replace <LOCATION> with your Artifact Registry location (e.g., us-central1).
33+ # Replace <YOUR_PROJECT_ID> with your project ID.
34+ image : <LOCATION>-docker.pkg.dev/<YOUR_PROJECT_ID>/gke-cloud-sql-repo/gke-sql:latest
35+ # This app listens on port 8080 for web traffic by default.
36+ ports :
37+ - containerPort : 8080
38+ env :
39+ - name : PORT
40+ value : " 8080"
41+ - name : INSTANCE_CONNECTION_NAME
42+ value : <INSTANCE_CONNECTION_NAME>
43+ - name : DB_HOST
44+ value : " 127.0.0.1"
45+ - name : DB_PORT
46+ value : " 5432"
47+ - name : DB_USER
48+ valueFrom :
49+ secretKeyRef :
50+ name : <YOUR-DB-SECRET>
51+ key : username
52+ - name : DB_PASS
53+ valueFrom :
54+ secretKeyRef :
55+ name : <YOUR-DB-SECRET>
56+ key : password
57+ - name : DB_NAME
58+ valueFrom :
59+ secretKeyRef :
60+ name : <YOUR-DB-SECRET>
61+ key : database
62+ # [END cloud_sql_postgres_java_gke_quickstart_deployment]
Original file line number Diff line number Diff line change 1+ # Copyright 2021 Google LLC
2+ #
3+ # Licensed under the Apache License, Version 2.0 (the "License");
4+ # you may not use this file except in compliance with the License.
5+ # You may obtain a copy of the License at
6+ #
7+ # http://www.apache.org/licenses/LICENSE-2.0
8+ #
9+ # Unless required by applicable law or agreed to in writing, software
10+ # distributed under the License is distributed on an "AS IS" BASIS,
11+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ # See the License for the specific language governing permissions and
13+ # limitations under the License.
14+
15+ # [START cloud_sql_postgres_java_gke_quickstart_sa]
16+ apiVersion : v1
17+ kind : ServiceAccount
18+ metadata :
19+ name : <YOUR-KSA-NAME> # TODO(developer): replace this value.
20+ # [END cloud_sql_postgres_java_gke_quickstart_sa]
Original file line number Diff line number Diff line change 1+ # Copyright 2021 Google LLC
2+ #
3+ # Licensed under the Apache License, Version 2.0 (the "License");
4+ # you may not use this file except in compliance with the License.
5+ # You may obtain a copy of the License at
6+ #
7+ # http://www.apache.org/licenses/LICENSE-2.0
8+ #
9+ # Unless required by applicable law or agreed to in writing, software
10+ # distributed under the License is distributed on an "AS IS" BASIS,
11+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ # See the License for the specific language governing permissions and
13+ # limitations under the License.
14+
15+ # [START cloud_sql_postgres_java_gke_quickstart_service]
16+ # The service provides a load-balancing proxy over the gke-cloud-sql-app
17+ # pods. By specifying the type as a 'LoadBalancer', Kubernetes Engine will
18+ # create an external HTTP load balancer.
19+ apiVersion : v1
20+ kind : Service
21+ metadata :
22+ name : gke-cloud-sql-app
23+ spec :
24+ type : LoadBalancer
25+ selector :
26+ app : gke-cloud-sql-app
27+ ports :
28+ - port : 80
29+ targetPort : 8080
30+ # [END cloud_sql_postgres_java_gke_quickstart_service]
You can’t perform that action at this time.
0 commit comments