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

Fixes issue when multiple VRGs conflict with the PVCs being protected #1535

Draft
wants to merge 117 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
ed18630
Fixes https://issues.redhat.com/browse/OCSBZM-4691
asn1809 Aug 30, 2024
e127357
Moving locks to util and some refactoring
asn1809 Sep 5, 2024
ef385a5
Correcting lint issues
asn1809 Sep 5, 2024
6e45f89
Use PVC name and namespace for changing PVC conditions (#1528)
ELENAGER Aug 29, 2024
025adc3
rephrase alerts message
rakeshgm Aug 22, 2024
37aae20
Reformat python version list
nirs Sep 4, 2024
b015270
Test more python versions
nirs Sep 4, 2024
48b3643
Upgrading capabilities in the CSVs
abhijeet219 Sep 2, 2024
f8ed0e5
Update open-cluster-management to use v0.13.0
abhijeet219 May 9, 2024
93481df
Delete namespace manifestwork for applications
abhijeet219 May 9, 2024
02ba28b
Update unit-tests to verify deletion of namespace manifestwork
abhijeet219 May 12, 2024
b511e77
tests: keep all suite cleanup functions in suite_test.go
raghavendra-talur Mar 15, 2024
b00e284
Bump CSI version to 0.9.1
ELENAGER Sep 4, 2024
e198936
Skip check for duplicate controller names
ELENAGER Sep 9, 2024
13e0c77
Fix PlacementDecision Exclusion from Hub Backup Due to Missing Label
Sep 9, 2024
be4cd85
Ignore not found namespace in argocd test
nirs Sep 10, 2024
a3cf1e9
'AllowVolumeExpansion' flag enables PV resizing
rakeshgm Sep 11, 2024
e907603
exclude PV and PVC in velero backups
rakeshgm Sep 3, 2024
1ba302c
Update setup-envtest to 0.19 version
ShyamsundarR Sep 12, 2024
49fa212
Add sample commit-msg hook
nirs Aug 15, 2024
5bddec4
go.mod: run go mod tidy
raghavendra-talur Sep 13, 2024
0a467d6
Update Ramen to use latest CRD from external-snapshotter
Sep 10, 2024
4fb500d
Ensure VGS name contains at most 63 characters
Sep 12, 2024
88c742a
Ensure the Secondary VRG is updated when DRPC is updated
Sep 12, 2024
e1fc2e2
Prepare for volsync block device test (#1559)
nirs Sep 17, 2024
1530d0c
Add debug logs in envfile
nirs Sep 12, 2024
dcf5dba
More clear argument names
nirs Aug 27, 2024
9933744
Move minikube helpers to minikube module
nirs Aug 27, 2024
871da2d
Remove `drenv setup` from make-venv
nirs Sep 9, 2024
4e64b18
Introduce drenv providers
nirs Aug 27, 2024
4e00bfc
Make unused minikube function private
nirs Aug 27, 2024
8b7f6d0
Move suspend and resume to minikube provider
nirs Aug 27, 2024
a06fcf0
Improve provider interface
nirs Aug 27, 2024
5e1bb80
Move containerd configuration to minikube.configure()
nirs Aug 27, 2024
b2e2615
Move waiting for fresh status to minikube
nirs Aug 28, 2024
fa145f6
Support watching stderr
nirs Aug 29, 2024
40e9b01
Log drenv log in tests
nirs Sep 4, 2024
005a0bc
Use /readyz endpoint for ready check
nirs Sep 5, 2024
40fe77c
Add external provider
nirs Aug 28, 2024
7aa8ae4
Implement DRClusterConfig reconciler to create required ClusterClaims…
ShyamsundarR Sep 18, 2024
18e3c21
Add yaml wraper
nirs Aug 29, 2024
41d0c76
Add kubeconfig module
nirs Aug 29, 2024
f70cee5
Update kubectl-gather to 0.5.1
nirs Sep 4, 2024
fed1215
Add setup for macOS
nirs Sep 4, 2024
6f52e8f
Add lima provider for Apple silicon
nirs Aug 29, 2024
ee98edb
Add development environment for lima
nirs Sep 2, 2024
756c2fb
Add a delay after starting a stopped cluster
nirs Sep 2, 2024
61a078f
Log limactl errors
nirs Sep 9, 2024
67e6cbc
Log invalid json logs in debug mode
nirs Sep 12, 2024
9002195
Disable port forwarding
nirs Aug 30, 2024
940d012
Change API server to use the shared network
nirs Aug 30, 2024
20d5e90
Configure kubelet to use the right IP address
nirs Aug 31, 2024
89c2ddd
Configure kubelet to pull images in parallel
nirs Aug 31, 2024
5d0e348
Configure kubelet feature gates
nirs Sep 1, 2024
201b273
Increase fs.inotify limits
nirs Sep 5, 2024
e63bcb3
Update minio to latest release
nirs Aug 31, 2024
2a39429
Use hostpath storage for minio
nirs Aug 31, 2024
6035794
Support commands reading from stdin
nirs Sep 8, 2024
44584e5
Support command work directory
nirs Sep 8, 2024
af53a2a
Introduce drenv load command
nirs Sep 8, 2024
8924dc7
Use drenv load to load images
nirs Aug 31, 2024
c4f5f54
Disable broker certificate check on macOS
nirs Sep 5, 2024
b12d40e
Annotate nodes with submariner public ip
nirs Sep 6, 2024
5246b03
Promote vmnet shared network route
nirs Sep 8, 2024
28a5e87
Upgrade submariner to 0.18.0
nirs Sep 8, 2024
d55abec
Wait for all clusters before deploying submariner
nirs Sep 6, 2024
bb9fa7a
Simplify connectivity check
nirs Sep 7, 2024
ee7617c
Fix submariner test container to keep running
nirs Sep 7, 2024
88da933
Enable submariner for lima
nirs Sep 8, 2024
51d331a
Add external-snapshotter addon
nirs Sep 9, 2024
5187293
Replace volumesnapshot with external-snapshotter
nirs Sep 9, 2024
9ac2f37
Fix argocd deployment on macOS
nirs Sep 10, 2024
145065b
Avoid random failures when deleting environment
nirs Sep 13, 2024
634d247
Ensure deleted DRPolicies do not add schedules to DRClusterConfig (#1…
ShyamsundarR Sep 19, 2024
35e5d26
Update csi-addons to v0.10.0 in drenv
nirs Sep 18, 2024
0a895a5
Update csi-addons requirement to v.0.10.0 in ramen
nirs Sep 18, 2024
cad86be
Adjust drenv to support consistency groups
ELENAGER Sep 18, 2024
44c1776
ci: use lower version of z as hard dependency
Madhu-1 Sep 24, 2024
948ff76
go.mod: update to newer version of recipe api
raghavendra-talur Sep 24, 2024
46d441c
test: add the updated recipe crd to the test dir
raghavendra-talur Sep 24, 2024
6fda9b2
controller: update implementation to match with recipe CRD
raghavendra-talur Sep 24, 2024
88168ee
go.mod: update to latest version of the ramen api
raghavendra-talur Sep 24, 2024
0ee14df
Add ClusterClaim to the ramen-dr-cluster reconciler scheme
ShyamsundarR Sep 25, 2024
24e0133
Kustomize rbd-mirror directory.
ELENAGER Sep 22, 2024
0134dea
Add flag for enabling or disabling consistency groups
ELENAGER Sep 26, 2024
627ccc8
Refactor: Extract resource watching logic from drpc controller into d…
Sep 26, 2024
1204662
Watch for DRPolicy resource changes
Sep 26, 2024
d17d112
Add external-snapshotter addon to kubevirt envs
nirs Sep 24, 2024
fcdddfd
Reformat reconcileMissingVR comment for readability
nirs Sep 23, 2024
fb1d4fb
Fix logs in reconcileMissingVR
nirs Sep 23, 2024
5fa81f5
Extract VRGInstance.validateVRCompletedStatus()
nirs Sep 23, 2024
99093c5
Clarify isVRConditionMet
nirs Sep 23, 2024
5661d38
Improve logging in delete VR flow
nirs Sep 23, 2024
a4d0b54
Fix disable dr if VR failed validation
nirs Sep 23, 2024
38654c6
Updating broken clusteradm link in the doc
abhijeet219 Oct 1, 2024
8a70425
Add daily e2e job for refreshing the cache
nirs Sep 19, 2024
86f5d17
drenv: add cluster name to storage id
ELENAGER Sep 29, 2024
1c04e61
Fix intermittent VolSync unit test failure
Oct 4, 2024
7e88713
Quote addresses to avoid yaml parsing surprises
nirs Sep 21, 2024
5482b46
Add drenv start --timeout option
nirs Sep 20, 2024
eede468
Make the vm environment smaller
nirs Sep 20, 2024
7043af7
Disable rosetta for vm environment
nirs Sep 21, 2024
5f9c5bb
Use lima also on darwin/x86_64
nirs Sep 19, 2024
77dc276
Scale down coredns to 1 replica
nirs Sep 22, 2024
7049474
Don't wait for coredns deployment
nirs Sep 22, 2024
cd6cffb
Clean up probing for completion
nirs Sep 22, 2024
3692dc5
Simplify port forwarding rules
nirs Sep 22, 2024
c10641d
Group kubeconfig setup in same provision step
nirs Sep 22, 2024
b911b9a
Remove unneeded sudo usage
nirs Sep 22, 2024
da3dc20
Remove unneeded route fix
nirs Sep 30, 2024
030adfa
Disallow relocation execution when a cluster is unreachable
Oct 4, 2024
79be579
Fixes https://issues.redhat.com/browse/OCSBZM-4691
asn1809 Aug 30, 2024
9611e95
Moving locks to util and some refactoring
asn1809 Sep 5, 2024
87c5a1d
Adding changes to the locking mechanism
asn1809 Sep 20, 2024
62faf94
TODO: Comments check
asn1809 Sep 25, 2024
af60e2a
Some more changes
asn1809 Oct 8, 2024
04f99b1
Condition changes
asn1809 Oct 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,12 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
python-version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13-dev"
steps:
- name: Checkout source
uses: actions/checkout@v4
Expand Down Expand Up @@ -178,8 +183,12 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]

python-version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13-dev"
steps:
- name: Checkout source
uses: actions/checkout@v4
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/e2e-daily.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# SPDX-FileCopyrightText: The RamenDR authors
# SPDX-License-Identifier: Apache-2.0

---
# yamllint disable rule:line-length
name: E2E Daily

on: # yamllint disable-line rule:truthy
# Run every day on 03:00.
schedule:
- cron: '0 3 * * *'
# Allow manual run.
# (Actions -> E2E Daily -> Run workflow)
workflow_dispatch:

jobs:
refresh-cache:
runs-on: [self-hosted, e2e-rdr]
if: github.repository == 'RamenDR/ramen'

steps:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Install drenv
run: pip install -e test

- name: Refresh cache
uses: nick-fields/retry@v3
with:
timeout_minutes: 2
retry_wait_seconds: 60
max_attempts: 10
command: |
cd test
drenv cache -v envs/regional-dr.yaml
4 changes: 2 additions & 2 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:

- name: Setup drenv
working-directory: test
run: drenv setup -v
run: drenv setup -v envs/regional-dr.yaml

- name: Install ramenctl
run: pip install -e ramenctl
Expand Down Expand Up @@ -100,4 +100,4 @@ jobs:
- name: Cleanup drenv
if: always()
working-directory: test
run: drenv cleanup -v
run: drenv cleanup -v envs/regional-dr.yaml
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ test-drcluster: generate manifests envtest ## Run DRCluster tests.
test-drpolicy: generate manifests envtest ## Run DRPolicy tests.
go test ./internal/controller -coverprofile cover.out -ginkgo.focus DRPolicyController

test-drclusterconfig: generate manifests envtest ## Run DRClusterConfig tests.
go test ./internal/controller -coverprofile cover.out -ginkgo.focus DRClusterConfig

test-util: generate manifests envtest ## Run util tests.
go test ./internal/controller/util -coverprofile cover.out

Expand Down
6 changes: 4 additions & 2 deletions api/go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
module github.com/ramendr/ramen/api

go 1.22.6
go 1.22.0

toolchain go1.22.7

require (
k8s.io/api v0.29.0
k8s.io/apimachinery v0.29.0
k8s.io/component-base v0.28.3
sigs.k8s.io/controller-runtime v0.16.3
)

Expand All @@ -19,7 +22,6 @@ require (
golang.org/x/text v0.13.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
k8s.io/component-base v0.28.3 // indirect
k8s.io/klog/v2 v2.110.1 // indirect
k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
Expand Down
13 changes: 8 additions & 5 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,8 @@ import (

volsyncv1alpha1 "github.com/backube/volsync/api/v1alpha1"
volrep "github.com/csi-addons/kubernetes-csi-addons/api/replication.storage/v1alpha1"
groupsnapv1alpha1 "github.com/kubernetes-csi/external-snapshotter/client/v7/apis/volumegroupsnapshot/v1alpha1"
snapv1 "github.com/kubernetes-csi/external-snapshotter/client/v7/apis/volumesnapshot/v1"
clrapiv1beta1 "github.com/open-cluster-management-io/api/cluster/v1beta1"
ocmv1 "github.com/open-cluster-management/api/cluster/v1"
ocmworkv1 "github.com/open-cluster-management/api/work/v1"
groupsnapv1alpha1 "github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumegroupsnapshot/v1alpha1"
snapv1 "github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumesnapshot/v1"
viewv1beta1 "github.com/stolostron/multicloud-operators-foundation/pkg/apis/view/v1beta1"
plrv1 "github.com/stolostron/multicloud-operators-placementrule/pkg/apis/apps/v1"
velero "github.com/vmware-tanzu/velero/pkg/apis/velero/v1"
Expand All @@ -29,6 +26,10 @@ import (
"k8s.io/apimachinery/pkg/runtime"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
ocmv1 "open-cluster-management.io/api/cluster/v1"
clusterv1alpha1 "open-cluster-management.io/api/cluster/v1alpha1"
clrapiv1beta1 "open-cluster-management.io/api/cluster/v1beta1"
ocmworkv1 "open-cluster-management.io/api/work/v1"
cpcv1 "open-cluster-management.io/config-policy-controller/api/v1"
gppv1 "open-cluster-management.io/governance-policy-propagator/api/v1"
ctrl "sigs.k8s.io/controller-runtime"
Expand Down Expand Up @@ -119,6 +120,7 @@ func configureController(ramenConfig *ramendrv1alpha1.RamenConfig) error {
utilruntime.Must(groupsnapv1alpha1.AddToScheme(scheme))
utilruntime.Must(recipe.AddToScheme(scheme))
utilruntime.Must(apiextensions.AddToScheme(scheme))
utilruntime.Must(clusterv1alpha1.AddToScheme(scheme))
}

return nil
Expand Down Expand Up @@ -174,6 +176,7 @@ func setupReconcilersCluster(mgr ctrl.Manager, ramenConfig *ramendrv1alpha1.Rame
if err := (&controllers.DRClusterConfigReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
Log: ctrl.Log.WithName("controllers").WithName("DRClusterConfig"),
}).SetupWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "DRClusterConfig")
os.Exit(1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: ClusterServiceVersion
metadata:
annotations:
alm-examples: '[]'
capabilities: Basic Install
capabilities: Seamless Upgrades
operators.openshift.io/infrastructure-features: '["disconnected"]'
name: ramen-dr-cluster-operator.v0.0.0
namespace: placeholder
Expand Down
11 changes: 11 additions & 0 deletions config/dr-cluster/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,17 @@ rules:
- patch
- update
- watch
- apiGroups:
- cluster.open-cluster-management.io
resources:
- clusterclaims
verbs:
- create
- delete
- get
- list
- update
- watch
- apiGroups:
- ramendr.openshift.io
resources:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: ClusterServiceVersion
metadata:
annotations:
alm-examples: '[]'
capabilities: Basic Install
capabilities: Seamless Upgrades
operators.openshift.io/infrastructure-features: '["disconnected"]'
name: ramen-hub-operator.v0.0.0
namespace: placeholder
Expand Down
3 changes: 1 addition & 2 deletions config/prometheus/alerts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,5 @@ spec:
labels:
severity: warning
annotations:
description: "Workload is not protected for disaster recovery (DRPC: {{ $labels.obj_name }}, Namespace: {{ $labels.obj_namespace }})."
description: "Workload is not protected for disaster recovery (DRPC: {{ $labels.obj_name }}, Namespace: {{ $labels.obj_namespace }}). Inspect DRPC status.conditions for details."
alert_type: "DisasterRecovery"

11 changes: 11 additions & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,17 @@ rules:
- get
- list
- watch
- apiGroups:
- cluster.open-cluster-management.io
resources:
- clusterclaims
verbs:
- create
- delete
- get
- list
- update
- watch
- apiGroups:
- cluster.open-cluster-management.io
resources:
Expand Down
14 changes: 2 additions & 12 deletions docs/devel-quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,14 @@ SPDX-License-Identifier: Apache-2.0
git remote add upstream https://github.com/RamenDR/ramen.git
```

1. Set up a commit-msg hook to sign off your commits
1. Add the commit-msg hook to sign off your commits

*Ramen* requires a `Signed-off-by: My Name <myemail@example.com>`
footer in the commit message. To add it automatically to all commits,
add this hook:

```sh
$ cat .git/hooks/commit-msg
#!/bin/sh
# Add Signed-off-by trailer.
sob=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
git interpret-trailers --in-place --trailer "$sob" "$1"
```

And make the hook executable:

```sh
chmod +x .git/hooks/commit-msg
cp hack/commit-msg .git/hooks/
```

## Setting up the environment for development and testing
Expand Down
3 changes: 2 additions & 1 deletion docs/krp.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ The VRG enables Kubernetes resources to be captured(backed up) and recovered as
part of disaster protection. This is accomplished through the
kubeObjectProtection section of the VRG spec. If kubeObjectProtection is not
included in a VRG, then Kubernetes resources are not protected as part of the
VRG disaster protection.
VRG disaster protection. PVCs and PVs are protected by Ramen and all resources
are protected and backed by kubeObjectProtection.

The kubeObjectProtection section contains two sub-sections, captureOrder and
recoverOrder. This captureOrder section provides instructions on how to backup
Expand Down
4 changes: 2 additions & 2 deletions docs/user-quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,14 @@ enough resources:
```

1. Install `clusteradm` tool. See
[Install clusteradm CLI tool](https://open-cluster-management.io/getting-started/installation/start-the-control-plane/#install-clusteradm-cli-tool)
[Install clusteradm CLI tool](https://open-cluster-management.io/docs/getting-started/installation/start-the-control-plane/#install-clusteradm-cli-tool)
for the details.
Version v0.8.1 or later is reuired.

1. Install `subctl` tool, See
[Submariner subctl installation](https://submariner.io/operations/deployment/subctl/)
for the details.
Version v0.17.0 or later is required.
Version v0.18.0 or later is required.

1. Install the `velero` tool

Expand Down
4 changes: 3 additions & 1 deletion e2e/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module github.com/ramendr/ramen/e2e

go 1.22.6
go 1.22.0

toolchain go1.22.7

require (
github.com/go-logr/logr v1.4.1
Expand Down
Loading