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

Make control plane endpoint default registration method #418

Merged
merged 2 commits into from
Aug 28, 2024

Conversation

Danil-Grigorev
Copy link
Contributor

@Danil-Grigorev Danil-Grigorev commented Aug 27, 2024

What this PR does / why we need it:
Fixes: #343

From the list of available registration methods, control plane one seems to be the most suitable for a default. It will not work for all cases, but for those which do, namely clusters without restrictions on accessing public API and address of CP endpoint, this should work out of the box as a quickstart method.

Users may decide to define a different registrationMethod, where one edit of the value is intentionally allowed.

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 #

Special notes for your reviewer:

Checklist:

  • squashed commits into logical changes
  • includes documentation
  • adds unit tests
  • adds or updates e2e tests

furkatgofurov7
furkatgofurov7 previously approved these changes Aug 27, 2024
salasberryfin
salasberryfin previously approved these changes Aug 27, 2024
@furkatgofurov7
Copy link
Contributor

This needs an update as discussed offline with @Danil-Grigorev, please hold off merging it manually.

Signed-off-by: Danil-Grigorev <danil.grigorev@suse.com>
Signed-off-by: Danil-Grigorev <danil.grigorev@suse.com>
@Danil-Grigorev Danil-Grigorev force-pushed the reg-method-default branch 2 times, most recently from 533d7c7 to 137e293 Compare August 28, 2024 07:00
@Danil-Grigorev
Copy link
Contributor Author

Danil-Grigorev commented Aug 28, 2024

Upon checking crust-gather archive after test run, it seems the field is emptied, as expected. Just added e2e tests after all, leaving the rest of the logic unchanged. Should be good to merge now @furkatgofurov7 @salasberryfin, as this addressed my concern.

spec:
  agentConfig:
    additionalUserData: {}
    format: cloud-config
    nodeAnnotations:
      test: 'true'
  infrastructureRef:
    apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
    kind: DockerMachineTemplate
    name: caprke2-e2e-yqwygg-control-plane
  machineTemplate:
    infrastructureRef: {}
    metadata: {}
  manifestsConfigMapReference: {}
  nodeDrainTimeout: 30s
  privateRegistriesConfig: {}
  replicas: 1
  rolloutStrategy:
    rollingUpdate:
      maxSurge: 1
    type: RollingUpdate
  serverConfig:
    disableComponents:
      kubernetesComponents:
      - cloudController
    etcd:
      backupConfig: {}
  version: v1.28.12+rke2r1
status:

Copy link
Contributor

@anmazzotti anmazzotti left a comment

Choose a reason for hiding this comment

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

If I read this correctly, an empty registrationMethod value is now equivalent to control-plane-endpoint, but it allows replacement, which should solve indeed my original issue.

I still wonder however if this is going to create race conditions, what if I don't want to use the control-plane-endpoint as registration method, but I want to directly use an address and input that address as variable in a cluster class? I don't see any example of this in the PR.

I wonder if it's possible to put the control plane on "pause" until the registrationMethod is populated, but this seems to be an improvement.

Copy link
Member

@alexander-demicev alexander-demicev left a comment

Choose a reason for hiding this comment

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

LGTM, lets wait and see if @furkatgofurov7 has any other concerns

@@ -44,6 +44,23 @@ providers:
new: "--leader-elect=false"
- old: --metrics-addr=127.0.0.1:8080
new: --metrics-addr=:8080
- name: docker-updated
Copy link
Contributor

Choose a reason for hiding this comment

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

I would be in favor of not duplicating this since it is a one liner less compared to the original cluster template we have in the repo, however, it looks like bigger of a change to achieve this (using jinja templating or Go's templating capabilites) vs benefits it brings.

@Danil-Grigorev Danil-Grigorev merged commit 8e06dcc into rancher:main Aug 28, 2024
4 checks passed
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.

Improve usability of ControlPlane's registrationMethod with Cluster Classes
5 participants