From 1b7708b975351c9bb27851ab60b3f82caf60f317 Mon Sep 17 00:00:00 2001 From: jlsong01 Date: Wed, 25 Nov 2020 23:38:13 +0800 Subject: [PATCH] rm podpresent --- .../en/docs/concepts/workloads/pods/_index.md | 1 - .../docs/concepts/workloads/pods/podpreset.md | 91 ------------------- 2 files changed, 92 deletions(-) delete mode 100644 content/en/docs/concepts/workloads/pods/podpreset.md diff --git a/content/en/docs/concepts/workloads/pods/_index.md b/content/en/docs/concepts/workloads/pods/_index.md index 1353d297a1..8ead92d2bd 100644 --- a/content/en/docs/concepts/workloads/pods/_index.md +++ b/content/en/docs/concepts/workloads/pods/_index.md @@ -253,7 +253,6 @@ but cannot be controlled from there. ## {{% heading "whatsnext" %}} * Learn about the [lifecycle of a Pod](/docs/concepts/workloads/pods/pod-lifecycle/). -* Learn about [PodPresets](/docs/concepts/workloads/pods/podpreset/). * Learn about [RuntimeClass](/docs/concepts/containers/runtime-class/) and how you can use it to configure different Pods with different container runtime configurations. * Read about [Pod topology spread constraints](/docs/concepts/workloads/pods/pod-topology-spread-constraints/). diff --git a/content/en/docs/concepts/workloads/pods/podpreset.md b/content/en/docs/concepts/workloads/pods/podpreset.md deleted file mode 100644 index 9cbb7bdff8..0000000000 --- a/content/en/docs/concepts/workloads/pods/podpreset.md +++ /dev/null @@ -1,91 +0,0 @@ ---- -reviewers: -- jessfraz -title: Pod Presets -content_type: concept -weight: 50 ---- - - -{{< feature-state for_k8s_version="v1.6" state="alpha" >}} - -This page provides an overview of PodPresets, which are objects for injecting -certain information into pods at creation time. The information can include -secrets, volumes, volume mounts, and environment variables. - - - - -## Understanding Pod presets - -A PodPreset is an API resource for injecting additional runtime requirements -into a Pod at creation time. -You use [label selectors](/docs/concepts/overview/working-with-objects/labels/#label-selectors) -to specify the Pods to which a given PodPreset applies. - -Using a PodPreset allows pod template authors to not have to explicitly provide -all information for every pod. This way, authors of pod templates consuming a -specific service do not need to know all the details about that service. - - -## Enable PodPreset in your cluster {#enable-pod-preset} - -In order to use Pod presets in your cluster you must ensure the following: - -1. You have enabled the API type `settings.k8s.io/v1alpha1/podpreset`. For - example, this can be done by including `settings.k8s.io/v1alpha1=true` in - the `--runtime-config` option for the API server. In minikube add this flag - `--extra-config=apiserver.runtime-config=settings.k8s.io/v1alpha1=true` while - starting the cluster. -1. You have enabled the admission controller named `PodPreset`. One way to doing this - is to include `PodPreset` in the `--enable-admission-plugins` option value specified - for the API server. For example, if you use Minikube, add this flag: - - ```shell - --extra-config=apiserver.enable-admission-plugins=NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota,PodPreset - ``` - - while starting your cluster. - -## How it works - -Kubernetes provides an admission controller (`PodPreset`) which, when enabled, -applies Pod Presets to incoming pod creation requests. -When a pod creation request occurs, the system does the following: - -1. Retrieve all `PodPresets` available for use. -1. Check if the label selectors of any `PodPreset` matches the labels on the - pod being created. -1. Attempt to merge the various resources defined by the `PodPreset` into the - Pod being created. -1. On error, throw an event documenting the merge error on the pod, and create - the pod _without_ any injected resources from the `PodPreset`. -1. Annotate the resulting modified Pod spec to indicate that it has been - modified by a `PodPreset`. The annotation is of the form - `podpreset.admission.kubernetes.io/podpreset-: ""`. - -Each Pod can be matched by zero or more PodPresets; and each PodPreset can be -applied to zero or more Pods. When a PodPreset is applied to one or more -Pods, Kubernetes modifies the Pod Spec. For changes to `env`, `envFrom`, and -`volumeMounts`, Kubernetes modifies the container spec for all containers in -the Pod; for changes to `volumes`, Kubernetes modifies the Pod Spec. - -{{< note >}} -A Pod Preset is capable of modifying the following fields in a Pod spec when appropriate: -- The `.spec.containers` field -- The `.spec.initContainers` field -{{< /note >}} - -### Disable Pod Preset for a specific pod - -There may be instances where you wish for a Pod to not be altered by any Pod -preset mutations. In these cases, you can add an annotation in the Pod's `.spec` -of the form: `podpreset.admission.kubernetes.io/exclude: "true"`. - - - -## {{% heading "whatsnext" %}} - -See [Injecting data into a Pod using PodPreset](/docs/tasks/inject-data-application/podpreset/) - -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).