diff --git a/deploy.sh b/deploy.sh index 9c8eb9a..152b02f 100755 --- a/deploy.sh +++ b/deploy.sh @@ -111,6 +111,9 @@ function main() { fi + # Refreshes all pods in case of a new image + bash ./refresh.sh + exit 0 } diff --git a/deployment/backend/backend.yaml b/deployment/backend/backend.yaml index 1200bab..c129cd0 100644 --- a/deployment/backend/backend.yaml +++ b/deployment/backend/backend.yaml @@ -22,8 +22,8 @@ spec: memory: "256Mi" cpu: "250m" limits: - memory: "512Mi" - cpu: "750m" + memory: "768Mi" + cpu: "500m" ports: - containerPort: 8070 env: diff --git a/deployment/frontend/frontend.yaml b/deployment/frontend/frontend.yaml index a9e62af..f9638fd 100644 --- a/deployment/frontend/frontend.yaml +++ b/deployment/frontend/frontend.yaml @@ -24,8 +24,8 @@ spec: memory: "256Mi" cpu: "250m" limits: - memory: "1536Mi" - cpu: "750m" + memory: "512Mi" + cpu: "500m" ports: - containerPort: 5000 env: diff --git a/deployment/postgres/postgres.yaml b/deployment/postgres/postgres.yaml index e6f8399..827e349 100644 --- a/deployment/postgres/postgres.yaml +++ b/deployment/postgres/postgres.yaml @@ -22,7 +22,7 @@ spec: memory: "512Mi" cpu: "500m" limits: - memory: "512Mi" + memory: "768Mi" cpu: "500m" ports: - containerPort: 5432 diff --git a/deployment/redis/redis.yaml b/deployment/redis/redis.yaml index bf3ba34..3c1eaec 100644 --- a/deployment/redis/redis.yaml +++ b/deployment/redis/redis.yaml @@ -23,7 +23,7 @@ spec: cpu: "250m" limits: memory: "1024Mi" - cpu: "500m" + cpu: "250m" ports: - containerPort: 6379 env: diff --git a/deployment/storage/storage.yaml b/deployment/storage/storage.yaml index bfceda1..2ffe59d 100644 --- a/deployment/storage/storage.yaml +++ b/deployment/storage/storage.yaml @@ -22,8 +22,8 @@ spec: memory: "256Mi" cpu: "250m" limits: - memory: "512Mi" - cpu: "500m" + memory: "256Mi" + cpu: "250m" ports: - containerPort: 8000 env: diff --git a/refresh.sh b/refresh.sh new file mode 100755 index 0000000..3d2a6ed --- /dev/null +++ b/refresh.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +NAMESPACES=( + portfolio +) + +DEPLOYMENTS=( + "frontend-deployment" + "backend-deployment" + "storage-deployment" + "storage-processor-deployment" +) + +for i in "${NAMESPACES[@]}"; do + for x in "${DEPLOYMENTS[@]}"; do + PODS=$(kubectl -n $i get pods --no-headers | awk '{print $1}' | grep $x | tr '\n' ' ') + kubectl -n $i delete pods $PODS + done +done diff --git a/setup.py b/setup.py index d9466b7..f8edc4b 100644 --- a/setup.py +++ b/setup.py @@ -13,6 +13,7 @@ def write_template(template: str, output: str): open(output, 'w') as output: output.write(envsubst(template.read())) + def configure_templates(environment: str): if not environment in ("prod", "staging", "local"): raise ValueError("Invalid Environment Selected")