Skip to content

Conversation

sirius1024
Copy link
Contributor

@sirius1024 sirius1024 commented Nov 6, 2019

@sirius1024 sirius1024 requested a review from a team as a code owner November 6, 2019 11:09
@googlebot googlebot added the cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA. label Nov 6, 2019
@istio-testing istio-testing added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. needs-ok-to-test labels Nov 6, 2019
@istio-testing
Copy link
Contributor

Hi @sirius1024. Thanks for your PR.

I'm waiting for a istio member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@@ -9,37 +9,35 @@ aliases:
- /docs/setup/kubernetes/additional-setup/sidecar-injection/
---

## Injection
## 注入
Copy link
Member

Choose a reason for hiding this comment

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

请问全文中所有的标题增加锚点。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已经加好测试过了。

Copy link
Member

@rootsongjc rootsongjc left a comment

Choose a reason for hiding this comment

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

缺少锚点

@rootsongjc rootsongjc added the translation/chinese Translation item label Nov 6, 2019
@rootsongjc
Copy link
Member

/ok-to-test

@istio-testing istio-testing added ok-to-test Set this label allow normal testing to take place for a PR not submitted by an Istio org member. and removed needs-ok-to-test labels Nov 6, 2019
@vflong
Copy link
Contributor

vflong commented Nov 6, 2019

/review

@@ -9,37 +9,35 @@ aliases:
- /docs/setup/kubernetes/additional-setup/sidecar-injection/
Copy link
Contributor

Choose a reason for hiding this comment

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

所有内部超链接前需要添加 /zh,例如
/zh/docs/setup/kubernetes/additional-setup/sidecar-injection/
/zh/docs/reference/commands/istioctl

Copy link
Contributor Author

Choose a reason for hiding this comment

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

所有内部超链接已经修复

title: Installing the Sidecar
description: Install the Istio sidecar in application pods automatically using the sidecar injector webhook or manually using istioctl CLI.
title: 设置 Sidecar
description: 在应用程序 Pod 中使用 sidecar injector webhook 自动安装或使用 istioctl CLI 手动安装 Istio sidecar 。
Copy link
Contributor

Choose a reason for hiding this comment

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

中文标点与英文之间不需要加空格

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已经修复


Manual injection directly modifies configuration, like deployments, and injects the proxy configuration into it.
手动注入直接修改配置,如 deployment ,并将代理配置注入其中。
Copy link
Contributor

Choose a reason for hiding this comment

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

中文标点与英文之间不需要加空格

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已经修复

The above command will not remove the injected sidecars from Pods. A
rolling update or simply deleting the pods and forcing the deployment
to create them is required.
上面的命令不会从 pod 中移除注入的 sidecar 。需要进行滚动更新或者直接删除 pod ,并强制 deployment 创建它们。
Copy link
Contributor

Choose a reason for hiding this comment

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

中文标点与英文之间不需要加空格

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已经修复

@luxious
Copy link
Contributor

luxious commented Nov 6, 2019

/review

@rootsongjc rootsongjc assigned luxious and vflong and unassigned vflong Nov 6, 2019
@@ -134,41 +130,27 @@ sleep-776b7bcdcd-bhn9m 2/2 Terminating 0 2m
sleep-776b7bcdcd-gmvnr 1/1 Running 0 2s
{{< /text >}}

#### Understanding what happened
#### 理解其过程{#understanding-what-happened}
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

title: Installing the Sidecar
description: Install the Istio sidecar in application pods automatically using the sidecar injector webhook or manually using istioctl CLI.
title: 设置 Sidecar
description: 在应用程序 Pod 中使用 sidecar injector webhook 自动安装或使用 istioctl CLI 手动安装 Istio sidecar 。
Copy link
Contributor

Choose a reason for hiding this comment

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

中文标点与英文之间不需要加空格,详见术语表。
https://github.com/servicemesher/istio-official-translation/blob/master/term.md

`istio-sidecar-injector` configuration map specifies the configuration for the
injected sidecar. To change how namespaces are selected for injection, you can
edit the `MutatingWebhookConfiguration` with the following command:
当 Kubernetes 调用 webhook 时, [`admissionregistration`](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.10/#mutatingwebhookconfiguration-v1beta1-admissionregistration-k8s-io) 配置被应用。默认配置将 sidecar 注入到所有拥有 `istio-injection=enabled` 标签的 namespace 下的 pod 中。 `istio-sidecar-injector` 配置图指定了注入 sidecar 的配置。如需更改指定哪些 namespace 被注入,你可以使用以下命令编辑 `MutatingWebhookConfiguration` :
Copy link
Contributor

Choose a reason for hiding this comment

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

英文与中文标点直接不需要加空格。

Copy link
Contributor

Choose a reason for hiding this comment

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

configuration map 翻译为配置图似乎不合适,map 在这里应该是指映射或字典。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

configuration map 翻译为配置图似乎不合适,map 在这里应该是指映射或字典。
不错。已经修改。
标点的哪些comments已经outdate了。您可以刷新一下,PR有更新这些错误。

@@ -286,19 +262,19 @@ data:
...
{{< /text >}}

The above statement means: Never inject on pods that have the label `openshift.io/build.name` **or** `openshift.io/deployer-pod-for.name` – the values of the labels don't matter, we are just checking if the keys exist. With this rule added, the OpenShift Builds use case illustrated above is covered, meaning auxiliary pods will not have sidecars injected (because source-to-image auxiliary pods **do** contain those labels).
上面声明的意思是:永远不要注入带有 `openshift.io/build.name` **或者** `openshift.io/deployer-pod-for.name` 标签的 pod —— 标签的值无关紧要,我们只检查键睡否存在。添加了这个规则之后,就涵盖了上面所说的 OpenShift 的构建用例,也就是说辅助 pod 不会被注入 sidecar(因为 source-to-image 工具产生的辅助 pod **明确**包含这些标签)。
Copy link
Contributor

Choose a reason for hiding this comment

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

睡否 => 是否

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed


To manually inject a deployment, use [`istioctl kube-inject`](/docs/reference/commands/istioctl/#istioctl-kube-inject):
要手动注入 deployment ,请使用 [`istioctl kube-inject`](/docs/reference/commands/istioctl/#istioctl-kube-inject)
Copy link
Contributor

Choose a reason for hiding this comment

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

deployment ,=> deployment,

{{< /tip >}}

When the injection webhook is enabled, any new pods that are created will automatically have a sidecar added to them.
当注入 webhook 被启用后,任何新的 pod 都有将在创建时自动添加 sidecar
Copy link
Contributor

Choose a reason for hiding this comment

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

sidecar 。=> sidecar。


{{< text bash >}}
$ kubectl describe pod -l app=sleep
{{< /text >}}

Disable injection for the `default` namespace and verify new pods are created without the sidecar.
禁用 `default` namespace 注入,并确认新的 pod 在创建时没有 sidecar
Copy link
Contributor

Choose a reason for hiding this comment

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

sidecar 。=> sidecar。


#### More control: adding exceptions
有些情况下用户无法控制 pod 的创建,例如,这些用户是被其他人创建的。因此他们无法在 pod 中添加 `sidecar.istio.io/inject` 注解,来明确是否安装 sidecar 。
Copy link
Contributor

Choose a reason for hiding this comment

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

sidecar 。=> sidecar。

@sirius1024
Copy link
Contributor Author

/retest


Note that unlike manual injection, automatic injection occurs at the pod-level. You won't see any change to the deployment itself. Instead you'll want to check individual pods (via `kubectl describe`) to see the injected proxy.
请注意,区别于手动注入,自动注入发生在 pod 层面。你将看不到 deployment 本身有任何更改。取而代之,需要检查单独的 pod(使用 `kubectl describe` )来查询被注入的代理。
Copy link
Contributor

Choose a reason for hiding this comment

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

此处右括号前多了一个空格
的 pod(使用 kubectl describe )来

`istio-sidecar-injector` configuration map specifies the configuration for the
injected sidecar. To change how namespaces are selected for injection, you can
edit the `MutatingWebhookConfiguration` with the following command:
当 Kubernetes 调用 webhook 时, [`admissionregistration`](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.10/#mutatingwebhookconfiguration-v1beta1-admissionregistration-k8s-io) 配置被应用。默认配置将 sidecar 注入到所有拥有 `istio-injection=enabled` 标签的 namespace 下的 pod 中。 `istio-sidecar-injector` 配置字典指定了注入 sidecar 的配置。如需更改指定哪些 namespace 被注入,你可以使用以下命令编辑 `MutatingWebhookConfiguration` :
Copy link
Contributor

Choose a reason for hiding this comment

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

中文标点与英文之间不需要加空格

命令编辑 MutatingWebhookConfiguration

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.


The label selector approach gives a lot of flexibility on how to express those exceptions. Take a look at [these docs](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#resources-that-support-set-based-requirements) to see what you can do with them!
使用标签选择器的方法在表达这些例外时提供了很大的灵活性。查看 [这些文档](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#resources-that-support-set-based-requirements) 看看可以用它们来做什么!
Copy link
Contributor

Choose a reason for hiding this comment

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

中文超链接前后无需加空格


The label selector approach gives a lot of flexibility on how to express those exceptions. Take a look at [these docs](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#resources-that-support-set-based-requirements) to see what you can do with them!
使用标签选择器的方法在表达这些例外时提供了很大的灵活性。查看[这些文档](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#resources-that-support-set-based-requirements) 看看可以用它们来做什么!
Copy link
Contributor

Choose a reason for hiding this comment

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

超链接右侧多了一个空格 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

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

超链接右侧多了一个空格 😅

Sorry for my negligence. Fixed.

@luxious
Copy link
Contributor

luxious commented Nov 7, 2019

/LGTM

Copy link
Member

@rootsongjc rootsongjc left a comment

Choose a reason for hiding this comment

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

/lgtm

@sirius1024
Copy link
Contributor Author

/retest

@vflong
Copy link
Contributor

vflong commented Nov 7, 2019

/LGTM

@istio-testing istio-testing merged commit 7aad648 into istio:master Nov 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA. kind/docs ok-to-test Set this label allow normal testing to take place for a PR not submitted by an Istio org member. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. translation/chinese Translation item
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants