Last active
November 27, 2017 20:38
-
-
Save rk295/4370fe458809c4deef87f65a68985230 to your computer and use it in GitHub Desktop.
Sample deployment of a new StorageClass which uses GP2 encrypted volumes, defines a new PersistentVolumeClaim and finaly maps this volume into a pod.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
apiVersion: storage.k8s.io/v1 | |
kind: StorageClass | |
metadata: | |
annotations: | |
storageclass.beta.kubernetes.io/is-default-class: "false" | |
labels: | |
k8s-addon: storage-aws.addons.k8s.io | |
name: gp2-encrypted | |
parameters: | |
encrypted: "true" | |
type: gp2 | |
provisioner: kubernetes.io/aws-ebs | |
--- | |
apiVersion: v1 | |
kind: PersistentVolumeClaim | |
metadata: | |
name: gp2-encrypted | |
namespace: default | |
spec: | |
storageClassName: gp2-encrypted | |
accessModes: | |
- ReadWriteOnce | |
resources: | |
requests: | |
storage: 1Gi | |
--- | |
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: gp2-encryption-test | |
namespace: default | |
spec: | |
containers: | |
- image: nginx | |
imagePullPolicy: IfNotPresent | |
name: gp2-encryption-test | |
ports: | |
- containerPort: 80 | |
name: http | |
protocol: TCP | |
volumeMounts: | |
- mountPath: /data | |
name: gp2-encrypted | |
volumes: | |
- name: gp2-encrypted | |
persistentVolumeClaim: | |
claimName: gp2-encrypted |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Quick demo showing dynamic Encrypted EBS volume provisioning and pod attachment. The AWS console proves this: