Disk
Storage is required to store persistent data in a Container. Read more about Kubernetes Storage.
Storage Class
Container Stack provides a list of Storage Classes for you to provision Persistent Storage.
To know more on Storage Class, please visit Kubernetes docs.
ReadWriteOnce access mode requires all workloads to reside in the same host. Please take your service use case into consideration, as it’ll restrict your workload HA capabilities.
Refer to Kubernetes documentation to learn more about Storage Class and Access Mode.
AWS Storage Classes
| Storage Class | Storage Type | Access Modes | Description |
|---|---|---|---|
| ebs-gp2 | EBS gp2 | ReadWriteOnce | Default StorageClass (SSD) |
| ebs-sc1 | EBS sc1 | ReadWriteOnce | Cold HDD Volume |
| ebs-st1 | EBS st1 | ReadWriteOnce | Throughput optimised HDD |
| ebs-10iops-per-gb | EBS io1 | ReadWriteOnce | Provisioned throughput of 10iops per GiB requested |
| ebs-20iops-per-gb | EBS io1 | ReadWriteOnce | Provisioned throughput of 20iops per GiB requested |
| ebs-30iops-per-gb | EBS io1 | ReadWriteOnce | Provisioned throughput of 30iops per GiB requested |
| ebs-50iops-per-gb | EBS io1 | ReadWriteOnce | Provisioned throughput of 50iops per GiB requested |
| fsx-hdd | FSx HDD | ReadWriteMany | Throughput 12MiB/s / TiB provisioned |
| fsx-ssd | FSx SSD | ReadWriteMany | Throughput 50MiB/s / TiB provisioned |
Other storage options are available, such as Block Storage.
Additional Resources
EBS
EBS Persistent Volumes can only be deployed in a ReadWriteOnce mode. EBS refers to the AWS Elastic Block Store.
Deployment
Deployment of an EBS Persistent Volume is done through the cstack-manifest.
To deploy an EBS PV refer to the following code:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: ebs-pvc
namespace: <your-namespace>
spec:
storageClassName: ebs-gp2 # Replace with the relevant storage class
resources:
requests:
storage: 4GiBackups and Restore
By default, all Persistent Volumes are backed up by CStack for a period of up to 5 years in production.
In addition to the default backups made, users are able to create additional snapshots of their EBS for their own purposes.
User Defined Snapshots
Snapshots for EBS are made through cstack-manifest.
apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshot
metadata:
name: ebs-pvc-snapshot
namespace: <your-namespace>
spec:
volumeSnapshotClassName: csi-ebs-aws-vsc
source:
persistentVolumeClaimName: ebs-pvcRestore From User Defined Snapshots
Restoration of an EBS from a Snapshot is made through cstack-manifest.
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: ebs-pvc-restored
namespace: <your-namespace>
spec:
storageClassName: ebs-gp2 # Replace with the relevant storage class
resources:
requests:
storage: 4Gi
dataSource:
name: ebs-pvc-snapshot
kind: VolumeSnapshot
apiGroup: snapshot.storage.k8s.ioRestore From Default Backups
To restore an EBS from a backup that is not user-defined, please contact CStack support.
FSx
EBS Persistent Volumes can be deployed in a ReadWriteMany mode. FSx refers to the AWS FSx for Lustre Storage.
Deployment
Deployment of an EBS Persistent Volume is done through the cstack-manifest.
To deploy an EBS PV:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: fsx-pvc
namespace: <your-namespace>
spec:
storageClassName: fsx-ssd # Replace with the relevant storage class
accessModes:
- ReadWriteMany
resources:
requests:
storage: 1200Gi # Minimum size for fsx-ssdStorage Classes
| Storage Class | Storage Type | Access Modes | Throughput | Block Sizes |
|---|---|---|---|---|
| fsx-ssd | FSx SSD | ReadWriteMany | 50MiB/s / TiB provisioned | Multiples of 2.4TiB; OR 1.2TiB |
FSx instances may be quite pricey, please check the pricing and evaluate its suitability for your project.
Backups and Restore
By default, all Persistent Volumes are backed up by CStack for a period of up to 5 years in production.
Users are able to restore their FSx volume using CStack’s reference application aws-backup-vault. Follow the wiki page on how to setup this application in your project namespace.
Once you have performed the restoration, the application will generate PVC manifest and you will need to commit them into your project’s cstack-manifests repository.
Example of the generated manifest:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
labels:
container.stack.gov.sg/backup: fsx.ap-southeast-1.amazonaws.com
name: pvc-fs-12345678901234567
namespace: <your_namespace>
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 1200Gi
volumeName: fs-12345678901234567