Skip to content

Commit

Permalink
Update terraform deployment notebook with scaling down the cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
JMGaljaard committed Sep 18, 2022
1 parent 99ad6d0 commit 0e022ca
Showing 1 changed file with 33 additions and 2 deletions.
35 changes: 33 additions & 2 deletions jupyter/terraform_notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@
"}\n",
"\n",
"# Create service-account\n",
"gcloud iam service-accounts create $ACCOUNT_ID --display-name=\"Terraform service account\" --project ${PROJECT_ID}\n",
"# gcloud iam service-accounts create $ACCOUNT_ID --display-name=\"Terraform service account\" --project ${PROJECT_ID}\n",
"\n",
"# Allow the service account to use the the set of roles below.\n",
"enable_gcp_role \"compute.viewer\" # Allow the service account to see active resources\n",
Expand Down Expand Up @@ -520,7 +520,7 @@
"execution_count": null,
"outputs": [],
"source": [
"cd ../terraform-dependencies"
"cd ../terraform/terraform-dependencies"
],
"metadata": {
"collapsed": false,
Expand Down Expand Up @@ -610,6 +610,16 @@
}
}
},
{
"cell_type": "markdown",
"source": [],
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%% md\n"
}
}
},
{
"cell_type": "markdown",
"metadata": {
Expand Down Expand Up @@ -675,6 +685,27 @@
"\n",
"terraform destroy -auto-approve"
]
},
{
"cell_type": "code",
"execution_count": null,
"outputs": [],
"source": [
"# Change nodepools\n",
"\n",
"\n",
"gcloud container clusters resize $CLUSTER_NAME --node-pool \"default-node-pool\" \\\n",
" --num-nodes 0 --region us-central1-c --quiet\n",
"\n",
"gcloud container clusters resize $CLUSTER_NAME --node-pool \"medium-fltk-pool-1\" \\\n",
" --num-nodes 0 --region us-central1-c --quiet\n"
],
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
}
}
],
"metadata": {
Expand Down

0 comments on commit 0e022ca

Please sign in to comment.