From 1fbf397424d8fd0ecc6744a721fe1587de610242 Mon Sep 17 00:00:00 2001 From: YJ Date: Sat, 11 Apr 2020 22:01:59 +0800 Subject: [PATCH 1/4] feat: set cpu/mem rqequests and limits for prisma and cloudsql --- .../kubernetes/nodewatcher-deployment-staging.yaml | 14 +++++++++++++- back/server/kubernetes/server-deployment.yaml | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/back/node_watcher/kubernetes/nodewatcher-deployment-staging.yaml b/back/node_watcher/kubernetes/nodewatcher-deployment-staging.yaml index 88a3ec3d..f7846135 100644 --- a/back/node_watcher/kubernetes/nodewatcher-deployment-staging.yaml +++ b/back/node_watcher/kubernetes/nodewatcher-deployment-staging.yaml @@ -27,6 +27,12 @@ spec: ports: - name: prisma-4466 containerPort: 4466 + requests: + memory: "64Mi" + cpu: "250m" + limits: + memory: "128Mi" + cpu: "500m" env: - name: PRISMA_CONFIG valueFrom: @@ -47,13 +53,19 @@ spec: valueFrom: secretKeyRef: name: cloudsql-db-credentials - key: dbname + key: dbname - name: cloudsql-proxy image: gcr.io/cloudsql-docker/gce-proxy:1.16 command: ["/cloud_sql_proxy", "--dir=/cloudsql", "-instances=test-installations-222013:europe-west1:kusama-etl=tcp:0.0.0.0:5432", "-credential_file=/secrets/cloudsql/credentials.json"] + requests: + memory: "64Mi" + cpu: "250m" + limits: + memory: "128Mi" + cpu: "500m" volumeMounts: - name: cloudsql-instance-credentials mountPath: /secrets/cloudsql diff --git a/back/server/kubernetes/server-deployment.yaml b/back/server/kubernetes/server-deployment.yaml index c3490287..0d7aa221 100644 --- a/back/server/kubernetes/server-deployment.yaml +++ b/back/server/kubernetes/server-deployment.yaml @@ -29,4 +29,4 @@ spec: value: http://nodewatcher.nodewatcher-staging:4466 ports: - name: nomidot-4000 - containerPort: 4000 + containerPort: 4000 \ No newline at end of file From 1decda62d7ac97e39b24124f5c3ef9312eaa51ae Mon Sep 17 00:00:00 2001 From: YJ Date: Sat, 11 Apr 2020 22:15:25 +0800 Subject: [PATCH 2/4] fix: values --- .../kubernetes/nodewatcher-deployment-staging.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/back/node_watcher/kubernetes/nodewatcher-deployment-staging.yaml b/back/node_watcher/kubernetes/nodewatcher-deployment-staging.yaml index f7846135..c616dc59 100644 --- a/back/node_watcher/kubernetes/nodewatcher-deployment-staging.yaml +++ b/back/node_watcher/kubernetes/nodewatcher-deployment-staging.yaml @@ -28,11 +28,11 @@ spec: - name: prisma-4466 containerPort: 4466 requests: - memory: "64Mi" + memory: "256Mi" cpu: "250m" limits: - memory: "128Mi" - cpu: "500m" + memory: "512Mi" + cpu: "500m" env: - name: PRISMA_CONFIG valueFrom: @@ -61,10 +61,10 @@ spec: "-instances=test-installations-222013:europe-west1:kusama-etl=tcp:0.0.0.0:5432", "-credential_file=/secrets/cloudsql/credentials.json"] requests: - memory: "64Mi" + memory: "8Mi" cpu: "250m" limits: - memory: "128Mi" + memory: "16Mi" cpu: "500m" volumeMounts: - name: cloudsql-instance-credentials From 82467be22df4f97ad87dd237b62cf16dbaf53437 Mon Sep 17 00:00:00 2001 From: YJ Date: Sat, 11 Apr 2020 22:16:57 +0800 Subject: [PATCH 3/4] fix: whitespace --- .../node_watcher/kubernetes/nodewatcher-deployment-staging.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/back/node_watcher/kubernetes/nodewatcher-deployment-staging.yaml b/back/node_watcher/kubernetes/nodewatcher-deployment-staging.yaml index c616dc59..3d2741da 100644 --- a/back/node_watcher/kubernetes/nodewatcher-deployment-staging.yaml +++ b/back/node_watcher/kubernetes/nodewatcher-deployment-staging.yaml @@ -53,7 +53,7 @@ spec: valueFrom: secretKeyRef: name: cloudsql-db-credentials - key: dbname + key: dbname - name: cloudsql-proxy image: gcr.io/cloudsql-docker/gce-proxy:1.16 command: ["/cloud_sql_proxy", From c3df741227fa01316a6919db407c386b615d9fe1 Mon Sep 17 00:00:00 2001 From: YJ Date: Sat, 11 Apr 2020 22:27:49 +0800 Subject: [PATCH 4/4] fix: math --- .../kubernetes/nodewatcher-deployment-staging.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/back/node_watcher/kubernetes/nodewatcher-deployment-staging.yaml b/back/node_watcher/kubernetes/nodewatcher-deployment-staging.yaml index 3d2741da..110b564a 100644 --- a/back/node_watcher/kubernetes/nodewatcher-deployment-staging.yaml +++ b/back/node_watcher/kubernetes/nodewatcher-deployment-staging.yaml @@ -28,10 +28,10 @@ spec: - name: prisma-4466 containerPort: 4466 requests: - memory: "256Mi" + memory: "1280Mi" cpu: "250m" limits: - memory: "512Mi" + memory: "2560Mi" cpu: "500m" env: - name: PRISMA_CONFIG @@ -61,10 +61,10 @@ spec: "-instances=test-installations-222013:europe-west1:kusama-etl=tcp:0.0.0.0:5432", "-credential_file=/secrets/cloudsql/credentials.json"] requests: - memory: "8Mi" + memory: "16Mi" cpu: "250m" limits: - memory: "16Mi" + memory: "32Mi" cpu: "500m" volumeMounts: - name: cloudsql-instance-credentials