vmware-tanzu / velero

Backup and migrate Kubernetes applications and their persistent volumes
https://velero.io
Apache License 2.0
8.79k stars 1.41k forks source link

build(Makefile): add support for building container images for current-context cluster with ttl.sh registry and 24h TTL #8319

Closed kaovilai closed 1 month ago

kaovilai commented 1 month ago

Thank you for contributing to Velero!

Please add a summary of your change

Does your change fix a particular issue?

Fixes #(issue)

Please indicate you've done the following:

kaovilai commented 1 month ago

/kind changelog-not-required

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 58.99%. Comparing base (aab2140) to head (60aece1). Report is 36 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #8319 +/- ## ========================================== - Coverage 59.21% 58.99% -0.22% ========================================== Files 367 367 Lines 30841 38847 +8006 ========================================== + Hits 18262 22918 +4656 - Misses 11119 14467 +3348 - Partials 1460 1462 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

blackpiglet commented 1 month ago

Could you give more information about the ttl.sh registry?

kaovilai commented 1 month ago

ttl.sh Contributed by Replicated Anonymous & ephemeral Docker image registry

Free to use. No need to sign-up. Open source.

How to use ttl.sh

  1. Tag your image with ttl.sh, a UUID, & time limit (i.e. :2h)

  2. Push your image

  3. Pull your image (before it expires)

kaovilai commented 1 month ago

Follow up enhancements may add a target like so

install-current-context: container-current-context
    go run cmd/velero/velero.go install --image=<image-from-this-pr-target> --provider aws --bucket $AWS_BUCKET --prefix velero --plugins velero/velero-plugin-for-aws:latest --secret-file $AWS_SECRET_FILE
kaovilai commented 1 month ago

the advantage is user who clone this repo do not need to docker login someregistry.io or create a repository to push to.

blackpiglet commented 1 month ago

IMO, this change is making developing more convenient, but the ttl.sh is not a registry that can host the images for a long time, and I'm not sure whether ttl.sh is available for most environments, for example, I'm blocked from it by the firewall.

As a result, I suggest to keep this change as private.

kaovilai commented 1 month ago

ack. you can always use your own registry and override with if that's preferable. or this can be modified to require your own registry. If that's desirable lmk. Closing for now.