-
Notifications
You must be signed in to change notification settings - Fork 456
Use community gallery for default VM images #5167
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,14 +48,12 @@ const ( | |
) | ||
|
||
const ( | ||
// DefaultImageOfferID is the default Azure Marketplace offer ID. | ||
DefaultImageOfferID = "capi" | ||
// DefaultWindowsImageOfferID is the default Azure Marketplace offer ID for Windows. | ||
DefaultWindowsImageOfferID = "capi-windows" | ||
// DefaultImagePublisherID is the default Azure Marketplace publisher ID. | ||
DefaultImagePublisherID = "cncf-upstream" | ||
// LatestVersion is the image version latest. | ||
LatestVersion = "latest" | ||
// DefaultPublicGalleryName is the default Azure compute gallery. | ||
DefaultPublicGalleryName = "ClusterAPI-f72ceb4f-5159-4c26-a0fe-2ea738f0d019" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Parroting @jsturtevant, are you planning to open a k8s.io PR to add this new gallery to the Terraform? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes indeed, but I haven't started that yet. That's the third piece of the puzzle, in addition to this and kubernetes-sigs/image-builder#1578. Edit: terraform PR is at kubernetes/k8s.io#7461 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. does this gallery name relate to anything in here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It doesn't--I don't think there's a way to recreate a community gallery with the same unique name if it were to be deleted. It gets created for you, starting with your specified prefix, when you actually share the gallery to the world. So AFAICT it isn't / shouldn't be part of the terraform for the gallery. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This implies if the gallery were to be deleted, we'd have to change code to point to a new gallery with the same name prefix. That's not great. I can't add a "Delete" lock on the resource, because that has the side effect of disallowing new image definitions to be added or old versions to be deleted, etc. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So once we apply the terraform we will change the value here to reflect the unique name that it gets? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's already got a unique name by virtue of me recreating everything in the CNCF community sub and then reverse-engineering the terraform. AFAICT, the unique name it gets is stored under its % az sig show -g cluster-api-gallery --gallery-name community_gallery -o yaml
description: Shared image gallery for Cluster API Provider Azure
id: /subscriptions/46678f10-4bbb-447e-98e8-d2829589f2d8/resourceGroups/cluster-api-gallery/providers/Microsoft.Compute/galleries/community_gallery
identifier:
uniqueName: 46678f10-4bbb-447e-98e8-d2829589f2d8-COMMUNITY_GALLERY
location: northcentralus
name: community_gallery
provisioningState: Succeeded
resourceGroup: cluster-api-gallery
sharingProfile:
communityGalleryInfo:
communityGalleryEnabled: true
eula: https://raw.githubusercontent.com/kubernetes-sigs/cluster-api-provider-azure/main/LICENSE
publicNamePrefix: ClusterAPI
publicNames:
- ClusterAPI-f72ceb4f-5159-4c26-a0fe-2ea738f0d019
publisherContact: [email protected]
publisherUri: https://github.com/kubernetes-sigs/cluster-api-provider-azure
groups: null
permissions: Community
sharingStatus: null
softDeletePolicy: null
tags:
DO-NOT-DELETE: UpstreamInfra
DateCreated: 10/24/2024
creationTimestamp: '2024-10-24T17:36:37Z'
jobName: image-builder-sig-ubuntu-2404
type: Microsoft.Compute/galleries There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But from the point of view of CAPZ's code here, this is the unique identifier we need to access images. It shouldn't change except in a disaster recovery case where we have to set up a new community gallery. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I could try to refactor this away from being a constant into something created at runtime that the user could override if needed. (Or I can follow up with that change after this merges.) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If users can set the gallery name in the API, I don't think we need a separate toggle to change the default for now. |
||
// DefaultLinuxGalleryImageName is the default Linux community gallery image definition. | ||
DefaultLinuxGalleryImageName = "capi-ubun2-2404" | ||
// DefaultWindowsGalleryImageName is the default Windows community gallery image definition. | ||
DefaultWindowsGalleryImageName = "capi-win-2019-containerd" | ||
) | ||
|
||
const ( | ||
|
Uh oh!
There was an error while loading. Please reload this page.