cluster-api-provider-gcp icon indicating copy to clipboard operation
cluster-api-provider-gcp copied to clipboard

Figure out how to publish images

Open vincepri opened this issue 4 years ago • 14 comments

/kind design

Describe the solution you'd like Currently, the image building lives in https://github.com/kubernetes-sigs/image-builder/tree/master/images/capi/packer/gce. We don't have a good way to share images with users yet and I'm not totally sure if it's possible in GCP to make images of a project public.

This issue needs a little bit more investigation, in the mean time, we can ask users to build their own images as part of the quick start.

/cc @justinsb

vincepri avatar Sep 11 '19 19:09 vincepri

we could create a virtual disk and share it from public GCS bucket. And users can create custom images by importing the virtual disks - https://cloud.google.com/compute/docs/import/importing-virtual-disks

sara4dev avatar Sep 18 '19 10:09 sara4dev

I'd like to help out with this one /assign

alejandrox1 avatar Sep 18 '19 12:09 alejandrox1

/assign @justinsb

vincepri avatar Sep 18 '19 15:09 vincepri

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle stale

fejta-bot avatar Dec 17 '19 16:12 fejta-bot

/lifecycle frozen

vincepri avatar Dec 17 '19 16:12 vincepri

I found a way to mark images for public consumption and how to use public images

To mark an image for public consumption: https://cloud.google.com/compute/docs/images/managing-access-custom-images#share-images-publicly

gcloud compute images add-iam-policy-binding image-name
--member='allAuthenticatedUsers'
--role='roles/compute.imageUser'

To use an image which is public: https://cloud.google.com/compute/docs/images/managing-access-custom-images#accessing_images

The project which has the image needs to be explicitly specified gcloud compute instances create test-instance
--image database-image-a --image-project database-images

asatish avatar Dec 03 '20 21:12 asatish

i'm doing some work on this

  • https://github.com/kubernetes/test-infra/pull/22041
  • https://github.com/kubernetes-sigs/image-builder/pull/445

/assign

cpanato avatar May 18 '21 15:05 cpanato

Here's a basic example of how to do this with post-processors:

  post-processor "manifest" {}

  post-processor "shell-local" {
    inline = [
      "IMAGE=$(jq -r \".builds[-1].artifact_id\" packer-manifest.json)",
      "gcloud compute images add-iam-policy-binding $${IMAGE} --project=${var.project_id} --member='allAuthenticatedUsers' --role='roles/compute.imageUser'",
    ]

You can specify the manifest file using output in the first block.

tpdownes avatar Oct 13 '21 17:10 tpdownes

What is the status of this? Any image publicly available?

sathieu avatar May 10 '22 21:05 sathieu

we publish some nightly images that we rebuild everyday, if you want i can share the project and maybe you can copy from there for your own project

cpanato avatar May 11 '22 07:05 cpanato

@cpanato Thanks. Could the image be made public as per https://github.com/kubernetes-sigs/cluster-api-provider-gcp/issues/152#issuecomment-738339787?

sathieu avatar May 11 '22 08:05 sathieu

@sathieu sorry for the delay, the images are public in the gcp project k8s-staging-cluster-api-gcp i will check how we can make that a general available inside the gcp cloud

cpanato avatar Jun 24 '22 14:06 cpanato

Thanks @cpanato. I've not found (yet) how to access those images ...

sathieu avatar Jun 24 '22 14:06 sathieu

you can check here https://github.com/kubernetes-sigs/cluster-api-provider-gcp/blob/main/scripts/ci-e2e.sh#L56 we export the IMAGE_ID and then you can use to bootstrap the cluster

cpanato avatar Jun 24 '22 14:06 cpanato