From 2d0fa393b51f7acd984d0ff831854a6acfadf55e Mon Sep 17 00:00:00 2001 From: Justin Santa Barbara Date: Sun, 5 Jul 2015 09:27:53 -0400 Subject: [PATCH] AWS: Add docs to volumes.md for EBS Describes how to create EBS volumes & the syntax for a pod. Derived from GCE PV docs. --- docs/volumes.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/docs/volumes.md b/docs/volumes.md index 110bb74967b..42f7d88bbea 100644 --- a/docs/volumes.md +++ b/docs/volumes.md @@ -81,6 +81,52 @@ spec: pdName: test fsType: ext4 ``` + +### AWSElasticBlockStore +__Important: You must create an EBS volume using ```aws ec2 create-volume``` or the AWS API before you can use it__ + +A Volume with an awsElasticBlockStore property allows access to files on a AWS +[EBS volume](http://aws.amazon.com/ebs/) + +There are some restrictions when using an awsElasticBlockStore volume: + +* the nodes (what the kubelet runs on) need to be AWS EC2 instances +* those instances need to be in the same region and availability-zone as the EBS volume +* EBS only supports a single EC2 instance mounting a volume + +#### Creating an EBS volume +Before you can use a EBS volume with a pod, you need to create it. + +```sh +aws ec2 create-volume --availability-zone eu-west-1a --size 10 --volume-type gp2 +``` + +Make sure the zone matches the zone you brought up your cluster in. (And also check that the size and EBS volume +type are suitable for your use!) + +#### AWS EBS Example configuration: +```yaml +apiVersion: v1 +kind: Pod +metadata: + name: testpd +spec: + containers: + - image: kubernetes/pause + name: testcontainer + volumeMounts: + - mountPath: /testpd + name: testvolume + volumes: + - name: testvolume + # This AWS EBS volume must already exist. + awsElasticBlockStore: + volumeID: aws:/// + fsType: ext4 +``` + +(Note: the syntax of volumeID is currently awkward; #10181 fixes it) + ### NFS Kubernetes NFS volumes allow an existing NFS share to be made available to containers within a pod.