Home > Storage > PowerFlex > White Papers > Replication using Container Storage Module with Dell PowerFlex > Repctl tool
Repctl is the CSM command line tool to manage CSM replication. repctl commands can be run from any of the OpenShift clusters for configuration on both the clusters, while enabling replication.
Steps to install the repctl tool and configure the cluster for replication:
# git clone -b v1.5.0 https://github.com/dell/csm-replication.git
# cd csm-replication/repctl
# make build
# ./repctl cluster add -f "/root/.kube/config-p1","/root/.kube/config-s1" -n "primaryocp","secondaryocp" [2023-11-16 04:17:21] INFO Adding clusters
[2023-11-16 04:17:21] INFO primaryocp
[2023-11-16 04:17:21] INFO Successfully created primaryocp in /root/.repctl/clusters folder. 12178 bytes copied
[2023-11-16 04:17:21] INFO secondaryocp
[2023-11-16 04:17:21] INFO Successfully created secondaryocp in /root/.repctl/clusters folder. 12196 bytes copied
# ./repctl create -f ../deploy/replicationcrds.all.yaml
# ./repctl create -f ../deploy/controller.yaml
Note: When CSM Replication is deployed in an environment where the DNS is not configured, or two clusters at different physical location with their own DNS servers, you may need to update the dell-replication-controller-manager to map the API endpoint FQDN to an IP address by adding the `hostAliases` field and FQDN:IP mappings on both the clusters participating in replication.
hostAliases:
- hostnames:
- api.primaryocp.dellpowerflex.com
ip: 192.168.105.120
- hostnames:
- api.secondaryocp.dellpowerflex.com
ip: 192.168.105.114
Sample command to patch the deployment controller.
# kubectl patch deployment -n dell-replication-controller dell-replication-controller-manager -p '{"spec":{"template":{"spec":{"hostAliases":[{"hostnames":["<remote-FQDN>"],"ip":"<remote-IP>"}]}}}}'
# ./repctl cluster inject --use-sa
# ./repctl create sc --from-config examples/powerflex_example_values.yaml
For the sample powerflex_example_values.yaml file, see Appendix-B.
Note: ClusterID in the file should match the names that were given to clusters in step 2.
# ./repctl get clusters
+---------------+
| Cluster |
+---------------+
ClusterId Version URL
primaryocp v1.25 https://api.primaryocp.dellpowerflex.com:6443
secondaryocp v1.25 https://api.secondaryocp.dellpowerflex.com:6443