More about Kubernetes Storage
- Kubernetes Volume Cloning with Cloud Volumes ONTAP
- Container Storage Interface: The Foundation of K8s Storage
- Kubernetes Deployment vs StatefulSet: Which is Right for You?
- Kubernetes for Developers: Overview, Insights, and Tips
- Kubernetes StatefulSet: A Practical Guide
- Kubernetes CSI: Basics of CSI Volumes and How to Build a CSI Driver
- Kubernetes Management and Orchestration Services: An Interview with Michael Shaul
- Kubernetes Database: How to Deploy and Manage Databases on Kubernetes
- Kubernetes and Persistent Apps: An Interview with Michael Shaul
- Kubernetes: Dynamic Provisioning with Cloud Volumes ONTAP and Astra Trident
- Kubernetes Cloud Storage Efficiency with Cloud Volumes ONTAP
- Data Protection for Persistent Data Storage in Kubernetes Workloads
- Managing Stateful Applications in Kubernetes
- Kubernetes: Provisioning Persistent Volumes
- An Introduction to Kubernetes
- Google Kubernetes Engine: Ultimate Quick Start Guide
- Kubernetes Persistent Volumes, Claims, Storage Classes, and More
- Azure Kubernetes Service Tutorial: How to Integrate AKS with Azure Container Instances
- Kubernetes Workloads with Cloud Volumes ONTAP: Success Stories
- Container Management in the Cloud Age: New Insights from 451 Research
- How to Use NetApp Cloud Manager with Trident for Provisioning Persistent Volumes in Kubernetes Deployments
- Kubernetes Storage: An In-Depth Look
- Monolith vs. Microservices: How Are You Running Your Applications?
- How to Set Up MySQL Kubernetes Deployments with Cloud Volumes ONTAP
- Kubernetes Shared Storage: The Basics and a Quick Tutorial
- Kubernetes NFS Provisioning with Cloud Volumes ONTAP and Trident
- Azure Kubernetes Service How-To: Configure Persistent Volumes for Containers in AKS
- Kubernetes NFS: Quick Tutorials
- NetApp Trident and Docker Volume Tutorial
Kubernetes storage provides excellent support for stateful applications, such as MySQL, through the use of persistent volumes, which are used to create permanent data storage for pods and containers. This allows you to deploy and manage all of the constituent services that make up your enterprise architecture using a single, scalable platform.With NetApp Trident, the underlying storage for persistent volumes can be allocated using Cloud Volumes ONTAP, which brings enterprise-grade data management to containerized applications in your Kubernetes cluster.
In this article, we discuss the benefits of deploying database storage with Cloud Volumes ONTAP, and demonstrate the way in which MySQL Kubernetes deployments can be set up using NetApp Trident.
Setting up Kubernetes MySQL in Kubernetes with Cloud Volumes ONTAP
Cloud Volumes ONTAP is NetApp’s cloud-based data management platform for AWS and Azure. Building on native cloud compute and AWS and Azure storage resources, Cloud Volumes ONTAP offers a comprehensive set of features for working with data storage, from storage space efficiencies that dramatically reduce cloud storage costs to enterprise-grade data protection. Containerized applications deployed to Kubernetes can benefit from these features by using the NetApp Trident storage provisioner, which enables persistent volumes to be created directly in Cloud Volumes ONTAP.
For database services, Cloud Volumes ONTAP delivers critical data protection features. For example, ONTAP Snapshots™ provide instant backup and instant restore for databases of any size. These snapshots are also very storage efficient, requiring only enough space to keep them consistent with the point-in-time to which they relate. Creating snapshots with NetApp SnapCenter® ensures that database I/O is properly quiesced beforehand, which is necessary for reliable backups.
Cloud Volumes ONTAP HA provides high availability across Availability Zones for Kubernetes persistent volumes, which improves upon the redundancy within an Availability Zone usually provided by iSCSI cloud storage solutions. In the event of a failure, the storage can be seamlessly failed over to provide uninterrupted access for clients and applications actively using the storage.
NetApp SnapMirror® provides efficient, block-level data replication between ONTAP storage services, whether on-premises or in the cloud with AWS or with Azure. This allows for persistent volumes to be mirrored either for DR purposes or archived for long-term backups, to a secondary location that may exist in a different region. After making an initial baseline copy of the source data to the destination, each subsequent synchronization only transfers the changes made to the source data since the last time it ran.
There are many additional advantages to using Cloud Volumes ONTAP for database storage. One of these is storage tiering, which is the ability to automatically and transparently move cold data to low cost object storage, such as Amazon S3 and Azure Blob. On access, the data is moved back to the performance tier for faster access. This feature can be used to make cloud storage more cost effective for large databases that contain a lot of infrequently used, historical data.
Another extremely useful feature is NetApp FlexClone®, which gives DevOps and database administrators the power to instantly clone existing persistent volumes without needing to make an additional copy of the data. This feature has been integrated into NetApp Trident, which allows clones to be created through persistent volume claims. Cloning makes it very easy to set up temporary, writable copies of a database for testing.
How to Set Up MySQL Databases
MySQL is a popular flavor of SQL database. The following provides an example of deploying a single Kubernetes MySQL instance using NetApp Trident.
First, we will create a persistent volume claim for the storage we need. As Trident uses dynamic provisioning, we will specify a storage class, which must have been setup prior to executing this manifest. Each storage class defines the provisioner to be used, along with any other provisioner-specific settings that will determine how the storage is provisioned.
When this claim is used by a pod, Trident will automatically create a 100 GiB high-performance storage volume in Cloud Volumes ONTAP to fulfil the request. This storage class may have been implemented to make use of Amazon EBS Provisioned IOPS disks, for example. A reclaim policy of “retain” has also been specified, which will prevent the persistent volume from being deleted if the pod releases the claim.
We can now bind a pod to this storage by referencing it in our MySQL deployment manifest. As shown below, we simply need to reference our previously defined persistent volume claim and specify where the bound persistent volume should be mounted within our MySQL Kubernetes container.
We can additionally set up test instances of our Kubernetes MySQL database using Trident’s integration with NetApp FlexClone. The following persistent volume claim manifest demonstrates how this can be done.
We simply annotate our claim with the name of the persistent volume claim to clone from, and Trident takes care of the rest by automatically finding the source storage volume in Cloud Volumes ONTAP and performing a NetApp FlexClone operation. The default reclaim policy of delete will ensure that the clone volume is automatically deleted when it is no longer required.
Kubernetes provides a complete solution for running both stateless and stateful applications, with the extensible flexibility to integrate with various cloud storage solutions through its persistent volumes and provisioner paradigms. NetApp Trident makes it possible to integrate Kubernetes with Cloud Volumes ONTAP, giving access to a whole host of data protection and data management benefits that are vital for running database platforms, including MySQL Kubernetes deployments.