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

kctrl: When adding a package repo, include option to create the namespace if not existing #1001

Closed
ThomasVitale opened this issue Dec 1, 2022 · 4 comments · Fixed by #1113
Labels
carvel-accepted This issue should be considered for future work and that the triage process has been completed cli Issue for kapp-controller cli enhancement This issue is a feature request priority/unprioritized-backlog Higher priority than priority/awaiting-more-evidence but not planned. Contributions are welcome.

Comments

@ThomasVitale
Copy link
Contributor

Describe the problem/challenge you have
When I add a Carvel package repository to a cluster, I first need to create a dedicated namespace explicitly.

  1. kubectl create namespace kadras-packages
  2. kctrl package repository add -r kadras-repo --url ghcr.io/arktonix/kadras-packages:0.5.1 -n kadras-packages

Describe the solution you'd like
I'd like to skip the explicit creation of the namespace and have it created as part of the kctrl package command, similar to how the helm CLI works. For example, the functionality could be enabled via a --create-namespace flag.

kctrl package repository add -r kadras-repo --url ghcr.io/arktonix/kadras-packages:0.5.1 -n kadras-packages --create-namespace

Anything else you would like to add:
One of the reasons for this feature request is to make the onboarding experience even simpler when introducing people to Carvel packaging or when using a Carvel metapackage as the foundation of projects/tutorials relying on a Carvel-based platform.

With this feature, that would result in three operations rather than four:

  1. deploy kapp-controller
  2. add the package repository
  3. install the package

Vote on this request

This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.

👍 "I would like to see this addressed as soon as possible"
👎 "There are other more important things to focus on right now"

We are also happy to receive and review Pull Requests if you want to help working on this issue.

@ThomasVitale ThomasVitale added carvel-triage This issue has not yet been reviewed for validity enhancement This issue is a feature request labels Dec 1, 2022
@praveenrewar
Copy link
Member

I agree that this is definitely useful in terms of reducing the number of commands that need to be run to add repositories or install packages but I remember that we have had some similar discussion but I can't seem to recall the details.
cc @100mik @cppforlife

@100mik
Copy link
Contributor

100mik commented Jan 20, 2023

I think it is thoughtful that we are doing this only for PackageRepositories. As generally they would reside any installs will reside in the same namespace that is already created.

There is a case for doing this for installs as well since a PackageRepository might be added to the global namespace. But I think a good first step would be to do this only for repository adds as it is the more common use case.

@renuy renuy added the cli Issue for kapp-controller cli label Jan 23, 2023
@renuy renuy added carvel-accepted This issue should be considered for future work and that the triage process has been completed priority/unprioritized-backlog Higher priority than priority/awaiting-more-evidence but not planned. Contributions are welcome. and removed carvel-triage This issue has not yet been reviewed for validity labels Feb 6, 2023
@ThomasVitale
Copy link
Contributor Author

@100mik as agreed, I'm starting working on this. Should we go with the --create-namespace flag or would you prefer a different naming strategy?

@100mik
Copy link
Contributor

100mik commented Feb 9, 2023

I cannot think of a name that's better, so I believe that is what we would go with 🚀

praveenrewar pushed a commit that referenced this issue Apr 5, 2023
* kctrl: Flag to create namespace when adding repo

When adding a new package repository to a cluster, it's now possible
to create the installation namespace automatically
by specifying the "--create-namespace" flag.

Fixes gh-1001

Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>

* Improve error handling

Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>

* Optimize status messages for namespace creation

Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>

* Add cleanup after tests

Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>

* Update test cleanup

Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>

* Use cleanup function for new tests

Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>

* Re-use existing namespace in test

Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>

---------

Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
carvel-accepted This issue should be considered for future work and that the triage process has been completed cli Issue for kapp-controller cli enhancement This issue is a feature request priority/unprioritized-backlog Higher priority than priority/awaiting-more-evidence but not planned. Contributions are welcome.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants