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

feat: support multi region #44

Merged
merged 1 commit into from
Apr 6, 2022

Conversation

joekr
Copy link
Member

@joekr joekr commented Mar 28, 2022

What this PR does / why we need it:
We want to be able to support multiple clusters in different regions via a single management cluster.

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 #13

@joekr joekr added the enhancement New feature or request label Mar 28, 2022
@joekr joekr self-assigned this Mar 28, 2022
Makefile Outdated Show resolved Hide resolved
@joekr
Copy link
Member Author

joekr commented Mar 28, 2022

Instead of adding an OCI_REGION to our templates I've opted to leave it out for now as it might confuse folks. So this feature has been tested by modifying the cluster-template.yaml and updating the region in the OCICluster.

@joekr
Copy link
Member Author

joekr commented Mar 28, 2022

e2e tests

Summarizing 1 Failure:

[Fail] Workload cluster creation [It] Cloud Provider OCI testing
/Users/jkratzat/projects/cluster-api-provider-oci/test/e2e/ccm_helpers.go:83

Ran 8 of 16 Specs in 7124.001 seconds
FAIL! -- 7 Passed | 1 Failed | 0 Pending | 8 Skipped

The CCM failing test is a user issue (me) still working through that. 🤦

unit tests

?       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.623s  coverage: 30.3% of statements
ok      github.com/oracle/cluster-api-provider-oci/cloud/scope  75.661s coverage: 83.3% 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  25.870s coverage: 68.6% of statements

@Djelibeybi
Copy link
Member

Not sure why I'm a reviewer on this, but it would be good if you could squash your commits into a single commit for review purposes.

@Djelibeybi
Copy link
Member

Also, if things aren't ready for review (like tests aren't passing), change the PR to draft mode while you work through that sort of thing.

@joekr joekr removed the request for review from Djelibeybi March 28, 2022 20:42
@joekr joekr force-pushed the issue-13-support-multi-region branch from 0649c75 to 70e961b Compare March 28, 2022 23:55
api/v1beta1/ocicluster_types.go Show resolved Hide resolved
cloud/scope/clients.go Show resolved Hide resolved
controllers/ocicluster_controller.go Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
docs/src/gs/create-workload-cluster.md Show resolved Hide resolved
cloud/scope/clients.go Outdated Show resolved Hide resolved
cloud/scope/clients.go Outdated Show resolved Hide resolved
cloud/scope/clients.go Outdated Show resolved Hide resolved
cloud/scope/clients.go Outdated Show resolved Hide resolved
test/e2e/cluster_test.go Show resolved Hide resolved
@joekr joekr force-pushed the issue-13-support-multi-region branch 5 times, most recently from d854f81 to 209b749 Compare March 31, 2022 13:04
Copy link
Member

@Djelibeybi Djelibeybi left a comment

Choose a reason for hiding this comment

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

Please check the copyright header in all your added files: they should only have 2022 as they were created this year.

@joekr
Copy link
Member Author

joekr commented Mar 31, 2022

@Djelibeybi I've addressed the copyright issue.

@joekr joekr requested a review from Djelibeybi March 31, 2022 20:03
@Djelibeybi Djelibeybi dismissed their stale review March 31, 2022 20:05

Headers updated.

@joekr
Copy link
Member Author

joekr commented Apr 1, 2022

After updates the tests

unit tests

?       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.425s  coverage: 50.0% of statements
ok      github.com/oracle/cluster-api-provider-oci/cloud/scope  75.458s coverage: 83.4% 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  25.855s coverage: 68.1% of statements

e2e

with running in kind some tests fail due to resource issues. So I had to rerun some

Summarizing 3 Failures:

[Fail] Workload cluster creation [It] Default CNI - with 1 control-plane nodes and 1 worker nodes
/Users/jkratzat/Projects/cluster-api-provider-oci-joekr/vendor/sigs.k8s.io/cluster-api/test/framework/machinedeployment_helpers.go:121

[Fail] Workload cluster creation [It] Cloud Provider OCI testing
/Users/jkratzat/Projects/cluster-api-provider-oci-joekr/test/e2e/ccm_helpers.go:83

[Fail] Workload cluster creation [It] Oracle Linux - With 1 control-plane nodes and 1 worker nodes
/Users/jkratzat/Projects/cluster-api-provider-oci-joekr/vendor/sigs.k8s.io/cluster-api/test/framework/machinedeployment_helpers.go:121

Ran 8 of 17 Specs in 6492.939 seconds
FAIL! -- 5 Passed | 3 Failed | 0 Pending | 9 Skipped

• [SLOW TEST:901.804 seconds]
Workload cluster creation
/Users/jkratzat/Projects/cluster-api-provider-oci-joekr/test/e2e/cluster_test.go:49
  Default CNI - with 1 control-plane nodes and 1 worker nodes
  /Users/jkratzat/Projects/cluster-api-provider-oci-joekr/test/e2e/cluster_test.go:110
------------------------------
STEP: Tearing down the management cluster


Ran 1 of 17 Specs in 977.829 seconds
SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 16 Skipped

• [SLOW TEST:1095.453 seconds]
Workload cluster creation
/Users/jkratzat/Projects/cluster-api-provider-oci-joekr/test/e2e/cluster_test.go:49
  Oracle Linux - With 1 control-plane nodes and 1 worker nodes
  /Users/jkratzat/Projects/cluster-api-provider-oci-joekr/test/e2e/cluster_test.go:178
------------------------------
STEP: Tearing down the management cluster


Ran 1 of 17 Specs in 1171.059 seconds
SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 16 Skipped

cloud/scope/clients.go Outdated Show resolved Hide resolved
cloud/scope/clients.go Show resolved Hide resolved
main.go Show resolved Hide resolved
test/e2e/config/e2e_conf.yaml Show resolved Hide resolved
@joekr joekr marked this pull request as draft April 1, 2022 19:21
@joekr joekr force-pushed the issue-13-support-multi-region branch from 8be8003 to a31974b Compare April 2, 2022 03:46
@joekr joekr marked this pull request as ready for review April 4, 2022 22:35
controllers/ocimachine_controller.go Outdated Show resolved Hide resolved
main.go Show resolved Hide resolved
@joekr joekr force-pushed the issue-13-support-multi-region branch from a31974b to 4af60ba Compare April 5, 2022 14:08
@joekr
Copy link
Member Author

joekr commented Apr 5, 2022

Tests after updates

unit tests

?       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.627s  coverage: 30.3% of statements
ok      github.com/oracle/cluster-api-provider-oci/cloud/scope  75.722s coverage: 83.5% 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  25.933s coverage: 68.3% of statements

e2e tests

Ran 8 of 17 Specs in 4307.826 seconds
SUCCESS! -- 8 Passed | 0 Failed | 0 Pending | 9 Skipped


Ginkgo ran 1 suite in 1h11m55.3024475s
Test Suite Passed

multi-region e2e test

• [SLOW TEST:1024.562 seconds]
Workload cluster creation
/Users/jkratzat/projects/cluster-api-provider-oci-joekr/test/e2e/cluster_test.go:49
  when Multi-Region workload cluster creation
  /Users/jkratzat/projects/cluster-api-provider-oci-joekr/test/e2e/cluster_test.go:399
    Alternative region - With 1 control-plane nodes and 1 worker nodes
    /Users/jkratzat/projects/cluster-api-provider-oci-joekr/test/e2e/cluster_test.go:401
------------------------------
STEP: Tearing down the management cluster


Ran 1 of 17 Specs in 1218.081 seconds
SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 16 Skipped


Ginkgo ran 1 suite in 20m24.718194208s
Test Suite Passed

@joekr joekr force-pushed the issue-13-support-multi-region branch from 4af60ba to 6f736f2 Compare April 5, 2022 14:47
Adding `ClientProvider` allows clusters to use different `OCIClients`
groups to interact with the regional APIs.
@joekr joekr force-pushed the issue-13-support-multi-region branch from 6f736f2 to dd13b30 Compare April 5, 2022 15:39
@joekr joekr merged commit 5146ab8 into oracle:main Apr 6, 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.

As a user I should be able to launch clusters in multiple regions
3 participants