From b14b120820958cc16de9f7e4aae682a5fb240b5f Mon Sep 17 00:00:00 2001 From: shinhong-park Date: Fri, 30 Jun 2023 18:39:07 +0900 Subject: [PATCH 01/10] Add codeowners --- .github/CODEOWNERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index b08bd0d1..ccd36ff4 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -18,5 +18,7 @@ apps/siksha-dev/ @wafflestudio/siksha apps/siksha-prod/ @wafflestudio/siksha apps/waffledotcom-dev/waffledotcom-server @wafflestudio/waffledotcom-backend apps/waffledotcom-prod/waffledotcom-server @wafflestudio/waffledotcom-backend +apps/wacruit-dev @wafflestudio/waffledotcom-backend +apps/wacruit-prod @wafflestudio/waffledotcom-backend apps/pupuri-prod/ @woohm402 apps/ggzz-dev/ @wafflestudio/ggzz From ea689436e1a0f34d61d83d105bdc76c37c33f48e Mon Sep 17 00:00:00 2001 From: shinhong-park Date: Fri, 30 Jun 2023 18:39:29 +0900 Subject: [PATCH 02/10] Add wacruit-dev --- apps/templates/wacruit-server-dev.yaml | 18 ++++++ .../wacruit-server/wacruit-server.yaml | 64 +++++++++++++++++++ misc/apps/namespace.yaml | 7 ++ 3 files changed, 89 insertions(+) create mode 100644 apps/templates/wacruit-server-dev.yaml create mode 100644 apps/wacruit-dev/wacruit-server/wacruit-server.yaml diff --git a/apps/templates/wacruit-server-dev.yaml b/apps/templates/wacruit-server-dev.yaml new file mode 100644 index 00000000..753f3fd8 --- /dev/null +++ b/apps/templates/wacruit-server-dev.yaml @@ -0,0 +1,18 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + namespace: argocd + name: wacruit-server-dev + finalizers: + - resources-finalizer.argocd.argoproj.io +spec: + project: default + source: + repoURL: {{ .Values.spec.source.repoURL }} + targetRevision: HEAD + path: apps/wacruit-dev/wacruit-server + destination: + server: {{ .Values.spec.destination.server }} + namespace: argocd + syncPolicy: + {{- .Values.spec.syncPolicy | toYaml | nindent 4 }} diff --git a/apps/wacruit-dev/wacruit-server/wacruit-server.yaml b/apps/wacruit-dev/wacruit-server/wacruit-server.yaml new file mode 100644 index 00000000..f800cd5d --- /dev/null +++ b/apps/wacruit-dev/wacruit-server/wacruit-server.yaml @@ -0,0 +1,64 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: wacruit-server + labels: + app: wacruit-server + namespace: wacruit-dev +spec: + replicas: 1 + selector: + matchLabels: + app: wacruit-server + strategy: + type: RollingUpdate + rollingUpdate: + maxSurge: 25% + maxUnavailable: 25% + revisionHistoryLimit: 4 + template: + metadata: + labels: + app: wacruit-server + spec: + containers: + - image: 405906814034.dkr.ecr.ap-northeast-2.amazonaws.com/wacruit-dev/wacruit-server:3 + name: wacruit-server + ports: + - containerPort: 8080 +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: wacruit-server + namespace: wacruit-dev + annotations: + eks.amazonaws.com/role-arn: arn:aws:iam::405906814034:role/wacruit-server-dev-role +--- +apiVersion: v1 +kind: Service +metadata: + namespace: wacruit-dev + name: wacruit-server +spec: + type: ClusterIP + selector: + app: wacruit-server + ports: + - port: 80 + targetPort: 8080 +--- +apiVersion: networking.istio.io/v1alpha3 +kind: VirtualService +metadata: + namespace: wacruit-dev + name: wacruit-server +spec: + gateways: + - istio-ingress/waffle-ingressgateway + hosts: + - wacruit-api-dev.wafflestudio.com + http: + - route: + - destination: + host: wacruit-server diff --git a/misc/apps/namespace.yaml b/misc/apps/namespace.yaml index 735e4e91..369a203b 100644 --- a/misc/apps/namespace.yaml +++ b/misc/apps/namespace.yaml @@ -116,3 +116,10 @@ metadata: name: waffledotcom-prod labels: istio-injection: enabled +--- +apiVersion: v1 +kind: Namespace +metadata: + name: wacruit-dev + labels: + istio-injection: enabled From c8c956324fec34b010edc33ad96c5cd4dbf67720 Mon Sep 17 00:00:00 2001 From: shinhong-park Date: Fri, 30 Jun 2023 18:39:41 +0900 Subject: [PATCH 03/10] Add wacruit-prod --- apps/templates/wacruit-server.yaml | 18 ++++++ .../wacruit-server/wacruit-server.yaml | 64 +++++++++++++++++++ misc/apps/namespace.yaml | 7 ++ 3 files changed, 89 insertions(+) create mode 100644 apps/templates/wacruit-server.yaml create mode 100644 apps/wacruit-prod/wacruit-server/wacruit-server.yaml diff --git a/apps/templates/wacruit-server.yaml b/apps/templates/wacruit-server.yaml new file mode 100644 index 00000000..171a893e --- /dev/null +++ b/apps/templates/wacruit-server.yaml @@ -0,0 +1,18 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + namespace: argocd + name: wacruit-server + finalizers: + - resources-finalizer.argocd.argoproj.io +spec: + project: default + source: + repoURL: {{ .Values.spec.source.repoURL }} + targetRevision: HEAD + path: apps/wacruit-prod/wacruit-server + destination: + server: {{ .Values.spec.destination.server }} + namespace: argocd + syncPolicy: + {{- .Values.spec.syncPolicy | toYaml | nindent 4 }} diff --git a/apps/wacruit-prod/wacruit-server/wacruit-server.yaml b/apps/wacruit-prod/wacruit-server/wacruit-server.yaml new file mode 100644 index 00000000..25658335 --- /dev/null +++ b/apps/wacruit-prod/wacruit-server/wacruit-server.yaml @@ -0,0 +1,64 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: wacruit-server + labels: + app: wacruit-server + namespace: wacruit-prod +spec: + replicas: 1 + selector: + matchLabels: + app: wacruit-server + strategy: + type: RollingUpdate + rollingUpdate: + maxSurge: 25% + maxUnavailable: 25% + revisionHistoryLimit: 4 + template: + metadata: + labels: + app: wacruit-server + spec: + containers: + - image: 405906814034.dkr.ecr.ap-northeast-2.amazonaws.com/wacruit-prod/wacruit-server:3 + name: wacruit-server + ports: + - containerPort: 8080 +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: wacruit-server + namespace: wacruit-prod + annotations: + eks.amazonaws.com/role-arn: arn:aws:iam::405906814034:role/wacruit-server-prod-role +--- +apiVersion: v1 +kind: Service +metadata: + namespace: wacruit-prod + name: wacruit-server +spec: + type: ClusterIP + selector: + app: wacruit-server + ports: + - port: 80 + targetPort: 8080 +--- +apiVersion: networking.istio.io/v1alpha3 +kind: VirtualService +metadata: + namespace: wacruit-prod + name: wacruit-server +spec: + gateways: + - istio-ingress/waffle-ingressgateway + hosts: + - wacruit-api.wafflestudio.com + http: + - route: + - destination: + host: wacruit-server diff --git a/misc/apps/namespace.yaml b/misc/apps/namespace.yaml index 369a203b..0606ec8e 100644 --- a/misc/apps/namespace.yaml +++ b/misc/apps/namespace.yaml @@ -123,3 +123,10 @@ metadata: name: wacruit-dev labels: istio-injection: enabled +--- +apiVersion: v1 +kind: Namespace +metadata: + name: wacruit-prod + labels: + istio-injection: enabled From 4f26f3b85b77a8754751048e45ef83934cfe64b9 Mon Sep 17 00:00:00 2001 From: shinhong-park Date: Fri, 30 Jun 2023 19:04:21 +0900 Subject: [PATCH 04/10] Add wacruit service in kong gateway (dev, prod) --- apps/sso-dev/kong-gateway/kong-config.yaml | 11 +++++++++++ apps/sso-dev/kong-gateway/kong-gateway.yaml | 1 + apps/sso-prod/kong-gateway/kong-config.yaml | 11 +++++++++++ apps/sso-prod/kong-gateway/kong-gateway.yaml | 1 + 4 files changed, 24 insertions(+) diff --git a/apps/sso-dev/kong-gateway/kong-config.yaml b/apps/sso-dev/kong-gateway/kong-config.yaml index 127d6f4a..a92f0696 100644 --- a/apps/sso-dev/kong-gateway/kong-config.yaml +++ b/apps/sso-dev/kong-gateway/kong-config.yaml @@ -14,3 +14,14 @@ services: - /api/account-service/ plugins: - name: waffle-jwt-authorizer + +- name: wacruit-service + url: http://wacruit-server.wacruit-dev.svc.cluster.local + routes: + - name: wacruit-service + hosts: + - wacruit-api-dev.wafflestudio.com + paths: + - /api/ + plugins: + - name: waffle-jwt-authorizer diff --git a/apps/sso-dev/kong-gateway/kong-gateway.yaml b/apps/sso-dev/kong-gateway/kong-gateway.yaml index af58f14e..fc5ca9cd 100644 --- a/apps/sso-dev/kong-gateway/kong-gateway.yaml +++ b/apps/sso-dev/kong-gateway/kong-gateway.yaml @@ -102,6 +102,7 @@ spec: hosts: - api-gateway-dev.wafflestudio.com - sso-dev.wafflestudio.com + - wacruit-api-dev.wafflestudio.com http: - route: - destination: diff --git a/apps/sso-prod/kong-gateway/kong-config.yaml b/apps/sso-prod/kong-gateway/kong-config.yaml index f56cd3e8..cab0a6ac 100644 --- a/apps/sso-prod/kong-gateway/kong-config.yaml +++ b/apps/sso-prod/kong-gateway/kong-config.yaml @@ -26,3 +26,14 @@ services: strip_path: false plugins: - name: waffle-jwt-authorizer + +- name: wacruit-service + url: http://wacruit-server.wacruit-prod.svc.cluster.local + routes: + - name: wacruit-service + hosts: + - wacruit-api.wafflestudio.com + paths: + - /api/ + plugins: + - name: waffle-jwt-authorizer diff --git a/apps/sso-prod/kong-gateway/kong-gateway.yaml b/apps/sso-prod/kong-gateway/kong-gateway.yaml index a0febd0d..ce2c2cdf 100644 --- a/apps/sso-prod/kong-gateway/kong-gateway.yaml +++ b/apps/sso-prod/kong-gateway/kong-gateway.yaml @@ -103,6 +103,7 @@ spec: - api-gateway.wafflestudio.com - sso.wafflestudio.com - truffle.wafflestudio.com + - wacruit-api.wafflestudio.com http: - route: - destination: From 4109e26962a0e3d2f043386257a99170f39cb713 Mon Sep 17 00:00:00 2001 From: shinhong-park Date: Fri, 30 Jun 2023 20:43:21 +0900 Subject: [PATCH 05/10] Rename iam roles --- apps/wacruit-dev/wacruit-server/wacruit-server.yaml | 2 +- apps/wacruit-prod/wacruit-server/wacruit-server.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/wacruit-dev/wacruit-server/wacruit-server.yaml b/apps/wacruit-dev/wacruit-server/wacruit-server.yaml index f800cd5d..058f2e5d 100644 --- a/apps/wacruit-dev/wacruit-server/wacruit-server.yaml +++ b/apps/wacruit-dev/wacruit-server/wacruit-server.yaml @@ -33,7 +33,7 @@ metadata: name: wacruit-server namespace: wacruit-dev annotations: - eks.amazonaws.com/role-arn: arn:aws:iam::405906814034:role/wacruit-server-dev-role + eks.amazonaws.com/role-arn: arn:aws:iam::405906814034:role/wacruit-dev-role --- apiVersion: v1 kind: Service diff --git a/apps/wacruit-prod/wacruit-server/wacruit-server.yaml b/apps/wacruit-prod/wacruit-server/wacruit-server.yaml index 25658335..60cbdb58 100644 --- a/apps/wacruit-prod/wacruit-server/wacruit-server.yaml +++ b/apps/wacruit-prod/wacruit-server/wacruit-server.yaml @@ -33,7 +33,7 @@ metadata: name: wacruit-server namespace: wacruit-prod annotations: - eks.amazonaws.com/role-arn: arn:aws:iam::405906814034:role/wacruit-server-prod-role + eks.amazonaws.com/role-arn: arn:aws:iam::405906814034:role/wacruit-prod-role --- apiVersion: v1 kind: Service From ba8274134b33abf8aa1a7e453e8d89f4a665cc06 Mon Sep 17 00:00:00 2001 From: shinhong-park Date: Fri, 30 Jun 2023 23:59:28 +0900 Subject: [PATCH 06/10] Add missing serviceAccountName --- apps/wacruit-dev/wacruit-server/wacruit-server.yaml | 1 + apps/wacruit-prod/wacruit-server/wacruit-server.yaml | 1 + 2 files changed, 2 insertions(+) diff --git a/apps/wacruit-dev/wacruit-server/wacruit-server.yaml b/apps/wacruit-dev/wacruit-server/wacruit-server.yaml index 058f2e5d..4cd1e4f3 100644 --- a/apps/wacruit-dev/wacruit-server/wacruit-server.yaml +++ b/apps/wacruit-dev/wacruit-server/wacruit-server.yaml @@ -21,6 +21,7 @@ spec: labels: app: wacruit-server spec: + serviceAccountName: wacruit-server containers: - image: 405906814034.dkr.ecr.ap-northeast-2.amazonaws.com/wacruit-dev/wacruit-server:3 name: wacruit-server diff --git a/apps/wacruit-prod/wacruit-server/wacruit-server.yaml b/apps/wacruit-prod/wacruit-server/wacruit-server.yaml index 60cbdb58..39d9f600 100644 --- a/apps/wacruit-prod/wacruit-server/wacruit-server.yaml +++ b/apps/wacruit-prod/wacruit-server/wacruit-server.yaml @@ -21,6 +21,7 @@ spec: labels: app: wacruit-server spec: + serviceAccountName: wacruit-server containers: - image: 405906814034.dkr.ecr.ap-northeast-2.amazonaws.com/wacruit-prod/wacruit-server:3 name: wacruit-server From 5b329a26fabd0b6f06b4f8dd890113a896e1ac01 Mon Sep 17 00:00:00 2001 From: shinhong-park Date: Sat, 8 Jul 2023 14:59:31 +0900 Subject: [PATCH 07/10] Remove virtual service --- .../wacruit-server/wacruit-server.yaml | 15 --------------- .../wacruit-server/wacruit-server.yaml | 15 --------------- 2 files changed, 30 deletions(-) diff --git a/apps/wacruit-dev/wacruit-server/wacruit-server.yaml b/apps/wacruit-dev/wacruit-server/wacruit-server.yaml index 4cd1e4f3..b4746ee9 100644 --- a/apps/wacruit-dev/wacruit-server/wacruit-server.yaml +++ b/apps/wacruit-dev/wacruit-server/wacruit-server.yaml @@ -48,18 +48,3 @@ spec: ports: - port: 80 targetPort: 8080 ---- -apiVersion: networking.istio.io/v1alpha3 -kind: VirtualService -metadata: - namespace: wacruit-dev - name: wacruit-server -spec: - gateways: - - istio-ingress/waffle-ingressgateway - hosts: - - wacruit-api-dev.wafflestudio.com - http: - - route: - - destination: - host: wacruit-server diff --git a/apps/wacruit-prod/wacruit-server/wacruit-server.yaml b/apps/wacruit-prod/wacruit-server/wacruit-server.yaml index 39d9f600..633580fc 100644 --- a/apps/wacruit-prod/wacruit-server/wacruit-server.yaml +++ b/apps/wacruit-prod/wacruit-server/wacruit-server.yaml @@ -48,18 +48,3 @@ spec: ports: - port: 80 targetPort: 8080 ---- -apiVersion: networking.istio.io/v1alpha3 -kind: VirtualService -metadata: - namespace: wacruit-prod - name: wacruit-server -spec: - gateways: - - istio-ingress/waffle-ingressgateway - hosts: - - wacruit-api.wafflestudio.com - http: - - route: - - destination: - host: wacruit-server From d1a54b577ce02654db3b8cf4a3a7a05173e4cb7e Mon Sep 17 00:00:00 2001 From: shinhong-park Date: Sat, 8 Jul 2023 15:27:35 +0900 Subject: [PATCH 08/10] Set resources: 100/128 for dev & 200/256 for prod --- apps/wacruit-dev/wacruit-server/wacruit-server.yaml | 7 +++++++ apps/wacruit-prod/wacruit-server/wacruit-server.yaml | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/apps/wacruit-dev/wacruit-server/wacruit-server.yaml b/apps/wacruit-dev/wacruit-server/wacruit-server.yaml index b4746ee9..9691a27e 100644 --- a/apps/wacruit-dev/wacruit-server/wacruit-server.yaml +++ b/apps/wacruit-dev/wacruit-server/wacruit-server.yaml @@ -25,6 +25,13 @@ spec: containers: - image: 405906814034.dkr.ecr.ap-northeast-2.amazonaws.com/wacruit-dev/wacruit-server:3 name: wacruit-server + resources: + requests: + cpu: 100m + memory: 128Mi + limits: + cpu: 100m + memory: 128Mi ports: - containerPort: 8080 --- diff --git a/apps/wacruit-prod/wacruit-server/wacruit-server.yaml b/apps/wacruit-prod/wacruit-server/wacruit-server.yaml index 633580fc..1e1d462e 100644 --- a/apps/wacruit-prod/wacruit-server/wacruit-server.yaml +++ b/apps/wacruit-prod/wacruit-server/wacruit-server.yaml @@ -25,6 +25,13 @@ spec: containers: - image: 405906814034.dkr.ecr.ap-northeast-2.amazonaws.com/wacruit-prod/wacruit-server:3 name: wacruit-server + resources: + requests: + cpu: 200m + memory: 256Mi + limits: + cpu: 200m + memory: 256Mi ports: - containerPort: 8080 --- From 0a4b54d3e64737dba1b66d98bf2f1988733b887e Mon Sep 17 00:00:00 2001 From: shinhong-park Date: Sun, 9 Jul 2023 12:55:14 +0900 Subject: [PATCH 09/10] Use `wacruit.wafflestudio.com/api/*`, add dev configuration --- apps/sso-prod/kong-gateway/kong-config.yaml | 15 +++++++++++++-- apps/sso-prod/kong-gateway/kong-gateway.yaml | 3 ++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/apps/sso-prod/kong-gateway/kong-config.yaml b/apps/sso-prod/kong-gateway/kong-config.yaml index cab0a6ac..c382400b 100644 --- a/apps/sso-prod/kong-gateway/kong-config.yaml +++ b/apps/sso-prod/kong-gateway/kong-config.yaml @@ -30,9 +30,20 @@ services: - name: wacruit-service url: http://wacruit-server.wacruit-prod.svc.cluster.local routes: - - name: wacruit-service + - name: wacruit-web-cf hosts: - - wacruit-api.wafflestudio.com + - wacruit.wafflestudio.com + paths: + - /api/ + plugins: + - name: waffle-jwt-authorizer + +- name: wacruit-service-dev + url: http://wacruit-server.wacruit-dev.svc.cluster.local + routes: + - name: wacruit-web-cf + hosts: + - wacruit-dev.wafflestudio.com paths: - /api/ plugins: diff --git a/apps/sso-prod/kong-gateway/kong-gateway.yaml b/apps/sso-prod/kong-gateway/kong-gateway.yaml index ce2c2cdf..07e9835d 100644 --- a/apps/sso-prod/kong-gateway/kong-gateway.yaml +++ b/apps/sso-prod/kong-gateway/kong-gateway.yaml @@ -103,7 +103,8 @@ spec: - api-gateway.wafflestudio.com - sso.wafflestudio.com - truffle.wafflestudio.com - - wacruit-api.wafflestudio.com + - wacruit.wafflestudio.com + - wacruit-dev.wafflestudio.com http: - route: - destination: From e63d766ce623dbc558575ffd23190ef6c1ebc0e7 Mon Sep 17 00:00:00 2001 From: davin111 Date: Sat, 15 Jul 2023 06:12:17 +0900 Subject: [PATCH 10/10] modified --- .github/CODEOWNERS | 8 ++++---- .../wacruit-server/wacruit-server.yaml | 18 +++++++++++++++++- .../wacruit-server/wacruit-server.yaml | 18 +++++++++++++++++- 3 files changed, 38 insertions(+), 6 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 7f562d50..32044044 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -15,10 +15,10 @@ apps/feelin-dev/ @wafflestudio/music-sns apps/feelin-prod/ @wafflestudio/music-sns apps/siksha-dev/ @wafflestudio/siksha apps/siksha-prod/ @wafflestudio/siksha -apps/waffledotcom-dev/waffledotcom-server @wafflestudio/waffledotcom-backend -apps/waffledotcom-prod/waffledotcom-server @wafflestudio/waffledotcom-backend -apps/wacruit-dev @wafflestudio/waffledotcom-backend -apps/wacruit-prod @wafflestudio/waffledotcom-backend +apps/waffledotcom-dev/ @wafflestudio/waffledotcom-backend +apps/waffledotcom-prod/ @wafflestudio/waffledotcom-backend +apps/wacruit-dev/ @wafflestudio/waffledotcom-backend +apps/wacruit-prod/ @wafflestudio/waffledotcom-backend apps/pupuri-prod/ @woohm402 apps/ggzz-dev/ @wafflestudio/ggzz apps/k8s-monitoring/ @PFCJeong diff --git a/apps/wacruit-dev/wacruit-server/wacruit-server.yaml b/apps/wacruit-dev/wacruit-server/wacruit-server.yaml index 9691a27e..911421f2 100644 --- a/apps/wacruit-dev/wacruit-server/wacruit-server.yaml +++ b/apps/wacruit-dev/wacruit-server/wacruit-server.yaml @@ -23,7 +23,7 @@ spec: spec: serviceAccountName: wacruit-server containers: - - image: 405906814034.dkr.ecr.ap-northeast-2.amazonaws.com/wacruit-dev/wacruit-server:3 + - image: 405906814034.dkr.ecr.ap-northeast-2.amazonaws.com/wacruit-dev/wacruit-server:5 name: wacruit-server resources: requests: @@ -55,3 +55,19 @@ spec: ports: - port: 80 targetPort: 8080 +--- +apiVersion: networking.istio.io/v1alpha3 +kind: VirtualService +metadata: + namespace: wacruit-dev + name: wacruit-server +spec: + gateways: + - istio-ingress/waffle-ingressgateway + - mesh + hosts: + - wacruit-server.wacruit-dev.svc.cluster.local + http: + - route: + - destination: + host: wacruit-server diff --git a/apps/wacruit-prod/wacruit-server/wacruit-server.yaml b/apps/wacruit-prod/wacruit-server/wacruit-server.yaml index 1e1d462e..d43b1d35 100644 --- a/apps/wacruit-prod/wacruit-server/wacruit-server.yaml +++ b/apps/wacruit-prod/wacruit-server/wacruit-server.yaml @@ -6,7 +6,7 @@ metadata: app: wacruit-server namespace: wacruit-prod spec: - replicas: 1 + replicas: 0 selector: matchLabels: app: wacruit-server @@ -55,3 +55,19 @@ spec: ports: - port: 80 targetPort: 8080 +--- +apiVersion: networking.istio.io/v1alpha3 +kind: VirtualService +metadata: + namespace: wacruit-prod + name: wacruit-server +spec: + gateways: + - istio-ingress/waffle-ingressgateway + - mesh + hosts: + - wacruit-server.wacruit-prod.svc.cluster.local + http: + - route: + - destination: + host: wacruit-server