Skip to content

Commit

Permalink
updated resources for license deployment (#432)
Browse files Browse the repository at this point in the history
* updated resources for license deployment

* updated cluster creation step
  • Loading branch information
aniketsinghrawat authored Apr 29, 2024
1 parent f567829 commit 7dd3cfe
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
7 changes: 5 additions & 2 deletions weather_dl_v2/fastapi-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,16 @@ export PROJECT_ID=<your-project-here>
export REGION=<region> eg: us-west1
export ZONE=<zone> eg: us-west1-a
export CLUSTER_NAME=<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
```

Expand Down Expand Up @@ -88,4 +91,4 @@ kubectl get pods

### For deleting existing deployment:
```
kubectl delete -f server.yaml --force
kubectl delete -f server.yaml --force
2 changes: 1 addition & 1 deletion weather_dl_v2/fastapi-server/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.3
1.0.4
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ 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
imagePullPolicy: Always
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:
Expand Down

0 comments on commit 7dd3cfe

Please sign in to comment.