I had istio configured but without the CNI addon enabled.
In that time, I had an init container with a service account that would call the Kubernetes API to verify a couple of things (via kubectl).
Since I enabled the CNI addon, this init container fails with the following message:
The connection to the server 10.23.64.1:443 was refused - did you specify the right host or port?
I tried removing all my network policies to see if that was the issue, but same result. I also gave the service account that this pods uses the cluster-admin role, but it didn't do the trick.
I tested with both 1.6 and 1.7 branches of Istio.
What is the issue here? Other pods without this init container work fine.
In order to have init container network connectivity with istio cni enabled please follow the guide for a workaround from istio documentation: