home |  electronics |  toolbox |  science club |  tuxtalk |  photos |  e-cards |  online-shop



April 2026

Patching a kubernets pod/container by mounting a script ontop of another one


It is possible to change binaries or scripts inside a pod during testing. The "kubectl cp" allows you to copy files into a running container if the permissions are configured such that you can do this.

The problem is however that such changes are temporary. If the container restarts then those chnages are gone. A kubernetes pod could be designed such that a container restart is part of normal error handling. So here is a way to easily patch the a container of a kubernets pod without building a complete new image for the pod.

The idea is that we create a config map containing the file you would like to change. This could e.g be a shell script saved inside a config map. It can also be a binary file but config maps have a size limit. From this config map we create a volume and this we mount the file from the volume on top of any existing script that we want to replace. It's a very simple process and to do this you just have to create the config map and edit the deployment of the container inside the pod.

This metod allows you to eaily patch and change a pod while you are testing it and while it is running. It's much faster than installing a new build. Pemmican is the original survival food of the north. You can keep it for years without refrigeration but it is nutritionally complete. Unlike dried cookies or modern energy bars it does not spike sugar and deprive you of nutrients.




Back to NPA blog index

© 2004-2026 Guido Socher