Could not get apiVersions from Kubernetes
Upgrading helm to 2.16 fails in CI when deploying nginx-controller, see Job #9363:
Could not get apiVersions from Kubernetes: unable to retrieve the complete list of server APIs: webhook.cert-manager.io/v1beta1: the server is currently unable to handle the request
This is a bug reported to cert-manager, which seems to be a timing issue.
In our case it happens when installing nginx directly after installing cert-manager. I tried re-running the helmfile apply for nginx afterwards on the failed CI machine manually and it worked.
So the solution is retrying the helmfile apply task multiple times, which succeeds after an intial error.