From 1a5f9a5ed19e721cfa4bcb8d46fa8dab8f4d7f66 Mon Sep 17 00:00:00 2001 From: Vitor Hideyoshi Date: Sun, 27 Oct 2024 03:10:47 -0300 Subject: [PATCH 1/2] Lowers LivenessProbe Check Time --- template/backend/backend.template.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/backend/backend.template.yaml b/template/backend/backend.template.yaml index 3954f22..c561ad0 100644 --- a/template/backend/backend.template.yaml +++ b/template/backend/backend.template.yaml @@ -49,7 +49,7 @@ spec: httpGet: path: /health port: 8070 - initialDelaySeconds: 240 + initialDelaySeconds: 60 env: - name: FRONTEND_PATH valueFrom: From 6b35c4969228012c1458df61bbb33dc17989fa3a Mon Sep 17 00:00:00 2001 From: Vitor Hideyoshi Date: Sun, 27 Oct 2024 03:23:49 -0300 Subject: [PATCH 2/2] Better Resource Configuration in Deploy Script --- deploy.sh | 33 ++++++++++++--------------------- 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/deploy.sh b/deploy.sh index 0d51381..5e64219 100755 --- a/deploy.sh +++ b/deploy.sh @@ -51,8 +51,8 @@ apply_template() { } -apply_deployment() { - deployment_name=$1 +apply_resource() { + resource_name=$1 deployment_files=$2 for file in $(find $2 -type f); do @@ -61,14 +61,14 @@ apply_deployment() { kubectl wait --for=condition=available \ --timeout=600s \ - deployment.apps/${deployment_name} \ + ${resource_name} \ -n ${KUBE_NAMESPACE} } configure_nginx_minikube() { if [[ $setup_minikube == "true" ]]; then - minikube start --driver kvm2 --cpus 4 --memory 4Gib + minikube start --driver kvm2 --cpus 8 --memory 8Gib fi minikube addons enable ingress-dns @@ -110,23 +110,12 @@ configure_cert_manager() { } -configure_postgres() { +configure_postgres_cluster() { helm repo add cnpg https://cloudnative-pg.github.io/charts helm upgrade --install cnpg \ --namespace ${KUBE_NAMESPACE} \ --create-namespace \ cnpg/cloudnative-pg - - kubectl wait --for=condition=available \ - --timeout=600s \ - deployment.apps/cnpg-cloudnative-pg \ - -n ${KUBE_NAMESPACE} - - apply_template "./template/postgres/cn-cluster.template.yaml" - kubectl wait --for=condition=Ready \ - --timeout=600s \ - cluster/postgres-cn-cluster \ - -n ${KUBE_NAMESPACE} } @@ -154,6 +143,8 @@ deploy_kubernetes() { configure_cert_manager + configure_postgres_cluster + KUBE_FILES=( "./template/portfolio-namespace.template.yaml" "./template/portfolio-secret.template.yml" @@ -163,15 +154,15 @@ deploy_kubernetes() { apply_template $file done - configure_postgres + apply_resource "cluster/postgres-cn-cluster" "./template/postgres" - apply_deployment "redis-deployment" "./template/redis" + apply_resource "deployment.apps/redis-deployment" "./template/redis" - apply_deployment "storage-deployment" "./template/storage" + apply_resource "deployment.apps/storage-deployment" "./template/storage" - apply_deployment "backend-deployment" "./template/backend" + apply_resource "deployment.apps/backend-deployment" "./template/backend" - apply_deployment "frontend-deployment" "./template/frontend" + apply_resource "deployment.apps/frontend-deployment" "./template/frontend" configure_ingress