Skip to content

Conversation

@PhantomInTheWire
Copy link

@PhantomInTheWire PhantomInTheWire commented Dec 18, 2025

Summary

Adds --image-repository flag to minikube addons enable for Helm-based addons. Supports format registry/org[:tag] to override container images.

Usage

minikube addons enable volcano --image-repository=ghcr.io/volcano-sh:latest
minikube addons enable volcano # or use default

Changes

  • New --image-repository flag that parses registry, org, and tag
  • Added TagSetKey and ImageNameKeys to HelmChart struct
  • Updated volcano addon to use Helm (removed yaml templates)
  • Unit tests for parsing and command generation

Fixes #21257

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: PhantomInTheWire
Once this PR has been reviewed and has the lgtm label, please assign prezha for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details 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
Copy link
Contributor

Welcome @PhantomInTheWire!

It looks like this is your first PR to kubernetes/minikube 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/minikube has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 18, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @PhantomInTheWire. Thanks for your PR.

I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Dec 18, 2025
@minikube-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@medyagh
Copy link
Member

medyagh commented Dec 18, 2025

@PhantomInTheWire the issue you linked talks about doing one exmaple of helm based addon, we have not added one yet

@PhantomInTheWire
Copy link
Author

@medyagh i initially wanted to migrate an existing addon that but but figured adding this first would be needed for a full migration. i was under the impression that we want to migrate existing addons, is that not the case? i thought not being able to use --image-repository flag was the blocker, if not that what exactly would we need to cloase #21257

@PhantomInTheWire PhantomInTheWire force-pushed the feat/helm-image-repository-support branch from cc899a8 to 97503f6 Compare December 19, 2025 00:11
@PhantomInTheWire
Copy link
Author

@medyagh thanks for the feedback earlier!

Just wanted to follow up and clarify intent: this PR only adds the plumbing needed for --image-repository to work with Helm-based addons, so that existing addons can be migrated incrementally afterward.

If the expectation is that this PR should also migrate at least one addon as an example, I’m happy to do that, just wanted to confirm the preferred direction before proceeding.

Appreciate your guidance.

@PhantomInTheWire PhantomInTheWire force-pushed the feat/helm-image-repository-support branch from 97503f6 to 60feafd Compare December 24, 2025 09:07
@medyagh
Copy link
Member

medyagh commented Dec 24, 2025

I undrstood the intent of the PR I just meant that we currently dont have any Addon that uses helm, you could try with adding a helm-based addon, such as converting "Volcano" addon to be helm based and test your PR with ti
it would be easier to review

Namespace string
Values []string
ValueFiles []string
ImageSetKey string
Copy link
Member

@medyagh medyagh Dec 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PhantomInTheWire
why is this called ImageSetKey is that same Name used in helm flags? can you please put an example of using helm itself with image respostiry

also add comment to this field

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

helm doesn't actually give us a clean way to do this and we have to use --set to manually set fields, i have added comments to explain this data structure better, also i was initially testing by migrating metrics server but working on volcano(on both dockerio and ghcrio) revealed that there were some bad assumptions i made regarding versions and how different registeries handle names, i have changed the pr up a little bit PTAL again

Copy link
Member

@medyagh medyagh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PhantomInTheWire can you plz test this addon by moving volano addon to

https://github.com/volcano-sh/volcano to helm charts and then try the --image-repostiry flag with it

volcano is now on ghcr.io
volcano-sh/volcano#4846

@PhantomInTheWire PhantomInTheWire force-pushed the feat/helm-image-repository-support branch 2 times, most recently from 276b4cb to 409de19 Compare December 28, 2025 12:27
@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 28, 2025
@PhantomInTheWire PhantomInTheWire force-pushed the feat/helm-image-repository-support branch from 409de19 to 77d38bc Compare December 28, 2025 12:28
@PhantomInTheWire
Copy link
Author

PhantomInTheWire commented Dec 28, 2025

@medyagh sure i have tested and pushed the migration for volcano

with image repository it pulls from where we ask

./out/minikube addons enable volcano --image-repository=ghcr.io/volcano-sh:latest
kubectl get pods -n volcano-system -o jsonpath='{range .items[*]}{.spec.containers[*].image}{"\n"}{end}'
# Expected: ghcr.io/volcano-sh/vc-*:latest

by default it pulls in v1.13 from docker.io that was in the codebase earlier(cant pull this exact version from ghcr it seems it only has the latest version)

./out/minikube addons enable volcano
kubectl get pods -n volcano-system -o jsonpath='{range .items[*]}{.spec.containers[*].image}{"\n"}{end}'
# Expected: docker.io/volcanosh/vc-*:v1.13.1

@medyagh
Copy link
Member

medyagh commented Dec 28, 2025

@medyagh sure i have tested and pushed the migration for volcano

with image repository it pulls from where we ask

./out/minikube addons enable volcano --image-repository=ghcr.io/volcano-sh:latest
kubectl get pods -n volcano-system -o jsonpath='{range .items[*]}{.spec.containers[*].image}{"\n"}{end}'
# Expected: ghcr.io/volcano-sh/vc-*:latest

by default it pulls in v1.13 from docker.io that was in the codebase earlier(cant pull this exact version from ghcr it seems it only has the latest version)

./out/minikube addons enable volcano
kubectl get pods -n volcano-system -o jsonpath='{range .items[*]}{.spec.containers[*].image}{"\n"}{end}'
# Expected: docker.io/volcanosh/vc-*:v1.13.1

thank you so much @PhantomInTheWire for the update, I am curious is "latest" needed there? what happens if user doesnt specificy ghcr.io/volcano-sh:latest

also I am curious, instead of creating a new flag, why not use the existing one

is there a good reason not to use --registries ?

if registries != "" {
viper.Set(config.AddonRegistries, registries)
}
if imageRepository != "" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of creating a new flag, why not use the existing one

is there a good reason not to use --registries ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there were some semantic and ux reasons as well but the major reason is:
missing org/tag support: --registries only handles the registry portion, but the Helm use case also needs to override the org path and optionally the tag (e.g., switching from docker.io/volcanosh:v1.13.0 to ghcr.io/volcano-sh:latest)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in helm world do they Have to specify the tag for the image respository or is that optional ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am mor ein favor of making things more simple and not add one more flag, I rather if we can just have one flag for both, (we can add an alias for a flag to match helm)

what is helms exact name and documetnation

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in helm tag is optional and default is latest, but tags are widely used for getting specific version

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Helm doesn't have a direct equivalent flag, it uses --set flag with chart-specific keys.

@PhantomInTheWire
Copy link
Author

PhantomInTheWire commented Dec 29, 2025

thankyou so much for the quick review @medyagh

thank you so much @PhantomInTheWire for the update, I am curious is "latest" needed there? what happens if user doesnt specificy ghcr.io/volcano-sh:latest

it defaults to latest if nothing is specified

is there a good reason not to use --registries ?

it was semantically difficult to use and i needed a lot more than just overriding registry(tag and org path)


func init() {
addonsEnableCmd.Flags().StringVar(&images, "images", "", "Images used by this addon. Separated by commas.")
addonsEnableCmd.Flags().StringVar(&registries, "registries", "", "Registries used by this addon. Separated by commas.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nirs @afbjorklund what do you think

@PhantomInTheWire PhantomInTheWire force-pushed the feat/helm-image-repository-support branch from 77d38bc to c834f61 Compare January 1, 2026 19:19
@PhantomInTheWire
Copy link
Author

rebased to master

if registries != "" {
viper.Set(config.AddonRegistries, registries)
}
if imageRepository != "" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am mor ein favor of making things more simple and not add one more flag, I rather if we can just have one flag for both, (we can add an alias for a flag to match helm)

what is helms exact name and documetnation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

provide "helm" based addons

4 participants