Panfactum LogoPanfactum
Bootstrapping StackStorage Interfaces

Container Storage Interface (CSI) Drivers

Objective

Deploy the various CSI drivers used by the Panfactum stack.

Background

Compared to networking, storage in kubernetes is relatively straightforward. Storage is exposed to pods via two mechanisms:

The primary use case for CSI is for attaching storage managed by cloud providers (e.g., AWS EBS). That said, this interface is extremely flexible and can also be used by other utilities to directly mount files inside your pods.

Deploy AWS EBS CSI Driver

The AWS EBS CSI Driver allows you to provision EBS volumes for use in your pods. This is the recommended way to store stateful data (i.e., Database storage) within the Panfactum stack.

We provide the kube_aws_ebs_csi module to deploy the driver.

Let's deploy it now:

  1. Create a new directory adjacent to your aws_eks module called kube_aws_ebs_csi.

  2. Add a terragrunt.hcl to that directory that looks like this.

  3. Run pf-tf-init to enable the required providers.

  4. Run terragrunt apply.

  5. Verify the pods deployed successfully:

    AWS EBS CSI launched successfully

Storage Classes

Note that there are now a couple StorageClass resources in the cluster:

Storage classes in the cluster

The following classes were installed by the kube_aws_ebs_csi module:

  • ebs-standard: Uses gp3 volumes and deletes the volumes automatically when the utilizing resource is deleted (default)
  • ebs-standard-retained: Uses gp3 volumes but never deletes the underlying volumes (recommended for production databases)

Next Steps

We will test the storage drivers in the next section where we deploy Vault (which needs persistent storage).

PreviousNext
Panfactum Bootstrapping Guide:
Step 10 /20

Footnotes

  1. This type of storage should be considered ephemeral (temporary) as it inherently linked to the lifetime of the underlying nodes. In the Panfactum stack, nodes can be replaced at any time.