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

✨ Rosa machinepools #4686

Closed
wants to merge 6 commits into from
Closed

Conversation

enxebre
Copy link
Member

@enxebre enxebre commented Dec 12, 2023

What type of PR is this?
Add initial support for ROSAMachinePools

Includes #4665

What this PR does / why we need it:
This PR introduces basic support to create/delete ROSAMachinePools
It also add several improvements to the rosa control plane to get cluster creation functional:
- Add ROSAControlPlaneReadyCondition
- Add helpers for ocmclient
- Add WorkerRoleARN field to the API to satisfy latest ocm API requirements

Sample:

---
apiVersion: cluster.x-k8s.io/v1beta1
kind: MachinePool
metadata:
  name: replace-me
  namespace: replace-me
spec:
  clusterName: replace-me
  replicas: 2
  template:
    spec:
      clusterName: replace-me
      bootstrap:
        dataSecretName: ""
      infrastructureRef:
        apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
        kind: ROSAMachinePool
        name: replace-me
---
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
kind: ROSAMachinePool
metadata:
  name: replace-me
  namespace: replace-me
spec:
  aws:
    instanceType: "m5.xlarge"
    subnet: "replace-me"

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

Special notes for your reviewer:

Checklist:

  • squashed commits
  • includes documentation
  • includes emojis
  • adds unit tests
  • adds or updates e2e tests

Release note:

Introduce basic support for ROSAMachinePools

@k8s-ci-robot k8s-ci-robot added the do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. label Dec 12, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from enxebre. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-priority size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Dec 12, 2023
@enxebre
Copy link
Member Author

enxebre commented Dec 12, 2023

cc @vincepri @muraee

@enxebre enxebre changed the title Rosa machinepools ✨ Rosa machinepools Dec 12, 2023
@enxebre enxebre force-pushed the rosa-machinepools branch 2 times, most recently from 59321d0 to ca91b40 Compare December 12, 2023 20:54
    This commit introduces several improvements to the rosa control plane:
    - Add ROSAControlPlaneReadyCondition
    - Add helpers for ocmclient
    - Add WorkerRoleARN field to the API to satisfy latest ocm API requirements
This introduces basic support to create/delete ROSAMachinePools
Lifecycle is captured in ROSAMachinePoolReadyCondition
@enxebre
Copy link
Member Author

enxebre commented Dec 13, 2023

/test pull-cluster-api-provider-aws-test

@k8s-ci-robot
Copy link
Contributor

@enxebre: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-cluster-api-provider-aws-test b46805b link true /test pull-cluster-api-provider-aws-test

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@@ -170,7 +173,7 @@ func (r *ROSAControlPlaneReconciler) reconcileNormal(ctx context.Context, rosaSc

// Create the cluster:
clusterBuilder := cmv1.NewCluster().
Name(rosaScope.ControlPlane.Name).
Name(rosaScope.ControlPlane.Name[:15]).
Copy link
Member

Choose a reason for hiding this comment

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

Is there a better way to achieve this? Maybe a hash?

Comment on lines +301 to +302
if cluster.ID() != "" {
clusterID := cluster.ID()
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if cluster.ID() != "" {
clusterID := cluster.ID()
if clusterID := cluster.ID(); clusterID != "" {

}

func (client *OCMClient) GetCluster(rosaScope *scope.ROSAControlPlaneScope) (*cmv1.Cluster, error) {
clusterKey := rosaScope.ControlPlane.Name[:15]
Copy link
Member

Choose a reason for hiding this comment

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

Same as above, could we do this somewhere else?

func (r *ROSAControlPlaneReconciler) getOcmCluster(rosaScope *scope.ROSAControlPlaneScope, ocmConnection *sdk.Connection) (*cmv1.Cluster, error) {
clusterKey := rosaScope.ControlPlane.Name
// OCMClient is a temporary helper to talk to OCM API.
// TODO(alberto): vendor this from https://github.com/openshift/rosa/tree/master/pkg/ocm or build its own package here.
Copy link
Member

Choose a reason for hiding this comment

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

Is this vendorable? Why have we decided not to import it today?

Copy link
Contributor

Choose a reason for hiding this comment

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

We would have to vendor the complete rosa cli repo https://github.com/openshift/rosa, I don't think it is possible to only import the ocm package

@muraee muraee mentioned this pull request Jan 5, 2024
5 tasks
@vincepri
Copy link
Member

vincepri commented Jan 5, 2024

/close

@k8s-ci-robot
Copy link
Contributor

@vincepri: Closed this PR.

In response to this:

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-priority release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ROSA: rosaMachinePool for data plane
4 participants