Skip to content

Instantly share code, notes, and snippets.

@warroyo
Created July 20, 2020 21:51
Show Gist options
  • Select an option

  • Save warroyo/75e27ab7963d7eca6460bc50b95bac3e to your computer and use it in GitHub Desktop.

Select an option

Save warroyo/75e27ab7963d7eca6460bc50b95bac3e to your computer and use it in GitHub Desktop.
match TKGI k8s nodes to vsphere vms
#!/bin/bash
set -e
BOSH_IDS=$(kubectl get nodes -o=jsonpath='{.items[*].metadata.labels.bosh\.id}')
for i in ${BOSH_IDS} ; do
VM=$(govc find -json / -type m -customValue "*:$i")
echo "Node: $i"
echo "VM: $VM"
echo "------------------------"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment