Skip to content

Commit 78ab651

Browse files
authored
Merge pull request #18342 from sftim/20191227_tidy_pod_preset_pages
Tidy pages for PodPreset
2 parents 2da45fa + 58498dc commit 78ab651

File tree

2 files changed

+34
-30
lines changed

2 files changed

+34
-30
lines changed

content/en/docs/concepts/workloads/pods/podpreset.md

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,47 @@ weight: 50
77
---
88

99
{{% capture overview %}}
10+
{{< feature-state for_k8s_version="v1.6" state="alpha" >}}
11+
1012
This page provides an overview of PodPresets, which are objects for injecting
1113
certain information into pods at creation time. The information can include
1214
secrets, volumes, volume mounts, and environment variables.
1315
{{% /capture %}}
1416

1517

1618
{{% capture body %}}
17-
## Understanding Pod Presets
19+
## Understanding Pod presets
1820

19-
A `Pod Preset` is an API resource for injecting additional runtime requirements
21+
A PodPreset is an API resource for injecting additional runtime requirements
2022
into a Pod at creation time.
2123
You use [label selectors](/docs/concepts/overview/working-with-objects/labels/#label-selectors)
22-
to specify the Pods to which a given Pod Preset applies.
24+
to specify the Pods to which a given PodPreset applies.
2325

24-
Using a Pod Preset allows pod template authors to not have to explicitly provide
26+
Using a PodPreset allows pod template authors to not have to explicitly provide
2527
all information for every pod. This way, authors of pod templates consuming a
2628
specific service do not need to know all the details about that service.
2729

28-
For more information about the background, see the [design proposal for PodPreset](https://git.k8s.io/community/contributors/design-proposals/service-catalog/pod-preset.md).
2930

30-
## How It Works
31+
## Enable PodPreset in your cluster {#enable-pod-preset}
32+
33+
In order to use Pod presets in your cluster you must ensure the following:
34+
35+
1. You have enabled the API type `settings.k8s.io/v1alpha1/podpreset`. For
36+
example, this can be done by including `settings.k8s.io/v1alpha1=true` in
37+
the `--runtime-config` option for the API server. In minikube add this flag
38+
`--extra-config=apiserver.runtime-config=settings.k8s.io/v1alpha1=true` while
39+
starting the cluster.
40+
1. You have enabled the admission controller `PodPreset`. One way to doing this
41+
is to include `PodPreset` in the `--enable-admission-plugins` option value specified
42+
for the API server. In minikube, add this flag
43+
44+
```shell
45+
--extra-config=apiserver.enable-admission-plugins=NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota,PodPreset
46+
```
47+
48+
while starting the cluster.
49+
50+
## How it works
3151

3252
Kubernetes provides an admission controller (`PodPreset`) which, when enabled,
3353
applies Pod Presets to incoming pod creation requests.
@@ -62,31 +82,12 @@ There may be instances where you wish for a Pod to not be altered by any Pod
6282
Preset mutations. In these cases, you can add an annotation in the Pod Spec
6383
of the form: `podpreset.admission.kubernetes.io/exclude: "true"`.
6484

65-
## Enable Pod Preset
66-
67-
In order to use Pod Presets in your cluster you must ensure the following:
68-
69-
1. You have enabled the API type `settings.k8s.io/v1alpha1/podpreset`. For
70-
example, this can be done by including `settings.k8s.io/v1alpha1=true` in
71-
the `--runtime-config` option for the API server. In minikube add this flag
72-
`--extra-config=apiserver.runtime-config=settings.k8s.io/v1alpha1=true` while
73-
starting the cluster.
74-
1. You have enabled the admission controller `PodPreset`. One way to doing this
75-
is to include `PodPreset` in the `--enable-admission-plugins` option value specified
76-
for the API server. In minikube add this flag
77-
78-
```shell
79-
--extra-config=apiserver.enable-admission-plugins=NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota,PodPreset
80-
```
81-
82-
while starting the cluster.
83-
1. You have defined your Pod Presets by creating `PodPreset` objects in the
84-
namespace you will use.
85-
8685
{{% /capture %}}
8786

8887
{{% capture whatsnext %}}
8988

90-
* [Injecting data into a Pod using PodPreset](/docs/tasks/inject-data-application/podpreset/)
89+
See [Injecting data into a Pod using PodPreset](/docs/tasks/inject-data-application/podpreset/)
90+
91+
For more information about the background, see the [design proposal for PodPreset](https://git.k8s.io/community/contributors/design-proposals/service-catalog/pod-preset.md).
9192

9293
{{% /capture %}}

content/en/docs/tasks/inject-data-application/podpreset.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,23 @@
22
reviewers:
33
- jessfraz
44
title: Inject Information into Pods Using a PodPreset
5-
min-kubernetes-server-version: v1.10
5+
min-kubernetes-server-version: v1.6
66
content_template: templates/task
77
weight: 60
88
---
99

1010
{{% capture overview %}}
1111

12+
{{< feature-state for_k8s_version="v1.6" state="alpha" >}}
13+
1214
This page shows how to use PodPreset objects to inject information like {{< glossary_tooltip text="Secrets" term_id="secret" >}}, volume mounts, and {{< glossary_tooltip text="environment variables" term_id="container-env-variables" >}} into Pods at creation time.
1315

1416
{{% /capture %}}
1517

1618
{{% capture prerequisites %}}
1719

18-
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
20+
You need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster. If you do not already have a cluster, you can create one using [Minikube](/docs/setup/learning-environment/minikube/).
21+
Make sure that you have [enabled PodPreset](/docs/concepts/workloads/pods/podpreset/#enable-pod-preset) in your cluster.
1922

2023
{{% /capture %}}
2124

0 commit comments

Comments
 (0)