@@ -36,16 +36,18 @@ can open a shell to your Node by entering `minikube ssh`.
36
36
37
37
In your shell on that Node, create a ` /mnt/data ` directory:
38
38
39
+ Ouvrez une session shell sur le noeud de votre cluster. La facon d'ouvrir
40
+ la session va dependre de la configuration de votre cluster. Si vous utilisez Minikube,
41
+ vous pouvez ouvrir une session via la commande ` minikube ssh ` .
42
+
39
43
``` shell
40
- # This assumes that your Node uses "sudo" to run commands
41
- # as the superuser
44
+ # En supposant que votre noeud utilise `sudo` pour les acces privilegies
42
45
sudo mkdir /mnt/data
43
46
```
44
47
45
48
Dans le dossier ` /mnt/data ` , creez un fichier ` index.html ` :
46
49
``` shell
47
- # This again assumes that your Node uses "sudo" to run commands
48
- # as the superuser
50
+ # En supposant toujours que votre noeud utilise `sudo` pour les acces privilegies
49
51
sudo sh -c " echo 'Hello from Kubernetes storage' > /mnt/data/index.html"
50
52
```
51
53
@@ -67,19 +69,18 @@ Vous pouvez maintenant fermer l'acces shell a votre Noeud.
67
69
68
70
## Creer un PersistentVolume
69
71
70
- In this exercise, you create a * hostPath* PersistentVolume. Kubernetes supports
71
- hostPath for development and testing on a single-node cluster. A hostPath
72
- PersistentVolume uses a file or directory on the Node to emulate network-attached storage.
73
-
74
- In a production cluster, you would not use hostPath. Instead a cluster administrator
75
- would provision a network resource like a Google Compute Engine persistent disk,
76
- an NFS share, or an Amazon Elastic Block Store volume. Cluster administrators can also
77
- use [ StorageClasses] (/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#storageclass-v1-storage-k8s-io)
78
- to set up
79
- [ dynamic provisioning] ( /docs/concepts/storage/dynamic-provisioning/ ) .
72
+ Dans cet exercice, vous allez créer un PersistentVolume de type * hostpath* . Prise en charge de Kubernetes
73
+ hostPath pour le développement et les tests sur un cluster à nœud unique. Un hostPath
74
+ PersistentVolume utilise un fichier ou un répertoire sur le nœud pour émuler le stockage en réseau.
80
75
81
- Here is the configuration file for the hostPath PersistentVolume:
76
+ Dans un cluster de production, vous n'utiliseriez pas le type * hostPath* . Communement, un administrateur de cluster
77
+ provisionnerait une ressource réseau comme un disque persistant Google Compute Engine,
78
+ un partage NFS ou un volume Amazon Elastic Block Store. Les administrateurs de cluster peuvent également
79
+ utiliser les [ StorageClasses] (/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#storageclass-v1-storage-k8s-io)
80
+ pour parametrer du
81
+ [ provisioning dynamique] ( /docs/concepts/storage/dynamic-provisioning/ ) .
82
82
83
+ Voici le fichier de configuration pour le PersitentVolume de type hostPath:
83
84
{{< codenew file="pods/storage/pv-volume.yaml" >}}
84
85
85
86
The configuration file specifies that the volume is at ` /mnt/data ` on the
@@ -89,25 +90,25 @@ read-write by a single Node. It defines the [StorageClass name](/docs/concepts/s
89
90
` manual ` for the PersistentVolume, which will be used to bind
90
91
PersistentVolumeClaim requests to this PersistentVolume.
91
92
92
- Create the PersistentVolume:
93
+ Creez le PersistentVolume:
93
94
94
95
``` shell
95
96
kubectl apply -f https://k8s.io/examples/pods/storage/pv-volume.yaml
96
97
```
97
98
98
- View information about the PersistentVolume:
99
+ Afficher les informations du PersistentVolume:
99
100
100
101
``` shell
101
102
kubectl get pv task-pv-volume
102
103
```
103
104
104
- The output shows that the PersistentVolume has a ` STATUS ` of ` Available ` . This
105
- means it has not yet been bound to a PersistentVolumeClaim.
105
+ Le resultat affiche que le PersitentVolume a un ` STATUS ` de ` Available ` .
106
+ Cela signifie qu'il n'a pas encore ete attache a un PersistentVolumeClaim.
106
107
107
108
NAME CAPACITY ACCESSMODES RECLAIMPOLICY STATUS CLAIM STORAGECLASS REASON AGE
108
109
task-pv-volume 10Gi RWO Retain Available manual 4s
109
110
110
- ## Create a PersistentVolumeClaim
111
+ ## Creer un PersistentVolumeClaim
111
112
112
113
The next step is to create a PersistentVolumeClaim. Pods use PersistentVolumeClaims
113
114
to request physical storage. In this exercise, you create a PersistentVolumeClaim
@@ -133,7 +134,7 @@ Look again at the PersistentVolume:
133
134
kubectl get pv task-pv-volume
134
135
```
135
136
136
- Now the output shows a ` STATUS ` of ` Bound ` .
137
+ Maintenant, le resultat affiche un ` STATUS ` a ` Bound ` .
137
138
138
139
NAME CAPACITY ACCESSMODES RECLAIMPOLICY STATUS CLAIM STORAGECLASS REASON AGE
139
140
task-pv-volume 10Gi RWO Retain Bound default/task-pv-claim manual 2m
@@ -144,48 +145,44 @@ Look at the PersistentVolumeClaim:
144
145
kubectl get pvc task-pv-claim
145
146
```
146
147
147
- The output shows that the PersistentVolumeClaim is bound to your PersistentVolume,
148
+ Le resultat montre que le PersistentVolumeClaim est attache au PersistentVolume
148
149
` task-pv-volume ` .
149
150
150
151
NAME STATUS VOLUME CAPACITY ACCESSMODES STORAGECLASS AGE
151
152
task-pv-claim Bound task-pv-volume 10Gi RWO manual 30s
152
153
153
- ## Create a Pod
154
+ ## Creer un Pod
154
155
155
- The next step is to create a Pod that uses your PersistentVolumeClaim as a volume.
156
+ La prochaine etape est de creer un Pod qui utilise le PersistentVolumeClaim comme volume de stockage .
156
157
157
- Here is the configuration file for the Pod:
158
+ Voici le fichier de configuration du Pod:
158
159
159
160
{{< codenew file="pods/storage/pv-pod.yaml" >}}
160
161
161
162
Notice that the Pod's configuration file specifies a PersistentVolumeClaim, but
162
163
it does not specify a PersistentVolume. From the Pod's point of view, the claim
163
164
is a volume.
164
165
165
- Create the Pod:
166
+ Creez le Pod:
166
167
167
168
``` shell
168
169
kubectl apply -f https://k8s.io/examples/pods/storage/pv-pod.yaml
169
170
```
170
171
171
- Verify that the container in the Pod is running;
172
-
172
+ Verifiez que le container dans le Pod est operationnel:
173
173
``` shell
174
174
kubectl get pod task-pv-pod
175
175
```
176
176
177
- Get a shell to the container running in your Pod:
178
-
177
+ Lancez un shell dans le container du Pod:
179
178
``` shell
180
179
kubectl exec -it task-pv-pod -- /bin/bash
181
180
```
182
181
183
- In your shell, verify that nginx is serving the ` index.html ` file from the
184
- hostPath volume:
185
-
182
+ Depuis le shell, verifiez que nginx utilise le fichier ` index.html ` du volume hosPath:
186
183
``` shell
187
- # Be sure to run these 3 commands inside the root shell that comes from
188
- # running "kubectl exec" in the previous step
184
+ # Assurez vouys de lancer ces 3 commandes dans le shell qui provient de
185
+ # la commande "kubectl exec" executee precedemment
189
186
apt update
190
187
apt install curl
191
188
curl http://localhost/
@@ -200,10 +197,9 @@ hostPath volume:
200
197
If you see that message, you have successfully configured a Pod to
201
198
use storage from a PersistentVolumeClaim.
202
199
203
- ## Clean up
204
-
205
- Delete the Pod, the PersistentVolumeClaim and the PersistentVolume:
200
+ ## Nettoyage
206
201
202
+ Supprimez le Pod, the PersistentVolumeClaim et le PersistentVolume:
207
203
``` shell
208
204
kubectl delete pod task-pv-pod
209
205
kubectl delete pvc task-pv-claim
@@ -222,7 +218,7 @@ sudo rm /mnt/data/index.html
222
218
sudo rmdir /mnt/data
223
219
```
224
220
225
- You can now close the shell to your Node .
221
+ Vous pouvez maintenant clore la session shell vers votre noeud .
226
222
227
223
## Mounting the same persistentVolume in two places
228
224
@@ -237,8 +233,10 @@ You can perform 2 volume mounts on your nginx container:
237
233
238
234
## Access control
239
235
240
- Storage configured with a group ID (GID) allows writing only by Pods using the same
241
- GID. Mismatched or missing GIDs cause permission denied errors. To reduce the
236
+ Le stockage configure avec un ID de groupe (GID) ne permettra l'ecriture que par les Pods
237
+ qui utilisent le meme GID.
238
+
239
+ Mismatched or missing GIDs cause permission denied errors. To reduce the
242
240
need for coordination with users, an administrator can annotate a PersistentVolume
243
241
with a GID. Then the GID is automatically added to any Pod that uses the
244
242
PersistentVolume.
@@ -252,6 +250,7 @@ metadata:
252
250
annotations :
253
251
pv.beta.kubernetes.io/gid : " 1234"
254
252
` ` `
253
+
255
254
When a Pod consumes a PersistentVolume that has a GID annotation, the annotated GID
256
255
is applied to all containers in the Pod in the same way that GIDs specified in the
257
256
Pod's security context are. Every GID, whether it originates from a PersistentVolume
@@ -272,7 +271,7 @@ PersistentVolume are not present on the Pod resource itself.
272
271
* Pour en savoir plus sur les [PersistentVolumes](/docs/concepts/storage/persistent-volumes/).
273
272
* Lire la [documentation de conception sur le stockage persistant](https://git.k8s.io/design-proposals-archive/storage/persistent-storage.md).
274
273
275
- ### Reference
274
+ ### References
276
275
277
276
* [PersistentVolume](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#persistentvolume-v1-core)
278
277
* [PersistentVolumeSpec](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#persistentvolumespec-v1-core)
0 commit comments