From 7dd3cfe25b4c7311db576a690e1f90a758316a0d Mon Sep 17 00:00:00 2001 From: Aniket Singh Rawat <122869307+aniketsinghrawat@users.noreply.github.com> Date: Mon, 29 Apr 2024 16:30:09 +0530 Subject: [PATCH] updated resources for license deployment (#432) * updated resources for license deployment * updated cluster creation step --- weather_dl_v2/fastapi-server/README.md | 7 +++++-- weather_dl_v2/fastapi-server/VERSION.txt | 2 +- .../fastapi-server/license_dep/license_deployment.yaml | 4 ++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/weather_dl_v2/fastapi-server/README.md b/weather_dl_v2/fastapi-server/README.md index ad44c6a9..9b8f1243 100644 --- a/weather_dl_v2/fastapi-server/README.md +++ b/weather_dl_v2/fastapi-server/README.md @@ -23,13 +23,16 @@ export PROJECT_ID= export REGION= eg: us-west1 export ZONE= eg: us-west1-a export CLUSTER_NAME= eg: weather-dl-v2-cluster +export LICENSE_NODE_POOL=license-pool export DOWNLOAD_NODE_POOL=downloader-pool export SERVER_NODE_POOL=server-pool -gcloud beta container --project $PROJECT_ID clusters create $CLUSTER_NAME --zone $ZONE --no-enable-basic-auth --cluster-version "1.27.2-gke.1200" --release-channel "regular" --machine-type "e2-standard-8" --image-type "COS_CONTAINERD" --disk-type "pd-balanced" --disk-size "1100" --metadata disable-legacy-endpoints=true --scopes "https://www.googleapis.com/auth/cloud-platform" --max-pods-per-node "16" --num-nodes "4" --logging=SYSTEM,WORKLOAD --monitoring=SYSTEM --enable-ip-alias --network "projects/$PROJECT_ID/global/networks/default" --subnetwork "projects/$PROJECT_ID/regions/$REGION/subnetworks/default" --no-enable-intra-node-visibility --default-max-pods-per-node "16" --enable-autoscaling --min-nodes "4" --max-nodes "100" --location-policy "BALANCED" --no-enable-master-authorized-networks --addons HorizontalPodAutoscaling,HttpLoadBalancing,GcePersistentDiskCsiDriver --enable-autoupgrade --enable-autorepair --max-surge-upgrade 1 --max-unavailable-upgrade 0 --enable-managed-prometheus --enable-shielded-nodes --node-locations $ZONE --node-labels preemptible=false && +gcloud beta container --project $PROJECT_ID clusters create $CLUSTER_NAME --zone $ZONE --no-enable-basic-auth --cluster-version "1.27.2-gke.1200" --release-channel "regular" --machine-type "e2-standard-8" --image-type "COS_CONTAINERD" --disk-type "pd-balanced" --disk-size "100" --metadata disable-legacy-endpoints=true --scopes "https://www.googleapis.com/auth/cloud-platform" --max-pods-per-node "16" --num-nodes "4" --logging=SYSTEM,WORKLOAD --monitoring=SYSTEM --enable-ip-alias --network "projects/$PROJECT_ID/global/networks/default" --subnetwork "projects/$PROJECT_ID/regions/$REGION/subnetworks/default" --no-enable-intra-node-visibility --default-max-pods-per-node "16" --enable-autoscaling --min-nodes "0" --max-nodes "100" --location-policy "BALANCED" --no-enable-master-authorized-networks --addons HorizontalPodAutoscaling,HttpLoadBalancing,GcePersistentDiskCsiDriver --enable-autoupgrade --enable-autorepair --max-surge-upgrade 1 --max-unavailable-upgrade 0 --enable-managed-prometheus --enable-shielded-nodes --node-locations $ZONE --node-labels preemptible=false gcloud beta container --project $PROJECT_ID node-pools create $DOWNLOAD_NODE_POOL --cluster $CLUSTER_NAME --zone $ZONE --machine-type "e2-standard-8" --image-type "COS_CONTAINERD" --disk-type "pd-balanced" --disk-size "1100" --metadata disable-legacy-endpoints=true --scopes "https://www.googleapis.com/auth/cloud-platform" --max-pods-per-node "16" --num-nodes "1" --enable-autoscaling --min-nodes "1" --max-nodes "100" --location-policy "BALANCED" --enable-autoupgrade --enable-autorepair --max-surge-upgrade 1 --max-unavailable-upgrade 0 --node-locations $ZONE --node-labels preemptible=false +gcloud beta container --project $PROJECT_ID node-pools create $LICENSE_NODE_POOL --cluster $CLUSTER_NAME --zone $ZONE --machine-type "e2-standard-8" --image-type "COS_CONTAINERD" --disk-type "pd-balanced" --disk-size "100" --metadata disable-legacy-endpoints=true --scopes "https://www.googleapis.com/auth/cloud-platform" --max-pods-per-node "16" --num-nodes "1" --enable-autoscaling --min-nodes "1" --max-nodes "100" --location-policy "BALANCED" --enable-autoupgrade --enable-autorepair --max-surge-upgrade 1 --max-unavailable-upgrade 0 --node-locations $ZONE --node-labels preemptible=false + gcloud beta container --project $PROJECT_ID node-pools create $SERVER_NODE_POOL --cluster $CLUSTER_NAME --zone $ZONE --node-version "1.27.7-gke.1056000" --machine-type "e2-standard-8" --image-type "COS_CONTAINERD" --disk-type "pd-balanced" --disk-size "250" --metadata disable-legacy-endpoints=true --scopes "https://www.googleapis.com/auth/cloud-platform" --num-nodes "1" --enable-autoupgrade --enable-autorepair --max-surge-upgrade 1 --max-unavailable-upgrade 0 ``` @@ -88,4 +91,4 @@ kubectl get pods ### For deleting existing deployment: ``` -kubectl delete -f server.yaml --force \ No newline at end of file +kubectl delete -f server.yaml --force diff --git a/weather_dl_v2/fastapi-server/VERSION.txt b/weather_dl_v2/fastapi-server/VERSION.txt index e4c0d46e..a6a3a43c 100644 --- a/weather_dl_v2/fastapi-server/VERSION.txt +++ b/weather_dl_v2/fastapi-server/VERSION.txt @@ -1 +1 @@ -1.0.3 \ No newline at end of file +1.0.4 \ No newline at end of file diff --git a/weather_dl_v2/fastapi-server/license_dep/license_deployment.yaml b/weather_dl_v2/fastapi-server/license_dep/license_deployment.yaml index dff460f8..0dad589d 100644 --- a/weather_dl_v2/fastapi-server/license_dep/license_deployment.yaml +++ b/weather_dl_v2/fastapi-server/license_dep/license_deployment.yaml @@ -10,7 +10,7 @@ spec: spec: restartPolicy: Never nodeSelector: - cloud.google.com/gke-nodepool: default-pool + cloud.google.com/gke-nodepool: license-pool containers: - name: weather-dl-v2-license-dep image: XXXXXXX @@ -18,7 +18,7 @@ spec: args: [] resources: requests: - cpu: "4000m" # CPU: 4 vCPU + cpu: "2000m" # CPU: 2 vCPU memory: "2Gi" # RAM: 2 GiB ephemeral-storage: "10Gi" # Storage: 10 GiB volumeMounts: