You need to override Kubernetes' built-in controllers to customize them to the details of the database, for example when is it safe to failover, or when is it safe to scale down. Outside of Kubernetes these decisions are made by cloud services like RDS, or manually by people with knowledge like DBAs.
To put that knowledge into Kubernetes you need Custom Resource Definitions (CRDs).
I know know if it is any good, but I just found a project called KubeDB that has CRDs for various DBs: https://kubedb.com/ and https://github.com/kubedb