Skip to content

Instantly share code, notes, and snippets.

Last active April 3, 2022 02:50
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save sirdarckcat/568934df2b33a125b0b0f42a5366df8c to your computer and use it in GitHub Desktop.
# Obtain the following values from /etc/node-os-release
# Source code:
# This command will print an Image ID
gcloud container get-server-config --format json \
| jq -r '.channels|map(select(.channel=="REGULAR"))|.[].validVersions[]' \
| sed 's/\(.*\)-gke.\(.*\)/gke-\1-gke\2/g' | sed s/[.]//g \
| xargs -i gcloud compute images list --project gke-node-images --filter "name~'{}-cos-"$VERSION"-"$BUILD_ID"-v[0-9]*-pre$'" --format 'get(name)'
# Once you get the image, visit
# Clicking on Create Instance will boot a VM with the exact same VM ran on the cluster.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment