Skip to content

Instantly share code, notes, and snippets.

@thebsdbox
Last active January 3, 2020 17:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thebsdbox/61b5457accaf4c0f0109a3dff2903479 to your computer and use it in GitHub Desktop.
Save thebsdbox/61b5457accaf4c0f0109a3dff2903479 to your computer and use it in GitHub Desktop.
#!/bin/sh
CLUSTERS=250
MACHINES=5
echo "About to build a configuration for $CLUSTERS deployed clusters with $MACHINES each and written to the file $1"
sleep 5
for i in $( seq $CLUSTERS ); do
echo "apiVersion: cluster.x-k8s.io/v1alpha2
kind: Cluster
metadata:
name: cluster-$i
spec:
clusterNetwork:
pods:
cidrBlocks: [\"192.168.0.0/16\"]
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: InceptionCluster
name: cluster-$i
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: InceptionCluster
metadata:
name: cluster-$i
---
kind: MachineDeployment
apiVersion: cluster.x-k8s.io/v1alpha2
metadata:
name: deployment-$i
namespace: default
labels:
cluster.x-k8s.io/cluster-name: cluster-$i
nodepool: nodepool-0
spec:
replicas: $MACHINES
selector:
matchLabels:
cluster.x-k8s.io/cluster-name: cluster-$i
nodepool: nodepool-0
template:
metadata:
labels:
cluster.x-k8s.io/cluster-name: cluster-$i
nodepool: nodepool-0
spec:
version: \"v1.15.3\"
bootstrap:
data: \"\"
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: InceptionMachine
name: imachinetemplate
namespace: default
---" >> $1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment