From cee08a6975672e8c64d7d8d8e237ef0298ecfa6d Mon Sep 17 00:00:00 2001 From: deanchen Date: Tue, 24 May 2022 09:52:33 +0800 Subject: [PATCH] feat: deploy test --- deployment/overlays/prod/deployment.yaml | 37 +++++++++++++++++++ deployment/overlays/prod/kustomization.yaml | 3 +- .../prod/treetracker-webmap-api-mapping.yaml | 16 ++++++++ 3 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 deployment/overlays/prod/deployment.yaml create mode 100644 deployment/overlays/prod/treetracker-webmap-api-mapping.yaml diff --git a/deployment/overlays/prod/deployment.yaml b/deployment/overlays/prod/deployment.yaml new file mode 100644 index 00000000..9dc7ec40 --- /dev/null +++ b/deployment/overlays/prod/deployment.yaml @@ -0,0 +1,37 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: treetracker-query-api + namespace: webmap + labels: + app: treetracker-query-api +spec: + replicas: 1 + selector: + matchLabels: + app: treetracker-query-api + template: + metadata: + labels: + app: treetracker-query-api + spec: + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: doks.digitalocean.com/node-pool + operator: In + values: + - microservices-node-pool + containers: + - name: treetracker-query-api + image: greenstand/treetracker-query-api:TAG + ports: + - containerPort: 80 + env: + - name: DATABASE_URL + valueFrom: + secretKeyRef: + name: dbconnection + key: database diff --git a/deployment/overlays/prod/kustomization.yaml b/deployment/overlays/prod/kustomization.yaml index 0ca88b7f..f5b4a6a9 100644 --- a/deployment/overlays/prod/kustomization.yaml +++ b/deployment/overlays/prod/kustomization.yaml @@ -1,4 +1,5 @@ bases: - ../../base patchesStrategicMerge: - - database-connection-sealed-secret.yaml + - treetracker-webmap-api-mapping.yaml + - deployment.yaml diff --git a/deployment/overlays/prod/treetracker-webmap-api-mapping.yaml b/deployment/overlays/prod/treetracker-webmap-api-mapping.yaml new file mode 100644 index 00000000..b3c8d74a --- /dev/null +++ b/deployment/overlays/prod/treetracker-webmap-api-mapping.yaml @@ -0,0 +1,16 @@ +--- +apiVersion: getambassador.io/v2 +kind: Mapping +metadata: + name: treetracker-query-api + namespace: webmap +spec: + cors: + origins: + - '*' + - https://wallet.treetracker.org + - https://freetown.treetracker.org + - https://map.treetracker.org + - https://forestmatic.com + - https://app.forestmatic.com + - https://staging-app.forestmatic.com