Skip to content

Instantly share code, notes, and snippets.

@sleepless-se
Last active December 11, 2018 14:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sleepless-se/ac6e200e609a6d00f9ff3f02abacd700 to your computer and use it in GitHub Desktop.
Save sleepless-se/ac6e200e609a6d00f9ff3f02abacd700 to your computer and use it in GitHub Desktop.
This shell start 3 preemptible f1-micro node and 1 f1-micro on k8s.
# setting gcloud
gcloud init
# Update components
gcloud components update
gcloud components update kubectl
#Set CLUSTER_NAM and NODE_POOL
CLUSTER_NAME="micro-cluster"
NODE_POOL="stable-node"
ZONE="us-central1-c"
# Create clustor and nodes
gcloud container clusters create $CLUSTER_NAME --preemptible --machine-type=f1-micro --num-nodes 3 --disk-size 10 --zone $ZONE
gcloud container node-pools create $NODE_POOL --cluster $CLUSTER_NAME --machine-type=f1-micro --num-nodes 1 --disk-size 10 --zone $ZONE
# Show clustor
gcloud container node-pools list --cluster $CLUSTER_NAME
# Show credentials
gcloud container clusters get-credentials $CLUSTER_NAME
# Show token
kubectl describe secrets
# Delete clustor
# gcloud container clusters delete $CLUSTER_NAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment