zalando / postgres-operator

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

Add ClusterRole and ClusterRoleBinding to support using bypass_api_service patroni option #2217

Open agrevtsev opened 1 year ago

agrevtsev commented 1 year ago

Hi team! Patroni supports bypass_api_service option, which allows it to connect to kubernetes endpoints directly, instead going over KUBERNETES_SERVICE_HOST (which is usually some LB, pointing to master nodes). For resolving such endpoints, it queries /api/v1/namespaces/default/endpoints/kubernetes which should be explicitly allowed. My proposal is to

  1. Create dedicated ClusterRole, to permit GET against /api/v1/namespaces/default/endpoints/kubernetes
  2. Create ClusterRoleBinding for pod service account (used by postgres & patroni pods), when cluster is created, by the means of operator.

Br, Alex

MatthiasLohr commented 5 months ago

Any progress on this?

@agrevtsev, did you find a work-around?