TLDR: Use for...of
instead of forEach()
in asynchronous code.
For legacy browsers, use for...i
or [].reduce()
To execute the promises in parallel, use Promise.all([].map(...))
#cloud-config | |
# Option 1 - Full installation using cURL | |
package_update: true | |
package_upgrade: true | |
groups: | |
- docker | |
system_info: |
kubectl get nodes -o=jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.status.capacity.cpu}{"\t"}{.status.capacity.memory}{"\t"}{.status.capacity.ephemeral-storage}{"\n"}{end}' | awk '{print $1, "\t", $2, "\t", $3/1024/1024, "GB", "\t", $4/1024/1024, "GB"}'