Skip to content

Instantly share code, notes, and snippets.

@AndrzejKomarnicki
Last active May 16, 2024 16:26
Show Gist options
  • Save AndrzejKomarnicki/3926bae40060cb07a66a3f193cbbcd7e to your computer and use it in GitHub Desktop.
Save AndrzejKomarnicki/3926bae40060cb07a66a3f193cbbcd7e to your computer and use it in GitHub Desktop.
AWS EBS CSI StorageClass for K8s with encryption, dynamic provisioning, and volume resizing support
# Recommended to be running at least K8s 1.15 or higher
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: ebs-csi-encrypted
provisioner: ebs.csi.aws.com
volumeBindingMode: WaitForFirstConsumer
allowVolumeExpansion: true
reclaimPolicy: Delete # set to Retain if you don't wante the volume to be deleted after the PVC is deleted
parameters:
type: gp2
fstype: ext4
encrypted: "true"
# kmsKeyID: "" // optional, default KMS is used when no ARN is specified
# Could be used to restrict which AZ the volume should be provisioned in -
# optional in most cases if volumeBindingMode is set to WaitForFirstConsumer:
# allowedTopologies:
# - matchLabelExpressions:
# - key: topology.ebs.csi.aws.com/zone
# values:
# - us-east-1a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment