zalando / postgres-operator

Postgres operator creates and manages PostgreSQL clusters running in Kubernetes
https://postgres-operator.readthedocs.io/
MIT License
4.22k stars 968 forks source link

TLS certs only readable by root #1408

Open nyxi opened 3 years ago

nyxi commented 3 years ago

Please, answer some short questions which should help us to understand your problem / question better?

PostgreSQL can't read the TLS certificate and key provided by cluster configuration:

tls:
  secretName: my-tls-secret
# ls -l /tls
total 0
lrwxrwxrwx 1 root root 14 Mar 16 09:18 tls.crt -> ..data/tls.crt
lrwxrwxrwx 1 root root 14 Mar 16 09:18 tls.key -> ..data/tls.key

# ls -l /tls/..data/
total 8
-rw-r----- 1 root root 1135 Mar 16 09:18 tls.crt
-rw-r----- 1 root root 1704 Mar 16 09:18 tls.key
FATAL:  could not load server certificate file "/tls/tls.crt": Permission denied
FxKu commented 3 years ago

Maybe setting spilo_fsgroup can help you? See user docs.

nyxi commented 3 years ago

Ah okay, I will give this a try. It would really be helpful to have a mention of this in the reference documentation for the cluster spec also.