[Yandex Cloud documentation](../../index.md) > [Yandex Managed Service for Kubernetes](../index.md) > FAQ > Data storage

# Data storage

* [What should I consider when using disk storage for a database, such as MySQL® or PostgreSQL, deployed in a Kubernetes cluster?](#bd)

* [How do I connect a pod to managed Yandex Cloud databases?](#mdb)

* [How do I correctly attach a persistent volume to a container?](#persistent-volume)

* [What types of volumes does Managed Service for Kubernetes support?](#supported-volumes)

#### What should I consider when using disk storage for a database, such as MySQL® or PostgreSQL, deployed in a Kubernetes cluster? {#bd}

For a database deployed in a Kubernetes cluster, use [StatefulSet](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/) controllers. We do not recommend running stateful services with persistent volumes in Kubernetes. To work with databases of stateful applications, use [Yandex Cloud managed databases](https://yandex.cloud/en/services#data-platform), e.g., Managed Service for MySQL® or Managed Service for PostgreSQL.

#### How do I connect a pod to managed Yandex Cloud databases? {#mdb}

To connect to a [Yandex Cloud managed database](https://yandex.cloud/en/services#data-platform) in the same [network](../../vpc/concepts/network.md#network), specify its [host name and FQDN](../../compute/concepts/network.md#hostname).

To connect a database certificate to a [pod](../concepts/index.md#pod), use the `secret` or `configmap` objects.

#### How do I correctly attach a persistent volume to a container? {#persistent-volume}

You can choose how to attach Compute Cloud [disks](../../compute/concepts/disk.md) depending on your use case:
* If you need Kubernetes to automatically provision a `PersistentVolume` and configure a new disk, create a pod with a [dynamically provisioned](../operations/volumes/dynamic-create-pv.md) volume.
* To use existing Compute Cloud volumes, create a pod with a [statically provisioned](../operations/volumes/static-create-pv.md) pod.

For more information, see [Working with persistent volumes](../concepts/volume.md#persistent-volume).

#### What types of volumes does Managed Service for Kubernetes support? {#supported-volumes}

Managed Service for Kubernetes supports temporary (`Volume`) and persistent (`PersistentVolume`) volumes. For more information, see [Volume](../concepts/volume.md).