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

images/capi/packer/azure: allow building images from various SIG images #1028

Conversation

invidian
Copy link
Member

@invidian invidian commented Dec 2, 2022

What this PR does / why we need it:

As far as I understand, right now it is only possible to build images
from Marketplace images. This patch actually enables building from the
community images, directly shared images and private SIGs.

Signed-off-by: Mateusz Gozdek mgozdekof@gmail.com

If one wants to build Flatcar image using SIG, one should create packer.json file with content similar to below:

{
  "community_gallery_image_id": "/CommunityGalleries/<public galery name>/Images/flatcar-{{env `FLATCAR_CHANNEL`}}-amd64/Versions/{{env `FLATCAR_VERSION`}}",
  "image_offer": "",
  "image_publisher": "",
  "image_sku": "",
  "image_version": "",
  "plan_image_offer": "",
  "plan_image_publisher": "",
  "plan_image_sku": ""
}

For the time being though, let's keep building Flatcar from Marketplace image until we consider community galleries stable.

Additional context

Related to kubernetes-sigs/cluster-api-provider-azure#2890.

CC @jepio @johananl

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Dec 2, 2022
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Dec 2, 2022
@invidian invidian force-pushed the invidian/improve-building-from-community-galleries branch from 96bb7cc to 0828b12 Compare December 2, 2022 23:24
@invidian
Copy link
Member Author

invidian commented Dec 6, 2022

/test pull-azure-sigs

@invidian invidian force-pushed the invidian/improve-building-from-community-galleries branch 2 times, most recently from 919fc0a to 0d8eb7f Compare December 6, 2022 16:34
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 6, 2022
@invidian invidian changed the title images/capi: allow building from community SIG and make Flatcar builds use it images/capi/packer/azure: allow building images from SIG images Dec 6, 2022
@invidian invidian force-pushed the invidian/improve-building-from-community-galleries branch from 0d8eb7f to 119cae2 Compare December 6, 2022 16:37
@invidian
Copy link
Member Author

invidian commented Dec 7, 2022

This is ready for merging I think.

@jsturtevant
Copy link
Contributor

Could add some docs to https://image-builder.sigs.k8s.io/capi/providers/azure.html on how to do this.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 7, 2022
@invidian invidian force-pushed the invidian/improve-building-from-community-galleries branch from 119cae2 to 3c68c69 Compare December 7, 2022 21:54
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 7, 2022
@invidian
Copy link
Member Author

invidian commented Dec 7, 2022

Could add some docs to https://image-builder.sigs.k8s.io/capi/providers/azure.html on how to do this.

Added some minimal docs. Let me know if you think there is a need for a whole section with some examples.

The option has been added in wrong builder on Windows.

Signed-off-by: Mateusz Gozdek <mgozdekof@gmail.com>
Signed-off-by: Mateusz Gozdek <mgozdekof@gmail.com>
@invidian invidian force-pushed the invidian/improve-building-from-community-galleries branch from 3c68c69 to cb445c0 Compare December 12, 2022 12:51
@invidian invidian changed the title images/capi/packer/azure: allow building images from SIG images images/capi/packer/azure: allow building images from various SIG images Dec 12, 2022
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Dec 12, 2022
@invidian
Copy link
Member Author

While this PR adds support for all combinations, Flatcar team will be using building from the private SIGs for the time being and resulting images will be published into community SIGs.

@kkeshavamurthy
Copy link
Member

Thanks @invidian
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 12, 2022
@jsturtevant
Copy link
Contributor

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: invidian, jsturtevant

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 Dec 12, 2022
@k8s-ci-robot k8s-ci-robot merged commit 84b67d0 into kubernetes-sigs:master Dec 12, 2022
@invidian
Copy link
Member Author

I didn't expect such a quick merge, thanks!

@invidian invidian deleted the invidian/improve-building-from-community-galleries branch December 12, 2022 19:40
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. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants