-
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.
Add codenew shortcode to configure-pod-configmap task file and saniti…
…ze the example files (#13078)
- Loading branch information
1 parent
5e50314
commit e38f800
Showing
14 changed files
with
292 additions
and
219 deletions.
There are no files selected for viewing
344 changes: 137 additions & 207 deletions
344
content/en/docs/tasks/configure-pod-container/configure-pod-configmap.md
Large diffs are not rendered by default.
Oops, something went wrong.
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,8 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: special-config | ||
namespace: default | ||
data: | ||
SPECIAL_LEVEL: very | ||
SPECIAL_TYPE: charm |
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,16 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: special-config | ||
namespace: default | ||
data: | ||
special.how: very | ||
--- | ||
|
||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: env-config | ||
namespace: default | ||
data: | ||
log_level: INFO |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
21 changes: 21 additions & 0 deletions
21
content/en/examples/pods/pod-configmap-env-var-valueFrom.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,21 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: dapi-test-pod | ||
spec: | ||
containers: | ||
- name: test-container | ||
image: k8s.gcr.io/busybox | ||
command: [ "/bin/sh", "-c", "echo $(SPECIAL_LEVEL_KEY) $(SPECIAL_TYPE_KEY)" ] | ||
env: | ||
- name: SPECIAL_LEVEL_KEY | ||
valueFrom: | ||
configMapKeyRef: | ||
name: special-config | ||
key: SPECIAL_LEVEL | ||
- name: SPECIAL_TYPE_KEY | ||
valueFrom: | ||
configMapKeyRef: | ||
name: special-config | ||
key: SPECIAL_TYPE | ||
restartPolicy: Never |
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: dapi-test-pod | ||
spec: | ||
containers: | ||
- name: test-container | ||
image: k8s.gcr.io/busybox | ||
command: [ "/bin/sh", "-c", "env" ] | ||
envFrom: | ||
- configMapRef: | ||
name: special-config | ||
restartPolicy: Never |
20 changes: 20 additions & 0 deletions
20
content/en/examples/pods/pod-configmap-volume-specific-key.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,20 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: dapi-test-pod | ||
spec: | ||
containers: | ||
- name: test-container | ||
image: k8s.gcr.io/busybox | ||
command: [ "/bin/sh","-c","cat /etc/config/keys" ] | ||
volumeMounts: | ||
- name: config-volume | ||
mountPath: /etc/config | ||
volumes: | ||
- name: config-volume | ||
configMap: | ||
name: special-config | ||
items: | ||
- key: special.level | ||
path: keys | ||
restartPolicy: Never |
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,19 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: dapi-test-pod | ||
spec: | ||
containers: | ||
- name: test-container | ||
image: k8s.gcr.io/busybox | ||
command: [ "/bin/sh", "-c", "ls /etc/config/" ] | ||
volumeMounts: | ||
- name: config-volume | ||
mountPath: /etc/config | ||
volumes: | ||
- name: config-volume | ||
configMap: | ||
# Provide the name of the ConfigMap containing the files you want | ||
# to add to the container | ||
name: special-config | ||
restartPolicy: Never |
21 changes: 21 additions & 0 deletions
21
content/en/examples/pods/pod-multiple-configmap-env-variable.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,21 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: dapi-test-pod | ||
spec: | ||
containers: | ||
- name: test-container | ||
image: k8s.gcr.io/busybox | ||
command: [ "/bin/sh", "-c", "env" ] | ||
env: | ||
- name: SPECIAL_LEVEL_KEY | ||
valueFrom: | ||
configMapKeyRef: | ||
name: special-config | ||
key: special.how | ||
- name: LOG_LEVEL | ||
valueFrom: | ||
configMapKeyRef: | ||
name: env-config | ||
key: log_level | ||
restartPolicy: Never |
19 changes: 19 additions & 0 deletions
19
content/en/examples/pods/pod-single-configmap-env-variable.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,19 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: dapi-test-pod | ||
spec: | ||
containers: | ||
- name: test-container | ||
image: k8s.gcr.io/busybox | ||
command: [ "/bin/sh", "-c", "env" ] | ||
env: | ||
# Define the environment variable | ||
- name: SPECIAL_LEVEL_KEY | ||
valueFrom: | ||
configMapKeyRef: | ||
# The ConfigMap containing the value you want to assign to SPECIAL_LEVEL_KEY | ||
name: special-config | ||
# Specify the key associated with the value | ||
key: special.how | ||
restartPolicy: Never |