Skip to content

zh-trans: update static-pod.md#14824

Merged
k8s-ci-robot merged 1 commit intokubernetes:release-1.14from
mysunshine92:update-static-pod
Jun 13, 2019
Merged

zh-trans: update static-pod.md#14824
k8s-ci-robot merged 1 commit intokubernetes:release-1.14from
mysunshine92:update-static-pod

Conversation

@mysunshine92
Copy link
Copy Markdown
Contributor

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Remember to delete this note before submitting your pull request.

For pull requests on 1.15 Features: set Milestone to 1.15 and Base Branch to dev-1.15

For pull requests on Chinese localization, set Base Branch to release-1.14

For pull requests on Korean Localization: set Base Branch to dev-1.14-ko.<latest team milestone>

If you need Help on editing and submitting pull requests, visit:
https://kubernetes.io/docs/contribute/start/#improve-existing-content.

If you need Help on choosing which branch to use, visit:
https://kubernetes.io/docs/contribute/start#choose-which-git-branch-to-use.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. language/zh Issues or PRs related to Chinese language sig/docs Categorizes an issue or PR as relevant to SIG Docs. labels Jun 11, 2019
@mysunshine92
Copy link
Copy Markdown
Contributor Author

cc @tengqm

@mysunshine92
Copy link
Copy Markdown
Contributor Author

/assign @jsafrane

@jsafrane
Copy link
Copy Markdown
Member

How did I become reviewer of static pods?
Anyway, the English part looks ok, I can't comment on the Chinese part.
/approve

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 12, 2019
Kubelet automatically tries to create a *mirror pod* on the Kubernetes API server for each static pod.
This means that the pods are visible on the API server but cannot be controlled from there.
--->
Kubelet 自动为每一个静态 pod 在 Kubernetes 的 API 服务器上创建一个镜像 Pod(*mirror pod*),因此可以在 API 服务器查询到该 pod,但是不被 API 服务器控制(例如不能删除)。
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Kubelet 自动为每一个静态 pod 在 Kubernetes 的 API 服务器上创建一个镜像 Pod(*mirror pod*),因此可以在 API 服务器查询到该 pod,但是不被 API 服务器控制(例如不能删除)。
Kubelet 自动为每一个静态 pod 在 Kubernetes 的 API 服务器上创建一个*镜像 Pod* (*mirror pod*),因此可以在 API 服务器查询到该 pod,但是不被 API 服务器控制(例如不能删除)。

### 配置文件

配置文件就是放在特定目录下的标准的 JSON 或 YAML 格式的 pod 定义文件。用`kubelet --pod-manifest-path=<the directory>`来启动 kubelet 进程,kubelet 将会周期扫描<the directory>这个目录,根据这个目录下出现或消失的 YAML/JSON 文件来创建或删除静态 pod。
配置文件就是放在特定目录下的标准的 JSON 或 YAML 格式的 pod 定义文件。用`kubelet --pod-manifest-path=<the directory>`来启动 kubelet 进程或者在[KubeletConfiguration 文件](/docs/tasks/administer-cluster/kubelet-config-file)中添加`staticPodPath: <the directory>`字段,kubelet 将会周期扫描<the directory>这个目录,根据这个目录下出现或消失的 YAML/JSON 文件来创建或删除静态 pod。
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
配置文件就是放在特定目录下的标准的 JSON 或 YAML 格式的 pod 定义文件。用`kubelet --pod-manifest-path=<the directory>`来启动 kubelet 进程或者在[KubeletConfiguration 文件](/docs/tasks/administer-cluster/kubelet-config-file)中添加`staticPodPath: <the directory>`字段,kubelet 将会周期扫描<the directory>这个目录,根据这个目录下出现或消失的 YAML/JSON 文件来创建或删除静态 pod。
配置文件就是放在特定目录下的标准的 JSON 或 YAML 格式的 pod 定义文件。用 `kubelet --pod-manifest-path=<the directory>` 来启动 kubelet 进程或者在 [KubeletConfiguration 文件](/docs/tasks/administer-cluster/kubelet-config-file)中添加 `staticPodPath: <the directory>` 字段,kubelet 将会周期扫描 `<the directory>` 这个目录,根据这个目录下出现或消失的 YAML/JSON 文件来创建或删除静态 pod。

--->
下面例子用静态 pod 的方式启动一个简单的 Web 服务器:

1. 选择一个节点来运行静态 pod。这个例子中就是`my-node1`。
Copy link
Copy Markdown
Member

@chenrui333 chenrui333 Jun 12, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. 选择一个节点来运行静态 pod。这个例子中就是`my-node1`
1. 选择一个节点来运行静态 pod。这个例子中就是 `my-node1`

下面例子用静态 pod 的方式启动一个 nginx 的 Web 服务器:
2. Choose a directory, say `/etc/kubelet.d` and place a web server pod definition there, e.g. `/etc/kubelet.d/static-web.yaml`:
--->
下面例子用静态 pod 的方式启动一个简单的 Web 服务器:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
下面例子用静态 pod 的方式启动一个简单的 Web 服务器:
下面例子用静态 pod 的方式启动一个简单的 web 服务器:


Instructions for other distributions or Kubernetes installations may vary.
--->
3.配置节点上的 kubelet 使用这个目录,kubelet 启动时增加`--pod-manifest-path=/etc/kubelet.d/`参数或者在[KubeletConfiguration 文件](/docs/tasks/administer-cluster/kubelet-config-file)中增加`staticPodPath: <the directory>`字段。如果是 Fedora 系统,在 Kubelet 配置文件 /etc/kubernetes/kubelet 中添加下面这行:
Copy link
Copy Markdown
Member

@chenrui333 chenrui333 Jun 12, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
3.配置节点上的 kubelet 使用这个目录,kubelet 启动时增加`--pod-manifest-path=/etc/kubelet.d/`参数或者在[KubeletConfiguration 文件](/docs/tasks/administer-cluster/kubelet-config-file)中增加`staticPodPath: <the directory>`字段。如果是 Fedora 系统,在 Kubelet 配置文件 /etc/kubernetes/kubelet 中添加下面这行
3.配置节点上的 kubelet 使用这个目录,kubelet 启动时增加`--pod-manifest-path=/etc/kubelet.d/`参数或者在 [KubeletConfiguration 文件](/docs/tasks/administer-cluster/kubelet-config-file)中增加 `staticPodPath: <the directory>` 字段。如果是 Fedora 系统,在 Kubelet 配置文件 /etc/kubernetes/kubelet 中添加下面这行配置代码

role: myrole
spec:
containers:
```shell
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里的代码可以不用修改。

也和其他地方的代码风格一致。:smile:


When kubelet starts, it automatically starts all pods defined in directory specified in `--pod-manifest-path=` or `--manifest-url=` arguments or add the `staticPodPath: <the directory>` field in the [KubeletConfiguration file](/docs/tasks/administer-cluster/kubelet-config-file), i.e. our static-web. (It may take some time to pull nginx image, be patient…):
--->
## 静态 pods 的动作行为
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## 静态 pods 的动作行为
## 静态 pods 的行为

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

另外的改进意见,虽然你没有修改这部分 😆

{{< /note >}}
--->
{{< note >}}
需要确保 kubelet 有权限在 API 服务器上创建镜像 pod。如果没有权限,API 服务器会拒绝创建请求,请参考[PodSecurityPolicy](/docs/concepts/policy/pod-security-policy/)。
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
需要确保 kubelet 有权限在 API 服务器上创建镜像 pod。如果没有权限,API 服务器会拒绝创建请求,请参考[PodSecurityPolicy](/docs/concepts/policy/pod-security-policy/)
需要确保 kubelet 有权限在 API 服务器上创建镜像 pod。如果没有权限,API 服务器会拒绝创建请求,请参考 [PodSecurityPolicy](/docs/concepts/policy/pod-security-policy/)

<!--
Back to our `my-node1` host, we can try to stop the container manually and see, that kubelet automatically restarts it in a while:
--->
返回`my-node1`主机,我们尝试手动终止容器,可以看到 kubelet 很快就会自动重启容器。
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
返回`my-node1`主机,我们尝试手动终止容器,可以看到 kubelet 很快就会自动重启容器。
返回 `my-node1` 主机,我们尝试手动终止容器,可以看到 kubelet 很快就会自动重启容器。

Copy link
Copy Markdown
Member

@chenrui333 chenrui333 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor comments about article style, and some suggestions. Otherwise, lgtm!

@chenrui333
Copy link
Copy Markdown
Member

Thanks for your contributions!

@mysunshine92 mysunshine92 force-pushed the update-static-pod branch 3 times, most recently from 28cffd6 to cc3c229 Compare June 12, 2019 16:03
@mysunshine92
Copy link
Copy Markdown
Contributor Author

@chenrui333 thanks for your suggesstion, I have modified those.
please add an lgtm and approve label, thanks.

Copy link
Copy Markdown
Member

@chenrui333 chenrui333 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 13, 2019
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chenrui333, jsafrane

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@chenrui333
Copy link
Copy Markdown
Member

Thanks for the updates! Cheers!

@k8s-ci-robot k8s-ci-robot merged commit 19d4217 into kubernetes:release-1.14 Jun 13, 2019
SataQiu pushed a commit to SataQiu/website that referenced this pull request Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. language/zh Issues or PRs related to Chinese language lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/docs Categorizes an issue or PR as relevant to SIG Docs. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants