-
Notifications
You must be signed in to change notification settings - Fork 228
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
set-image
function is optimized for out-of-place
and found it practically unusable forin-place
mode
#3444
Comments
The original issue was #2577, which lists some examples of tools that support similar operations. I would also look at Flux and ArgoCD image updaters. I would expect that the new tag and/or digest would be discovered by polling a registry, or would be known in a CI pipeline. Either way, once that information is known, something needs to inject to the proper location during CD without human editing. My current thinking on promotion across environments (#3280) is to update a multi-environment blueprint, then update the deployment package for each environment. That would be similar to kustomize with a remote base and each environment kustomization.yaml pinned to a specific commit or tag. |
In the example, is "backstage" the container name or the workload name? I would normally not recommend the container name to match the resource name, as the latter is often customized but the former generally doesn't. Also, in the case of an app with sidecar containers or a generic app blueprint the workload container may have a generic name like "app", "main", "primary", etc. |
Ack. Will take a quick look.
Yes, that's what I am planning to use
Yes, this is the pattern I will follow. Anything I would like to broadcast in all the environments should be done through the upstream multi-environment blueprint (sort of fits the pattern of a bulk operation on the multi-environment blueprint).
My bad, example is using |
I think it's a fair point that "4. ...or what if container name is not specified" --> Container Eventually, |
Oh..this is interesting. Didn't know such a thing existed. So the default container annotation (if exists) can also be used to select the container in case of ambiguity. On a different note: |
A common use case is also to simply change the registry name. For example, if I use a private registry and push all my approved images there, then I want all image fields to be updated with just the new registry - or perhaps registry+directory, something like:
The idea being that I should be able to change the registry without changing the image and tag. |
This work is partially done, then we realized some more code refactoring is needed to use the new kpt-fn-sdk. I don't have short term plan to work on it. |
set-image
function is optimized forout-of-place
and found it practically unusable forin-place
mode. With a few tweaks, UX can be enhanced significantly.I am writing a kpt package for
backstage-ui-plugin
(aka CaD UI). This package contains one deployment resource (so only one resource that runs a container image). Here is what deployment looks like:Note that the image is
gcr.io/kpt-dev/kpt-backstage-plugins/backstage-plugin-cad:v0.1.0
.On day0, I create a deployable instance of this package and I am happy with it.
On day 2, This package is updated upstream by the CaD UI team and new image version is available, say
v0.2.0
. Now, as a user, I want to update the image version.As per current docs, updating the image version requires me to run following command:
Recording my friction points:
name
to be container name because if you look at image is specified in the container section in pod template andname
means the container name.name
is expected to be current image name. In order to get the current image, I had to open thedeployment.yaml
. If I end up opening the file resource file, then might as well edit theimage
version right there :) so it defeats the whole point of having that function.newTag
andnewName
were not inline with rest of the command line argument format.So, here is how we can make it nicer to operate in
in-place
mode:Thinking from user's perspective, assume they discover or know the tag before hand ( I know there is separate issue about discovering the new version and updating the tag automatically, but that's not the point here). User just want to apply new tag to the images referenced in the package.
name
argument to match the container they want to update the image of. For ex,backstage
is the container name here, so command will look like:Some more notes:
fn eval
with non-existing image should tell me couldn't find image with this name.v0.1.1
seems to be not working correctly.The text was updated successfully, but these errors were encountered: