Created
July 20, 2020 21:51
-
-
Save warroyo/75e27ab7963d7eca6460bc50b95bac3e to your computer and use it in GitHub Desktop.
match TKGI k8s nodes to vsphere vms
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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