Is it recommended to run a clustered database with Kubernetes in a production environment?

Can Kubernetes be used for a clustered database such as MySQL in a production environment?

Examples of configurations exist, such as the mysql galera example . However, most examples do not use persistent volumes. As I understand it, persistent volumes must reside in some common file system, as defined here Kubernetes contiguous volume types . A shared file system does not guarantee that the module database files will be local to the machine on which the module is located. It will be available over a network that is rather slow. In addition, there are problems with MySQL and NFS, for example.

This may be acceptable for a test environment. However, what should I do in a production environment? Is it better to start a database cluster outside of Kubernetes and only run application servers with Kubernetes?

+7
database mysql production-environment kubernetes
source share
1 answer

The Kubernetes project introduces PetSets, a new block management abstraction designed to run stateful applications. This is an alpha feature currently (starting with version 1.4) and is moving fast. A list of different questions when switching to the beta version is presented here . Quote from the section when to use billboards :

PetSet ensures that a certain number of "pets" with unique identifiers will work at any given time. Pet identity consists of:

  • stable hostname available in DNS
  • ordinal index
  • stable storage: associated with serial number and host name

In addition to the above, it can be associated with several other features that help deploy and manage state-supported cluster applications. For example, in combination with dynamic volume backup , it can be used to automatically store storage.

Several YAML configuration files are available (for example, the ones you referenced) using ReplicaSets and Deployments for MySQL and other databases that can be run in production and probably also run this way. However, PetSets is expected to greatly facilitate the execution of these types of workloads by supporting updates, maintenance, scaling, etc.

The following are examples of distributed pet databases here .


The advantage of providing persistent volumes that are network and non-local (such as GlusterFS) is realized on a scale. However, for relatively small clusters, there is a proposal that allows future local storage in the future.


+4
source share

All Articles