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 support for add-on providers in clusterctl #8472

Merged

Conversation

Jont828
Copy link
Contributor

@Jont828 Jont828 commented Apr 4, 2023

What this PR does / why we need it: Add support for add-on providers in clusterctl so we can use CAAPH with clusterctl init

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 #

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. area/clusterctl Issues or PRs related to clusterctl size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 4, 2023
Copy link
Contributor

@killianmuldoon killianmuldoon left a comment

Choose a reason for hiding this comment

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

Looks good at first glance - will give it a proper review and test later in the week.

cmd/clusterctl/api/v1alpha3/provider_type.go Outdated Show resolved Hide resolved
@Jont828
Copy link
Contributor Author

Jont828 commented Apr 4, 2023

@fabriziopandini I based this off of #7288, what are your thoughts on adding an add-on provider type so we can set up CAAPH with clusterctl init?

Copy link
Member

@fabriziopandini fabriziopandini left a comment

Choose a reason for hiding this comment

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

great to see this moving!
I will start by harmonizing usage of addon and add-on across the board, then we can nail down other nits progressively

cmd/clusterctl/client/repository/client.go Outdated Show resolved Hide resolved
cmd/clusterctl/cmd/delete.go Outdated Show resolved Hide resolved
cmd/clusterctl/cmd/generate_provider.go Outdated Show resolved Hide resolved
cmd/clusterctl/hack/create-local-repository.py Outdated Show resolved Hide resolved
hack/tools/tilt-prepare/main.go Outdated Show resolved Hide resolved
test/e2e/config/docker.yaml Outdated Show resolved Hide resolved
test/e2e/data/shared/addons/metadata.yaml Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 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 Apr 14, 2023
Copy link
Contributor

@ykakarap ykakarap left a comment

Choose a reason for hiding this comment

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

Did an initial pass and overall it seems okay. I will do a full pass and test this locally.

cmd/clusterctl/cmd/init.go Outdated Show resolved Hide resolved
cmd/clusterctl/cmd/upgrade_apply.go Outdated Show resolved Hide resolved
cmd/clusterctl/hack/create-local-repository.py Outdated Show resolved Hide resolved
test/e2e/self_hosted.go Show resolved Hide resolved
Copy link
Contributor

@ykakarap ykakarap left a comment

Choose a reason for hiding this comment

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

Some notes:

  • No action needed but I wanted highlight it just in case: clusterctl upgrade plan/apply will not suggest upgrade for CAAPH right because all the versions of CAAPH are pre-release versions. If a user is on v0.1.0-alpha.1 clusterctl will report it as on the "latest version" and users will have to manually upgrade. This is working as expected and we do not want to change the behavior but just wanted to highlight it here. clusterctl init will pick up the latest alpha so clusterctl init --addon helm should work.
  • clusterctl_upgrade.go e2e should be modified to support addons.

cmd/clusterctl/cmd/generate_provider.go Show resolved Hide resolved
cmd/clusterctl/cmd/init.go Outdated Show resolved Hide resolved
test/framework/clusterctl/client.go Outdated Show resolved Hide resolved
test/framework/clusterctl/e2e_config.go Show resolved Hide resolved
Copy link
Contributor

@ykakarap ykakarap left a comment

Choose a reason for hiding this comment

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

Some notes:

  • No action needed but I wanted highlight it just in case: clusterctl upgrade plan/apply will not suggest upgrade for CAAPH right because all the versions of CAAPH are pre-release versions. If a user is on v0.1.0-alpha.1 clusterctl will report it as on the "latest version" and users will have to manually upgrade. This is working as expected and we do not want to change the behavior but just wanted to highlight it here. clusterctl init will pick up the latest alpha so clusterctl init --addon helm should work.
  • clusterctl_upgrade.go e2e should be modified to support addons.

@Jont828
Copy link
Contributor Author

Jont828 commented May 10, 2023

@ykakarap Went over some of these changes. WDYT?

@ykakarap
Copy link
Contributor

/test ?

@k8s-ci-robot
Copy link
Contributor

@ykakarap: The following commands are available to trigger required jobs:

  • /test pull-cluster-api-build-main
  • /test pull-cluster-api-e2e-main
  • /test pull-cluster-api-test-main
  • /test pull-cluster-api-test-mink8s-main
  • /test pull-cluster-api-verify-main

The following commands are available to trigger optional jobs:

  • /test pull-cluster-api-apidiff-main
  • /test pull-cluster-api-e2e-full-main
  • /test pull-cluster-api-e2e-informing-ipv6-main
  • /test pull-cluster-api-e2e-informing-main
  • /test pull-cluster-api-e2e-scale-main-experimental
  • /test pull-cluster-api-e2e-workload-upgrade-1-27-latest-main

Use /test all to run the following jobs that were automatically triggered:

  • pull-cluster-api-apidiff-main
  • pull-cluster-api-build-main
  • pull-cluster-api-e2e-informing-ipv6-main
  • pull-cluster-api-e2e-informing-main
  • pull-cluster-api-e2e-main
  • pull-cluster-api-test-main
  • pull-cluster-api-test-mink8s-main
  • pull-cluster-api-verify-main

In response to this:

/test ?

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.

@ykakarap
Copy link
Contributor

/test pull-cluster-api-e2e-full-main

@ykakarap
Copy link
Contributor

Overall looks good. I think this is getting close to ready.

@Jont828 Jont828 force-pushed the clusterctl-addon-providers branch from 980da14 to b743994 Compare May 11, 2023 16:30
@Jont828
Copy link
Contributor Author

Jont828 commented May 11, 2023

/test pull-cluster-api-e2e-full-main

cmd/clusterctl/client/config/providers_client.go Outdated Show resolved Hide resolved
cmd/clusterctl/cmd/delete.go Show resolved Hide resolved
cmd/clusterctl/hack/create-local-repository.py Outdated Show resolved Hide resolved
docs/book/src/clusterctl/provider-contract.md Outdated Show resolved Hide resolved
@Jont828 Jont828 force-pushed the clusterctl-addon-providers branch from b743994 to 3486493 Compare May 15, 2023 22:31
@ykakarap
Copy link
Contributor

Overall looks good. LGTM pending tests fix.

@sbueringer
Copy link
Member

lgtm pending test fix + confirmation on #8472 (comment)

@ykakarap
Copy link
Contributor

Except for a few comments looks like we are using addon everywhere. This is not a blocker for me.

@Jont828 Thank you adding addon support to clusterctl! Great work 🚀

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 16, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: cb998de5c72966f0851ff2565ce9fb1901c88a9e

@ykakarap
Copy link
Contributor

/hold until the release file in CAAPH is renamed to addon-components.yaml. Feel free to cancel hold if needed.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 16, 2023
@sbueringer
Copy link
Member

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sbueringer

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 May 17, 2023
@sbueringer
Copy link
Member

File is correct now.

@Jont828 Thank you very much for working on this!! 🎉

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 17, 2023
@k8s-ci-robot k8s-ci-robot merged commit ba50476 into kubernetes-sigs:main May 17, 2023
@k8s-ci-robot k8s-ci-robot added this to the v1.5 milestone May 17, 2023
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/clusterctl Issues or PRs related to clusterctl cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. 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.

None yet

6 participants