Files
Zach Corleissen abcee2dccd Update localization guidelines (#10485)
* Update localization guidelines for language labels

Continuing work

Continuing work

Continuing work

More work in progress

Add local OWNERS folders

Add an OWNERS file to Chinese

Remove shortcode for repos

Add Japanese

Alphabetize languages, change weights accordingly

More updates

Add Korean in Korean

Add English to languageName

Feedback from gochist

Move Chinese content from cn/ to zh/

Move OWNERS from cn/ to zh/

Resolve merge conflicts by updating from master

Add files back in to prep for resolution

After rebase on upstream/master, remove files

Review and update localization guidelines

Feedback from gochist, tnir, cstoku

Add a trailing newline to content/ja/OWNERS

Add a trailing newline to content/zh/OWNERS

Drop requirement for GH repo project

Clarify language about forks/branches

Edits and typos

Remove a shortcode specific to a multi-repo language setup

Update aliases and owners

Add explicit OWNERS for content/en

Migrate content from Chinese repo, update regex in config.toml

Remove untranslated strings

Add trailing newline to content/en/OWNERS

Add trailing newlines to OWNERS files

add Jaguar project description (#10433)

* add Jaguar project description

[Jaguar](https://gitlab.com/sdnlab/jaguar) is an open source solution for Kubernetes's network based on OpenDaylight.
Jaguar provides overlay network using vxlan and Jaguar CNIPlugin provides one IP address per pod.

* Minor newline tweak

blog post for azure vmss (#10538)

Add microk8s to pick-right-solution.md (#10542)

* Add microk8s to pick-right-solution.md

Microk8s is a single-command installation of upstream Kubernetes on any Linux and should be included in the list of local-machine solutions.

* capitalized Istio

Add microk8s to foundational.md (#10543)

* Add microk8s to foundational.md

Adding microk8s as credible and stable alternative to get started with Kubernetes on a local machine. This is especially attractive for those not wanting to incur the overhead of running a VM for a local cluster.

* Update foundational.md

Thank you for your suggestions! LMK if this works now?

* Rewrote first paragraph

And included a bullet list of features of microk8s

* Copyedit

fix typo (#10545)

Fix the kubectl subcommands links. (#10550)

Signed-off-by: William Zhang <warmchang@outlook.com>

Fix command issue (#10515)

Signed-off-by: mooncake <xcoder@tenxcloud.com>

remove imported community files per issue 10184 (#10501)

networking.md: Markdown fix (#10498)

Fix front matter, federation command-line tools (#10500)

Clean up glossary entry (#10399)

update slack link (#10536)

typo in StatefulSet docs (#10558)

fix discription about horizontal pod autoscale (#10557)

Remove redundant symbols (#10556)

Fix issue #10520 (#10554)

Signed-off-by: William Zhang <warmchang@outlook.com>

Update api-concepts.md (#10534)

Revert "Fix command issue (#10515)"

This reverts commit c02a7fb9f9.

Update memory-constraint-namespace.md (#10530)

update memory request to 100MiB corresponding the yaml content

Blog: Introducing Volume Snapshot Alpha for Kubernetes (#10562)

* blog post for azure vmss

* snapshot blog post

Resolve merge conflicts in OWNERS*

Minor typo fix (#10567)

Not sure what's supposed to be here, proposing removing it.

* Feedback from gochist

Tweaks to feedback

* Feedback from ClaudiaJKang
2018-10-12 14:25:01 -07:00

3.2 KiB
Raw Permalink Blame History

approvers, title, content_template
approvers title content_template
jessfraz
Pod Preset templates/concept

{{% capture overview %}} 本文提供了 PodPreset 的概述。 在 pod 创建时,用户可以使用 podpreset 对象将特定信息注入 pod 中,这些信息可以包括 secret、 卷、卷挂载和环境变量。 {{% /capture %}}

{{< toc >}}

{{% capture body %}}

理解 Pod Preset

Pod Preset 是一种 API 资源,在 pod 创建时,用户可以用它将额外的运行时需求信息注入 pod。 使用标签选择器(label selector来指定 Pod Preset 所适用的 pod。

使用 Pod Preset 使得 pod 模板编写者不必显式地为每个 pod 设置信息。 这样,使用特定服务的 pod 模板编写者不需要了解该服务的所有细节。

了解更多的相关背景信息,请参考 PodPreset 设计提案

PodPreset 如何工作

Kubernetes 提供了准入控制器 (PodPreset),该控制器被启用时,会将 Pod Preset 应用于接收到的 pod 创建请求中。 当出现 pod 创建请求时,系统会执行以下操作:

  1. 检索所有可用 PodPresets
  2. 检查 PodPreset 的标签选择器与要创建的 pod 的标签是否匹配。
  3. 尝试合并 PodPreset 中定义的各种资源,并注入要创建的 pod。
  4. 发生错误时抛出事件,该事件记录了 pod 信息合并错误,同时在 不注入 PodPreset 信息的情况下创建 pod。
  5. 为改动的 pod spec 添加注解,来表明它被 PodPreset 所修改。 注解形如: podpreset.admission.kubernetes.io/podpreset-<pod-preset name>": "<resource version>"

一个 Pod 可能不与任何 Pod Preset 匹配,也可能匹配多个 Pod Preset。 同时,一个 PodPreset 可能不应用于任何 Pod,也可能应用于多个 Pod。 当 PodPreset 应用于一个或多个 Pod 时,Kubernetes 修改 pod spec。 对于 EnvEnvFromVolumeMounts 的改动, Kubernetes 修改 pod 中所有容器的规格,对于卷的改动,Kubernetes 修改 Pod spec。

{{< note >}} 注意: Pod Preset 能够在适当的时候修改 Pod spec 的 spec.containers 字段, 但是不会应用于 initContainers 字段。 {{< /note >}}

为特定 Pod 禁用 Pod Preset

在一些情况下,用户不希望 pod 被 pod preset 所改动,这时,用户可以在 pod spec 中添加形如 podpreset.admission.kubernetes.io/exclude: "true" 的注解。

启用 Pod Preset

为了在集群中使用 Pod Preset,必须确保以下几点:

  1. 已启用 api 类型 settings.k8s.io/v1alpha1/podpreset。 这可以通过在 API 服务器的 --runtime-config 配置项中包含 settings.k8s.io/v1alpha1=true 来实现。
  2. 已启用准入控制器 PodPreset。 启用的一种方式是在 API 服务器的 --admission-control 配置项中包含 PodPreset
  3. 已经通过在相应的名字空间中创建 PodPreset 对象,定义了 Pod preset。

{{% /capture %}}

{{% capture whatsnext %}}

{{% /capture %}}