Skip to content

Commit

Permalink
update create GKE cluster script
Browse files Browse the repository at this point in the history
  • Loading branch information
samos123 committed Nov 2, 2023
1 parent 6c28a0b commit 80930e5
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions deploy/create-gke-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,27 @@ set -x
PROJECT_ID=${PROJECT_ID:=$(gcloud config get project)}
REGION=${REGION:-us-central1}
ZONE=${ZONE:=${REGION}-a}
LOCATION=${LOCATION:-"${REGION}"}
L4_LOCATIONS=$(gcloud compute accelerator-types list | grep L4 | grep ${REGION} | grep -v Workstation | awk '{ print $2 }' | tr '\n' ',' | sed 's/.$//')
INSTALL_OPERATOR=${INSTALL_OPERATOR:-yes} # set to yes if you want to install operator

# Enable required services.
gcloud services enable container.googleapis.com
gcloud services enable artifactregistry.googleapis.com

export CLUSTER_NAME=substratus
if ! gcloud container clusters describe ${CLUSTER_NAME} --location ${REGION} -q >/dev/null; then
gcloud container clusters create ${CLUSTER_NAME} --location ${REGION} \
--machine-type e2-medium --num-nodes 1 --min-nodes 1 --max-nodes 5 \
if ! gcloud container clusters describe ${CLUSTER_NAME} --location ${LOCATION} -q >/dev/null; then
gcloud container clusters create ${CLUSTER_NAME} --location ${LOCATION} \
--machine-type e2-standard-2 --num-nodes 1 --min-nodes 1 --max-nodes 5 \
--autoscaling-profile optimize-utilization --enable-autoscaling \
--node-locations ${ZONE} --workload-pool ${PROJECT_ID}.svc.id.goog \
--enable-image-streaming --enable-shielded-nodes --shielded-secure-boot \
--shielded-integrity-monitoring \
--addons GcsFuseCsiDriver
fi

if ! gcloud container node-pools describe g2-standard-8 --cluster ${CLUSTER_NAME} --region ${REGION} -q >/dev/null; then
if ! gcloud container node-pools describe g2-standard-8 --cluster ${CLUSTER_NAME} --location ${LOCATION} -q >/dev/null; then
nodepool_args=(--spot --enable-autoscaling --enable-image-streaming
--num-nodes=0 --min-nodes=0 --max-nodes=3 --cluster ${CLUSTER_NAME}
--node-locations "${L4_LOCATIONS}" --region ${REGION} --async)
--node-locations "${L4_LOCATIONS}" --location ${LOCATION} --async)

gcloud container node-pools create g2-standard-8 \
--accelerator type=nvidia-l4,count=1,gpu-driver-version=latest \
Expand Down

0 comments on commit 80930e5

Please sign in to comment.