From 1417475f8075abffa7a77f670feaab8e8d34cb74 Mon Sep 17 00:00:00 2001 From: hwmin414 Date: Mon, 15 Jan 2024 00:07:17 +0900 Subject: [PATCH 01/25] feat: initialize deployment definitions --- .github/workflows/push_image_ecr.yml | 64 +++++++++++++++++++++ deployment/.gitignore | 1 + deployment/README.md | 32 +++++++++++ deployment/base/db/deployment.yaml | 34 +++++++++++ deployment/base/db/service.yaml | 12 ++++ deployment/base/kustomization.yaml | 10 ++++ deployment/base/server/configmap.yaml | 8 +++ deployment/base/server/deployment.yaml | 29 ++++++++++ deployment/base/server/ingress.yaml | 34 +++++++++++ deployment/base/server/secret-template.yaml | 10 ++++ deployment/base/server/service.yaml | 12 ++++ deployment/overlays/dev/kustomization.yaml | 7 +++ 12 files changed, 253 insertions(+) create mode 100644 .github/workflows/push_image_ecr.yml create mode 100644 deployment/.gitignore create mode 100644 deployment/README.md create mode 100644 deployment/base/db/deployment.yaml create mode 100644 deployment/base/db/service.yaml create mode 100644 deployment/base/kustomization.yaml create mode 100644 deployment/base/server/configmap.yaml create mode 100644 deployment/base/server/deployment.yaml create mode 100644 deployment/base/server/ingress.yaml create mode 100644 deployment/base/server/secret-template.yaml create mode 100644 deployment/base/server/service.yaml create mode 100644 deployment/overlays/dev/kustomization.yaml diff --git a/.github/workflows/push_image_ecr.yml b/.github/workflows/push_image_ecr.yml new file mode 100644 index 00000000..4b69a057 --- /dev/null +++ b/.github/workflows/push_image_ecr.yml @@ -0,0 +1,64 @@ +name: Push Prod Image to Amazon ECR + +# when tagging action success +on: + pull_request: + types: + - closed + branches: + - deploy + +env: + AWS_REGION: ap-northeast-2 + +jobs: + image-build-and-push: + name: Build and Push + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Cache Docker layers + uses: actions/cache@v3 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: ${{ env.AWS_REGION }} + + - name: Login to AWS ECR + id: login-ecr + uses: aws-actions/amazon-ecr-login@v1 + + - name: Build Image and Push to AWS ECR + id: build_image_and_push + uses: docker/build-push-action@v5 + env: + ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} + ECR_REPOSITORY: biseo-server + with: + push: true + tags: | + "${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:latest" + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new + + - name: Remove old cache + run: | + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache + \ No newline at end of file diff --git a/deployment/.gitignore b/deployment/.gitignore new file mode 100644 index 00000000..d37e42ce --- /dev/null +++ b/deployment/.gitignore @@ -0,0 +1 @@ +**/secret.yaml \ No newline at end of file diff --git a/deployment/README.md b/deployment/README.md new file mode 100644 index 00000000..89a0b77a --- /dev/null +++ b/deployment/README.md @@ -0,0 +1,32 @@ +# Deployment Resource Definitions for Taxi Backend Service + +### directories +``` +├── README.md +├── base +│ ├── kustomization.yaml +│ ├── db +│ │ ├── deployment.yaml +│ │ └── service.yaml +│ └── server +│ ├── configmap.yaml +│ ├── deployment.yaml +│ ├── ingress.yaml +│ ├── sealed-secret.yaml +│ ├── secret-template.yaml +│ ├── secret.yaml +│ └── service.yaml +└── overlays + └── dev + └── kustomization.yaml +``` + +*under base folder* +- shared resource definitions for all environments + +*under overlay folder* +- environment specific settings +- you can add more environments + +### Using kubeseal +[Document Notion Link](https://www.notion.so/sparcs/K8S-Sealed-Secret-kubeseal-c3e315e429c442bebf8998b048404e17) [sparcs only] \ No newline at end of file diff --git a/deployment/base/db/deployment.yaml b/deployment/base/db/deployment.yaml new file mode 100644 index 00000000..af538bd7 --- /dev/null +++ b/deployment/base/db/deployment.yaml @@ -0,0 +1,34 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: biseo-db + labels: + app: biseo-db +spec: + replicas: 1 + selector: + matchLabels: + app: biseo-db + template: + metadata: + labels: + app: biseo-db + spec: + containers: + - name: biseo-db + image: mysql:8.0 + command: ["--character-set-server=utf8mb4", "--collation-server=utf8mb4_unicode_ci"] + ports: + - containerPort: 3306 + name: db-port + env: + - name: MYSQL_ROOT_PASSWORD + valueFrom: + secretKeyRef: + name: biseo-secret + key: DB_PASSWORD + - name: MYSQL_DATABASE + valueFrom: + configMapKeyRef: + name: biseo-env + key: DB_NAME \ No newline at end of file diff --git a/deployment/base/db/service.yaml b/deployment/base/db/service.yaml new file mode 100644 index 00000000..d69c716b --- /dev/null +++ b/deployment/base/db/service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: biseo-db-service +spec: + selector: + app: biseo-db + ports: + - name: db-port + protocol: TCP + port: 3306 + targetPort: db-port diff --git a/deployment/base/kustomization.yaml b/deployment/base/kustomization.yaml new file mode 100644 index 00000000..58774115 --- /dev/null +++ b/deployment/base/kustomization.yaml @@ -0,0 +1,10 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- ./server/deployment.yaml +- ./server/configmap.yaml +- ./server/service.yaml +- ./server/ingress.yaml +- ./server/sealed-secret.yaml +- ./db/deployment.yaml +- ./db/service.yaml \ No newline at end of file diff --git a/deployment/base/server/configmap.yaml b/deployment/base/server/configmap.yaml new file mode 100644 index 00000000..5a2c5ae7 --- /dev/null +++ b/deployment/base/server/configmap.yaml @@ -0,0 +1,8 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: biseo-env +data: + NODE_ENV: "production" + SERVER_PORT: 8000 + DB_NAME: "biseo" \ No newline at end of file diff --git a/deployment/base/server/deployment.yaml b/deployment/base/server/deployment.yaml new file mode 100644 index 00000000..65c35651 --- /dev/null +++ b/deployment/base/server/deployment.yaml @@ -0,0 +1,29 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: biseo-server + labels: + app: biseo-server +spec: + replicas: 2 + selector: + matchLabels: + app: biseo-server + template: + metadata: + labels: + app: biseo-server + spec: + containers: + - name: biseo-server + image: + ports: + - containerPort: 8000 + envFrom: + - secretRef: + name: biseo-secret + env: + - name: NODE_ENV + value: "production" + - name: SERVER_PORT + value: "8000" \ No newline at end of file diff --git a/deployment/base/server/ingress.yaml b/deployment/base/server/ingress.yaml new file mode 100644 index 00000000..39e7f9dc --- /dev/null +++ b/deployment/base/server/ingress.yaml @@ -0,0 +1,34 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + annotations: + alb.ingress.kubernetes.io/backend-protocol: HTTP + alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS":443}]' + alb.ingress.kubernetes.io/ssl-redirect: '443' + alb.ingress.kubernetes.io/scheme: internet-facing + alb.ingress.kubernetes.io/healthcheck-path: /api + alb.ingress.kubernetes.io/target-type: 'instance' + alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:ap-northeast-2:666583083672:certificate/2f5020e0-01dd-43dd-aa7e-0699015d6b89 + alb.ingress.kubernetes.io/ssl-policy: ELBSecurityPolicy-2016-08 + name: biseo-ingress + namespace: biseo + finalizers: + - ingress.k8s.aws/resources + labels: + app: biseo-ingress +spec: + ingressClassName: alb + rules: + - host: biseo-staging.sparcs.org + http: + paths: + - path: / + backend: + service: + name: biseo-svc + port: + number: 8000 + pathType: Prefix + tls: + - hosts: + - biseo-staging.sparcs.org diff --git a/deployment/base/server/secret-template.yaml b/deployment/base/server/secret-template.yaml new file mode 100644 index 00000000..5b9e9b7b --- /dev/null +++ b/deployment/base/server/secret-template.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: Secret +metadata: + name: biseo-secret + namespace: biseo +type: Opaque +data: + DATABASE_URL: base64encodedvalue + DB_PASSWORD: base64encodedvalue + SECRET_KEY: base64encodedvalue \ No newline at end of file diff --git a/deployment/base/server/service.yaml b/deployment/base/server/service.yaml new file mode 100644 index 00000000..aa631c9f --- /dev/null +++ b/deployment/base/server/service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: biseo-svc +spec: + type: NodePort + selector: + app: biseo-server + ports: + - protocol: TCP + port: 8000 + targetPort: 8000 \ No newline at end of file diff --git a/deployment/overlays/dev/kustomization.yaml b/deployment/overlays/dev/kustomization.yaml new file mode 100644 index 00000000..3f65ed37 --- /dev/null +++ b/deployment/overlays/dev/kustomization.yaml @@ -0,0 +1,7 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +images: +- name: ghcr.io/sparcs-kaist/biseo-server + newTag: latest +resources: +- ../../base \ No newline at end of file From 8f41adcc9b8845942184335b4793fb6d7a42de5d Mon Sep 17 00:00:00 2001 From: hwmin414 Date: Mon, 15 Jan 2024 16:05:17 +0900 Subject: [PATCH 02/25] feat: add sealed secret --- deployment/base/server/sealed-secret.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 deployment/base/server/sealed-secret.yaml diff --git a/deployment/base/server/sealed-secret.yaml b/deployment/base/server/sealed-secret.yaml new file mode 100644 index 00000000..8d60d3ca --- /dev/null +++ b/deployment/base/server/sealed-secret.yaml @@ -0,0 +1,18 @@ +--- +apiVersion: bitnami.com/v1alpha1 +kind: SealedSecret +metadata: + creationTimestamp: null + name: biseo-secret + namespace: biseo +spec: + encryptedData: + DATABASE_URL: AgBaJnMCzb2U+54Kb23hKBgMUOWE/a5lqGFOv367ndv4w5Ql1mt9WyDcWctfKoa5oz5M0VvPV3XcXppFvwfgaaYcOmRAaSnvH158JXW/vttFGb79XND/TYuUHI6ZSCHBdMReWQfca6Zk4y22YqUSBSfJvq/GyNe1Q358X5oc/dzUzWJXemD0G7K+m9FdD5YbZBotmhx6AXQIFAqNJ1Um/3J7QhUA9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uG1QNLgnxEpWcwoMbDgL4PxqHBf9oax7LfcSmk6usQJV5r0MOyZRFVyxIl9jLL89wN5GrcM+JU5Smk5OKolB4lIAWHwAHM6K5n0o9qRM2gz+wCoKjVqVrNsHneRL1K3w9Kqv5nWRRbNgx0HfQZMkuVj19F7+4puxHSpNISGD6fKzOA= + SECRET_KEY: AgBz3iRVvzfb/MB+tOlrJuS0zYJHqXQoLPuWHJX+24xoXNvVZvhdrGA5o1rtC+ro1rA+w3A6LZvA7trHebUBuUiKwcvoiklq0xB8hHSZGxZwUReCeNrKB17h7zVp3rsoGS16t73f9msequNLoFZAZfngGVPBf1aVhp1EPoSodGdRuiLUkHdS37K1HSUcYCZF5KUcBBuCJHvN5rNqm4+ZfdTq4nEuFtp7qbqcF1JW2jWI1qwzdVh7VRfB9tY3bzHirSsiqq580v+GxKG7CZEi+STWg2L/mqRFgbX9JaGar2/KuTw8TqMs4Ef1JutPzJdcIgChnks76VJEUy0jKRjxXdN9X7oB3wr1MjcSJvzCEwijSt2f8gYZ5SxYYzsdCNVoqO7ig3g2qbvsMVtTHcsNhAbyV9VdOTgUMsL+00xiIUos2MUedq8xhh0uytJunlnbkObAmdISv/ad/BbN/s514sr0ANDPmmeXUDm16/MhuZmaFRoDuCY/zdfb0ADDnzmeBscyhEKKcV7XZ5UHDcRNDkhZFbQYxfNF65uv7tFzrSFjVPvzdhdDwKT5cgWQLPcHIk54q2Sf3UP74M/LFTwGQ4lXkVnOfFtlUL9fnT1/F2R1wRdvrIevWSvOlbsB1DW3Yrc0krFh71ZPigVVgtdbr2KQv61qFf5MglsvazqfYNEkajhZPIqhCstRKtRrld2dmxHPJaZ6frU= + template: + metadata: + creationTimestamp: null + name: biseo-secret + namespace: biseo + type: Opaque From f97999694b6e556ae6b8138545d2684ae0ddbbd8 Mon Sep 17 00:00:00 2001 From: hwmin414 Date: Mon, 15 Jan 2024 16:10:18 +0900 Subject: [PATCH 03/25] fix: configmap err --- deployment/base/server/configmap.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/base/server/configmap.yaml b/deployment/base/server/configmap.yaml index 5a2c5ae7..b473f043 100644 --- a/deployment/base/server/configmap.yaml +++ b/deployment/base/server/configmap.yaml @@ -4,5 +4,5 @@ metadata: name: biseo-env data: NODE_ENV: "production" - SERVER_PORT: 8000 + SERVER_PORT: "8000" DB_NAME: "biseo" \ No newline at end of file From f310f0239f7af158229d25004320b479a46dc101 Mon Sep 17 00:00:00 2001 From: hwmin414 Date: Mon, 15 Jan 2024 16:11:33 +0900 Subject: [PATCH 04/25] feat: add image name --- deployment/base/server/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/base/server/deployment.yaml b/deployment/base/server/deployment.yaml index 65c35651..52b973f4 100644 --- a/deployment/base/server/deployment.yaml +++ b/deployment/base/server/deployment.yaml @@ -16,7 +16,7 @@ spec: spec: containers: - name: biseo-server - image: + image: 666583083672.dkr.ecr.ap-northeast-2.amazonaws.com/biseo-server:latest ports: - containerPort: 8000 envFrom: From e1c9955d84983bf2613e3c019fbd9f51d67acf28 Mon Sep 17 00:00:00 2001 From: hwmin414 Date: Mon, 15 Jan 2024 16:12:39 +0900 Subject: [PATCH 05/25] fix: db args --- deployment/base/db/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/base/db/deployment.yaml b/deployment/base/db/deployment.yaml index af538bd7..bf5431b2 100644 --- a/deployment/base/db/deployment.yaml +++ b/deployment/base/db/deployment.yaml @@ -17,7 +17,7 @@ spec: containers: - name: biseo-db image: mysql:8.0 - command: ["--character-set-server=utf8mb4", "--collation-server=utf8mb4_unicode_ci"] + args: ["--character-set-server=utf8mb4", "--collation-server=utf8mb4_unicode_ci"] ports: - containerPort: 3306 name: db-port From b1a91475fda51a314740f5311bfc1a46e85efa30 Mon Sep 17 00:00:00 2001 From: hwmin414 Date: Mon, 15 Jan 2024 16:23:16 +0900 Subject: [PATCH 06/25] feat: change to statefulset and add pvc --- deployment/base/db/pvc.yaml | 14 ++++++++++++++ .../db/{deployment.yaml => statefulset.yaml} | 17 +++++++++++++---- deployment/base/kustomization.yaml | 5 +++-- 3 files changed, 30 insertions(+), 6 deletions(-) create mode 100644 deployment/base/db/pvc.yaml rename deployment/base/db/{deployment.yaml => statefulset.yaml} (60%) diff --git a/deployment/base/db/pvc.yaml b/deployment/base/db/pvc.yaml new file mode 100644 index 00000000..5d16b55d --- /dev/null +++ b/deployment/base/db/pvc.yaml @@ -0,0 +1,14 @@ +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + namespace: biseo + name: biseo-db-pv-claim + labels: + app: biseo-db +spec: + storageClassName: "ebs-sc" + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 2Gi \ No newline at end of file diff --git a/deployment/base/db/deployment.yaml b/deployment/base/db/statefulset.yaml similarity index 60% rename from deployment/base/db/deployment.yaml rename to deployment/base/db/statefulset.yaml index bf5431b2..2906dbc3 100644 --- a/deployment/base/db/deployment.yaml +++ b/deployment/base/db/statefulset.yaml @@ -1,5 +1,5 @@ apiVersion: apps/v1 -kind: Deployment +kind: StatefulSet metadata: name: biseo-db labels: @@ -16,8 +16,10 @@ spec: spec: containers: - name: biseo-db - image: mysql:8.0 - args: ["--character-set-server=utf8mb4", "--collation-server=utf8mb4_unicode_ci"] + image: mysql:8.0.19 + args: + - --character-set-server=utf8mb4 + - --collation-server=utf8mb4_unicode_ci ports: - containerPort: 3306 name: db-port @@ -31,4 +33,11 @@ spec: valueFrom: configMapKeyRef: name: biseo-env - key: DB_NAME \ No newline at end of file + key: DB_NAME + volumeMounts: + - name: biseo-db-storage + mountPath: /var/lib/mysql + volumes: + - name: biseo-db-storage + persistentVolumeClaim: + claimName: biseo-db-pv-claim \ No newline at end of file diff --git a/deployment/base/kustomization.yaml b/deployment/base/kustomization.yaml index 58774115..9fea4586 100644 --- a/deployment/base/kustomization.yaml +++ b/deployment/base/kustomization.yaml @@ -6,5 +6,6 @@ resources: - ./server/service.yaml - ./server/ingress.yaml - ./server/sealed-secret.yaml -- ./db/deployment.yaml -- ./db/service.yaml \ No newline at end of file +- ./db/statefulset.yaml +- ./db/service.yaml +- ./db/pvc.yaml \ No newline at end of file From a0c71a28702d5a2341537834d6d9985c15634c8b Mon Sep 17 00:00:00 2001 From: hwmin414 Date: Mon, 15 Jan 2024 17:50:51 +0900 Subject: [PATCH 07/25] feat: update secret --- deployment/base/server/sealed-secret.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/deployment/base/server/sealed-secret.yaml b/deployment/base/server/sealed-secret.yaml index 8d60d3ca..bff8f91e 100644 --- a/deployment/base/server/sealed-secret.yaml +++ b/deployment/base/server/sealed-secret.yaml @@ -7,9 +7,9 @@ metadata: namespace: biseo spec: encryptedData: - DATABASE_URL: AgBaJnMCzb2U+54Kb23hKBgMUOWE/a5lqGFOv367ndv4w5Ql1mt9WyDcWctfKoa5oz5M0VvPV3XcXppFvwfgaaYcOmRAaSnvH158JXW/vttFGb79XND/TYuUHI6ZSCHBdMReWQfca6Zk4y22YqUSBSfJvq/GyNe1Q358X5oc/dzUzWJXemD0G7K+m9FdD5YbZBotmhx6AXQIFAqNJ1Um/3J7QhUA9VbIhxmfcr6EN1swDwTkYvm9S9LvspzmiIcBWu6QkFfDJxqBJXglT8M3p7qeKnfd8nyTQvtsP+PNzyxb1FQu1TZYHpUtorXmI8JrQLS1tDqQsCpaKABUKMpjlMZbD0srOI1r4pgXW5YlB/2KHdInKPVGeNaL6RZ+s577t96/jQNQ/5/1us852EQwZ5y7rPPeWadNOhyxsGrWK24LOJ9ncKLI+QXyXGBjaSU2KWVP7PGkRfnnPdoVcWFOrbuDfaioM1fOphGnsDEPT9T7GneVGVR05RP7xh80jI7a04c5beCMHxLJylI+SWBC9ePI4R3Ec/F0gJzZoICwJeGXHBZBP+GHa65v50W7sAHIX1fdY3qavP3BIblHmFFpLMwJ+6b21jOhEGNCmBelLGiJNe+E6srOBa0UK4NSge+7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1VDc8grZhf4TJDT/LXIZN9qaw0i7QYwo7Y0jtZhQhOC0IJtlfMVdjlySggRR3oYiH//tx8QWRVI+rQUvWEGJo7fiLs/VMYEc9mOFX2yHXmyzFEzLVZ41sR301Rf83AUw+fnxyaFQVUlJHoMTVumJ3AMBN4TyV4MDGwaNpq3BKxSu3DPn63fZdg8XpxxzZvGJSf0aZMWjnYYXAP9PWBFWmewPPlp534uiF/kr8i/r7JMBkr36B1vppNfPMpvSDjHXWEhcVp/ZeiWdJXzb2vfvkXi3TvpAAMuaHemHjVypTcL5N+d2gIek0rneizVJDB1PfE8JwhLyF2Cd2HBdPsbUQU8xgsT7sTnMUEBBYddW3OgyN55Qpegouzq5O7CYuXfYgijWvVSVPmowvheUkU8a5TDEF0t6HM768vW/7xBJ1bZIejC/WA+ShPYspEanQylWO1XPedIKaeg2ERQkhjA6WkqkQqASdvpraTq/VY23T7Tjvz3Xbb1+JsS0HbLIxsQaiE1izh8x/HhX1/gV4St6KmnT7LHnU+aXRH/6l3iHJhbRTw9KMY6VAXCJbF2YDgL+g= template: metadata: creationTimestamp: null From 2dc6545820b6bc8dda7f43d262ae73c68d1f7dd2 Mon Sep 17 00:00:00 2001 From: hwmin414 Date: Mon, 15 Jan 2024 17:56:57 +0900 Subject: [PATCH 08/25] feat: test sleep --- deployment/base/server/deployment.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/deployment/base/server/deployment.yaml b/deployment/base/server/deployment.yaml index 52b973f4..f26e42c3 100644 --- a/deployment/base/server/deployment.yaml +++ b/deployment/base/server/deployment.yaml @@ -17,6 +17,7 @@ spec: containers: - name: biseo-server image: 666583083672.dkr.ecr.ap-northeast-2.amazonaws.com/biseo-server:latest + commands: ["sleep", "600"] ports: - containerPort: 8000 envFrom: From f4a4a16a2969ba385bcce97e043332aaf58a0719 Mon Sep 17 00:00:00 2001 From: hwmin414 Date: Mon, 15 Jan 2024 18:08:11 +0900 Subject: [PATCH 09/25] feat: change secret --- deployment/base/server/sealed-secret.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/deployment/base/server/sealed-secret.yaml b/deployment/base/server/sealed-secret.yaml index bff8f91e..5d2dde3e 100644 --- a/deployment/base/server/sealed-secret.yaml +++ b/deployment/base/server/sealed-secret.yaml @@ -7,9 +7,9 @@ metadata: namespace: biseo spec: encryptedData: - DATABASE_URL: AgCTwJjwNhCu9qPI0mNJzsLtssZNha+Hnr1iczeE59QJhGCdlIMC1zOXjEqYQDD0IiAWYHTym418ol3GW3vgIoZcthcpp7Zp1Kt1XQ6q4KtV4fI5hdTESymVUUeUNCbG2ZTFZHFX5zZexZPkZqGQI68M5BZdk+Bl0uF/tc0qPYeH2FaMK3m8xpO6lEkxlaGumJIMO+chw9k9Y85gdr9CnnYwVCA+6rlXlw8m+HgZzeHuxuhUt293P8gY6Cx4ohL0gDmeWrBzsn79Cu3D7ZLBucSkexg6cZvsLWr9j1fW4TVv2gUaHJp8yVrAfp2DEnYDIxlGrnSJF6jw123ngWt+0jeIq1qkdCNHkPEy8sa9kD8DOlaSX/3UQ6hAsRnLqLtnx/BAeQPcOidNL6C+KkQ8jJEpkDk8bDD1wocObp5r+R3EZHbZa35NQluoK6WKj/IvLceYnv7sqdMXUGOqqy2kNR2IYrv5s7+F2xZ+qVcHhy4tWoUPBadAVaIPQoyLco3fZXysYZs31Z0hELc+CUbI6FiP83iCcSusGy1tKU61U2h914nFOWHi5EwKU129mmi74SI3a3tFr7JqBb2M9TjrnKRC59UXywAaEkvR7cdw20QSpVbCsO5oiQFfR9RzqLB17sUfdrDL0/HO9SKoPR8Evs9lyRfkZH1eupMf+IP7nVQ4nBMIGHhZe8pDzSANNnNzGqhxEWD3T0JHEzUVpNME+LWu58G4LsbbmMiB72xIaKPqaEyRzj+RHkJ31VmzrFOi - DB_PASSWORD: AgAB+YhfWhZS/uWiXh3TziSLzryv/YZuLEsay7EoPqfEV3hqSlrYi6KLxT864SilYwE/ajpIZiAh4pZ5NGaE6OGA1BUGcW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YsENSHiALffmRTt0fznnZTVWfVqiLIrY15SvQh3kWxQv8JRFi/SwGEXwN6ie/BXuh7zaGZmXKqSKFspkSpvdQio1gVxmbRM6xXYcSHdINQ54DRBIlzWC8ZtD5VBB07WvLM2qEQDr20JSep1B45M8DxxsDHwHwdH4NrahbSKUA6Da8NJbA/OlMeGGOWRSKTBCdfPsTafG0BH6fICLKSoJW/7xJpuN3bWT04xta+LsMh5vJayW+jwXjEIFMAmPATD2HhnB3ojW9JuS1bGk//PkAusmC748nH8hdG2YFXDc9l2Gsw1kaKI+MOFBxtXSO1YAjO3lI2Kl1mKfGSaN5QawDA== template: metadata: creationTimestamp: null From 8200371f2382251098ed1d0ad9028a8d0f4cf9e1 Mon Sep 17 00:00:00 2001 From: hwmin414 Date: Mon, 15 Jan 2024 22:03:31 +0900 Subject: [PATCH 10/25] feat: change mysql version --- deployment/base/db/statefulset.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/base/db/statefulset.yaml b/deployment/base/db/statefulset.yaml index 2906dbc3..e1ddfb70 100644 --- a/deployment/base/db/statefulset.yaml +++ b/deployment/base/db/statefulset.yaml @@ -16,7 +16,7 @@ spec: spec: containers: - name: biseo-db - image: mysql:8.0.19 + image: mysql:8.0 args: - --character-set-server=utf8mb4 - --collation-server=utf8mb4_unicode_ci From d2e702ce0d5ec0b9a223c6e691feccef11958f3b Mon Sep 17 00:00:00 2001 From: hwmin414 Date: Mon, 15 Jan 2024 22:12:41 +0900 Subject: [PATCH 11/25] feat: change mysql password plugin --- deployment/base/db/statefulset.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/deployment/base/db/statefulset.yaml b/deployment/base/db/statefulset.yaml index e1ddfb70..3749705a 100644 --- a/deployment/base/db/statefulset.yaml +++ b/deployment/base/db/statefulset.yaml @@ -20,6 +20,7 @@ spec: args: - --character-set-server=utf8mb4 - --collation-server=utf8mb4_unicode_ci + - --default_authentication_plugin=mysql_native_password ports: - containerPort: 3306 name: db-port From c060002afa940d94f5754aed787c91e43cbbe8d3 Mon Sep 17 00:00:00 2001 From: hwmin414 Date: Tue, 16 Jan 2024 00:02:46 +0900 Subject: [PATCH 12/25] feat: update secret --- deployment/base/server/sealed-secret.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/deployment/base/server/sealed-secret.yaml b/deployment/base/server/sealed-secret.yaml index 5d2dde3e..2c42bbde 100644 --- a/deployment/base/server/sealed-secret.yaml +++ b/deployment/base/server/sealed-secret.yaml @@ -7,9 +7,9 @@ metadata: namespace: biseo spec: encryptedData: - DATABASE_URL: AgAuNovYzIPt7UaYaZeDpjfgZ8IQRLd35S7z5kAd05HIDJC6SLBOPhQarkKJMkbta4soyS2s9lxvfigJZSmxDks4s+muTExh6JB0dOi4XeYZQYoAq9sTI9fH6nSLJLYIKa42aQZJyv25nHXchtJardnQPTaZ9lRWUoNy0c0FTM5PIg/dw4qnCl8WKoepqRpUdf4azlcJoi1C3cTJLB8CxykQVd3k7iU0XA+A4aCWKohH3eST9xRncAjGhzkCGV52ZlxZ31jLDXoLYX5pT72qSqDHwoG6rmdmTzPjDQS7Q7JqEEmTXvSbzpxjmTCQLphQtF1Bq4ppcRveLXk1K8GPVtL0WKrVrdICb06Z5mcMQu7TMgFb704YSsrPhAqzGkPKoTdYzZjsGZpqL2lt+aAoJseOjverNMwkRby4ViyCUFM06xMp4/zQHVg9t1suXCm27F5ilRO55vUj8O58x6yUp8gSK3FOm5HDM0YJ0rYHZTnrvMW/THWi+sa3yaI2aGe00ga1KpjQua8dUXWrYRZlHuV/9rn12vHIWAiTWTW7BBXRqt072Yv2/oxtRuGwvf/0I3hMDx4lYFjN1IRF/bFoZUXVNIxFW5rVVAe5eqCss0CQFuA7J6wG+6HX4En4DDxS+vtCijr41b0/gzgJQCjzpuc1yYWZRGw41DZD6MTYd/zW/zThpkN3LzE+hs2qlOYFVs/KoFX2sn2tRL+zMoxJxA4ZS6LfmClNIk7ThZunR/R/xQKbFK3Dz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sCRaUucZyQyPQe+dU3S+lFs0oZxPrZ+6VvA/KJkYhQdFnFNCuWQgpqlKj0Rd5fwBjlJAoQbhYE+eseybN/hjkU6AvfGkojIx1M9xO+9GyvOWp4nYCVkDIaayorOV7KZJeBgAd7fqbUhRnTxMPZn+J/Y/VnUQ/2nj5xlsszriFQhDoJ7VcAKAMKk/9YD8HyHdxJDx0J7Amsdi+3sGQKIKi3eDlE2jPDtNq70tabF0DfaPvznJxzYDCGYyLuuK6IN60w717DpRLJYZCHLyIYkMmylZeVphJTGG0ZSqqnsbFSoYQsAvxvbTqRbbFgtrEVoI9IeQIy8yR8cEXIi9+iYAuqPIQQgmu3wyHF3nbG9Vz7BwjDSOJLMGlq7ezSyPxoxknU6cAh6wVhsYUk2TlHZNSXZFGhJVQEC08om5N6mQxalCuLoQCZfiGPTA== template: metadata: creationTimestamp: null From 6b3e6e142e3f8c631e84cce59b579261dad2d984 Mon Sep 17 00:00:00 2001 From: hwmin414 Date: Tue, 16 Jan 2024 00:12:10 +0900 Subject: [PATCH 13/25] feat: change configmap --- deployment/base/db/statefulset.yaml | 15 +++++++++++++++ deployment/base/server/configmap.yaml | 4 +++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/deployment/base/db/statefulset.yaml b/deployment/base/db/statefulset.yaml index 3749705a..0d298143 100644 --- a/deployment/base/db/statefulset.yaml +++ b/deployment/base/db/statefulset.yaml @@ -30,11 +30,26 @@ spec: secretKeyRef: name: biseo-secret key: DB_PASSWORD + - name: MYSQL_PASSWORD + valueFrom: + secretKeyRef: + name: biseo-secret + key: DB_PASSWORD - name: MYSQL_DATABASE valueFrom: configMapKeyRef: name: biseo-env key: DB_NAME + - name: MYSQL_USER + valueFrom: + configMapKeyRef: + name: biseo-env + key: DB_USER + - name: MYSQL_ROOT_HOST + valueFrom: + configMapKeyRef: + name: biseo-env + key: DB_ROOT_HOST volumeMounts: - name: biseo-db-storage mountPath: /var/lib/mysql diff --git a/deployment/base/server/configmap.yaml b/deployment/base/server/configmap.yaml index b473f043..099802da 100644 --- a/deployment/base/server/configmap.yaml +++ b/deployment/base/server/configmap.yaml @@ -5,4 +5,6 @@ metadata: data: NODE_ENV: "production" SERVER_PORT: "8000" - DB_NAME: "biseo" \ No newline at end of file + DB_NAME: "biseo" + DB_USER: "mysql" + DB_ROOT_HOST: "%" \ No newline at end of file From ad4d611c7be6b7955411c3a4531ec4e8ea960f95 Mon Sep 17 00:00:00 2001 From: hwmin414 Date: Tue, 16 Jan 2024 00:38:01 +0900 Subject: [PATCH 14/25] feat: remove db migrate to operator --- deployment/base/db/pvc.yaml | 14 ------ deployment/base/db/service.yaml | 12 ----- deployment/base/db/statefulset.yaml | 59 ----------------------- deployment/base/kustomization.yaml | 5 +- deployment/base/server/configmap.yaml | 6 +-- deployment/base/server/sealed-secret.yaml | 9 ++-- 6 files changed, 10 insertions(+), 95 deletions(-) delete mode 100644 deployment/base/db/pvc.yaml delete mode 100644 deployment/base/db/service.yaml delete mode 100644 deployment/base/db/statefulset.yaml diff --git a/deployment/base/db/pvc.yaml b/deployment/base/db/pvc.yaml deleted file mode 100644 index 5d16b55d..00000000 --- a/deployment/base/db/pvc.yaml +++ /dev/null @@ -1,14 +0,0 @@ -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - namespace: biseo - name: biseo-db-pv-claim - labels: - app: biseo-db -spec: - storageClassName: "ebs-sc" - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 2Gi \ No newline at end of file diff --git a/deployment/base/db/service.yaml b/deployment/base/db/service.yaml deleted file mode 100644 index d69c716b..00000000 --- a/deployment/base/db/service.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: biseo-db-service -spec: - selector: - app: biseo-db - ports: - - name: db-port - protocol: TCP - port: 3306 - targetPort: db-port diff --git a/deployment/base/db/statefulset.yaml b/deployment/base/db/statefulset.yaml deleted file mode 100644 index 0d298143..00000000 --- a/deployment/base/db/statefulset.yaml +++ /dev/null @@ -1,59 +0,0 @@ -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: biseo-db - labels: - app: biseo-db -spec: - replicas: 1 - selector: - matchLabels: - app: biseo-db - template: - metadata: - labels: - app: biseo-db - spec: - containers: - - name: biseo-db - image: mysql:8.0 - args: - - --character-set-server=utf8mb4 - - --collation-server=utf8mb4_unicode_ci - - --default_authentication_plugin=mysql_native_password - ports: - - containerPort: 3306 - name: db-port - env: - - name: MYSQL_ROOT_PASSWORD - valueFrom: - secretKeyRef: - name: biseo-secret - key: DB_PASSWORD - - name: MYSQL_PASSWORD - valueFrom: - secretKeyRef: - name: biseo-secret - key: DB_PASSWORD - - name: MYSQL_DATABASE - valueFrom: - configMapKeyRef: - name: biseo-env - key: DB_NAME - - name: MYSQL_USER - valueFrom: - configMapKeyRef: - name: biseo-env - key: DB_USER - - name: MYSQL_ROOT_HOST - valueFrom: - configMapKeyRef: - name: biseo-env - key: DB_ROOT_HOST - volumeMounts: - - name: biseo-db-storage - mountPath: /var/lib/mysql - volumes: - - name: biseo-db-storage - persistentVolumeClaim: - claimName: biseo-db-pv-claim \ No newline at end of file diff --git a/deployment/base/kustomization.yaml b/deployment/base/kustomization.yaml index 9fea4586..7c475acd 100644 --- a/deployment/base/kustomization.yaml +++ b/deployment/base/kustomization.yaml @@ -5,7 +5,4 @@ resources: - ./server/configmap.yaml - ./server/service.yaml - ./server/ingress.yaml -- ./server/sealed-secret.yaml -- ./db/statefulset.yaml -- ./db/service.yaml -- ./db/pvc.yaml \ No newline at end of file +- ./server/sealed-secret.yaml \ No newline at end of file diff --git a/deployment/base/server/configmap.yaml b/deployment/base/server/configmap.yaml index 099802da..0ed64f5d 100644 --- a/deployment/base/server/configmap.yaml +++ b/deployment/base/server/configmap.yaml @@ -5,6 +5,6 @@ metadata: data: NODE_ENV: "production" SERVER_PORT: "8000" - DB_NAME: "biseo" - DB_USER: "mysql" - DB_ROOT_HOST: "%" \ No newline at end of file + DB_NAME: biseo + DB_USER: mysql + DB_ROOT_HOST: '%' \ No newline at end of file diff --git a/deployment/base/server/sealed-secret.yaml b/deployment/base/server/sealed-secret.yaml index 2c42bbde..f7bdf97c 100644 --- a/deployment/base/server/sealed-secret.yaml +++ b/deployment/base/server/sealed-secret.yaml @@ -7,9 +7,12 @@ metadata: namespace: biseo spec: encryptedData: - DATABASE_URL: AgCVlPHeSs94eckR7tUfQZw/w1vw4+4qS3l7x0ZZQgI39vhpLcqDsUvGAFnAArzM2T427VtXp1OFFYnyHrwdKBvn9wCPJo4HvBQziU39TWOoepin3wTN6pA51414pRCi0XYMcnDEG5ySK337sdtjx6pknGyEZMqeFa0ToesCOhuuLLV0FrmAv/LyqPUF3Fttm9BhVUICT4E0v723mJGlI4llYrXAQYuCnYO7hpndW48QxFXAK4lq2qWcAL409A4NwCaHW/q4rPd6pqtbsUToGLfxIK571ae0uiaJkxMSXGY8d+5ivQows7diiWn07d9vHClO2jlIk1vBFajFvWQnUYdtj9N82u4L1mSdPz5g09gmhEvikLnADmHtKNmPfFhqt/LWGJ3GV5A/3VhVDLSCM0+j3Tco3xHUNcmOZxIoDQ+erqz3DdB+eZsg09EmcUQxwSvkwYvDN3zwaQsUn+gVSzDNsEFeTHkvTHb1wTsKL+bU55dnsacxuWyiEo5UQrFNK2xg3V1+7CszYS7f1WDV/yRHaXrwZG9wstzZvy8z3qFhCjCzHyogSmaRmR/xwuHN7kj8jFoxXQNYQggeJTwNj4edOXcAEVH6VRa3YdaSUeWgRcEQ1lb6iGOGK4krJ8v9wCQ1tf+f6J+N+4tl2QcmdKqPafBr4VU1uhql60scOKWE+DP2lODpCetaMqIvutaWEslYHJqSfbfVQSMf5nhzpIFOc9k5RWGSl8YxBy6/jZclNBHMCh5Fj4IwSn6e8Y0N - DB_PASSWORD: AgC3eLNvpyoA1O9fqIgoR7NSysr/z4It7qQGTE1U/7sXO8FaQJi6Y8iCZQmpO/oWvX0OeT+YfwBJWGccBmH1yLmPmn7edICgWmjUKEHl9WhJ4NzW46kieBd9WNsB1SsZ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EdrNVLfLPle/FwM2AflHv1MMrZCdmRRw3EQ8+zneZrzUHRPQirFmpcDQbLKtY9GlQzumDqkSuZvcnbBqKK+nKKt1SL95oo0+5rcjh+9Ox8sgyiDJnIIGgwhlQZ9GdhsHJIs0kvOLOegapoG+4F/Qykqg8r+BrCZzQu2KSN+ClPUErHYiZY/fzd8ebrJA+QwoJB0Hqi8fqkPg9BeIscCng5KLEnUMZvsHFUuUgwGwzuaG/NmoICRFPRlj7Hc37iLmFFoCWVjIOhOnv1+NQJ8AugpDgc01H/iLj41Fk07BN6lQFoTiDT template: metadata: creationTimestamp: null From 79b95975d6ee5a1ea378197256cfa12ed7c9f789 Mon Sep 17 00:00:00 2001 From: hwmin414 Date: Tue, 16 Jan 2024 01:03:56 +0900 Subject: [PATCH 15/25] feat: update .env --- deployment/base/server/deployment.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/deployment/base/server/deployment.yaml b/deployment/base/server/deployment.yaml index f26e42c3..12a8f303 100644 --- a/deployment/base/server/deployment.yaml +++ b/deployment/base/server/deployment.yaml @@ -27,4 +27,12 @@ spec: - name: NODE_ENV value: "production" - name: SERVER_PORT - value: "8000" \ No newline at end of file + value: "8000" + volumeMounts: + - mountPath: "/app/.env" + name: secret-env + readOnly: true + volumes: + - name: secret-env + secret: + secretName: biseo-secret \ No newline at end of file From ab813f218217a8f8e4310c67cb9748d77d9d7c56 Mon Sep 17 00:00:00 2001 From: hwmin414 Date: Tue, 16 Jan 2024 01:10:11 +0900 Subject: [PATCH 16/25] feat: remove .env mount --- deployment/base/server/deployment.yaml | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/deployment/base/server/deployment.yaml b/deployment/base/server/deployment.yaml index 12a8f303..6a9440a4 100644 --- a/deployment/base/server/deployment.yaml +++ b/deployment/base/server/deployment.yaml @@ -17,7 +17,7 @@ spec: containers: - name: biseo-server image: 666583083672.dkr.ecr.ap-northeast-2.amazonaws.com/biseo-server:latest - commands: ["sleep", "600"] + command: ["sleep", "600"] ports: - containerPort: 8000 envFrom: @@ -27,12 +27,4 @@ spec: - name: NODE_ENV value: "production" - name: SERVER_PORT - value: "8000" - volumeMounts: - - mountPath: "/app/.env" - name: secret-env - readOnly: true - volumes: - - name: secret-env - secret: - secretName: biseo-secret \ No newline at end of file + value: "8000" \ No newline at end of file From 110544f9ab69e0b71f12842835e7531f754d73b5 Mon Sep 17 00:00:00 2001 From: hwmin414 Date: Tue, 16 Jan 2024 01:23:05 +0900 Subject: [PATCH 17/25] feat: change env name --- packages/api/prisma/schema.prisma | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/api/prisma/schema.prisma b/packages/api/prisma/schema.prisma index df9cec09..d48e49df 100644 --- a/packages/api/prisma/schema.prisma +++ b/packages/api/prisma/schema.prisma @@ -5,7 +5,7 @@ generator client { datasource db { provider = "mysql" - url = env("DATABASE_URL") + url = env("DB_URL") } model Agenda { From fbff50a3a5dd920c2d8e35af70aed073ddd721eb Mon Sep 17 00:00:00 2001 From: hwmin414 Date: Tue, 16 Jan 2024 01:24:17 +0900 Subject: [PATCH 18/25] feat: update secret --- deployment/base/server/deployment.yaml | 1 - deployment/base/server/sealed-secret.yaml | 12 ++++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/deployment/base/server/deployment.yaml b/deployment/base/server/deployment.yaml index 6a9440a4..52b973f4 100644 --- a/deployment/base/server/deployment.yaml +++ b/deployment/base/server/deployment.yaml @@ -17,7 +17,6 @@ spec: containers: - name: biseo-server image: 666583083672.dkr.ecr.ap-northeast-2.amazonaws.com/biseo-server:latest - command: ["sleep", "600"] ports: - containerPort: 8000 envFrom: diff --git a/deployment/base/server/sealed-secret.yaml b/deployment/base/server/sealed-secret.yaml index f7bdf97c..08936725 100644 --- a/deployment/base/server/sealed-secret.yaml +++ b/deployment/base/server/sealed-secret.yaml @@ -7,12 +7,12 @@ metadata: namespace: biseo spec: encryptedData: - DATABASE_URL: AgDHksUt2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Hm/PDCzrGk8osO0FmlbinJwnWmipdaEe4M0fz7ldXIDk8F/0j2quQ21qI/d+rsGI1mQb9svPakuDGcxW1M7ZkCda8ixjXZPD template: metadata: creationTimestamp: null From b29a979812fa8038f7c8e0f91e1cd749ffd8d6bf Mon Sep 17 00:00:00 2001 From: hwmin414 Date: Wed, 17 Jan 2024 14:52:49 +0900 Subject: [PATCH 19/25] feat: change ecr push workflow --- .github/workflows/push_image_ecr.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/push_image_ecr.yml b/.github/workflows/push_image_ecr.yml index 4b69a057..ad5cbcea 100644 --- a/.github/workflows/push_image_ecr.yml +++ b/.github/workflows/push_image_ecr.yml @@ -51,6 +51,7 @@ jobs: ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} ECR_REPOSITORY: biseo-server with: + file: .docker/api.Dockerfile push: true tags: | "${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:latest" From 14fb1c1769d324aaa51e81ccea69a012d3ae443d Mon Sep 17 00:00:00 2001 From: hwmin414 Date: Wed, 17 Jan 2024 14:57:42 +0900 Subject: [PATCH 20/25] feat: change workflow to run on push --- .github/workflows/push_image_ecr.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/push_image_ecr.yml b/.github/workflows/push_image_ecr.yml index ad5cbcea..70e99b18 100644 --- a/.github/workflows/push_image_ecr.yml +++ b/.github/workflows/push_image_ecr.yml @@ -2,12 +2,17 @@ name: Push Prod Image to Amazon ECR # when tagging action success on: - pull_request: - types: - - closed + push: branches: - deploy +# on: +# pull_request: +# types: +# - closed +# branches: +# - deploy + env: AWS_REGION: ap-northeast-2 From 5b2c29d0c66ebb249f4179ecf6d1f52af0f067c2 Mon Sep 17 00:00:00 2001 From: hwmin414 Date: Wed, 17 Jan 2024 15:01:39 +0900 Subject: [PATCH 21/25] feat: add pr closed build run --- .github/workflows/push_image_ecr.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/push_image_ecr.yml b/.github/workflows/push_image_ecr.yml index 70e99b18..3bc5716f 100644 --- a/.github/workflows/push_image_ecr.yml +++ b/.github/workflows/push_image_ecr.yml @@ -5,13 +5,11 @@ on: push: branches: - deploy - -# on: -# pull_request: -# types: -# - closed -# branches: -# - deploy + pull_request: + types: + - closed + branches: + - deploy env: AWS_REGION: ap-northeast-2 From 21b5f9922be603308604eaeed8d97b4746eda844 Mon Sep 17 00:00:00 2001 From: hwmin414 Date: Thu, 18 Jan 2024 13:48:23 +0900 Subject: [PATCH 22/25] feat: ignore deployment folder lint --- .prettierignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.prettierignore b/.prettierignore index ee05fcc5..cc71ecd3 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,2 +1,3 @@ pnpm-lock.yaml **/dist +deployment/**/*.yaml \ No newline at end of file From aa9fe4824010f7b87ddfb3a517c0695131d76aeb Mon Sep 17 00:00:00 2001 From: Soonho Kwon Date: Thu, 18 Jan 2024 13:57:56 +0900 Subject: [PATCH 23/25] feat(cors): add cors origin rule --- packages/api/src/index.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/api/src/index.ts b/packages/api/src/index.ts index 8770f561..733a3d8b 100644 --- a/packages/api/src/index.ts +++ b/packages/api/src/index.ts @@ -17,16 +17,19 @@ import { agendaRouter } from "@biseo/api/listener/agenda"; import { agendaTemplateRouter } from "@biseo/api/listener/agenda.template"; import { userTagRouter } from "@biseo/api/listener/user.tag"; +const corsOrigin = + env.NODE_ENV === "development" ? "*" : [/sparcs\.org$/, /kaist\.ac\.kr$/]; + const app = express(); const httpServer = createServer(app); const io: BiseoServer = new Server(httpServer, { path: "/api/socket", - cors: { origin: "*" }, + cors: { origin: corsOrigin }, }); const port = env.SERVER_PORT ?? 8000; app.use(express.json()); -app.use(cors()); +app.use(cors({ origin: corsOrigin })); app.get("/api", (req, res) => { res.send("Hello World!"); From cd0bc1513cc2cd6ee7a9ea87df73825c3e84fc4d Mon Sep 17 00:00:00 2001 From: Soonho Kwon Date: Thu, 18 Jan 2024 13:59:22 +0900 Subject: [PATCH 24/25] feat(deploy): change github actions trigger to `main` --- .github/workflows/push_image_ecr.yml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/push_image_ecr.yml b/.github/workflows/push_image_ecr.yml index 3bc5716f..474cd556 100644 --- a/.github/workflows/push_image_ecr.yml +++ b/.github/workflows/push_image_ecr.yml @@ -2,14 +2,11 @@ name: Push Prod Image to Amazon ECR # when tagging action success on: - push: - branches: - - deploy pull_request: types: - closed branches: - - deploy + - main env: AWS_REGION: ap-northeast-2 @@ -24,7 +21,7 @@ jobs: uses: actions/checkout@v3 with: fetch-depth: 0 - + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -35,18 +32,18 @@ jobs: key: ${{ runner.os }}-buildx-${{ github.sha }} restore-keys: | ${{ runner.os }}-buildx- - + - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 with: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: ${{ env.AWS_REGION }} - + - name: Login to AWS ECR id: login-ecr uses: aws-actions/amazon-ecr-login@v1 - + - name: Build Image and Push to AWS ECR id: build_image_and_push uses: docker/build-push-action@v5 @@ -65,4 +62,3 @@ jobs: run: | rm -rf /tmp/.buildx-cache mv /tmp/.buildx-cache-new /tmp/.buildx-cache - \ No newline at end of file From 7840876d967b631a381197e49a7bf30ac0cb6aaa Mon Sep 17 00:00:00 2001 From: Soonho Kwon Date: Thu, 18 Jan 2024 14:06:20 +0900 Subject: [PATCH 25/25] chore(prettier): add config `yml` files to `.prettierignore` --- .prettierignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.prettierignore b/.prettierignore index cc71ecd3..fdcded4a 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,3 +1,5 @@ pnpm-lock.yaml **/dist -deployment/**/*.yaml \ No newline at end of file +deployment/**/*.yaml +.github/**/*.yml +**/*.md