|
| 1 | +# Copyright 2022 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_sqlserver_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 | + # For more information about using Kubernetes service accounts see: |
| 30 | + # https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts |
| 31 | + serviceAccountName: <YOUR-KSA-NAME> # TODO(developer): replace this value. |
| 32 | + containers: |
| 33 | + - name: gke-cloud-sql-app |
| 34 | + # Replace <LOCATION> with your Artifact Registry location (e.g., us-central1). |
| 35 | + # Replace <YOUR_PROJECT_ID> with your project ID. |
| 36 | + image: <LOCATION>-docker.pkg.dev/<YOUR_PROJECT_ID>/gke-cloud-sql-repo/gke-sql:latest |
| 37 | + # This app listens on port 8080 for web traffic by default. |
| 38 | + ports: |
| 39 | + - containerPort: 8080 |
| 40 | + env: |
| 41 | + - name: PORT |
| 42 | + value: "8080" |
| 43 | + - name: INSTANCE_CONNECTION_NAME |
| 44 | + value: <INSTANCE_CONNECTION_NAME> |
| 45 | + - name: DB_HOST |
| 46 | + value: "127.0.0.1" |
| 47 | + - name: DB_PORT |
| 48 | + value: "1433" |
| 49 | + - name: DB_USER |
| 50 | + valueFrom: |
| 51 | + secretKeyRef: |
| 52 | + name: <YOUR-DB-SECRET> |
| 53 | + key: username |
| 54 | + - name: DB_PASS |
| 55 | + valueFrom: |
| 56 | + secretKeyRef: |
| 57 | + name: <YOUR-DB-SECRET> |
| 58 | + key: password |
| 59 | + - name: DB_NAME |
| 60 | + valueFrom: |
| 61 | + secretKeyRef: |
| 62 | + name: <YOUR-DB-SECRET> |
| 63 | + key: database |
| 64 | +# [END cloud_sql_sqlserver_java_gke_quickstart_deployment] |
0 commit comments