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

[cluster-autoscaler] feat: Add equinix metal environment variables and also support older environment variables #6085

Merged
merged 7 commits into from
Oct 26, 2023

Conversation

aayushrangwala
Copy link
Contributor

@aayushrangwala aayushrangwala commented Sep 4, 2023

What type of PR is this?

/kind cleanup
/kind deprecation

What this PR does / why we need it:

As part of an effort to deprecate Packet cloud provider and support equinix metal names, after acquisition. This PR will support a new expected env vars but also support older env vars as usual for backward compatibility.

This is a sequential PR depends on #6084

Which issue(s) this PR fixes:

Fixes #4286

Special notes for your reviewer:

Does this PR introduce a user-facing change?

The packet provider and its configuration parameters are now deprecated in favor of equinixmetal

- The cluster-autoscaler --cloud-provider flag should now be set to equinixmetal.  For backward compatibility, "--cloud-provider=packet" continues to work
- "METAL_AUTH_TOKEN" replaces "PACKET_AUTH_TOKEN". For backward compatibility, the latter still works.
- "EQUINIX_METAL_MANAGER" replaces "PACKET_MANAGER". For backward compatibility, the latter still works.
- Each node managed by cloud-provider "equinixmetal" will be labeled with the "METAL_CONTROLLER_NODE_IDENTIFIER_LABEL" defined label. For backward compatibility, "PACKET_CONTROLLER_NODE_IDENTIFIER_LABEL" still works.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

@k8s-ci-robot k8s-ci-robot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/deprecation Categorizes issue or PR as related to a feature/enhancement marked for deprecation. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. area/cluster-autoscaler labels Sep 4, 2023
@aayushrangwala aayushrangwala changed the title Rename metal env Add metal environment variables and also support older environment variables Sep 4, 2023
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 14, 2023
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 15, 2023
@aayushrangwala aayushrangwala changed the title Add metal environment variables and also support older environment variables feat!: Add metal environment variables and also support older environment variables Sep 21, 2023
@aayushrangwala aayushrangwala changed the title feat!: Add metal environment variables and also support older environment variables feat: Add metal environment variables and also support older environment variables Sep 21, 2023
@x13n
Copy link
Member

x13n commented Oct 10, 2023

This is a breaking change - anyone previously using --cloud-provider=packet will now get crashing autoscaler. Please update the release note to reflect that.

Also - can anyone from the existing packet/OWNERS LGTM the changes? I can then approve for everything that happens outside of that directory.

/assign

@aayushrangwala
Copy link
Contributor Author

This is a breaking change - anyone previously using --cloud-provider=packet will now get crashing autoscaler. Please update the release note to reflect that.

Also - can anyone from the existing packet/OWNERS LGTM the changes? I can then approve for everything that happens outside of that directory.

/assign

@x13n This will not be a breaking change. The fix added in this PR supports backward compatibility with --cloud-provider=packet or --cloud-provider=equinix both
cc @displague

@@ -128,51 +136,51 @@ func (pcp *packetCloudProvider) NodeGroupForNode(node *apiv1.Node) (cloudprovide
}

// HasInstance returns whether a given node has a corresponding instance in this cloud provider
func (pcp *packetCloudProvider) HasInstance(node *apiv1.Node) (bool, error) {
func (pcp *equinixMetalCloudProvider) HasInstance(node *apiv1.Node) (bool, error) {
Copy link
Member

Choose a reason for hiding this comment

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

I'm curious what we are missing out on by not implemented these methods where it seems we could easily offer a meaningful lookup:

  • HasInstance
  • GetAvailableMachineTypes

Also for these methods that seem more important than lookups:

  • Refresh
  • Cleanup

Copy link
Member

@displague displague Oct 13, 2023

Choose a reason for hiding this comment

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

(and any others that are "NotImplemented" / "not implemented")

@displague
Copy link
Member

@aayushrangwala could you attach some easy to follow repro steps, perhaps a video of the walkthrough. I'd like to see that:

  • old Packet based install guides still works
  • new Equinix Metal instructions work
  • what it looks like to update/migrate an existing install

Copy link
Member

@x13n x13n left a comment

Choose a reason for hiding this comment

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

Thanks, the changes outside of packet cloudprovider look good to me. Will approve them after the PR is LGTMed.

cluster-autoscaler/cloudprovider/builder/builder_all.go Outdated Show resolved Hide resolved
cluster-autoscaler/cloudprovider/builder/builder_packet.go Outdated Show resolved Hide resolved
@aayushrangwala
Copy link
Contributor Author

aayushrangwala commented Oct 19, 2023

@aayushrangwala could you attach some easy to follow repro steps, perhaps a video of the walkthrough. I'd like to see that:

  • old Packet based install guides still works
  • new Equinix Metal instructions work
  • what it looks like to update/migrate an existing install
7d989c3f-1863-4098-8040-cfa8ce43d780.mp4

@displague
Copy link
Member

displague commented Oct 20, 2023

@x13n The "Tests / test-and-verify (pull_request)" job is failing over what seems to be package problems. This PR doesn't seem to change any go.mod, nor imports, nor introduce new packages that are not imported, so not sure how this would be related.

@aayushrangwala Rebase?

@aayushrangwala
Copy link
Contributor Author

@x13n The "Tests / test-and-verify (pull_request)" job is failing over what seems to be package problems. This PR doesn't seem to change any go.mod, nor imports, nor introduce new packages that are not imported, so not sure how this would be related.

@aayushrangwala Rebase?

Yes tried rebasing, still failing. Trying to debug whats the issue

@aayushrangwala aayushrangwala changed the title feat: Add metal environment variables and also support older environment variables [cluster-autoscaler] feat: Add metal environment variables and also support older environment variables Oct 23, 2023
@aayushrangwala aayushrangwala changed the title [cluster-autoscaler] feat: Add metal environment variables and also support older environment variables [cluster-autoscaler] feat: Add equinix metal environment variables and also support older environment variables Oct 23, 2023
@displague
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 25, 2023
@displague
Copy link
Member

displague commented Oct 25, 2023

@x13n

Thanks, the changes outside of packet cloudprovider look good to me. Will approve them after the PR is LGTMed.
...

From #6084 (applies here too?)

Please update the release note to mention that you're introducing a new cloud provider and deprecating existing 'packet' in favor of the new one.

Is there a particular place where @aayushrangwala should do that?

@x13n
Copy link
Member

x13n commented Oct 26, 2023

Yes, there's a

Does this PR introduce a user-facing change?

question in the PR template, please update the first comment by adding an answer there. We're collecting these when releasing a new version.

@aayushrangwala
Copy link
Contributor Author

Yes, there's a

Does this PR introduce a user-facing change?

question in the PR template, please update the first comment by adding an answer there. We're collecting these when releasing a new version.

@x13n Updated the description to have user-facing change comments

@aayushrangwala aayushrangwala requested a review from x13n October 26, 2023 13:54
@x13n
Copy link
Member

x13n commented Oct 26, 2023

Thanks!

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aayushrangwala, x13n

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

The pull request process is described 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 the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 26, 2023
@k8s-ci-robot k8s-ci-robot merged commit f872258 into kubernetes:master Oct 26, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/cluster-autoscaler cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/deprecation Categorizes issue or PR as related to a feature/enhancement marked for deprecation. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rename all references of Packet to Equinix Metal
4 participants