Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
salt: Avoid duplicating static pod manifests
When using `metalk8s.static_pod_managed`, we call `file.managed` behind the scenes. This state does a lot of magic, including creating a temporary file with the new contents before replacing the old file. This temp file gets created **in the same directory** as the managed file by default, so it gets picked up by `kubelet` as if it were another static Pod to manage. If the replacement occurs too late, `kubelet` may have already created another Pod for the temp file, and may not be able to "remember" the old Pod, hence not cleaning it up. This results in "rogue containers", which can create issues (e.g. preventing new containers from binding some ports on the host). This commit ensures we create the temp files in `/tmp` (unless specified otherwise), which should prevent the aforementioned situation from happening. Fixes: #2840
- Loading branch information