diff --git a/k8s/api-deployment.yaml b/k8s/api-deployment.yaml new file mode 100644 index 0000000..3d9b7c3 --- /dev/null +++ b/k8s/api-deployment.yaml @@ -0,0 +1,55 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: snack-bar-api + namespace: snack-bar +spec: + replicas: 1 + selector: + matchLabels: + app: snack-bar-api + template: + metadata: + labels: + app: snack-bar-api + spec: + containers: + - name: snack-bar-api + image: deborasilveira/snack-bar-api:latest + ports: + - containerPort: 3000 + env: + - name: DATABASE_URL + value: 'postgresql://root:root@snack-bar-db:5432/snack-api-db' + resources: + requests: + cpu: 100m +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: payment-webhook-api + namespace: snack-bar +spec: + replicas: 1 + selector: + matchLabels: + app: payment-webhook-api + template: + metadata: + labels: + app: payment-webhook-api + spec: + containers: + - name: payment-webhook-api + image: deborasilveira/payment-webhook-api:latest + ports: + - containerPort: 3001 + env: + - name: MERCADO_PAGO_ACCESS_TOKEN + value: 'TEST-7418278903320835-072411-cef84b2f32a8952e205f8f50e3e20d15-391569826' + - name: MERCADO_PAGO_API_URL + value: 'https://api.mercadopago.com/v1' + resources: + requests: + cpu: 100m diff --git a/k8s/api-service.yaml b/k8s/api-service.yaml new file mode 100644 index 0000000..760f5c1 --- /dev/null +++ b/k8s/api-service.yaml @@ -0,0 +1,25 @@ +apiVersion: v1 +kind: Service +metadata: + name: snack-bar-api + namespace: snack-bar +spec: + selector: + app: snack-bar-api + ports: + - port: 3000 + targetPort: 3000 + type: LoadBalancer +--- +apiVersion: v1 +kind: Service +metadata: + name: payment-webhook-api + namespace: snack-bar +spec: + selector: + app: payment-webhook-api + ports: + - port: 3001 + targetPort: 3001 + type: LoadBalancer diff --git a/snack-bar-api/infra/k8s/db-deployment.yaml b/k8s/db-deployment.yaml similarity index 100% rename from snack-bar-api/infra/k8s/db-deployment.yaml rename to k8s/db-deployment.yaml diff --git a/snack-bar-api/infra/k8s/db-pv.yaml b/k8s/db-pv.yaml similarity index 100% rename from snack-bar-api/infra/k8s/db-pv.yaml rename to k8s/db-pv.yaml diff --git a/snack-bar-api/infra/k8s/db-pvc.yaml b/k8s/db-pvc.yaml similarity index 100% rename from snack-bar-api/infra/k8s/db-pvc.yaml rename to k8s/db-pvc.yaml diff --git a/snack-bar-api/infra/k8s/db-service.yaml b/k8s/db-service.yaml similarity index 100% rename from snack-bar-api/infra/k8s/db-service.yaml rename to k8s/db-service.yaml diff --git a/snack-bar-api/infra/k8s/hpa.yaml b/k8s/hpa.yaml similarity index 100% rename from snack-bar-api/infra/k8s/hpa.yaml rename to k8s/hpa.yaml diff --git a/snack-bar-api/infra/k8s/metrics.yaml b/k8s/metrics.yaml similarity index 100% rename from snack-bar-api/infra/k8s/metrics.yaml rename to k8s/metrics.yaml diff --git a/snack-bar-api/infra/k8s/migration-job.yaml b/k8s/migration-job.yaml similarity index 100% rename from snack-bar-api/infra/k8s/migration-job.yaml rename to k8s/migration-job.yaml diff --git a/snack-bar-api/infra/k8s/namespace.yaml b/k8s/namespace.yaml similarity index 100% rename from snack-bar-api/infra/k8s/namespace.yaml rename to k8s/namespace.yaml diff --git a/payment-webhook b/payment-webhook index cd72877..71f2837 160000 --- a/payment-webhook +++ b/payment-webhook @@ -1 +1 @@ -Subproject commit cd72877ba5b06f3b9b067f5e4a690b8538b5493d +Subproject commit 71f2837d3a96fb96c5f7c34947f8aef72e4588b8 diff --git a/snack-bar-api/infra/k8s/api-deployment.yaml b/snack-bar-api/infra/k8s/api-deployment.yaml deleted file mode 100644 index b119c91..0000000 --- a/snack-bar-api/infra/k8s/api-deployment.yaml +++ /dev/null @@ -1,26 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: snack-bar-api - namespace: snack-bar -spec: - replicas: 1 - selector: - matchLabels: - app: snack-bar-api - template: - metadata: - labels: - app: snack-bar-api - spec: - containers: - - name: snack-bar-api - image: deborasilveira/snack-bar-api:latest - ports: - - containerPort: 3000 - env: - - name: DATABASE_URL - value: "postgresql://root:root@snack-bar-db:5432/snack-api-db" - resources: - requests: - cpu: 100m diff --git a/snack-bar-api/infra/k8s/api-service.yaml b/snack-bar-api/infra/k8s/api-service.yaml deleted file mode 100644 index 6cdc311..0000000 --- a/snack-bar-api/infra/k8s/api-service.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: snack-bar-api - namespace: snack-bar -spec: - selector: - app: snack-bar-api - ports: - - port: 3000 - targetPort: 3000 - type: LoadBalancer