Skip to content

Preparing for adding kubevirt samples#44

Merged
ShyamsundarR merged 7 commits into
RamenDR:mainfrom
nirs:kubevirt-samples
Mar 13, 2024
Merged

Preparing for adding kubevirt samples#44
ShyamsundarR merged 7 commits into
RamenDR:mainfrom
nirs:kubevirt-samples

Conversation

@nirs

@nirs nirs commented Mar 7, 2024

Copy link
Copy Markdown
Member

Preparing for adding kubevirt samples, clean up the current samples, and change the directory layout to make it easy to add new applications and allow automated testing on all cluster and storage types.

Status:

Fixes #43

nirs added 5 commits March 7, 2024 22:53
No need to repeat the directory name in the resource names. This makes
it harder to work with the source.

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
Instead of repeating the same label everywhere, use commonLabels in the
kustomization.

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
- Improve names (logger container writing to /var/log/ramen.log)
- Make "name" property first for consistency
- Improve indentation

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
Log START, UPDATE, and STOP events to make it easier to verify failover
and relocate.

Based on ramen logger for the cirros image:
RamenDR/ramen#1105

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
- Fix indentation to the default yamllint style

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
@nirs nirs changed the title Add kubevirt samples Preparing for adding kubevirt samples Mar 8, 2024
@nirs
nirs marked this pull request as ready for review March 11, 2024 11:09
@nirs
nirs force-pushed the kubevirt-samples branch from 771ab9a to 57717c3 Compare March 11, 2024 11:11
Comment thread dr/core/base/drpc.yaml
Comment thread channel/kustomization.yaml

@ShyamsundarR ShyamsundarR left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few questions:

  • Why is there a core subdirectory within dr and subscription directories?
  • My understanding of core under root, and deployment under the same is to have another higher level directory like kubevirt with its variants within. This reduces some clutter (so that we avoid deployment/sts/daemonset within core). The issue I see is with the name core or just stashing away 3 workload types from the clutter (we will still need kubevirt at the root with it's sub-directories in there). It would be preferable to be more explicit and have deployment at the root. We can add a workloads or similar directory at the root and move all workloads within it (avoid clutter at root of the repo).

The second is more key than the first, as it impacts product documentation.

@nirs

nirs commented Mar 11, 2024

Copy link
Copy Markdown
Member Author

A few questions:

  • Why is there a core subdirectory within dr and subscription directories?

We need different drpc for busybox and kubevirt, mainly because we use different pvc selector, based on appname label. We use the same drpc if we use the same appname for all samples, maybe appname: sample

For subscription I assumed we will have few differences between core and kubvrit, but I managed to share the same files in #45.

If we remove core and use the layout bellow, we have something like:

subscripiton/deployment-...
subscription/kubevirt-vm-pvc-...

And same for dr/

  • My understanding of core under root, and deployment under the same is to have another higher level directory like kubevirt with its variants within. This reduces some clutter (so that we avoid deployment/sts/daemonset within core). The issue I see is with the name core or just stashing away 3 workload types from the clutter (we will still need kubevirt at the root with it's sub-directories in there). It would be preferable to be more explicit and have deployment at the root. We can add a workloads or similar directory at the root and move all workloads within it (avoid clutter at root of the repo).

The second is more key than the first, as it impacts product documentation.

We already discussed this structure last week - grouping the standard resources (deployment, statefulset, daemonset under core, and 3 vm samples under kubevirt. For kubvirt grouping the VMs makes sense since we want to have a kubvirt specific README.md. For core samples, I don't think we need any specific README.md.

Do you prefer this layout?

workloads/
  deployment/
  statefulset/
  daemonset/
  kubevirt/
  kafka/
  mongodb/

From OpenShift console, adding user will need to choose paths like:

  • workloads/deployemnt/odr-regional-rbd
  • workloads/kubevirt/vm-pvc/odr-regional-rbd

@nirs nirs mentioned this pull request Mar 11, 2024
Comment thread README.md Outdated
Comment thread dr/core/base/drpc.yaml
@ShyamsundarR

Copy link
Copy Markdown
Member

A few questions:

  • Why is there a core subdirectory within dr and subscription directories?

We need different drpc for busybox and kubevirt, mainly because we use different pvc selector, based on appname label. We use the same drpc if we use the same appname for all samples, maybe appname: sample

Ack, looks related to the pvcSelector comment that I made, if not possible yet we can look at this later.

For subscription I assumed we will have few differences between core and kubvrit, but I managed to share the same files in #45.

Ack!

If we remove core and use the layout bellow, we have something like:

subscripiton/deployment-...
subscription/kubevirt-vm-pvc-...

And same for dr/

  • My understanding of core under root, and deployment under the same is to have another higher level directory like kubevirt with its variants within. This reduces some clutter (so that we avoid deployment/sts/daemonset within core). The issue I see is with the name core or just stashing away 3 workload types from the clutter (we will still need kubevirt at the root with it's sub-directories in there). It would be preferable to be more explicit and have deployment at the root. We can add a workloads or similar directory at the root and move all workloads within it (avoid clutter at root of the repo).

The second is more key than the first, as it impacts product documentation.

We already discussed this structure last week - grouping the standard resources (deployment, statefulset, daemonset under core, and 3 vm samples under kubevirt. For kubvirt grouping the VMs makes sense since we want to have a kubvirt specific README.md. For core samples, I don't think we need any specific README.md.

Do you prefer this layout?

workloads/
  deployment/
  statefulset/
  daemonset/
  kubevirt/
  kafka/
  mongodb/

2 things I see here, looks cleaner so that at the higher level we do not have more directories, also core is misleading a bit. In an attempt to find a better name I could only come up with something like k8s-builtins from here

From OpenShift console, adding user will need to choose paths like:

* workloads/deployemnt/odr-regional-rbd

* workloads/kubevirt/vm-pvc/odr-regional-rbd

@nirs

nirs commented Mar 12, 2024

Copy link
Copy Markdown
Member Author

Conclusions after discussion:

  • Go with workloads{deployment,kubevirt} layout, removing core
  • Otherwise current layout is fine

nirs added 2 commits March 13, 2024 17:09
Improve README, preparing for additional samples.

- Minor text cleanups
- Improve formatting of code examples
- Consistent commands arguments order
- Simplify commands for inspecting installed resources

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
Change to directory layout to support additional applications that can
be deployed on multiple clusters types and storage.

The workloads directory keep all samples applications. Currently we have
only a deployment sample, but we want to add kubevirt virtual machines,
statefulset and daemonset samples..

A sample have a base directory and overlays for deploying it on
different clusters (odr, k8s) DR topology (retional, metro) and storage
(rbd, cephfs).

    workloads/
    └── deployment
        ├── base
        │   ├── deployment.yaml
        │   ├── kustomization.yaml
        │   └── pvc.yaml
        ├── k8s-regional-rbd
        │   └── kustomization.yaml
        ├── odr-metro-rbd
        │   └── kustomization.yaml
        ├── odr-regional-cephfs
        │   └── kustomization.yaml
        └── odr-regional-rbd
            └── kustomization.yaml

The subscription directory changed to similar structure to make it easy
to add overlays for new applications, and cover more cluster types and
storage options.

    subscription/
    ├── base
    │   ├── binding.yaml
    │   ├── kustomization.yaml
    │   ├── namespace.yaml
    │   ├── placement.yaml
    │   └── subscription.yaml
    └── deployment-k8s-regional-rbd
        └── kustomization.yaml

The dr directory changed to similar layout for same reason:

    dr/
    ├── base
    │   ├── drpc.yaml
    │   └── kustomization.yaml
    └── deployment-k8s-regional-rbd
        └── kustomization.yaml

The README.md was updated to reflect the new layout, showing how to
use the busybox deployment.

Fixes RamenDR#43

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
@nirs
nirs force-pushed the kubevirt-samples branch from 57717c3 to 37d7e30 Compare March 13, 2024 16:31
@nirs
nirs requested a review from ShyamsundarR March 13, 2024 16:31
@ShyamsundarR
ShyamsundarR merged commit 922e009 into RamenDR:main Mar 13, 2024
@nirs
nirs deleted the kubevirt-samples branch March 17, 2024 19:53
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

Successfully merging this pull request may close these issues.

Support for automated testing for k8s and odr

2 participants