From 3dc4ccb62c2a2afde0241f9a68c2b414ac5b0f8c Mon Sep 17 00:00:00 2001 From: Suraj Deshmukh Date: Thu, 23 Nov 2017 12:08:27 +0530 Subject: [PATCH] Add PodPreset basic usage instructions --- .../inject-data-application/podpreset.md | 32 +++++++++++++++++-- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/docs/tasks/inject-data-application/podpreset.md b/docs/tasks/inject-data-application/podpreset.md index d2571ab844..51357494a7 100644 --- a/docs/tasks/inject-data-application/podpreset.md +++ b/docs/tasks/inject-data-application/podpreset.md @@ -20,18 +20,44 @@ You can get an overview of PodPresets at This is a simple example to show how a Pod spec is modified by the Pod Preset. -**User submitted pod spec:** +{% include code.html language="yaml" file="podpreset-preset.yaml" ghlink="/docs/tasks/inject-data-application/podpreset-preset.yaml" %} + +1. Create above PodPreset + + kubectl create -f https://k8s.io/docs/tasks/inject-data-application/podpreset-preset.yaml + + +1. See the created PodPreset + + $ 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. {% include code.html language="yaml" file="podpreset-pod.yaml" ghlink="/docs/tasks/inject-data-application/podpreset-pod.yaml" %} -**Example Pod Preset:** +1. Create Pod + + 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 -{% include code.html language="yaml" file="podpreset-preset.yaml" ghlink="/docs/tasks/inject-data-application/podpreset-preset.yaml" %} **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 + + ### Pod Spec with `ConfigMap` Example This is an example to show how a Pod spec is modified by the Pod Preset