PodSecurityPolicy
was removed from K8s since v1.25.
Our GKE cluster had been forcely upgraded to v1.25 from v1.24 and we forgot to
retire the PodSecurityPolicy
resources in the chart, so the subsequent helm
upgrade from pipeline failed due to the disappearance of PodSecurityPolicy
kind and version policy/v1beta1
.
Even if I disabled the PodSecurityPolicy from the chart but the helm upgrade still would reference to the resource from existing release and the “not found” showed up:
1 | [2023-07-08T01:12:20.712Z] ARGS: |
The helm uninstall on existing release also failed and got stuck with the same reason:
1 | helm uninstall <release name> -n <ns> --no-hooks |
The fix is
simple by a helm plugin mapkubeapis
:
1 | helm plugin install https://github.com/helm/helm-mapkubeapis |
1 | helm history <release name> -n <ns> |
Then the next helm uninstall/upgrade should be good.