I'm migrating karpenter to version v0.32.x and I need to verify if there are some machines left that might not have been migrated to nodepools.
Note
I have a none context that I select to "turn off" kubectl. I need to filter it out.
To create this context, I used the following command: kubectl config set-context none
let machines = ^kubectl config view
| from yaml
| get contexts
| where $it.name != none # I have a "null" context called "none"
| par-each { |ctx|
try {
print $"Getting machines from ($ctx.context.cluster)"
^kubectl --context $ctx.name get machines -o json
| from json
| get items
| select kind metadata.name
| insert cluster $ctx.context.cluster
| move cluster --before kind
} catch {
[]
}
}
| flatten
$machines