k3s-io / helm-controller

Apache License 2.0
391 stars 85 forks source link

Revert PodFailurePolicy in favor of rejecting v2 charts in the controller #242

Closed brandond closed 3 months ago

brandond commented 3 months ago

Turns out using PodFailurePolicy leaves a bunch of old pods around instead of just restarting the containers. Rather than pollute the cluster with failed pods when installation is successfully retried, lets just reject v2 charts at the controller level. Add status conditions and an Event to report this, for better visibility.

Example output when the pod is recreated due to PodFailurePolicy, instead of just restarting the job container:

NAMESPACE     NAME                                      READY   STATUS      RESTARTS   AGE
kube-system   coredns-576bfc4dc7-l8hvn                  1/1     Running     0          22s
kube-system   helm-install-traefik-crd-dpvth            0/1     Completed   0          22s
kube-system   helm-install-traefik-h94jj                0/1     Completed   0          8s
kube-system   helm-install-traefik-x4sl7                0/1     Error       0          22s
kube-system   local-path-provisioner-6795b5f9d8-pb7mj   1/1     Running     0          22s
kube-system   metrics-server-557ff575fb-zfnr9           1/1     Running     0          22s
kube-system   svclb-traefik-c50d9682-zwb6v              2/2     Running     0          7s
kube-system   traefik-5fb479b77-swxcg                   1/1     Running     0          8s