Skip to content

Instantly share code, notes, and snippets.

@alecmerdler
Created May 11, 2018 17:31
Show Gist options
  • Save alecmerdler/ba96a135155a9d4c2b345d3a30eab03b to your computer and use it in GitHub Desktop.
Save alecmerdler/ba96a135155a9d4c2b345d3a30eab03b to your computer and use it in GitHub Desktop.
const { execSync } = require('child_process');
/**
* Create a bunch of configmaps for load testing.
*/
new Array(10000).fill(0).forEach((_, i) => {
const configMap = {
apiVersion: 'v1',
kind: 'ConfigMap',
metadata: {
namespace: 'load-test',
name: `test-${i}`,
},
data: {
key: 'val',
}
};
const result = execSync(`echo '${JSON.stringify(configMap)}' | kubectl create -f - `).toString().trim();
console.log(result);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment