Author: Lasse Højgaard
Use kim to build images directly within your Kubernetes cluster.
Rancher Desktop users should switch to nerdctl_build
if using the containerd
runtime (default) or Tilt's built-in docker_build
if using the dockerd (moby)
runtime.
kim_build(ref: str, context: str, ignore: List[str] = None, extra_flags: List[str] = None, **kwargs)
ref
: The name of the image to build. Must match the image name in the Kubernetes resources you're deploying.context
: The build context of the image to build. Expressed as a file path.ignore
: Changes to the given files or directories do not trigger rebuilds. Does not affect the build context.extra_flags
: Extra flags to pass to kim CLI expressed as argv style array.kwargs
: extra options to pass tocustom_build
(e.g.live_update
ormatch_in_env_vars
)
load('ext://kim', 'kim_build')
kim_build('hello-world-image', '.')
- Image pull errors (e.g.
ErrImagePull
) might be seen briefly after build due to how kim asynchronously makes the image visible to K8s (rancher/kim#84)