|
| 1 | +apiVersion: apps/v1 |
| 2 | +kind: Deployment |
| 3 | +metadata: |
| 4 | + namespace: prod |
| 5 | + name: relui-deployment |
| 6 | +spec: |
| 7 | + selector: |
| 8 | + matchLabels: |
| 9 | + app: relui |
| 10 | + strategy: |
| 11 | + type: Recreate |
| 12 | + template: |
| 13 | + metadata: |
| 14 | + labels: |
| 15 | + app: relui |
| 16 | + spec: |
| 17 | + serviceAccountName: relui |
| 18 | + containers: |
| 19 | + - name: relui |
| 20 | + image: gcr.io/symbolic-datum-552/relui:latest |
| 21 | + imagePullPolicy: Always |
| 22 | + command: ["/sbin/tini", "--", "./relui", "--listen-https-selfsigned=:444"] |
| 23 | + ports: |
| 24 | + - containerPort: 444 |
| 25 | + env: |
| 26 | + - name: PGUSER |
| 27 | + value: relui |
| 28 | + - name: PGDATABASE |
| 29 | + value: relui-prod |
| 30 | + resources: |
| 31 | + requests: |
| 32 | + cpu: "2" |
| 33 | + memory: "4Gi" |
| 34 | + - name: cloud-sql-proxy |
| 35 | + # It is recommended to use the latest version of the Cloud SQL proxy |
| 36 | + image: gcr.io/cloudsql-docker/gce-proxy:latest |
| 37 | + command: |
| 38 | + - "/cloud_sql_proxy" |
| 39 | + |
| 40 | + # If connecting from a VPC-native GKE cluster, you can use the |
| 41 | + # following flag to have the proxy connect over private IP |
| 42 | + - "-ip_address_types=PRIVATE" |
| 43 | + |
| 44 | + # Replace DB_PORT with the port the proxy should listen on |
| 45 | + # Defaults: MySQL: 3306, Postgres: 5432, SQLServer: 1433 |
| 46 | + - "-instances=symbolic-datum-552:us-central1:relui-prod-01=tcp:5432" |
| 47 | + securityContext: |
| 48 | + # The default Cloud SQL proxy image runs as the |
| 49 | + # "nonroot" user and group (uid: 65532) by default. |
| 50 | + runAsNonRoot: true |
| 51 | + # Resource configuration depends on an application's requirements. You |
| 52 | + # should adjust the following values based on what your application |
| 53 | + # needs. For details, see https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ |
| 54 | + resources: |
| 55 | + requests: |
| 56 | + # The proxy's memory use scales linearly with the number of active |
| 57 | + # connections. Fewer open connections will use less memory. Adjust |
| 58 | + # this value based on your application's requirements. |
| 59 | + memory: "2Gi" |
| 60 | + # The proxy's CPU use scales linearly with the amount of IO between |
| 61 | + # the database and the application. Adjust this value based on your |
| 62 | + # application's requirements. |
| 63 | + cpu: "1" |
| 64 | +--- |
| 65 | +apiVersion: v1 |
| 66 | +kind: ServiceAccount |
| 67 | +metadata: |
| 68 | + namespace: prod |
| 69 | + name: relui |
| 70 | + annotations: |
| 71 | + iam.gke.io/gcp-service-account: [email protected] |
| 72 | +--- |
| 73 | +apiVersion: v1 |
| 74 | +kind: Service |
| 75 | +metadata: |
| 76 | + namespace: prod |
| 77 | + name: relui-internal |
| 78 | + annotations: |
| 79 | + cloud.google.com/neg: '{"ingress": false}' |
| 80 | + cloud.google.com/app-protocols: '{"https":"HTTP2"}' |
| 81 | +spec: |
| 82 | + ports: |
| 83 | + - port: 444 |
| 84 | + targetPort: 444 |
| 85 | + name: https |
| 86 | + selector: |
| 87 | + app: relui |
| 88 | + type: NodePort |
0 commit comments