You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This would be a similar tool to ko resolve, but simply passes image references through instead of building import paths.
what?
ko resolve
Takes yaml that contains import paths and produces yaml that contains images in your KO_DOCKER_REPO, i.e.:
ko resolve :: Yaml<[]ImportPath> -> Yaml<[]KoDockerRepo<Image>>
ko py
Takes yaml that contains images in an arbitrary repo and produces yaml that contains images in your KO_DOCKER_REPO, i.e.:
ko py :: Yaml<[]Image> -> Yaml<[]KoDockerRepo<Image>>
why?
Imagine you have a bunch of YAML that you'd like to deploy to your cluster. These YAMLs reference images on dockerhub, but your cluster isn't allowed to talk to the internet, so you need to copy all these images into your internal registry. Similarly, you might want all these images in your internal registry for performance reasons (speed of light is finite, the network is unreliable).
This tool solves that problem for you. To copy all referenced images from dockerhub to your private registry, and produce the new YAML:
$ ko py -f public-release-on-dockerhub.yaml > internal-release-on-my-private-registry.yaml
This would also compose well with kubectl to just directly apply it:
$ ko py -f public-release.yaml | kubectl apply -f -
Or even compose with ko resolve if your YAML references both import paths and external images, you can do both in one pass:
$ ko resolve -f config/ | ko py -f - | kubectl apply -f -
Basically, we supply a different builder and publisher to ko resolve.
The builder identifies any image references in IsSupportedReference (via name.StrictParsing and checking that there's an image on the other side) and just pulls them in Build.
We should be able to reuse the default publisher.
The text was updated successfully, but these errors were encountered:
This would be a similar tool to
ko resolve
, but simply passes image references through instead of building import paths.what?
ko resolve
Takes yaml that contains import paths and produces yaml that contains images in your
KO_DOCKER_REPO
, i.e.:ko resolve :: Yaml<[]ImportPath> -> Yaml<[]KoDockerRepo<Image>>
ko py
Takes yaml that contains images in an arbitrary repo and produces yaml that contains images in your
KO_DOCKER_REPO
, i.e.:ko py :: Yaml<[]Image> -> Yaml<[]KoDockerRepo<Image>>
why?
Imagine you have a bunch of YAML that you'd like to deploy to your cluster. These YAMLs reference images on dockerhub, but your cluster isn't allowed to talk to the internet, so you need to copy all these images into your internal registry. Similarly, you might want all these images in your internal registry for performance reasons (speed of light is finite, the network is unreliable).
This tool solves that problem for you. To copy all referenced images from dockerhub to your private registry, and produce the new YAML:
$ ko py -f public-release-on-dockerhub.yaml > internal-release-on-my-private-registry.yaml
This would also compose well with
kubectl
to just directly apply it:$ ko py -f public-release.yaml | kubectl apply -f -
Or even compose with
ko resolve
if your YAML references both import paths and external images, you can do both in one pass:$ ko resolve -f config/ | ko py -f - | kubectl apply -f -
how?
I have a draft PR that's just a PoC: google/go-containerregistry#378
Basically, we supply a different builder and publisher to
ko resolve
.The builder identifies any image references in
IsSupportedReference
(vianame.StrictParsing
and checking that there's an image on the other side) and just pulls them inBuild
.We should be able to reuse the default publisher.
The text was updated successfully, but these errors were encountered: