Home > Storage > PowerFlex > White Papers > CockroachDB Deployment on Dell PowerFlex with Kubernetes > Test setup
To run the tpcc and KV workloads on the CockroachDB cluster hosted in Kubernetes, client VMs are deployed on a separate host. This is a common practice when running performance validation tests so that the workload clients, which simulate the users, are not consuming memory and CPU resources from the database cluster nodes.
The following figure shows the logical architecture diagram of the client VMs connecting to CockroachDB pods.
In the above figure, a couple of client VMs are configured to connect the CockroachDB cluster. The tests are carried out from both these VMs simultaneously.
To run the tests from the client VM, first copy the Kubernetes config file to this VM. Next, export this config file into the KUBECONFIG variable.
export KUBECONFIG=/tmp/config
After exporting kubeconfig, this VM can now connect to the CockroachDB kubernetes cluster. To test the same, use the following command. This command lists all the pods under the CockroachDB cluster as shown in the following figure.
kubectl get pods -n cockroach-operator-system
To validate CockroachDB performance on PowerFlex, the tpcc and KV databases are initially created. Then the data is populated within these databases.
The following command is used from the client VM to create a tpcc database and load test data. This populates about 1.3 TB of data into the tpcc database.
kubectl exec -it cockroachdb-client-secure -- ./cockroach workload fixtures import tpcc --warehouses 24000 'postgresql://root@cockroachdb-public:26257?sslcert=%2Fcockroach%2Fcockroach-certs%2Fclient.root.crt&sslkey=%2Fcockroach%2Fcockroach-certs%2Fclient.root.key&sslmode=verify-full&sslrootcert=%2Fcockroach%2Fcockroach-certs%2Fca.crt'
Similarly, for a kv database 20 billion records are inserted as shown in the following command. This creates and populates about 1.1 TB of data into the kv database.
kubectl exec -it cockroachdb-client-secure -- ./cockroach workload fixtures import kv --insert-count=20000000000 'postgresql://root@cockroachdb-public:26257?sslcert=%2Fcockroach%2Fcockroach-certs%2Fclient.root.crt&sslkey=%2Fcockroach%2Fcockroach-certs%2Fclient.root.key&sslmode=verify-full&sslrootcert=%2Fcockroach%2Fcockroach-certs%2Fca.crt'
To verify if the databases are correctly populated, log in to the CockroachDB sql pod as shown in the following code sample:
[root@cockroachdbadmin cockroach-certs]# kubectl exec -it cockroachdb-client-secure -- ./cockroach sql --certs-dir=/cockroach/cockroach-certs --host=cockroachdb-public
root@cockroachdb-public:26257/defaultdb> show DATABASES;
database_name | owner | primary_region | secondary_region | regions | survival_goal
----------------+-------+----------------+------------------+-----
defaultdb | root | NULL | NULL | {} | NULL
kv | root | NULL | NULL | {} | NULL
postgres | root | NULL | NULL | {} | NULL
system | node | NULL | NULL | {} | NULL
tpcc | root | NULL | NULL | {} | NULL
ycsb | root | NULL | NULL | {} | NULL
(6 rows)
Time: 9ms total (execution 9ms / network 0ms)