-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeployment.yaml
66 lines (64 loc) · 2.12 KB
/
deployment.yaml
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
apiVersion: apps/v1
kind: Deployment
metadata:
name: odoo-deployment
spec:
replicas: 3
selector:
matchLabels:
app: odoo-app
template:
metadata:
labels:
app: odoo-app
spec:
serviceAccountName: ksa-bidv-cloudsql
containers:
- name: odoo-app
image: asia-southeast1-docker.pkg.dev/odoo-lab-vsi/bidv-poc/bidv_poc
ports:
- containerPort: 8069
env:
- name: DB_PORT_5432_TCP_ADDR
value: "localhost"
- name: DB_PORT_5432_TCP_PORT
value: "5432"
- name: INSTANCE_HOST
value: "127.0.0.1"
- name: DB_PORT
value: "5432"
- name: DB_ENV_POSTGRES_USER
value: "odoo"
- name: DB_ENV_POSTGRES_PASSWORD
value: "password"
- name: DB_USER
valueFrom:
secretKeyRef:
name: gke-cloud-sql-secrets
key: username
- name: DB_PASS
valueFrom:
secretKeyRef:
name: gke-cloud-sql-secrets
key: password
- name: DB_NAME
value: "odoo"
- name: cloud-sql-proxy
# This uses the latest version of the Cloud SQL proxy
# It is recommended to use a specific version for production environments.
# See: https://github.com/GoogleCloudPlatform/cloudsql-proxy
image: gcr.io/cloudsql-docker/gce-proxy:latest
command:
- "/cloud_sql_proxy"
# If connecting from a VPC-native GKE cluster, you can use the
# following flag to have the proxy connect over private IP
- "-ip_address_types=PRIVATE"
# tcp should be set to the port the proxy should listen on
# and should match the DB_PORT value set above.
# Defaults: MySQL: 3306, Postgres: 5432, SQLServer: 1433
- "-instances=odoo-lab-vsi:asia-southeast1:odoo-bidv-doc=tcp:5432"
securityContext:
# The default Cloud SQL proxy image runs as the
# "nonroot" user and group (uid: 65532) by default.
runAsNonRoot: true
# [END cloud_sql_postgres_databasesql_gke_quickstart_deployment]