mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-20 09:05:26 +00:00
Create an example pod for AWS EBS
Signed-off-by: Sami Wagiaalla <swagiaal@redhat.com>
This commit is contained in:
parent
6674913f92
commit
4f5c1b8b65
20
examples/aws_ebs/README.md
Normal file
20
examples/aws_ebs/README.md
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
This is a simple web server pod which serves HTML from an AWS EBS
|
||||||
|
volume.
|
||||||
|
|
||||||
|
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 aws-ebs-web.yaml
|
||||||
|
```
|
||||||
|
Add some data to the volume if is empty:
|
||||||
|
```shell
|
||||||
|
$ echo "Hello World" >& /var/lib/kubelet/plugins/kubernetes.io/aws-ebs/mounts/aws/{Region}/{Volume ID}/index.html
|
||||||
|
```
|
||||||
|
You should now be able to query your web server:
|
||||||
|
```shell
|
||||||
|
$ curl <Pod IP address>
|
||||||
|
$ Hello World
|
||||||
|
````
|
||||||
|
|
||||||
|
[]()
|
21
examples/aws_ebs/aws-ebs-web.yaml
Normal file
21
examples/aws_ebs/aws-ebs-web.yaml
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Pod
|
||||||
|
metadata:
|
||||||
|
name: aws-web
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: web
|
||||||
|
image: nginx
|
||||||
|
ports:
|
||||||
|
- name: web
|
||||||
|
containerPort: 80
|
||||||
|
protocol: tcp
|
||||||
|
volumeMounts:
|
||||||
|
- name: html-volume
|
||||||
|
mountPath: "/usr/share/nginx/html"
|
||||||
|
volumes:
|
||||||
|
- name: html-volume
|
||||||
|
awsElasticBlockStore:
|
||||||
|
# Enter the volume region and ID below
|
||||||
|
volumeID: aws://{region}/{volume ID}
|
||||||
|
fsType: ext4
|
Loading…
Reference in New Issue
Block a user