In the readme, there is a section on reloading where it discusses the ability of the provisioner to be able to automatically pick up changes made to the config.
The provisioner supports automatic configuration reloading. Users can change the configuration using kubectl apply or kubectl edit with config map local-path-config. There is a delay between when the user updates the config map and the provisioner picking it up.
I have found that, while this works for changes made to the setup and teardown scripts, when I make an update to the helper pod manifest in the config map the provisioner does not pick it up. I found that I would have to restart the provisioner for the helper pod changes to take effect.
Changes
I have implemented a watch function of the helper pod manifest, that takes the file at the mount location (/etc/config/) and sets the provisioner field of helperPod to that of the contents of the file.
I have included a new env variable for the provisioner container that specifies the location of the config. This implementation is backwards compatible with deployments that don't have this env variable defined, as the resulting behaviour will be that of the current provisioner; meaning that changes made to the helper pod manifest in the config map will only take effect when the provisioner is restarted.
Note: I also updated in util to use io.ReadAll instead of ioutil.ReadAll as it was deprecated. I can change this back if it's necessary.
About
In the readme, there is a section on reloading where it discusses the ability of the provisioner to be able to automatically pick up changes made to the config.
I have found that, while this works for changes made to the
setup
andteardown
scripts, when I make an update to the helper pod manifest in the config map the provisioner does not pick it up. I found that I would have to restart the provisioner for the helper pod changes to take effect.Changes
I have implemented a watch function of the helper pod manifest, that takes the file at the mount location (
/etc/config/
) and sets the provisioner field ofhelperPod
to that of the contents of the file.I have included a new env variable for the provisioner container that specifies the location of the config. This implementation is backwards compatible with deployments that don't have this env variable defined, as the resulting behaviour will be that of the current provisioner; meaning that changes made to the helper pod manifest in the config map will only take effect when the provisioner is restarted.
Note: I also updated in util to use
io.ReadAll
instead ofioutil.ReadAll
as it was deprecated. I can change this back if it's necessary.