Containers are designed to be able to regulate resource usage through the use of cgroups, and so as long as we are able to predict usage, we should have no issue (with performance) running it in a container. There are other considerations besides the resource usage, however.
In an architecture like Kubernetes, it becomes more complex to manage database deployments, in part because containers are now ephemeral. If a pod goes down on a given node, there is no guarantee it will be brought back up on that same node, and so special considerations need to be made for stateful applications (pod must be mounted to the same volume on relaunch, etc). This is where constructs like StatefulSets come in. So, it works, and the solutions and very well thought out, but there are a few more operational hoops to jump through.
There are also things like Operators that can handle the complex needs of bringing up and managing a stateful application like a database or distributed message queue. These projects can be quite green at times, but there's a lot of behavior that would be tough to orchestrate on bare metal that we get right out of the box.
More or less, at the end of the day, running stateful applications like databases or message queues on Kubernetes (or other container orchestrators) is a contentious topic. Like all design decisions, there are tradeoffs with resilience, complexity, and debuggability. Lots of large companies are doing it in production, so it's by no means unreasonable.