FREE

Understanding Kubernetes Storage Best Practices

You have to complete/review all lessons in this course to receive your badge!

Complete the lab to learn about the different storage classes, volume types and snapshots in Kubernetes, and how Kubernetes-native application backup and recovery works using Kasten K10 by Veeam.

What is the structure of the Course?

The course consists of two sections.  The first covers Kubernetes Storage theory. The second provides hands-on keyboard command line experience. Each section is approximately 30 minutes long, however, your time may vary, depending on how quickly you pass either section.

There are a total of 9 challenges to complete during the lab.

Important: On multiple-choice questions, note that more than one answer may be correct. The lab is timed, so it’s best to complete in one sitting.

Section 1:  Theory – Background on Kubernetes Storage

This section will cover background topics and terminology for Kubernetes storage.  Each topic will review material on-screen, then pose a challenge question. You must answer the question correctly to proceed to the next section.

The theory section includes the following topics:

  • Topic 1: Introduction to Kubernetes Storage
  • Topic 2: Kubernetes Volumes and Storage Types
  • Topic 3: Ephemeral Volumes
  • Topic 4: Persistent Volumes
  • Topic 5: Projected Volumes
  • Topic 6: Kubernetes Volume Snapshots and Volume Snapshot Classes
  • Topic 7: Protecting Applications with Kasten K10
  • Topic 8: Kubernetes Storage Best Practices

Topic 1: Introduction to Kubernetes Storage  

Kubernetes storage is based on the Kubernetes volume.  A volume can be thought of as a directory that is accessible to the container in a pod. A pod can use any number of volume types simultaneously.

Kubernetes supports several types of volumes:

  • emptyDir
  • hostPath
  • Local
  • nfs
  • fc (fibre channel)
  • gcePersistentDisk
  • awsElasticBlockStore
  • azureDisk
  • azureFile
  • Cephfs

During the introduction, we’ll also cover the Container Storage Interface (CSI), volume plugins and how storage works.

CSI (Container Storage Interface) is a standard for exposing arbitrary block filestore systems to the containerized workload on container orchestration systems such as Kubernetes. CSI providers can write plugins, and those can be used in Kubernetes to extend storage capabilities.

Topic 2: Kubernetes Volumes and Storage Types

In Kubernetes, all containers are ephemeral and a Kubernetes volume is an abstraction implemented to solve two problems:

  1. Loss of files when a container crashes
  2. Sharing files between containers running together in a pod

Volumes fall under three major categories:

  • Persistent volumes
  • Ephemeral volumes
  • Projected volumes

Persistent volumes exist beyond the lifetime of a pod.  Ephemeral volumes will be destroyed when a pod is destroyed. A projected volume maps several existing volume sources into the same directory.

Storage Classes 

Storage classes provide a way to describe different types of storage available for Kubernetes. Storage classes are defined by Kubernetes cluster administrators using the StorageClass Resource.

Administrators can map different classes based on quality-of-service levels and backup policies, or to arbitrary policies derived from storage requirements.

Each storage class has an associated provisioner that determines what volume plugin is used for provisioning the persistent volumes.

Example plugins:

  • AWSElasticBlockStore
  • AWS EBS
  • AzureFile
  • Azure File
  • NFS
  • NFS
  • Cinder
  • OpenStack Cinder

Topic 3: Ephemeral Volumes 

Generic ephemeral volumes are a newer feature and are in beta (enabled by default) as of Kubernetes 1.21. These volumes also work with typical storage operations such as snapshotting, cloning, resizing, and storage capacity tracking.

Types of ephemeral storage:

  • emptyDir
  • configMap, downwardAPI, secret
  • CSI ephemeral volumes
  • generic ephemeral volumes

More information on this topic is available here.

Topic 4: Persistent Volumes  

A persistent volume is a resource in the cluster and has a life cycle independent of any individual pod that uses persistent volumes. Examples of persistent volumes are:

  • NFS
  • iSCSI

A volume claim is a request for storage by a user. It is similar to a pod. Pods consume node resources, and PVCs consume PV resources.

Persistent Volume Lifecycle

The persistent volume lifecycle consists of these components:

  • Provisioning
  • Static
  • Dynamic
  • Binding
  • Using
  • Reclaiming
  • Retaining
  • Deleting

More information on this topic can be found here.

Topic 5: Projected Volumes

A projected volume maps several existing volume sources into the same directory.

It automatically populates a single volume to create a single directory with the keys from multiple Secrets, ConfigMaps and downstream API information.

More information on this topic can be found at this link

Topic 6: Kubernetes Volume Snapshots and Volume Snapshot Classes

Volume snapshots provide a standardized way to copy volumes of content at a particular point in time, without creating a new volume. This capability enables administrators to perform various backup operations in Kubernetes.

A VolumeSnapshotContent is a snapshot taken from a volume in the cluster that has been provisioned by an administrator. It is a resource in the cluster just like a PersistentVolume is a cluster resource.

A VolumeSnapshot is a request for a snapshot of a volume by a user. It is similar to a PersistentVolumeClaim.

VolumeSnapshotClass enables you to specify different attributes belonging to a VolumeSnapshot. These attributes may differ among snapshots taken from the same volume on the storage system and, therefore, cannot be expressed by using the same StorageClass of a PersistentVolumeClaim.

More information on this topic can be found here.

Topic 7: Kasten K10 Backups and DR

This topic describes how volume snapshot classes are used by Kasten K10, and how Kasten K10 offers persistent backups and Disaster Recovery (DR).

More information on this topic can be found here.

Topic 8:  Storage Best Practices

This section summarizes the theory section of the lab with the top suggested best practices to successfully implement storage in Kubernetes, including key thoughts on:

  • Architecture
  • Recoverability
  • Operations
  • Security
  • Application portability

Section 2: Hands-on Commands — Storage 

In this section, you will use hands-on commands to configure ephemeral, projected and persistent volumes, as well as snapshots. You will also employ Kasten K10 to perform a test backup and recovery operation based on all the storage theory covered in Section 1.

Is there pre-work for the lab?

Yes. Be sure to complete reading and studying this blog post, the video showing the work to be performed during the lab, and the accompanying slides.

Note: Additional Learning

To extend the learning experience, Kasten offers a variety of resources such as whitepaperscase studiesdata sheets and eBooks on Kubernetes backup.

Ready to start?

Take the skill level self-assessment quiz

Share

Welcome to the KubeCampus Learning Community!

Learning.Kasten.io has now relaunched and re-branded as KubeCampus.io​

For technical support with KubeCampus.io please email [email protected].

Connect with other users and Kasten support on Kasten’s Learning Slack Channel.

Download
Kasten K10 free now

Kasten K10