Skip to content

Add DisasterRecovery mode to manifests when running storkctl create clusterpair #1023

@Ben10k

Description

@Ben10k

Is this a BUG REPORT or FEATURE REQUEST?:
FEATURE REQUEST

What happened:
storkctl generate clusterpair has a flag (--storageoptions) to add additional storage options, for example
mode=DisasterRecovery.

storkctl generate clusterpair does not have any way to add that storage option to the manifests before they are
applied.

What you expected to happen:
A way to provide the storageoption mode=DisasterRecovery to storkctl create clusterpair

How to reproduce it (as minimally and precisely as possible):
2 Portworx enabled kubernetes clusters are required

Required variables:

Variable Meaning
DST_KUBE_CONFIG Path to a kubeconfig file where current context is the destination cluster
DESTINATION_IP IP address of the destination cluster's Portworx loadbalancer
DESTINATION_TOKEN Token of the destination Portworx cluster, can be retrieved by running on /opt/pwx/bin/pxctl cluster token show on the cluster
SRC_KUBE_CONFIG Path to a kubeconfig file where current context is the source cluster
SOURCE_IP IP address of the source cluster's Portworx loadbalancer
SOURCE_TOKEN Token of the source Portworx cluster

To generate clusterpair manifests, use this:

storkctl generate clusterpair generated-prod-to-dr \
  --kubeconfig $DST_KUBE_CONFIG \
  --namespace default \
  --storageoptions "ip=$DESTINATION_IP,token=$DESTINATION_TOKEN,mode=DisasterRecovery" \
  >generated-prod-to-dr.yaml

storkctl generate clusterpair generated-dr-to-prod \
  --kubeconfig $SRC_KUBE_CONFIG \
  --namespace default \
  --storageoptions "ip=$SOURCE_IP,token=$SOURCE_TOKEN,mode=DisasterRecovery" \
  >generated-dr-to-prod.yaml

To create and get back the yaml use this

storkctl create clusterpair created \
  -n default \
  --src-kube-file $SRC_KUBE_CONFIG \
  --src-ip $SOURCE_IP \
  --src-token $SOURCE_TOKEN \
  --dest-kube-file $DST_KUBE_CONFIG \
  --dest-ip $DESTINATION_IP \
  --dest-token $DESTINATION_TOKEN

kubectl get clusterpairs.stork.libopenstorage.org created \
  --kubeconfig $SRC_KUBE_CONFIG \
  -o yaml \
  >created-prod-to-dr.yaml

kubectl get clusterpairs.stork.libopenstorage.org created \
  --kubeconfig $DST_KUBE_CONFIG \
  -o yaml \
  >created-dr-to-prod.yaml

Anything else we need to know?:

Environment:

  • Kubernetes version (use kubectl version): N/A
  • Cloud provider or hardware configuration: N/A
  • OS (e.g. from /etc/os-release): N/A
  • Kernel (e.g. uname -a): N/A
  • Install tools: N/A
  • Others:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions