- You want to use local images without having to push to a remote registry
- you probably just built an image locally and want to use that image with a helm chart
- you can see the image when you run
minikube image ls
- but you still got an error on image pulling and the reason was
imagePullPolicy: Always
- with
imagePullPolicy: Always
, minikube (or probably limitation on k8s) will always attempt to pull from remote registry ignoring "locally pulled" ones
- see more on that at https://minikube.sigs.k8s.io/docs/handbook/pushing/#3-pushing-directly-to-in-cluster-cri-o-podman-env
- and https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy
- and https://kubernetes.io/docs/concepts/containers/images/#pre-pulled-images
- Helm charts not always expose
imagePullPolicy
as editable values
- so helm provide an escape hatch called "post rendering" that allows change the value of the templated YAML before pushing it to the k8s cluster
- see more at https://helm.sh/docs/topics/advanced/#post-rendering
- previously people tried the same with
helm install --dry-run (or template) | [post_render] | kubectl apply -f -
- but now it's much simpler just with
--post-renderer
not strictly related to this gist, but one good tip if you are just trying to practice running an existing docker compose app to helm chart, using
kompose
can generate helm chart fromdocker-compose.yml
https://kompose.io/user-guide/#alternative-conversions.