-
Notifications
You must be signed in to change notification settings - Fork 14.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9cd3dee
commit 3479b55
Showing
3 changed files
with
166 additions
and
0 deletions.
There are no files selected for viewing
140 changes: 140 additions & 0 deletions
140
content/fr/docs/tasks/configure-pod-container/extended-resource.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
--- | ||
title: Affecter des ressources supplémentaires à un conteneur | ||
content_template: templates/task | ||
weight: 40 | ||
--- | ||
|
||
{{% capture overview %}} | ||
|
||
Cette page montre comment affecter des ressources supplémentaires à un conteneur. | ||
|
||
{{< feature-state state="stable" >}} | ||
|
||
{{% /capture %}} | ||
|
||
|
||
{{% capture prerequisites %}} | ||
|
||
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} | ||
|
||
Avant de commencer cet exercice, procédez à l'exercice en | ||
[Annoncer des ressources supplémentaires pour un nœud](/docs/tasks/administer-cluster/extended-resource-node/). | ||
Cela configurera l'un de vos nœuds pour qu'il annoncera une ressource dongle. | ||
|
||
{{% /capture %}} | ||
|
||
|
||
{{% capture steps %}} | ||
|
||
## Affecter une ressource supplémentaire à un Pod | ||
|
||
Pour demander une ressource supplémentaire, incluez le champ `resources:requests` dans votre fichier de manifeste du conteneur. Les ressources supplémentaires sont entièrement qualifiées dans n'importe quel domaine à l'extérieur de `*.kubernetes.io/`. | ||
Les noms de ressources supplémentaires valides ont la forme `example.com/foo` où `example.com` est remplacé par le domaine de votre organisation et `foo` est le nom descriptif de la ressource. | ||
|
||
Voici le fichier de configuration d'un Pod qui a un seul conteneur : | ||
|
||
{{< codenew file="pods/resource/extended-resource-pod.yaml" >}} | ||
|
||
Dans le fichier de configuration, vous pouvez constater que le conteneur demande 3 dongles. | ||
|
||
Créez un pod : | ||
|
||
```shell | ||
kubectl apply -f https://k8s.io/examples/pods/resource/extended-resource-pod.yaml | ||
``` | ||
|
||
Vérifiez que le Pod fonctionne : | ||
|
||
```shell | ||
kubectl get pod extended-resource-demo | ||
``` | ||
|
||
Décrivez le Pod : | ||
|
||
```shell | ||
kubectl describe pod extended-resource-demo | ||
``` | ||
|
||
La sortie affiche les demandes des dongles : | ||
|
||
```yaml | ||
Limits: | ||
example.com/dongle: 3 | ||
Requests: | ||
example.com/dongle: 3 | ||
``` | ||
## Tentative de création d'un deuxième Pod | ||
Voici le fichier de configuration d'un Pod qui a un seul conteneur. Le conteneur demande | ||
deux dongles. | ||
{{< codenew file="pods/resource/extended-resource-pod-2.yaml" >}} | ||
Kubernetes ne pourra pas satisfaire la demande de deux dongles, parce que le premier Pod | ||
a utilisé trois des quatre dongles disponibles. | ||
Essayez de créer un Pod : | ||
```shell | ||
kubectl apply -f https://k8s.io/examples/pods/resource/extended-resource-pod-2.yaml | ||
``` | ||
|
||
Décrivez le Pod : | ||
|
||
```shell | ||
kubectl describe pod extended-resource-demo-2 | ||
``` | ||
|
||
La sortie montre que le Pod ne peut pas être planifié, du fait qu'il n'y a pas de Nœud qui a | ||
2 dongles disponibles : | ||
|
||
|
||
``` | ||
Conditions: | ||
Type Status | ||
PodScheduled False | ||
... | ||
Events: | ||
... | ||
... Warning FailedScheduling pod (extended-resource-demo-2) failed to fit in any node | ||
fit failure summary on nodes : Insufficient example.com/dongle (1) | ||
``` | ||
|
||
Affichez l'état du Pod : | ||
|
||
```shell | ||
kubectl get pod extended-resource-demo-2 | ||
``` | ||
|
||
La sortie indique que le Pod a été créé, mais pas programmé pour tourner sur un Nœud. | ||
Il a le statut Pending : | ||
|
||
```yaml | ||
NAME READY STATUS RESTARTS AGE | ||
extended-resource-demo-2 0/1 Pending 0 6m | ||
``` | ||
|
||
## Nettoyage | ||
|
||
Supprimez les Pods que vous avez créés dans cet exercice : | ||
|
||
```shell | ||
kubectl delete pod extended-resource-demo | ||
kubectl delete pod extended-resource-demo-2 | ||
``` | ||
|
||
{{% /capture %}} | ||
|
||
{{% capture whatsnext %}} | ||
|
||
### Pour les développeurs d'applications | ||
|
||
* [Allocation des ressources mémoire aux conteneurs et pods](/fr/docs/tasks/configure-pod-container/assign-memory-resource/) | ||
* [Allocation des ressources CPU aux conteneurs et pods](/docs/tasks/configure-pod-container/assign-cpu-resource/) | ||
|
||
### Pour les administrateurs de cluster | ||
|
||
* [Annoncer des ressources supplémentaires pour un nœud](/docs/tasks/administer-cluster/extended-resource-node/) | ||
|
||
{{% /capture %}} |
13 changes: 13 additions & 0 deletions
13
content/fr/examples/pods/resource/extended-resource-pod-2.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: extended-resource-demo-2 | ||
spec: | ||
containers: | ||
- name: extended-resource-demo-2-ctr | ||
image: nginx | ||
resources: | ||
requests: | ||
example.com/dongle: 2 | ||
limits: | ||
example.com/dongle: 2 |
13 changes: 13 additions & 0 deletions
13
content/fr/examples/pods/resource/extended-resource-pod.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: extended-resource-demo | ||
spec: | ||
containers: | ||
- name: extended-resource-demo-ctr | ||
image: nginx | ||
resources: | ||
requests: | ||
example.com/dongle: 3 | ||
limits: | ||
example.com/dongle: 3 |