Skip to content

Commit 049c832

Browse files
committed
Fix
1 parent fb9823b commit 049c832

9 files changed

+137
-2
lines changed

content/fr/docs/tasks/configure-pod-container/configure-pod-configmap.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -602,9 +602,9 @@ very
602602
Comme avant, tous les fichiers précédents dans le répertoire `/etc/config/` seront supprimés.
603603
{{< /caution >}}
604604

605-
### Clés de projet pour des chemins et des autorisations de fichiers spécifiques
605+
### Projections de clés pour des chemins et des autorisations de fichiers spécifiques
606606

607-
You can project keys to specific paths and specific permissions on a per-file basis.
607+
Vous pouvez projeter des clés vers des chemins spécifiques avec des autorisations spécifiques fichiers par fichiers.
608608
Le guide de l'utilisateur [Secrets](/docs/concepts/configuration/secret/#using-secrets-as-files-from-a-pod) explique la syntaxe.
609609

610610
### Les ConfigMaps montées sont mises à jour automatiquement
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: special-config
5+
namespace: default
6+
data:
7+
SPECIAL_LEVEL: very
8+
SPECIAL_TYPE: charm
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: special-config
5+
namespace: default
6+
data:
7+
special.how: very
8+
---
9+
apiVersion: v1
10+
kind: ConfigMap
11+
metadata:
12+
name: env-config
13+
namespace: default
14+
data:
15+
log_level: INFO
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
name: dapi-test-pod
5+
spec:
6+
containers:
7+
- name: test-container
8+
image: k8s.gcr.io/busybox
9+
command: [ "/bin/echo", "$(SPECIAL_LEVEL_KEY) $(SPECIAL_TYPE_KEY)" ]
10+
env:
11+
- name: SPECIAL_LEVEL_KEY
12+
valueFrom:
13+
configMapKeyRef:
14+
name: special-config
15+
key: SPECIAL_LEVEL
16+
- name: SPECIAL_TYPE_KEY
17+
valueFrom:
18+
configMapKeyRef:
19+
name: special-config
20+
key: SPECIAL_TYPE
21+
restartPolicy: Never
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
name: dapi-test-pod
5+
spec:
6+
containers:
7+
- name: test-container
8+
image: k8s.gcr.io/busybox
9+
command: [ "/bin/sh", "-c", "env" ]
10+
envFrom:
11+
- configMapRef:
12+
name: special-config
13+
restartPolicy: Never
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
name: dapi-test-pod
5+
spec:
6+
containers:
7+
- name: test-container
8+
image: k8s.gcr.io/busybox
9+
command: [ "/bin/sh","-c","cat /etc/config/keys" ]
10+
volumeMounts:
11+
- name: config-volume
12+
mountPath: /etc/config
13+
volumes:
14+
- name: config-volume
15+
configMap:
16+
name: special-config
17+
items:
18+
- key: SPECIAL_LEVEL
19+
path: keys
20+
restartPolicy: Never
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
name: dapi-test-pod
5+
spec:
6+
containers:
7+
- name: test-container
8+
image: k8s.gcr.io/busybox
9+
command: [ "/bin/sh", "-c", "ls /etc/config/" ]
10+
volumeMounts:
11+
- name: config-volume
12+
mountPath: /etc/config
13+
volumes:
14+
- name: config-volume
15+
configMap:
16+
# Indiquez le nom de la ConfigMap contenant les fichiers que vous souhaitez ajouter au conteneur
17+
name: special-config
18+
restartPolicy: Never
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
name: dapi-test-pod
5+
spec:
6+
containers:
7+
- name: test-container
8+
image: k8s.gcr.io/busybox
9+
command: [ "/bin/sh", "-c", "env" ]
10+
env:
11+
- name: SPECIAL_LEVEL_KEY
12+
valueFrom:
13+
configMapKeyRef:
14+
name: special-config
15+
key: special.how
16+
- name: LOG_LEVEL
17+
valueFrom:
18+
configMapKeyRef:
19+
name: env-config
20+
key: log_level
21+
restartPolicy: Never
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
name: dapi-test-pod
5+
spec:
6+
containers:
7+
- name: test-container
8+
image: k8s.gcr.io/busybox
9+
command: [ "/bin/sh", "-c", "env" ]
10+
env:
11+
# Définie la variable d'environnement
12+
- name: SPECIAL_LEVEL_KEY
13+
valueFrom:
14+
configMapKeyRef:
15+
# La ConfigMap contenant la valeur que vous voulez attribuer à SPECIAL_LEVEL_KEY
16+
name: special-config
17+
# Spécifier la clé associée à la valeur
18+
key: special.how
19+
restartPolicy: Never

0 commit comments

Comments
 (0)