Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Ben10k opened this issue Jan 17, 2022 · 0 comments

Comments

@Ben10k
Copy link

Ben10k commented Jan 17, 2022

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:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant