hall / kubenix

Kubernetes management with Nix
https://kubenix.org/
MIT License
319 stars 30 forks source link

Deprecated: kubectl apply will no longer prune non-namespaced resources by default #47

Open pizzapim opened 1 year ago

pizzapim commented 1 year ago

Running the built-in deployer yields the following warning:

# result/bin/kubenix
W1128 21:21:52.260311  310470 prune.go:71] Deprecated: kubectl apply will no longer prune non-namespaced resources by default when used with the --namespace flag in a future release. To preserve the current behaviour, list the resources you want to target explicitly in the --prune-allowlist flag.

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

Running this on NixOS 23.05 with the k3s service.

pizzapim commented 4 months ago

Apparently there exists an experimental feature called ApplySets, which might be something Kubenix can use for pruning: https://kubernetes.io/blog/2023/05/09/introducing-kubectl-applyset-pruning/

mibmo commented 1 month ago

also having this issue. Any plans to update kubenix to deal with this? doesn't seem like pruning works at all in kubenix anymore. Would be happy to help; might be as simple as adding --prune-allowlist ... to the kubectl invocations?