Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cinder volume examples #45013

Merged
merged 1 commit into from
May 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: gold
provisioner: kubernetes.io/cinder
parameters:
type: fast
availability: nova
23 changes: 23 additions & 0 deletions examples/persistent-volume-provisioning/cinder/example-pod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: v1
kind: ReplicationController
metadata:
name: server
spec:
replicas: 1
selector:
role: server
template:
metadata:
labels:
role: server
spec:
containers:
- name: server
image: nginx
volumeMounts:
- mountPath: /var/lib/www/html
name: cinderpvc
volumes:
- name: cinderpvc
persistentVolumeClaim:
claimName: claim1
27 changes: 27 additions & 0 deletions examples/volumes/cinder/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
This is a simple web server pod which serves HTML from an Cinder volume.

Create a volume in the same tenant and zone as your node.

Add your volume information in the pod description file cinder-web.yaml then create the pod:

```shell
$ kubectl create -f examples/volumes/cinder/cinder-web.yaml
```

Add some data to the volume if is empty:

```sh
$ echo "Hello World" >& /var/lib/kubelet/plugins/kubernetes.io/cinder/mounts/{Volume ID}/index.html
```

You should now be able to query your web server:

```sh
$ curl <Pod IP address>
$ Hello World
```


<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/examples/volumes/cinder/README.md?pixel)]()
<!-- END MUNGE: GENERATED_ANALYTICS -->
21 changes: 21 additions & 0 deletions examples/volumes/cinder/cinder-web.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: v1
kind: Pod
metadata:
name: cinder-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
cinder:
# Enter the volume ID below
volumeID: volume_ID
fsType: ext4