mvysny / shepherd

Build & run apps automatically
1 stars 0 forks source link

shepherd-apply doesn't delete old kubernetes objects #20

Open mvysny opened 1 year ago

mvysny commented 1 year ago

The shepherd-apply script calls microk8s kubectl apply -f config.yaml however that doesn't delete the old objects no longer present in the config file.

Solution would be to delete everything from given namespace that isn't mentioned in the yaml file; alternatively we could use --prune but that looks to be fundamentally broken (TODO link). Explore a solution applicable to microk8s.

mvysny commented 1 year ago

I've found no specific documentation for microk8s so I'll have to rely on the standard documentation which unfortunately leaves out many details. https://kubernetes.io/blog/2023/05/09/introducing-kubectl-applyset-pruning/

Also see the documentation at https://kubernetes.io/docs/tasks/manage-kubernetes-objects/declarative-config/#alternative-kubectl-apply-f-directory-prune .

microk8s supports both modes of --prune. Maybe the old prune with --namespace could be enough?