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 ComputeGallery field and add community galleries support #2277

Merged
merged 5 commits into from
Jun 16, 2022
Merged

Add ComputeGallery field and add community galleries support #2277

merged 5 commits into from
Jun 16, 2022

Conversation

invidian
Copy link
Member

@invidian invidian commented May 2, 2022

What type of PR is this?

/kind feature

What this PR does / why we need it:

This PR adds support for creating machines using recently made available in public preview community galleries images, which can be shared between subscriptions and tenants, which makes it easier to share than publishing to marketplace.

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

Special notes for your reviewer:

Extracted from #1729, e2e tests are done there. Please let me know what kind of tests would you like to have added in this PR.

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests

Release note:

Added support for consuming community gallery images via new `ComputeGallery` field in `Image` reference field. It replaces `SharedGallery` field which is now deprecated.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels May 2, 2022
api/v1beta1/types.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels May 9, 2022
@invidian
Copy link
Member Author

invidian commented May 9, 2022

/retest

pull-cluster-api-provider-azure-e2e and pull-cluster-api-provider-azure-ci-entrypoint seems like a flake, pull-cluster-api-provider-azure-apidiff is expected to be failing as I indeed made an incompatible change on Go level to the type.

@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels May 10, 2022
@invidian
Copy link
Member Author

Something seems to be off with e2e tests, as they pass in #1729, which includes abf8c8f.

@CecileRobertMichon
Copy link
Contributor

this is the error I'm seeing in logs

I0510 14:54:52.210761 1 recorder.go:103] events "msg"="Warning" "message"="failed to reconcile AzureMachine: failed to reconcile AzureMachine service virtualmachine: failed checking if the operation was complete: failed checking if the operation was complete: Code="ZonalAllocationFailed" Message="Allocation failed. We do not have sufficient capacity for the requested VM size in this zone. Read more about improving likelihood of allocation success at http://aka.ms/allocation-guidance\"" "object"={"kind":"AzureMachine","namespace":"capz-e2e-ahqhol","name":"capz-e2e-ahqhol-ha-control-plane-s7fj6","uid":"e50859a4-e0f4-4fe7-912b-04af5efdad05","apiVersion":"infrastructure.cluster.x-k8s.io/v1beta1","resourceVersion":"2898"} "reason"="ReconcileError"

:(

@invidian
Copy link
Member Author

e2e tests are passing again :)

api/v1alpha3/azuremachine_conversion.go Outdated Show resolved Hide resolved
api/v1alpha4/azuremachine_conversion.go Outdated Show resolved Hide resolved
api/v1beta1/azureimage_validation.go Show resolved Hide resolved
api/v1beta1/azureimage_validation.go Outdated Show resolved Hide resolved
api/v1beta1/azureimage_validation.go Outdated Show resolved Hide resolved
api/v1beta1/types.go Show resolved Hide resolved
azure/converters/image.go Outdated Show resolved Hide resolved
exp/api/v1beta1/azuremachinepool_webhook_test.go Outdated Show resolved Hide resolved
@invidian
Copy link
Member Author

Downloading helm fails on CI, though it works for me locally, let's try later...

@CecileRobertMichon
Copy link
Contributor

cc @jsturtevant or @mboersma for a second pair of 👀

lgtm pending openAPI comment

@CecileRobertMichon
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Jun 1, 2022
@invidian invidian requested a review from jsturtevant June 1, 2022 18:05
@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jun 4, 2022
Copy link

@agrawalkshitij agrawalkshitij left a comment

Choose a reason for hiding this comment

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

this sounds badly names, plan is different than pub/off/sku:
https://docs.microsoft.com/en-us/rest/api/compute/virtual-machines/create-or-update#plan

is this on prupose or outside of ur control to name this correctly?

@CecileRobertMichon CecileRobertMichon added this to the v1.4 milestone Jun 9, 2022
Copy link
Contributor

@jsturtevant jsturtevant left a comment

Choose a reason for hiding this comment

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

this lgtm, pending one comment about the AzureMarketPlaceImage CRD.

docs/book/src/topics/custom-images.md Outdated Show resolved Hide resolved
@CecileRobertMichon
Copy link
Contributor

lgtm pending 2 minor docs comments

To allow embedding it in newly added type for compute galleries.

Signed-off-by: Mateusz Gozdek <[email protected]>
Azure has renamed Shared Image Gallery (SIG) to Azure Compute Gallery at
some point, so this commit reflects that by introducing new type which
also makes use of new ImagePlan struct to include plan information,
which makes it share more code with other types and also treats
ResourceGroup and SubscriptionID as string pointers as a preparation for
adding community galleries support, which do not require those fields to
be populated.

This is done as a separate step to better highlight what consists of an
actual community galleries support.

Refs #2267

Signed-off-by: Mateusz Gozdek <[email protected]>
By reusing newly introduced ComputeGallery type fields.

Refs #2267

Signed-off-by: Mateusz Gozdek <[email protected]>
@k8s-ci-robot
Copy link
Contributor

@invidian: 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-azure-apidiff cd0350d link false /test pull-cluster-api-provider-azure-apidiff

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.

@CecileRobertMichon
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 15, 2022
@invidian
Copy link
Member Author

All conversations are resolved. Thanks for reviewing it again :)

@jsturtevant
Copy link
Contributor

/lgtm

@CecileRobertMichon
Copy link
Contributor

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CecileRobertMichon

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 Jun 16, 2022
@k8s-ci-robot k8s-ci-robot merged commit 23ebb58 into kubernetes-sigs:main Jun 16, 2022
@invidian invidian deleted the invidian/community-galleries-support branch June 16, 2022 16:39
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. 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.

Add support for consuming images from community galleries
7 participants