k3s/examples/volumes/aws_ebs/README.md

38 lines
1.1 KiB
Markdown
Raw Normal View History

This is a simple web server pod which serves HTML from an AWS EBS
volume.
2015-09-15 00:45:52 +00:00
If you did not use kube-up script, make sure that your minions have the following IAM permissions ([Amazon IAM Roles](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html#create-iam-role-console)):
2015-07-17 02:01:02 +00:00
2015-09-15 00:45:52 +00:00
```shell
ec2:AttachVolume
ec2:DetachVolume
ec2:DescribeInstances
ec2:DescribeVolumes
```
Create a volume in the same region as your node.
Add your volume information in the pod description file aws-ebs-web.yaml then create the pod:
```shell
$ kubectl create -f examples/volumes/aws_ebs/aws-ebs-web.yaml
```
2015-07-17 02:01:02 +00:00
Add some data to the volume if is empty:
2015-07-17 02:01:02 +00:00
2015-07-20 04:38:53 +00:00
```sh
$ echo "Hello World" >& /var/lib/kubelet/plugins/kubernetes.io/aws-ebs/mounts/aws/{Region}/{Volume ID}/index.html
```
2015-07-17 02:01:02 +00:00
You should now be able to query your web server:
2015-07-17 02:01:02 +00:00
2015-07-20 04:38:53 +00:00
```sh
$ curl <Pod IP address>
$ Hello World
2015-07-18 03:56:47 +00:00
```
2015-07-14 00:13:09 +00:00
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/examples/volumes/aws_ebs/README.md?pixel)]()
2015-07-14 00:13:09 +00:00
<!-- END MUNGE: GENERATED_ANALYTICS -->