postgres-operator
postgres-operator copied to clipboard
Generate part of the PostgresCluster object status the binding.name = secret
Overview
Generate part of the PostgresCluster object status a new field binding.name which includes the name of the secret which has been created and which contains the data allowing to access the DB such as. The secret should also been aligned with the Service Binding spec.
Example of secret and data
apiVersion: v1
kind: Secret
metadata:
name: production-db-secret
type: servicebinding.io/mysql
stringData:
type: mysql
provider: bitnami
host: localhost
port: 3306
username: root
password: root
Use Case
When the Postgres Operator is deployed on kubernetes where the ServiceBinding Operator is used, we need a way to communicate to the Service Binding how it is possible to fetch the secret containing the data allowing to access the DB.
The service binding (and/or an additional service) will in this case query as defined part of the spec the .staus.binding.name to find the secret to be used to bind a service with a microservice.
Several services already support the spec and have implemented it:
- RabbitMQ: https://github.com/servicebinding/spec#provisioned-service
- Tanzu PostgreSQL: https://docs.vmware.com/en/VMware-Tanzu-SQL-with-Postgres-for-Kubernetes/1.5/tanzu-postgres-k8s/GUID-creating-service-bindings.html
Here is an example from RabbitMQ Operator: https://github.com/rabbitmq/cluster-operator/blob/f79f2a571077a89e47f6e8350a7adc4586138848/api/v1beta1/rabbitmqcluster_status.go#L20
The application developer will consume bindings as explained in this document: https://servicebinding.io/application-developer/
What is the status of this request ?
@cmoulliard We have created an enhancement story in our backlog and will consider adding it in a future release. Thanks for submitting the issue.
Re-opening until we complete the story.