-
Notifications
You must be signed in to change notification settings - Fork 66
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 discovered application samples #53
base: main
Are you sure you want to change the base?
Conversation
Add a section about the difference between managed and discovered applications and update the titles to make it clear that the current instructions are for OCM managed applications. Signed-off-by: Nir Soffer <[email protected]>
Move current dr samples to dr/managed, making rook for dr/discovered samples. Signed-off-by: Nir Soffer <[email protected]>
043ea92
to
97df338
Compare
The ManagedClusterBinding belongs to the ramen-ops namespace and not to the application, so we keep it in the ramen-ops directory. The rest of the resources are in the deployment-rbd directory. I'm not sure how easy it will be to share a base kustomization with other workloads so lets start with something simple. The README was updated to describe complete DR flow for discovered application using the new resources. Signed-off-by: Nir Soffer <[email protected]>
Here is what I suggest as the directory structure for discovered:
The above presents one dr enabling set of resources for any discovered application. The kustomization would hold the templates for required values that need to change, for example the protectedNS, kubeObjectProtection specification etc. Also, the common setup for supporting discovered workloads is moved to the ramen directory, to be used as part of setup. This PR attempts to separate this into a managed/discovered seems to lead back to creating a overlay for each type of workload that we have in the repository, which is excessive and something we want to avoid. |
Do yo suggest discovered/kustomization will customize base/ resources?
Sure we can move binding.yaml here. It is needed only for discovered apps but we document the simple command to deploy it in the right section.
We don't need ramen-ops-ns - it is already created by ramen. At least we don't need to do anything in drenv for this. If we want to help users create ramen-ops with the binding we can add something like this:
But we need an overlay for each application (e.g deloyment, deadonset, statefulset, vm-pvc, vm-dv, vm-dvt). If we don't add it the user will have to add it manually which makes testing and experimenting too hard. This is what we have now for other workloads. |
namespace in cluster `dr1`: | ||
|
||
``` | ||
kubectl get vrg -l app=deployment-rbd -n ramen-ops --context dr1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not work:
$ kubectl get vrg -l app=deployment-rbd -n ramen-ops --context dr1
No resources found in ramen-ops namespace.
Because ramen does not label the vrg with the same label of the drpc. I think this works for OCM managed apps.
Example output: | ||
|
||
``` | ||
$ kubectl get vrg deployment-rbd-drpc -n ramen-ops --context dr1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Command should move up, this is just the output.
placementdecision.cluster.open-cluster-management.io/deployment-rbd-placement-decision patched (no change) | ||
``` | ||
|
||
At this point *Ramen* take over and start protecting the application. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For completeness, we should show the drpc at this stage:
kubectl get drpc -l app=deployment-rbd -n ramen-ops --context hub
Example output:
NAME AGE PREFERREDCLUSTER FAILOVERCLUSTER DESIREDSTATE CURRENTSTATE
deployment-rbd-drpc 11m dr1 Deployed
cluster, *OCM* delete the application from the cluster and deploy it on | ||
the other cluster. | ||
|
||
### OCM discovered applications* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing *
The application is still running on the primary cluster: | ||
|
||
``` | ||
$ kubectl get deploy,pod,pvc -n deployment-rbd --context dr1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leading $
unneeded - breaks copy and paste from rendered page.
@@ -0,0 +1,6 @@ | |||
apiVersion: cluster.open-cluster-management.io/v1beta1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ramen already has code to create a placement decision with the right decision set:
https://github.com/RamenDR/ramen/blob/d475bc759f4cb84b0fd823b9eea2b0b54b7c0364/controllers/drplacementcontrol_controller.go#L2116
So this file should not be needed.
--type merge \ | ||
--namespace ramen-ops \ | ||
--context hub | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This step should not be needed if we remove the placemnt-decision.yaml - ramen will create a new configured resource automatically.
https://github.com/RamenDR/ramen/blob/d475bc759f4cb84b0fd823b9eea2b0b54b7c0364/controllers/drplacementcontrol_controller.go#L2116
### OCM managed applications | ||
|
||
Deployed and undeployed by *OCM*, using either *Subsription* or | ||
*ApplciationSet* resources. *Ramen* take ownership of the application |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/take/takes
|
||
Deployed and undeployed by *OCM*, using either *Subsription* or | ||
*ApplciationSet* resources. *Ramen* take ownership of the application | ||
when enabling DR, and return ownership to OCM when disabling DR. When DR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/return/returns
Deployed and undeployed by *OCM*, using either *Subsription* or | ||
*ApplciationSet* resources. *Ramen* take ownership of the application | ||
when enabling DR, and return ownership to OCM when disabling DR. When DR | ||
is enabled, *Ramen* control the placement of the application and backup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/control/controls
and restore the application PVCs. | ||
|
||
When failing over or relocating an *OCM managed application* to another | ||
cluster, *OCM* delete the application from the cluster and deploy it on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/delete/deletes and s/deploy/deploys
repository using kubectl. Another example is creating a virtual machine | ||
using KubeVirt console. | ||
|
||
*Ramen* take ownership of the application when enabling DR and return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
plural changes in this and next paragraph too
@@ -0,0 +1,8 @@ | |||
--- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If ACM is never to look at the placement and placementdecision, then we don't need the managedClusterSetBinding.
imperative means. An example is deploying one of the workloads in this | ||
repository using kubectl. Another example is creating a virtual machine |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imperative means. An example is deploying one of the workloads in this | |
repository using kubectl. Another example is creating a virtual machine | |
imperative means. An example is directly supplying one of the workload definitions in this | |
repository (Deployment, for example) to `kubectl apply`. Another example is creating a virtual machine |
Since this PR is big enough, I will post another PR for the kubevirt samples.