# README
Performance test
We can use the perftool
to do the performance test for the multicluster controlplane
Required
- One Kubernetes cluster, we will deploy the multicluster controlplane on that.
- Kind environment, we will create one kind cluster for performance test.
Run
- export your Kubernetes cluster kubeconfig with
KUBECONFIG
. - run
make test-performance
to start the performance test.
Configuration
By default, this performance test creates 1000 clusters and generates 5 manifest works for each cluster, you can
configure the --count
and --work-count
in the hack/performance.sh
to modify the cluster and manifestwork conuts.
By default, we use the below manifestwork as the workload
apiVersion: work.open-cluster-management.io/v1
kind: ManifestWork
metadata:
name: perftest-<cluster-name>-work-<work-number>
spec:
workload:
manifests:
- apiVersion: v1
kind: ConfigMap
metadata:
name: perftest-<cluster-name>-work-<work-number>
namespace: default
data:
test-data: "I'm a test configmap"
You can customize your own workload by following steps
- Define your manifestworks in a directory and use
perftest.open-cluster-management.io/expected-work-count
annotation to specify your expected manifestwork counts, e.g.
apiVersion: work.open-cluster-management.io/v1
kind: ManifestWork
metadata:
name: work-1
annotations:
"perftest.open-cluster-management.io/expected-work-count": "10"
spec:
workload:
manifests: <your-manifests>
---
apiVersion: work.open-cluster-management.io/v1
kind: ManifestWork
metadata:
name: work-2
annotations:
"perftest.open-cluster-management.io/expected-work-count": "20"
spec:
workload:
manifests: <your-manifests>
- Use
--work-template-dir
flag to specify your manifestworks directory path, then theperftool
will generate the manifest works with your expected work count on each cluster, and the generated work will use aconfigmap
to save your manifestwork to simulate the same size with your customized workloads, for above example, theperftool
will generate 10 manifest works forwork-1
and 20 manifest workswork-2
on each cluster, and the generated manifest work will be
apiVersion: work.open-cluster-management.io/v1
kind: ManifestWork
metadata:
name: perftest-<cluster-name>-work-work-1-<work-number>
spec:
workload:
- apiVersion: v1
kind: ConfigMap
metadata:
name: perftest-<cluster-name>-work-1-<work-number>
namespace: default
data:
test-data: |-
<the content of work-1>
---
apiVersion: work.open-cluster-management.io/v1
kind: ManifestWork
metadata:
name: <cluster-name>-work-work-2-<work-number>
spec:
workload:
- apiVersion: v1
kind: ConfigMap
metadata:
name: perftest-<cluster-name>-work-2-<work-number>
namespace: default
data:
test-data: |-
<the content of work-2>
Test Result
There is a doc to record our test result.