Skip to content

Commit

Permalink
list available pools
Browse files Browse the repository at this point in the history
Signed-off-by: Jesse Nelson <[email protected]>
  • Loading branch information
jnels124 committed Oct 29, 2024
1 parent 444af78 commit 3901b87
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docs/runbook/scripts/change-machine-type.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ if [[ -z "${MACHINE_TYPE}" ]]; then
exit 1
fi

POOLS_TO_UPDATE_INPUT="$(readUserInput "Enter the node pools to update (space-separated): ")"
AVAILABLE_POOLS="$(gcloud container node-pools list --project="${GCP_PROJECT}" --cluster="${GCP_K8S_CLUSTER_NAME}" --region="${GCP_K8S_CLUSTER_REGION}" --format="json(name)"| jq -r '.[].name' | tr '\n' ' ')"
POOLS_TO_UPDATE_INPUT="$(readUserInput "Enter the node pools(${AVAILABLE_POOLS}) to update (space-separated): ")"
if [[ -z "${POOLS_TO_UPDATE_INPUT}" ]]; then
log "POOLS_TO_UPDATE_INPUT is not set and is required. Exiting"
exit 1
Expand Down
13 changes: 12 additions & 1 deletion docs/runbook/scripts/upgrade-k8s-version-citus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ set -euo pipefail
source ./utils.sh

NAMESPACES=($(kubectl get sgshardedclusters.stackgres.io -A -o jsonpath='{.items[*].metadata.namespace}'))
POOLS_TO_UPDATE=("${GCP_WORKER_POOL_NAME}" "${GCP_COORDINATOR_POOL_NAME}" "default-pool")

GCP_PROJECT="$(readUserInput "Enter GCP Project for target: ")"
if [[ -z "${GCP_PROJECT}" ]]; then
Expand Down Expand Up @@ -45,6 +44,18 @@ else
fi
fi

AVAILABLE_POOLS="$(gcloud container node-pools list --project="${GCP_PROJECT}" --cluster="${GCP_K8S_CLUSTER_NAME}" --region="${GCP_K8S_CLUSTER_REGION}" --format="json(name)"| jq -r '.[].name' | tr '\n' ' ')"
POOLS_TO_UPDATE_INPUT="$(readUserInput "Enter the node pools(${AVAILABLE_POOLS}) to update (space-separated): ")"
if [[ -z "${POOLS_TO_UPDATE_INPUT}" ]]; then
log "POOLS_TO_UPDATE_INPUT is not set and is required. Exiting"
exit 1
else
IFS=', ' read -r -a POOLS_TO_UPDATE <<< "${POOLS_TO_UPDATE_INPUT}"
for pool in "${POOLS_TO_UPDATE[@]}"; do
gcloud container node-pools describe "${pool}" --project="${GCP_PROJECT}" --cluster="${GCP_K8S_CLUSTER_NAME}" --region="${GCP_K8S_CLUSTER_REGION}" > /dev/null
done
fi

for namespace in "${NAMESPACES[@]}"
do
unrouteTraffic "${namespace}"
Expand Down

0 comments on commit 3901b87

Please sign in to comment.