Update podpreset.md

reviewable/pr6424/r2
Qiming 2017-11-23 20:51:55 +08:00 committed by GitHub
parent 3dc4ccb62c
commit 4c083fc73e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 23 additions and 17 deletions

View File

@ -22,41 +22,47 @@ Preset.
{% include code.html language="yaml" file="podpreset-preset.yaml" ghlink="/docs/tasks/inject-data-application/podpreset-preset.yaml" %}
1. Create above PodPreset
1. Create the PodPreset:
kubectl create -f https://k8s.io/docs/tasks/inject-data-application/podpreset-preset.yaml
```shell
kubectl create -f https://k8s.io/docs/tasks/inject-data-application/podpreset-preset.yaml
```
1. Examine the created PodPreset:
1. See the created PodPreset
```shell
kubectl get podpreset
NAME AGE
allow-database 1m
```
$ kubectl get podpreset
NAME AGE
allow-database 1m
Create above PodPreset, now any pod that has label `role: frontend` will have this
PodPreset acted upon.
The new PodPreset will act upon any pod that has label `role: frontend`.
{% include code.html language="yaml" file="podpreset-pod.yaml" ghlink="/docs/tasks/inject-data-application/podpreset-pod.yaml" %}
1. Create Pod
kubectl create -f https://k8s.io/docs/tasks/inject-data-application/podpreset-pod.yaml
```shell
kubectl create -f https://k8s.io/docs/tasks/inject-data-application/podpreset-pod.yaml
```
1. List the running Pods:
$ kubectl get pods
NAME READY STATUS RESTARTS AGE
website 1/1 Running 0 4m
```shell
kubectl get pods
NAME READY STATUS RESTARTS AGE
website 1/1 Running 0 4m
```
**Pod spec after admission controller:**
{% include code.html language="yaml" file="podpreset-merged.yaml" ghlink="/docs/tasks/inject-data-application/podpreset-merged.yaml" %}
To see above output, run following command
kubectl get pod website -o yaml
To see above output, run the following command:
```shell
kubectl get pod website -o yaml
```
### Pod Spec with `ConfigMap` Example