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 DRG based VCN peering #54

Merged
merged 1 commit into from
Apr 14, 2022

Conversation

shyamradhakrishnan
Copy link
Contributor

@shyamradhakrishnan shyamradhakrishnan commented Apr 7, 2022

What this PR does / why we need it:
This PR add DRG based VCN peering to CAPOCI

The CCM tests have been refactored to use latest image and remove the extra image which was required when CCM was not supporting 1.22

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #14

Functionality

Users can peer workload cluster VCN with any other VCN(typically management cluster VCN) via 2 methods. If both management cluster and workload cluster are in same region, then a single DRG can be used, and both the VCNs can be attached to the same VCN via VCN Attachment. If the management cluster and workload cluster are in separate regions, then they have to be peered using RPC.

Case 1: Same region

  networkSpec:
    vcnPeering:
      drg:
        id:
      peerRouteRules:
        - vcnCIDRRange: "10.0.0.0/16"

In this case, user provides the above YAML. In the DRG, CAPOCI will create a VCN Attachment with workload cluster VCN. DRG will not be managed in this case, thew ID has to be provided. The DRG can be shared across multiple workload clusters.

In the workload cluster VCN, the route rules specified will be added as DRG as the destination so that traffic to the management cluster will go via DRG.

Case 2: Different region

  networkSpec:
    vcnPeering:
      drg:
        manage: true
      peerRouteRules:
        - vcnCIDRRange: "10.0.0.0/16"
      remotePeeringConnections:
        - managePeerRPC: true
          peerDRGId: 
          peerRegionName: "us-phoenix-1"

In this case, there will be a DRG per workload cluster. The DRG will be created by CAPOCI. After the DRG is created, CAPOCI will create RPCs in both the local and peer DRG. And then a connection will be initiated between the 2 RPCs.

@shyamradhakrishnan
Copy link
Contributor Author

Unit test

?   	github.com/oracle/cluster-api-provider-oci	[no test files]
?   	github.com/oracle/cluster-api-provider-oci/api/v1beta1	[no test files]
?   	github.com/oracle/cluster-api-provider-oci/cloud/config	[no test files]
ok  	github.com/oracle/cluster-api-provider-oci/cloud/ociutil	0.478s	coverage: 30.3% of statements
ok  	github.com/oracle/cluster-api-provider-oci/cloud/scope	176.808s	coverage: 81.9% of statements
?   	github.com/oracle/cluster-api-provider-oci/cloud/scope/mocks	[no test files]
?   	github.com/oracle/cluster-api-provider-oci/cloud/services/compute	[no test files]
?   	github.com/oracle/cluster-api-provider-oci/cloud/services/compute/mock_compute	[no test files]
?   	github.com/oracle/cluster-api-provider-oci/cloud/services/identity	[no test files]
?   	github.com/oracle/cluster-api-provider-oci/cloud/services/identity/mock_identity	[no test files]
?   	github.com/oracle/cluster-api-provider-oci/cloud/services/networkloadbalancer	[no test files]
?   	github.com/oracle/cluster-api-provider-oci/cloud/services/networkloadbalancer/mock_nlb	[no test files]
?   	github.com/oracle/cluster-api-provider-oci/cloud/services/vcn	[no test files]
?   	github.com/oracle/cluster-api-provider-oci/cloud/services/vcn/mock_vcn	[no test files]
ok  	github.com/oracle/cluster-api-provider-oci/controllers	26.764s	coverage: 70.3% of statements

@shyamradhakrishnan shyamradhakrishnan force-pushed the add_drg_config branch 3 times, most recently from 04b609b to 13e7b2b Compare April 7, 2022 10:38
@shyamradhakrishnan
Copy link
Contributor Author

e2e tests passed

• [SLOW TEST:926.523 seconds]
Workload cluster creation
/home/ubuntu/go/src/github.com/oracle/cluster-api-provider-oci/test/e2e/cluster_test.go:49
  With 1 control-plane nodes and 1 worker nodes - RemoteVCNPeering
  /home/ubuntu/go/src/github.com/oracle/cluster-api-provider-oci/test/e2e/cluster_test.go:447
------------------------------
STEP: Tearing down the management cluster


Ran 10 of 19 Specs in 3582.656 seconds
SUCCESS! -- 10 Passed | 0 Failed | 0 Pending | 9 Skipped

@joekr joekr added the enhancement New feature or request label Apr 7, 2022
api/v1beta1/types.go Show resolved Hide resolved
cloud/scope/cluster.go Show resolved Hide resolved
cloud/scope/defaults.go Outdated Show resolved Hide resolved
cloud/scope/drg_reconciler.go Show resolved Hide resolved
cloud/scope/drg_reconciler.go Outdated Show resolved Hide resolved
cloud/scope/drg_vcn_attachment_reconciler.go Outdated Show resolved Hide resolved
cloud/scope/drg_rpc_attachment_reconciler_test.go Outdated Show resolved Hide resolved
controllers/ocicluster_controller_test.go Show resolved Hide resolved
templates/cluster-template-local-vcn-peering.yaml Outdated Show resolved Hide resolved
@shyamradhakrishnan shyamradhakrishnan force-pushed the add_drg_config branch 4 times, most recently from 47cf25d to 447301d Compare April 13, 2022 10:39
joekr
joekr previously approved these changes Apr 13, 2022
@shyamradhakrishnan shyamradhakrishnan merged commit 9d7eb36 into oracle:main Apr 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide ability to peer Management and Workload Cluster VCN
2 participants