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