Skip to content

Commit 0ac53c2

Browse files
steveperry-53chenopis
authored andcommitted
Put moved notice in persistent volume topic.
1 parent 2973296 commit 0ac53c2

File tree

2 files changed

+2
-123
lines changed

2 files changed

+2
-123
lines changed

docs/tasks/configure-pod-container/configure-persistent-volume-storage.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
---
2-
redirect_from:
3-
- "/docs/user-guide/persistent-volumes/walkthrough/"
4-
- "/docs/user-guide/persistent-volumes/walkthrough.html"
52
title: Configuring a Pod to Use a PersistentVolume for Storage
63
---
74

docs/user-guide/persistent-volumes/walkthrough.md

Lines changed: 2 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -5,124 +5,6 @@ assignees:
55
title: Persistent Volumes Walkthrough
66
---
77

8-
The purpose of this guide is to help you become familiar with [Kubernetes Persistent Volumes](/docs/user-guide/persistent-volumes/). By the end of the guide, we'll have
9-
nginx serving content from your persistent volume.
8+
{% include user-guide-content-moved.md %}
109

11-
You can view all the files for this example in [the docs repo
12-
here](https://github.com/kubernetes/kubernetes.github.io/tree/{{page.docsbranch}}/docs/user-guide/persistent-volumes).
13-
14-
This guide assumes knowledge of Kubernetes fundamentals and that you have a cluster up and running.
15-
16-
See [Persistent Storage design document](https://github.com/kubernetes/kubernetes/blob/{{page.githubbranch}}/docs/design/persistent-storage.md) for more information.
17-
18-
## Provisioning
19-
20-
A Persistent Volume (PV) in Kubernetes represents a real piece of underlying storage capacity in the infrastructure. Cluster administrators
21-
must first create storage (create their Google Compute Engine (GCE) disks, export their NFS shares, etc.) in order for Kubernetes to mount it.
22-
23-
PVs are intended for "network volumes" like GCE Persistent Disks, NFS shares, and AWS ElasticBlockStore volumes. `HostPath` was included
24-
for ease of development and testing. You'll create a local `HostPath` for this example.
25-
26-
> IMPORTANT! For `HostPath` to work, you will need to run a single node cluster. Kubernetes does not
27-
support local storage on the host at this time. There is no guarantee your pod ends up on the correct node where the `HostPath` resides.
28-
29-
```shell
30-
# This will be nginx's webroot; execute this on the node where your pod will run.
31-
$ mkdir /tmp/data01
32-
$ echo 'I love Kubernetes storage!' > /tmp/data01/index.html
33-
```
34-
35-
PVs are created by posting them to the API server.
36-
37-
```shell
38-
$ kubectl create -f docs/user-guide/persistent-volumes/volumes/local-01.yaml
39-
NAME LABELS CAPACITY ACCESSMODES STATUS CLAIM REASON
40-
pv0001 type=local 10737418240 RWO Available
41-
```
42-
43-
### Access Control
44-
Storage configured with GID will only allow writing by pods using the same GID.
45-
Mismatched or missing GIDs will cause `permission denied` errors. Annotating a
46-
`PersistentVolume` with a GID allows `Kubelet` to automatically add the GID to
47-
the pod that requires it. No coordination between an admin and end user is
48-
required.
49-
50-
To annotate the volume's with a GID you use the `pv.beta.kubernetes.io/gid`
51-
annotation as follows:
52-
53-
```yaml
54-
kind: PersistentVolume
55-
apiVersion: v1
56-
metadata:
57-
name: pv1
58-
annotations:
59-
pv.beta.kubernetes.io/gid: "1234"
60-
#...
61-
```
62-
63-
When a pod consumes a PV with a GID annotation, the annotated GID is applied to
64-
all containers in the pod in the same way GIDs specified in the pod's
65-
[security context](/docs/user-guide/security-context/) are. Every GID, whether
66-
it originates from a PV annotation or the pod's specification, is applied to
67-
the first process run in each container, in addition to the container's primary
68-
GID. Currently, the GIDs associated with PVs a pod consumes will not be present
69-
on the pod resource itself, unlike GIDs specified in a pod's security context.
70-
71-
## Requesting storage
72-
73-
Users of Kubernetes request persistent storage for their pods. They don't know how the underlying cluster is provisioned.
74-
They just know they can rely on their claim to storage and can manage its lifecycle independently from the many pods that may use it.
75-
76-
Claims must be created in the same namespace as the pods that use them.
77-
78-
```shell
79-
$ kubectl create -f docs/user-guide/persistent-volumes/claims/claim-01.yaml
80-
81-
$ kubectl get pvc
82-
NAME LABELS STATUS VOLUME
83-
myclaim-1 map[]
84-
85-
86-
# A background process will attempt to match this claim to a volume.
87-
# The eventual state of your claim will look something like this:
88-
89-
$ kubectl get pvc
90-
NAME LABELS STATUS VOLUME
91-
myclaim-1 map[] Bound pv0001
92-
93-
$ kubectl get pv
94-
NAME LABELS CAPACITY ACCESSMODES STATUS CLAIM REASON
95-
pv0001 type=local 10737418240 RWO Bound default/myclaim-1
96-
```
97-
98-
## Using your claim as a volume
99-
100-
Claims are used as volumes in pods. Kubernetes uses the claim to look up its bound PV. The PV is then exposed to the pod.
101-
102-
```shell
103-
$ kubectl create -f docs/user-guide/persistent-volumes/simpletest/pod.yaml
104-
105-
$ kubectl get pods
106-
NAME READY STATUS RESTARTS AGE
107-
mypod 1/1 Running 0 1h
108-
109-
$ kubectl create -f docs/user-guide/persistent-volumes/simpletest/service.json
110-
$ kubectl get services
111-
NAME CLUSTER_IP EXTERNAL_IP PORT(S) SELECTOR AGE
112-
frontendservice 10.0.0.241 <none> 3000/TCP name=frontendhttp 1d
113-
kubernetes 10.0.0.2 <none> 443/TCP <none> 2d
114-
```
115-
116-
## Next steps
117-
118-
You should be able to query your service endpoint and see what content nginx is serving. A "forbidden" error might mean you
119-
need to disable SELinux (setenforce 0).
120-
121-
```shell
122-
$ curl 10.0.0.241:3000
123-
I love Kubernetes storage!
124-
```
125-
126-
Hopefully this simple guide is enough to get you started with PersistentVolumes. If you have any questions, join the team on [Slack](/docs/troubleshooting/#slack) and ask!
127-
128-
Enjoy!
10+
[Configuring a Pod to Use a Persistent Volume for Storage](/docs/tasks/configure-pod-container/configure-persistent-volume-storage/)

0 commit comments

Comments
 (0)