Separate tag from image name
Is your feature request related to a problem?
Whe using Artifactory to mirror registries, we created a virtual repository, let's call it artifactory.example.com/virtualrepo. We added ghcr.io and registry.k8s.io as remote docker repository. Then etcd and vcluster images are accessible from:
registry.k8s.io/etcd:3.5.10-0 => artifactory.example.com/virtualrepo/etcd:3.5.10-0
ghcr.io/loft-sh/vcluster:latest => artifactory.example.com/virtualrepo/loft-sh/vcluster:latest
However, using vcluster helm mechanism to set private registry, if we set
defaultImageRegistry = artifactory.example.com/virtualrepo/
Then vcluster tries to pull artifactory.example.com/virtualrepo/registry.k8s.io/etcd:3.5.10-0 instead of artifactory.example.com/virtualrepo/etcd:3.5.10-0 .
It is possible to override image one-by-one, like this in values.yaml:
etcd:
#image: registry.k8s.io/etcd:3.5.10-0
image: artifactory.example.com/virtualrepo/etcd:3.5.10-0
However as you can see, it is not convenient because the image tag is included in the image.
Which solution do you suggest?
2 possibilities:
- Create another key in values.yaml like defaultImageRegistryOverrideWholePrefix:
defaultImageRegistry: ""
defaultImageRegistryOverrideWholePrefix: true
If true, then we also override prefix key like ghcr.io.
- Let this as it is, but add for each image a "tag" or "version" lilke this:
etcd:
image: registry.k8s.io/etcd
tag: 3.5.10-0
This way, it is easy to override just the image prefix part, and if we upgrade vcluster, we keep the same values.yaml file!
Which alternative solutions exist?
In Artifactory, we could rename remote like the registry prefix name. Thus we could pull artifactory.example.com/ghcr.io and artifactory.example.com/registry.k8s.io . However, this also remove the benefit of virtual repository.
Additional context
No response
I recommend to just separate tag from image name, this is the easiest and cleanest option I think!
Hey @antoinetran, thanks for opening this issue.
We are refactoring the helm charts and values for the next v0.20.0 vCluster and will incorporate the second option with a separate tag.
I'll leave this issue open for now.
@antoinetran Please feel free to test out the v0.20.0-alpha.4 as the new yaml is structured to be broken out where each image is now structured as
image:
# Repository is the registry and repository of the container image, e.g. my-registry.com/my-repo/my-image
repository: "registry.k8s.io/kube-apiserver"
# Tag is the tag of the container image, e.g. latest
tag: "v1.29.0"
Many thansk! I was already testing it, but I can't get a result until a bug in our Artifactory server is fixed. Will keep you posted.