Controller errors when enabling tls with the kubernetes operator

We have been experimenting with the kubernetes operator in GCP, and it works great without TLS. When trying to follow the guidelines on setting up TLS, the controller ends up in a error loop, only logging

2020-02-19T19:44:31.149Z        ERROR   controller-runtime.controller   Reconciler error        {"controller": "foundationdbcluster", "request": "default/<cluster-name>", "error": "open : no such file or directory"}*zapLogger).Error

This happens as long as the sidecar is happy with its TLS parameters (otherwise the sidecar fails and the controller never gets to this point). We would like to help out on the operator if possible, but it’s a complicating factor that the error gives no indication on where in the controller the error happened, the stack trace seems to be entirely from the k8s controller framework.

Any hints on what could be the reason, or how to efficiently investigate this would be appreciated.

EDIT: I forked the operator and added some stack traces to the errors, using the package So far this has told me that the operator is failing to get pod clients in

EDIT2: The reason it failed was that the controller needs to have TLS environment variables set up when talking to a TLS enabled cluster, it failed here: Maybe I missed something, but I can’t remember seeing any documentation that the controller needs to be able to talk to the pods over TLS, though in hindsight it seems obvious. I think improving the error messages here could go a long way to reduce debug time.

Thanks for that feedback. I agree that we should make the error messages clearer, and also make the documentation clearer. We set the TLS environment variables up in the development environment, but not in the samples for running the operator in a real environment. The reason for that is that I don’t know of a general-purpose solution for getting the certs set up in a way that is secure and provides appropriate fields for restricting access to a cluster. It’s a big gap in our solution that we should make clear, since it’ll be common for people to want to run with TLS.