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

Integrate submariner in test environment #917

Closed
wants to merge 9 commits into from
Closed

Conversation

nirs
Copy link
Member

@nirs nirs commented Jun 7, 2023

Add submariner addon and integrate it with regional environment.

  • Deploy submariner on minikube using vxlan (IPSEC does not work)
  • Deployment toplogy - we install the broker on the hub
  • Add submariner development env
  • Add submariner addon
  • Add self test
  • Test submariner with minio env
  • Test submariner with ocm env
  • Test submariner with rook env (rook may use it for rbd mirroring)
  • Add submariner to regional-dr
  • Test volsync with submariner (using Integrate volsync in test environment #927)

Fixes #916

@nirs nirs linked an issue Jun 7, 2023 that may be closed by this pull request
3 tasks
@nirs nirs force-pushed the submariner branch 4 times, most recently from 657a719 to 3898b81 Compare June 12, 2023 18:16
@nirs nirs requested review from BenamarMk and netzzer June 12, 2023 21:02
@nirs nirs force-pushed the submariner branch 2 times, most recently from 636ebf2 to e1e32d3 Compare June 13, 2023 22:19
@nirs
Copy link
Member Author

nirs commented Jun 13, 2023

Testing with minio by adding minio addons to submariner clusters:

$ drenv start envs/submariner.yaml 
2023-06-14 01:32:42,325 INFO    [submariner] Starting environment
2023-06-14 01:32:42,359 INFO    [hub] Starting minikube cluster
2023-06-14 01:32:43,484 INFO    [dr1] Starting minikube cluster
2023-06-14 01:32:44,385 INFO    [dr2] Starting minikube cluster
2023-06-14 01:33:24,950 INFO    [hub] Cluster started in 42.59 seconds
2023-06-14 01:33:24,951 INFO    [hub/0] Running addons/submariner/start
2023-06-14 01:33:45,577 INFO    [dr1] Cluster started in 62.09 seconds
2023-06-14 01:33:45,578 INFO    [dr1/0] Running addons/submariner/start
2023-06-14 01:33:50,474 INFO    [hub/0] addons/submariner/start completed in 25.52 seconds
2023-06-14 01:33:50,474 INFO    [hub/0] Running addons/submariner/test
2023-06-14 01:33:50,663 INFO    [hub/0] addons/submariner/test completed in 0.19 seconds
2023-06-14 01:34:08,447 INFO    [dr2] Cluster started in 84.06 seconds
2023-06-14 01:34:08,447 INFO    [dr2/0] Running addons/submariner/start
2023-06-14 01:34:45,371 INFO    [dr1/0] addons/submariner/start completed in 59.79 seconds
2023-06-14 01:34:45,372 INFO    [dr1/0] Running addons/submariner/test
2023-06-14 01:34:48,634 INFO    [dr1/0] addons/submariner/test completed in 3.26 seconds
2023-06-14 01:34:48,634 INFO    [dr1/0] Running addons/minio/start
2023-06-14 01:34:59,201 INFO    [dr2/0] addons/submariner/start completed in 50.75 seconds
2023-06-14 01:34:59,201 INFO    [dr2/0] Running addons/submariner/test
2023-06-14 01:34:59,368 INFO    [dr2/0] addons/submariner/test completed in 0.17 seconds
2023-06-14 01:34:59,368 INFO    [dr2/0] Running addons/minio/start
2023-06-14 01:35:09,413 INFO    [dr1/0] addons/minio/start completed in 20.78 seconds
2023-06-14 01:35:15,225 INFO    [dr2/0] addons/minio/start completed in 15.86 seconds
2023-06-14 01:35:15,225 INFO    [submariner] Environment started in 152.90 seconds

Tested minor with mc as described here:
#743

@nirs
Copy link
Member Author

nirs commented Jun 13, 2023

Tested submariner with ocm by adding it before ocm-hub and cluster:

--- a/test/envs/ocm.yaml
+++ b/test/envs/ocm.yaml
@@ -12,6 +12,8 @@ templates:
     network: default
     workers:
       - addons:
+          - name: submariner
+            args: [$name, hub]
           - name: ocm-hub
           - name: ocm-controller
   - name: "dr-cluster"
@@ -20,6 +22,8 @@ templates:
     network: default
     workers:
       - addons:
+          - name: submariner
+            args: [$name, hub]
           - name: ocm-cluster
             args: ["$name", "hub"]
 profiles:
$ drenv start envs/ocm.yaml 
2023-06-14 01:52:40,245 INFO    [ocm] Starting environment
2023-06-14 01:52:40,278 INFO    [hub] Starting minikube cluster
2023-06-14 01:52:41,406 INFO    [dr1] Starting minikube cluster
2023-06-14 01:52:42,304 INFO    [dr2] Starting minikube cluster
2023-06-14 01:53:21,392 INFO    [hub] Cluster started in 41.11 seconds
2023-06-14 01:53:21,392 INFO    [hub/0] Running addons/submariner/start
2023-06-14 01:53:40,804 INFO    [dr1] Cluster started in 59.40 seconds
2023-06-14 01:53:40,805 INFO    [dr1/0] Running addons/submariner/start
2023-06-14 01:53:46,976 INFO    [hub/0] addons/submariner/start completed in 25.58 seconds
2023-06-14 01:53:46,976 INFO    [hub/0] Running addons/submariner/test
2023-06-14 01:53:47,130 INFO    [hub/0] addons/submariner/test completed in 0.15 seconds
2023-06-14 01:53:47,130 INFO    [hub/0] Running addons/ocm-hub/start
2023-06-14 01:54:00,406 INFO    [dr2] Cluster started in 78.10 seconds
2023-06-14 01:54:00,407 INFO    [dr2/0] Running addons/submariner/start
2023-06-14 01:54:34,871 INFO    [dr1/0] addons/submariner/start completed in 54.07 seconds
2023-06-14 01:54:34,871 INFO    [dr1/0] Running addons/submariner/test
2023-06-14 01:54:47,380 INFO    [dr2/0] addons/submariner/start completed in 46.97 seconds
2023-06-14 01:54:47,380 INFO    [dr2/0] Running addons/submariner/test
2023-06-14 01:54:47,548 INFO    [dr2/0] addons/submariner/test completed in 0.17 seconds
2023-06-14 01:54:47,549 INFO    [dr2/0] Running addons/ocm-cluster/start
2023-06-14 01:54:50,306 INFO    [dr1/0] addons/submariner/test completed in 15.44 seconds
2023-06-14 01:54:50,306 INFO    [dr1/0] Running addons/ocm-cluster/start
2023-06-14 01:55:00,196 INFO    [hub/0] addons/ocm-hub/start completed in 73.07 seconds
2023-06-14 01:55:00,196 INFO    [hub/0] Running addons/ocm-controller/start
2023-06-14 01:55:17,472 INFO    [hub/0] addons/ocm-controller/start completed in 17.28 seconds
2023-06-14 01:56:30,459 INFO    [dr2/0] addons/ocm-cluster/start completed in 102.91 seconds
2023-06-14 01:56:30,459 INFO    [dr2/0] Running addons/ocm-cluster/test
2023-06-14 01:56:32,196 INFO    [dr1/0] addons/ocm-cluster/start completed in 101.89 seconds
2023-06-14 01:56:32,196 INFO    [dr1/0] Running addons/ocm-cluster/test
2023-06-14 01:56:37,397 INFO    [dr1/0] addons/ocm-cluster/test completed in 5.20 seconds
2023-06-14 01:56:37,874 INFO    [dr2/0] addons/ocm-cluster/test completed in 7.41 seconds
2023-06-14 01:56:37,875 INFO    [ocm] Environment started in 237.63 seconds

@nirs
Copy link
Member Author

nirs commented Jun 13, 2023

Testing submariner with rook using this patch:

--- a/test/envs/rook.yaml
+++ b/test/envs/rook.yaml
@@ -6,6 +6,15 @@
 name: "rook"
 
 templates:
+  - name: hub
+    driver: kvm2
+    container_runtime: containerd
+    network: default
+    memory: "3g"
+    workers:
+      - addons:
+          - name: submariner
+            args: [$name, hub]
   - name: "dr-cluster"
     driver: kvm2
     container_runtime: containerd
@@ -15,6 +24,8 @@ templates:
     disk_size: "50g"
     workers:
       - addons:
+          - name: submariner
+            args: [$name, hub]
           - name: rook-operator
           - name: rook-cluster
           - name: rook-pool
@@ -23,6 +34,8 @@ templates:
           - name: csi-addons
 
 profiles:
+  - name: hub
+    template: hub
   - name: "dr1"
     template: "dr-cluster"
   - name: "dr2"
$ drenv start envs/rook.yaml 
2023-06-14 02:04:01,509 INFO    [rook] Starting environment
2023-06-14 02:04:01,544 INFO    [hub] Starting minikube cluster
2023-06-14 02:04:02,655 INFO    [dr1] Starting minikube cluster
2023-06-14 02:04:03,578 INFO    [dr2] Starting minikube cluster
2023-06-14 02:04:42,685 INFO    [hub] Cluster started in 41.14 seconds
2023-06-14 02:04:42,686 INFO    [hub/0] Running addons/submariner/start
2023-06-14 02:05:02,978 INFO    [dr1] Cluster started in 60.32 seconds
2023-06-14 02:05:02,978 INFO    [dr1/0] Running addons/submariner/start
2023-06-14 02:05:02,979 INFO    [dr1/1] Running addons/csi-addons/start
2023-06-14 02:05:07,988 INFO    [hub/0] addons/submariner/start completed in 25.30 seconds
2023-06-14 02:05:07,989 INFO    [hub/0] Running addons/submariner/test
2023-06-14 02:05:08,174 INFO    [hub/0] addons/submariner/test completed in 0.19 seconds
2023-06-14 02:05:23,058 INFO    [dr2] Cluster started in 79.48 seconds
2023-06-14 02:05:23,058 INFO    [dr2/0] Running addons/submariner/start
2023-06-14 02:05:23,059 INFO    [dr2/1] Running addons/csi-addons/start
2023-06-14 02:05:36,048 INFO    [dr1/1] addons/csi-addons/start completed in 33.07 seconds
2023-06-14 02:05:55,780 INFO    [dr2/1] addons/csi-addons/start completed in 32.72 seconds
2023-06-14 02:05:57,004 INFO    [dr1/0] addons/submariner/start completed in 54.03 seconds
2023-06-14 02:05:57,004 INFO    [dr1/0] Running addons/submariner/test
2023-06-14 02:06:00,274 INFO    [dr1/0] addons/submariner/test completed in 3.27 seconds
2023-06-14 02:06:00,274 INFO    [dr1/0] Running addons/rook-operator/start
2023-06-14 02:06:11,071 INFO    [dr2/0] addons/submariner/start completed in 48.01 seconds
2023-06-14 02:06:11,071 INFO    [dr2/0] Running addons/submariner/test
2023-06-14 02:06:11,228 INFO    [dr2/0] addons/submariner/test completed in 0.16 seconds
2023-06-14 02:06:11,228 INFO    [dr2/0] Running addons/rook-operator/start
2023-06-14 02:06:37,351 INFO    [dr1/0] addons/rook-operator/start completed in 37.08 seconds
2023-06-14 02:06:37,351 INFO    [dr1/0] Running addons/rook-cluster/start
2023-06-14 02:06:49,332 INFO    [dr2/0] addons/rook-operator/start completed in 38.10 seconds
2023-06-14 02:06:49,332 INFO    [dr2/0] Running addons/rook-cluster/start
2023-06-14 02:08:12,936 INFO    [dr1/0] addons/rook-cluster/start completed in 95.59 seconds
2023-06-14 02:08:12,936 INFO    [dr1/0] Running addons/rook-pool/start
2023-06-14 02:08:44,136 INFO    [dr1/0] addons/rook-pool/start completed in 31.20 seconds
2023-06-14 02:08:44,136 INFO    [dr1/0] Running addons/rook-toolbox/start
2023-06-14 02:08:53,668 INFO    [dr1/0] addons/rook-toolbox/start completed in 9.53 seconds
2023-06-14 02:08:58,472 INFO    [dr2/0] addons/rook-cluster/start completed in 129.14 seconds
2023-06-14 02:08:58,472 INFO    [dr2/0] Running addons/rook-pool/start
2023-06-14 02:09:17,041 INFO    [dr2/0] addons/rook-pool/start completed in 18.57 seconds
2023-06-14 02:09:17,041 INFO    [dr2/0] Running addons/rook-toolbox/start
2023-06-14 02:09:19,595 INFO    [dr2/0] addons/rook-toolbox/start completed in 2.55 seconds
2023-06-14 02:09:19,596 INFO    [rook/0] Running addons/rbd-mirror/start
2023-06-14 02:10:17,943 INFO    [rook/0] addons/rbd-mirror/start completed in 58.35 seconds
2023-06-14 02:10:17,943 INFO    [rook/0] Running addons/rbd-mirror/test
2023-06-14 02:10:30,693 INFO    [rook/0] addons/rbd-mirror/test completed in 12.75 seconds
2023-06-14 02:10:30,693 INFO    [rook] Environment started in 389.18 seconds

rbd mirror secrets looks the same:

kubectl get secret/pool-peer-token-replicapool -n rook-ceph -o jsonpath='{.data.token}' | base64 -d | base64 -d | jq
{
  "fsid": "de7f5b2a-5069-4fe5-9db4-7064968ad4e2",
  "client_id": "rbd-mirror-peer",
  "key": "AQDq9ohkK2h/KRAAHWCDzyxn7cE3YLxLJ9B7lw==",
  "mon_host": "[v2:192.168.122.103:3300/0,v1:192.168.122.103:6789/0]",
  "namespace": "rook-ceph"
}

@nirs
Copy link
Member Author

nirs commented Jun 14, 2023

Testing with regional-dr:

Starting environment:

$ drenv start envs/regional-dr.yaml
2023-06-14 21:03:50,761 INFO    [rdr] Starting environment
2023-06-14 21:03:50,788 INFO    [dr1] Starting minikube cluster
2023-06-14 21:03:51,821 INFO    [dr2] Starting minikube cluster
2023-06-14 21:03:52,813 INFO    [hub] Starting minikube cluster
2023-06-14 21:04:28,636 INFO    [dr1] Cluster started in 37.85 seconds
2023-06-14 21:04:28,636 INFO    [dr1/0] Running addons/cert-manager/start
2023-06-14 21:04:28,636 INFO    [dr1/1] Running addons/submariner/start
2023-06-14 21:04:28,638 INFO    [dr1/2] Running addons/csi-addons/start
2023-06-14 21:04:46,557 INFO    [dr2] Cluster started in 54.74 seconds
2023-06-14 21:04:46,558 INFO    [dr2/0] Running addons/cert-manager/start
2023-06-14 21:04:46,558 INFO    [dr2/1] Running addons/submariner/start
2023-06-14 21:04:46,559 INFO    [dr2/2] Running addons/csi-addons/start
2023-06-14 21:04:57,919 INFO    [dr1/0] addons/cert-manager/start completed in 29.28 seconds
2023-06-14 21:04:57,919 INFO    [dr1/0] Running addons/rook-operator/start
2023-06-14 21:05:06,390 INFO    [hub] Cluster started in 73.58 seconds
2023-06-14 21:05:06,390 INFO    [hub/0] Running addons/submariner/start
2023-06-14 21:05:11,463 INFO    [dr1/2] addons/csi-addons/start completed in 42.83 seconds
2023-06-14 21:05:11,463 INFO    [dr1/2] Running addons/olm/start
2023-06-14 21:05:16,475 INFO    [dr2/0] addons/cert-manager/start completed in 29.92 seconds
2023-06-14 21:05:16,475 INFO    [dr2/0] Running addons/rook-operator/start
2023-06-14 21:05:29,761 INFO    [dr2/2] addons/csi-addons/start completed in 43.20 seconds
2023-06-14 21:05:29,761 INFO    [dr2/2] Running addons/olm/start
2023-06-14 21:05:30,820 INFO    [dr1/0] addons/rook-operator/start completed in 32.90 seconds
2023-06-14 21:05:30,821 INFO    [dr1/0] Running addons/rook-cluster/start
2023-06-14 21:05:31,665 INFO    [hub/0] addons/submariner/start completed in 25.28 seconds
2023-06-14 21:05:31,665 INFO    [hub/0] Running addons/submariner/test
2023-06-14 21:05:31,892 INFO    [hub/0] addons/submariner/test completed in 0.23 seconds
2023-06-14 21:05:31,892 INFO    [hub/0] Running addons/ocm-hub/start
2023-06-14 21:05:53,655 INFO    [dr2/0] addons/rook-operator/start completed in 37.18 seconds
2023-06-14 21:05:53,656 INFO    [dr2/0] Running addons/rook-cluster/start
2023-06-14 21:06:28,932 INFO    [hub/0] addons/ocm-hub/start completed in 57.04 seconds
2023-06-14 21:06:28,932 INFO    [hub/0] Running addons/ocm-controller/start
2023-06-14 21:06:42,777 INFO    [dr1/2] addons/olm/start completed in 91.31 seconds
2023-06-14 21:06:42,777 INFO    [dr1/2] Running addons/minio/start
2023-06-14 21:06:43,640 INFO    [hub/0] addons/ocm-controller/start completed in 14.71 seconds
2023-06-14 21:06:43,640 INFO    [hub/0] Running addons/cert-manager/start
2023-06-14 21:07:06,017 INFO    [dr2/2] addons/olm/start completed in 96.26 seconds
2023-06-14 21:07:06,017 INFO    [dr2/2] Running addons/minio/start
2023-06-14 21:07:08,675 INFO    [hub/0] addons/cert-manager/start completed in 25.04 seconds
2023-06-14 21:07:08,676 INFO    [hub/0] Running addons/olm/start
2023-06-14 21:07:39,197 INFO    [dr1/0] addons/rook-cluster/start completed in 128.38 seconds
2023-06-14 21:07:39,197 INFO    [dr1/0] Running addons/rook-pool/start
2023-06-14 21:07:40,361 INFO    [hub/0] addons/olm/start completed in 31.69 seconds
2023-06-14 21:08:10,037 INFO    [dr1/0] addons/rook-pool/start completed in 30.84 seconds
2023-06-14 21:08:10,038 INFO    [dr1/0] Running addons/rook-toolbox/start
2023-06-14 21:08:15,891 INFO    [dr2/0] addons/rook-cluster/start completed in 142.24 seconds
2023-06-14 21:08:15,892 INFO    [dr2/0] Running addons/rook-pool/start
2023-06-14 21:08:16,619 INFO    [dr1/2] addons/minio/start completed in 93.84 seconds
2023-06-14 21:08:16,619 INFO    [dr1/2] Running addons/velero/start
2023-06-14 21:08:17,702 INFO    [dr1/2] addons/velero/start completed in 1.08 seconds
2023-06-14 21:08:17,702 INFO    [dr1/2] Running addons/volsync/start
2023-06-14 21:08:20,432 INFO    [dr1/2] addons/volsync/start completed in 2.73 seconds
2023-06-14 21:08:23,498 INFO    [dr2/2] addons/minio/start completed in 77.48 seconds
2023-06-14 21:08:23,498 INFO    [dr2/2] Running addons/velero/start
2023-06-14 21:08:24,479 INFO    [dr2/2] addons/velero/start completed in 0.98 seconds
2023-06-14 21:08:24,479 INFO    [dr2/2] Running addons/volsync/start
2023-06-14 21:08:25,670 INFO    [dr2/2] addons/volsync/start completed in 1.19 seconds
2023-06-14 21:08:44,596 INFO    [dr2/1] addons/submariner/start completed in 238.04 seconds
2023-06-14 21:08:44,596 INFO    [dr2/1] Running addons/submariner/test
2023-06-14 21:08:44,753 INFO    [dr2/1] addons/submariner/test completed in 0.16 seconds
2023-06-14 21:08:44,753 INFO    [dr2/1] Running addons/ocm-cluster/start
2023-06-14 21:08:49,771 INFO    [dr1/1] addons/submariner/start completed in 261.13 seconds
2023-06-14 21:08:49,772 INFO    [dr1/1] Running addons/submariner/test
2023-06-14 21:08:50,002 INFO    [dr1/1] addons/submariner/test completed in 0.23 seconds
2023-06-14 21:08:50,002 INFO    [dr1/1] Running addons/ocm-cluster/start
2023-06-14 21:08:50,755 INFO    [dr1/0] addons/rook-toolbox/start completed in 40.72 seconds
2023-06-14 21:08:57,324 INFO    [dr2/0] addons/rook-pool/start completed in 41.43 seconds
2023-06-14 21:08:57,325 INFO    [dr2/0] Running addons/rook-toolbox/start
2023-06-14 21:09:02,671 INFO    [dr2/0] addons/rook-toolbox/start completed in 5.35 seconds
2023-06-14 21:10:35,546 INFO    [dr1/1] addons/ocm-cluster/start completed in 105.54 seconds
2023-06-14 21:10:35,546 INFO    [dr1/1] Running addons/ocm-cluster/test
2023-06-14 21:10:36,536 INFO    [dr2/1] addons/ocm-cluster/start completed in 111.78 seconds
2023-06-14 21:10:36,536 INFO    [dr2/1] Running addons/ocm-cluster/test
2023-06-14 21:10:42,304 INFO    [dr2/1] addons/ocm-cluster/test completed in 5.77 seconds
2023-06-14 21:10:42,391 INFO    [dr1/1] addons/ocm-cluster/test completed in 6.85 seconds
2023-06-14 21:10:42,392 INFO    [rdr/0] Running addons/rbd-mirror/start
2023-06-14 21:11:12,843 INFO    [rdr/0] addons/rbd-mirror/start completed in 30.45 seconds
2023-06-14 21:11:12,843 INFO    [rdr/0] Running addons/rbd-mirror/test
2023-06-14 21:11:28,238 INFO    [rdr/0] addons/rbd-mirror/test completed in 15.40 seconds
2023-06-14 21:11:28,238 INFO    [rdr] Environment started in 457.48 seconds

Deploying ramen and running basic test:

$ ramenctl deploy test/envs/regional-dr.yaml
2023-06-14 21:16:50,700 INFO    [ramenctl] Starting deploy
2023-06-14 21:16:50,704 INFO    [ramenctl] Saving image 'quay.io/ramendr/ramen-operator:latest'
2023-06-14 21:16:53,279 INFO    [ramenctl] Loading image in cluster 'hub'
2023-06-14 21:16:53,279 INFO    [ramenctl] Loading image in cluster 'dr1'
2023-06-14 21:16:53,280 INFO    [ramenctl] Loading image in cluster 'dr2'
2023-06-14 21:17:03,850 INFO    [ramenctl] Deploying ramen operator in cluster 'hub'
2023-06-14 21:17:07,729 INFO    [ramenctl] Deploying ramen operator in cluster 'dr1'
2023-06-14 21:17:10,470 INFO    [ramenctl] Deploying ramen operator in cluster 'dr2'
2023-06-14 21:17:13,429 INFO    [ramenctl] Finished deploy in 22.73 seconds

$ ramenctl config test/envs/regional-dr.yaml
2023-06-14 21:17:42,744 INFO    [ramenctl] Starting config
2023-06-14 21:17:42,748 INFO    [ramenctl] Waiting until ramen-hub-operator is rolled out
2023-06-14 21:17:42,801 INFO    [ramenctl] Creating s3 secret in ramen hub namespace
2023-06-14 21:17:43,901 INFO    [ramenctl] Updating ramen config map
2023-06-14 21:17:44,407 INFO    [ramenctl] Creating DRClusters and DRPolicy for regional-dr
2023-06-14 21:17:44,781 INFO    [ramenctl] Waiting until DRClusters report phase
2023-06-14 21:17:45,973 INFO    [ramenctl] Waiting until DRClusters phase is available
2023-06-14 21:17:46,253 INFO    [ramenctl] Waiting until DRPolicy is validated
2023-06-14 21:17:46,426 INFO    [ramenctl] Creating channel
2023-06-14 21:17:46,800 INFO    [ramenctl] Finished config in 4.06 seconds

$ test/basic-test/run
2023-06-14 21:17:55,957 INFO    [deploy] Creating temporary directory /tmp/ramen-test/basic-test
2023-06-14 21:17:55,958 INFO    [deploy] Cloning ocm-ramen-samples
2023-06-14 21:17:55,958 INFO    [deploy] Creating kustomization for using cluster 'dr1'
2023-06-14 21:17:55,958 INFO    [deploy] Deploying busybox example application
2023-06-14 21:17:56,382 INFO    [deploy] waiting for namespace busybox-sample
2023-06-14 21:17:56,453 INFO    [deploy] Waiting until busybox drpc reports phase
2023-06-14 21:17:57,572 INFO    [deploy] Waiting until busybox drpc is deployed
2023-06-14 21:17:57,734 INFO    [deploy] Waiting until application is replicated
2023-06-14 21:19:26,325 INFO    [deploy] Application was deployed successfully
2023-06-14 21:19:26,432 INFO    [failover] Waiting until application is replicated
2023-06-14 21:19:26,482 INFO    [failover] Starting failover
2023-06-14 21:19:26,549 INFO    [failover] Waiting until application is failed over...
2023-06-14 21:19:56,092 INFO    [failover] Waiting until application is replicated
2023-06-14 21:22:56,648 INFO    [failover] Application was failed over to cluster dr2 successfully
2023-06-14 21:22:56,753 INFO    [relocate] Waiting until peer is ready
2023-06-14 21:22:56,911 INFO    [relocate] Waiting until application is replicated
2023-06-14 21:22:56,957 INFO    [relocate] Starting relocate
2023-06-14 21:22:57,021 INFO    [relocate] Waiting until application is relocated...
2023-06-14 21:25:26,079 INFO    [relocate] Waiting until relocation completes...
2023-06-14 21:25:56,233 INFO    [relocate] Application was relocated to cluster dr1 successfully
2023-06-14 21:25:56,343 INFO    [undeploy] Deleting busybox example application
2023-06-14 21:26:31,493 INFO    [undeploy] Application was undeployed successfully

$ ramenctl unconfig test/envs/regional-dr.yaml
2023-06-14 21:26:40,616 INFO    [ramenctl] Starting unconfig
2023-06-14 21:26:40,620 INFO    [ramenctl] Deleting samples channel
2023-06-14 21:26:45,837 INFO    [ramenctl] Deleting DRClusters and DRPolicy
2023-06-14 21:26:46,350 INFO    [ramenctl] Deleting s3 secret in ramen hub namespace
2023-06-14 21:26:46,416 INFO    [ramenctl] Finished unconfig in 5.80 seconds

$ ramenctl undeploy test/envs/regional-dr.yaml
2023-06-14 21:26:50,593 INFO    [ramenctl] Starting undeploy
2023-06-14 21:26:50,597 INFO    [ramenctl] Undeploying ramen operator in cluster 'dr1'
2023-06-14 21:26:58,365 INFO    [ramenctl] Undeploying ramen operator in cluster 'dr2'
2023-06-14 21:27:00,313 INFO    [ramenctl] Undeploying ramen operator in cluster 'hub'
2023-06-14 21:27:08,209 INFO    [ramenctl] Finished undeploy in 17.62 seconds

Following DRRP during the test:

$ kubectl get drpc -A --context hub -o wide -w
NAMESPACE        NAME           AGE   PREFERREDCLUSTER   FAILOVERCLUSTER   DESIREDSTATE   CURRENTSTATE   PROGRESSION   START TIME   DURATION   PEER READY
busybox-sample   busybox-drpc   0s    dr1                                                                                                      
busybox-sample   busybox-drpc   0s    dr1                                                                                                      
busybox-sample   busybox-drpc   0s    dr1                                                 Deployed       UpdatingPlRule   2023-06-14T18:17:56Z              True
busybox-sample   busybox-drpc   0s    dr1                                                 Deploying      CreatingMW       2023-06-14T18:17:56Z              True
busybox-sample   busybox-drpc   0s    dr1                                                 Deployed       UpdatingPlRule   2023-06-14T18:17:56Z              True
busybox-sample   busybox-drpc   1s    dr1                                                 Deployed       UpdatingPlRule   2023-06-14T18:17:57Z              True
busybox-sample   busybox-drpc   6s    dr1                                                 Deployed       UpdatingPlRule   2023-06-14T18:18:02Z              True
busybox-sample   busybox-drpc   16s   dr1                                                 Deployed       UpdatingPlRule   2023-06-14T18:18:12Z              True
busybox-sample   busybox-drpc   30s   dr1                                                 Deployed       Completed        2023-06-14T18:18:12Z   14.060693019s   True
busybox-sample   busybox-drpc   90s   dr1                                                 Deployed       Completed        2023-06-14T18:18:12Z   14.060693019s   True
busybox-sample   busybox-drpc   90s   dr1                dr2               Failover       Deployed       Completed        2023-06-14T18:18:12Z   14.060693019s   True
busybox-sample   busybox-drpc   90s   dr1                dr2               Failover       FailingOver    WaitingForResourceRestore   2023-06-14T18:19:26Z                   False
busybox-sample   busybox-drpc   90s   dr1                dr2               Failover       FailingOver    FailingOverToCluster        2023-06-14T18:19:26Z                   False
busybox-sample   busybox-drpc   2m    dr1                dr2               Failover       FailedOver     UpdatedPlacement            2023-06-14T18:19:26Z                   False
busybox-sample   busybox-drpc   2m    dr1                dr2               Failover       FailedOver     Cleaning Up                 2023-06-14T18:19:26Z                   False
busybox-sample   busybox-drpc   5m    dr1                dr2               Failover       FailedOver     Cleaning Up                 2023-06-14T18:19:26Z                   False
busybox-sample   busybox-drpc   5m    dr1                dr2               Failover       FailedOver     Completed                   2023-06-14T18:19:26Z   3m30.138120249s   True
busybox-sample   busybox-drpc   5m1s   dr1                dr2               Relocate       FailedOver     Completed                   2023-06-14T18:19:26Z   3m30.138120249s   True
busybox-sample   busybox-drpc   5m1s   dr1                dr2               Relocate       Initiating     PreparingFinalSync          2023-06-14T18:22:57Z                     True
busybox-sample   busybox-drpc   5m30s   dr1                dr2               Relocate       Relocating     RunningFinalSync            2023-06-14T18:22:57Z                     True
busybox-sample   busybox-drpc   6m      dr1                dr2               Relocate       Relocating     EnsuringVolumesAreSecondary   2023-06-14T18:22:57Z                     True
busybox-sample   busybox-drpc   7m      dr1                dr2               Relocate       Relocating     WaitingForResourceRestore     2023-06-14T18:22:57Z                     True
busybox-sample   busybox-drpc   7m      dr1                dr2               Relocate       Relocating     WaitingForResourceRestore     2023-06-14T18:22:57Z                     True
busybox-sample   busybox-drpc   7m30s   dr1                dr2               Relocate       Relocated      UpdatedPlacement              2023-06-14T18:22:57Z                     False
busybox-sample   busybox-drpc   7m30s   dr1                dr2               Relocate       Relocated      Cleaning Up                   2023-06-14T18:22:57Z                     False
busybox-sample   busybox-drpc   8m      dr1                dr2               Relocate       Relocated      Completed                     2023-06-14T18:22:57Z   2m59.212297535s   True
busybox-sample   busybox-drpc   8m      dr1                dr2               Relocate       Relocated      Completed                     2023-06-14T18:22:57Z   2m59.212297535s   True
busybox-sample   busybox-drpc   8m30s   dr1                dr2               Relocate       Relocated      Completed                     2023-06-14T18:22:57Z   2m59.212297535s   True

@nirs nirs marked this pull request as ready for review June 14, 2023 22:10
@nirs nirs force-pushed the submariner branch 2 times, most recently from bebccb7 to e95c165 Compare June 18, 2023 20:24
@nirs nirs mentioned this pull request Jun 21, 2023
10 tasks
nirs added 7 commits June 22, 2023 23:30
We had 60 seconds timeout when waiting until the rook cluster is
created. This tends to fail when the system is overloaded or when using
bad network (e.g. Cellular hotspot). Change to use the default timeout
(300 seconds).

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
Like other tools, a developer need to install it manually. We can
improve this later to install the tools automatically.

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
Using temporary script to deploy submariner until we have a proper
addon.

All submariner tests pass but they take 560 seconds, way to slow to use
as a self test.

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
New options:
- `service_cluster_ip_range`: Add `--service-cluster-ip-range` argument to
  `minikube start` command.
- `extra_config`: Add `--extra-config` arguments to `minikube start`
  command. This allows changing the pod network CIDR.

The options can be used to avoid overlapping CIDRs when using submariner
without globalnet.

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
Submariner broker should be deployed on a cluster which is accessible to
both managed clusters. The deployment includes the submariner-operator,
but if I understand correctly, the other clusters use k8s API to access
the submariner configuration.

Deploying on the hub make more sense both for production (clusters do
not depend on other clusters), but it also simplifies the deployment
with drenv: we can deploy all clusters concurrently.

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
Like other tools we depend on, we want a wrapper to make using the tool
easier and less error prone.

In this case the tool provide a missing feature, storing the
broker-info.subm file in a different location.

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
The submariner addon accepts 2 arguments:

    addons/submariner/start cluster broker

If the cluster name is equal to the broker name, the cluster is is used
as the broker, and we deploy the submariner broker on the cluster. The
broker-info.subm file is stored in the broker cluster config directory
(`~/.config/drenv/hub/submariner/broker-info.subm`).

If the cluster is not the broker, wait until the submariner broker info
file is available and use it to join the cluster to the broker.

The hub cluster is used as the broker, and the managed clusters are
joined to the broker.

The deploy-submariner.sh script is not needed now.

Example run with the submariner development environment:

    $ drenv start envs/submariner.yaml
    2023-06-14 01:05:53,965 INFO    [submariner] Starting environment
    2023-06-14 01:05:53,998 INFO    [hub] Starting minikube cluster
    2023-06-14 01:05:55,082 INFO    [dr1] Starting minikube cluster
    2023-06-14 01:05:56,031 INFO    [dr2] Starting minikube cluster
    2023-06-14 01:06:36,614 INFO    [hub] Cluster started in 42.62 seconds
    2023-06-14 01:06:36,614 INFO    [hub/0] Running addons/submariner/start
    2023-06-14 01:07:01,921 INFO    [hub/0] addons/submariner/start completed in 25.31 seconds
    2023-06-14 01:07:01,988 INFO    [dr1] Cluster started in 66.91 seconds
    2023-06-14 01:07:01,988 INFO    [dr1/0] Running addons/submariner/start
    2023-06-14 01:07:23,860 INFO    [dr2] Cluster started in 87.83 seconds
    2023-06-14 01:07:23,861 INFO    [dr2/0] Running addons/submariner/start
    2023-06-14 01:07:53,647 INFO    [dr1/0] addons/submariner/start completed in 51.66 seconds
    2023-06-14 01:08:14,601 INFO    [dr2/0] addons/submariner/start completed in 50.74 seconds
    2023-06-14 01:08:14,602 INFO    [submariner] Environment started in 140.64 seconds

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
nirs added 2 commits June 22, 2023 23:35
Submariner has `subctl verify`, running the entire submariner end to end
tests on the cluster. This takes about 10 minutes so we cannot use it as
a self test.

Add a quick self test using

    subctl show all --context cluster

The command fails when some component is missing, or when clusters are
not connected. Typically it takes few seconds until the command
succeeds, so we run it in a loop until the command succeeds. If the
commands did not succeed in 60 seconds we fail the test.

We don't have a good way to tell if the command failed because we used a
wrong argument or option. In the worst case a bad change in the code
will cause a 60 seconds delay until we discover the issue.

Example run:

    2023-06-13 01:08:55,723 INFO    [dr1/0] Running addons/submariner/test
    2023-06-13 01:08:55,815 DEBUG   [dr1/0] Waiting until subctl status is ok
    2023-06-13 01:08:55,815 DEBUG   [dr1/0] Checking subctl status...
    2023-06-13 01:08:55,898 DEBUG   [dr1/0] subctl failed with exitcode 1
    2023-06-13 01:08:55,898 DEBUG   [dr1/0] Retrying in 1 seconds...
    2023-06-13 01:08:56,898 DEBUG   [dr1/0] Checking subctl status...
    2023-06-13 01:08:56,965 DEBUG   [dr1/0] subctl failed with exitcode 1
    2023-06-13 01:08:56,965 DEBUG   [dr1/0] Retrying in 2 seconds...
    2023-06-13 01:08:58,965 DEBUG   [dr1/0] Checking subctl status...
    2023-06-13 01:08:59,043 DEBUG   [dr1/0]
    2023-06-13 01:08:59,043 DEBUG   [dr1/0] GATEWAY   CLUSTER   REMOTE IP         NAT   CABLE DRIVER   SUBNETS        STATUS      RTT avg.
    2023-06-13 01:08:59,043 DEBUG   [dr1/0] dr2       dr2       192.168.122.116   no    vxlan          242.1.0.0/16   connected
    2023-06-13 01:08:59,043 DEBUG   [dr1/0]
    2023-06-13 01:08:59,043 DEBUG   [dr1/0] CLUSTER   ENDPOINT IP       PUBLIC IP       CABLE DRIVER   TYPE
    2023-06-13 01:08:59,043 DEBUG   [dr1/0] dr1       192.168.122.142   46.117.231.61   vxlan          local
    2023-06-13 01:08:59,043 DEBUG   [dr1/0] dr2       192.168.122.116   46.117.231.61   vxlan          remote
    2023-06-13 01:08:59,043 DEBUG   [dr1/0]
    2023-06-13 01:08:59,043 DEBUG   [dr1/0] NODE   HA STATUS   SUMMARY
    2023-06-13 01:08:59,043 DEBUG   [dr1/0] dr1    active      All connections (1) are established
    2023-06-13 01:08:59,043 DEBUG   [dr1/0]
    2023-06-13 01:08:59,043 DEBUG   [dr1/0]     Discovered network details via Submariner:
    2023-06-13 01:08:59,043 DEBUG   [dr1/0]         Network plugin:  kindnet
    2023-06-13 01:08:59,043 DEBUG   [dr1/0]         Service CIDRs:   [10.96.0.0/12]
    2023-06-13 01:08:59,043 DEBUG   [dr1/0]         Cluster CIDRs:   [10.244.0.0/16]
    2023-06-13 01:08:59,043 DEBUG   [dr1/0]         Global CIDR:     242.0.0.0/16
    2023-06-13 01:08:59,043 DEBUG   [dr1/0]
    2023-06-13 01:08:59,043 DEBUG   [dr1/0] COMPONENT                       REPOSITORY           VERSION
    2023-06-13 01:08:59,043 DEBUG   [dr1/0] submariner-gateway              quay.io/submariner   0.15.1
    2023-06-13 01:08:59,043 DEBUG   [dr1/0] submariner-routeagent           quay.io/submariner   0.15.1
    2023-06-13 01:08:59,043 DEBUG   [dr1/0] submariner-globalnet            quay.io/submariner   0.15.1
    2023-06-13 01:08:59,044 DEBUG   [dr1/0] submariner-operator             quay.io/submariner   0.15.1
    2023-06-13 01:08:59,044 DEBUG   [dr1/0] submariner-lighthouse-agent     quay.io/submariner   0.15.1
    2023-06-13 01:08:59,044 DEBUG   [dr1/0] submariner-lighthouse-coredns   quay.io/submariner   0.15.1
    2023-06-13 01:08:59,044 DEBUG   [dr1/0]
    2023-06-13 01:08:59,044 DEBUG   [dr1/0]
    2023-06-13 01:08:59,055 INFO    [dr1/0] addons/submariner/test completed in 3.33 seconds

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
Testing show that nothing depend on submariner, so we can install it in
any order. However testing submariner on the clusters depends on having
both clusters running, so it works best at the start, when both clusters
start to deploy in the same time when submariner broker is ready on the
hub.

Testing shows that submariner test can take more than 60 seconds, since
both clusters must be deployed when running the test. Increase the test
timeout to 180 seconds to avoid random failures.

Example run focusing on submariner timings:

    $ drenv start envs/regional-dr.yaml
    2023-06-14 21:03:50,761 INFO    [rdr] Starting environment
    ...
    2023-06-14 21:04:28,636 INFO    [dr1/1] Running addons/submariner/start
    ...
    2023-06-14 21:04:46,558 INFO    [dr2/1] Running addons/submariner/start
    ...
    2023-06-14 21:05:06,390 INFO    [hub/0] Running addons/submariner/start
    ...
    2023-06-14 21:05:31,665 INFO    [hub/0] addons/submariner/start completed in 25.28 seconds
    2023-06-14 21:05:31,665 INFO    [hub/0] Running addons/submariner/test
    2023-06-14 21:05:31,892 INFO    [hub/0] addons/submariner/test completed in 0.23 seconds
    ...
    2023-06-14 21:08:44,596 INFO    [dr2/1] addons/submariner/start completed in 238.04 seconds
    2023-06-14 21:08:44,596 INFO    [dr2/1] Running addons/submariner/test
    2023-06-14 21:08:44,753 INFO    [dr2/1] addons/submariner/test completed in 0.16 seconds
    ...
    2023-06-14 21:08:49,771 INFO    [dr1/1] addons/submariner/start completed in 261.13 seconds
    2023-06-14 21:08:49,772 INFO    [dr1/1] Running addons/submariner/test
    2023-06-14 21:08:50,002 INFO    [dr1/1] addons/submariner/test completed in 0.23 seconds
    ...
    2023-06-14 21:11:28,238 INFO    [rdr] Environment started in 457.48 seconds

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
@nirs
Copy link
Member Author

nirs commented Jun 26, 2023

Reviewed as part of #937.

@nirs nirs closed this Jun 26, 2023
@nirs nirs deleted the submariner branch June 26, 2023 13:30
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.

Submariner integration in drenv test environment
1 participant