Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sunny0826 committed Sep 6, 2019
1 parent a4e1ba0 commit e455acc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions examples/zh/image.md
Expand Up @@ -9,17 +9,17 @@ DEMO_HOME=$(mktemp -d)

创建包含pod资源的 `kustomization`

<!-- @createKustomization @testAgainstLatestRelease -->
<!-- @testAgainstLatestRelease to @test -->
```bash
cat <<EOF >$DEMO_HOME/kustomization.yaml
resources:
- pod.yaml
EOF
```

创建pod资源声明
创建 pod 资源pod.yaml

<!-- @createDeployment @testAgainstLatestRelease -->
<!-- @createDeployment @test -->
```bash
cat <<EOF >$DEMO_HOME/pod.yaml
apiVersion: v1
Expand All @@ -45,7 +45,7 @@ EOF
`kustomization.yaml` 中添加 `images` 字段来更改镜像 `busybox` 和标签 `1.29.0`

- 通过 `kustomize` 添加 `images`
<!-- @addImages @testAgainstLatestRelease -->
<!-- @addImages @test -->
```bash
cd $DEMO_HOME
kustomize edit set image busybox=alpine:3.6
Expand Down
12 changes: 6 additions & 6 deletions examples/zh/patchMultipleObjects.md
Expand Up @@ -5,9 +5,9 @@

# 示例:通过一个 patch 来修改多个资源

kustomization 文件支持通过 [Strategic Merge Patch][JSON patch] 来自定义资源。 现在,一个 patch 可以应用于多个资源
kustomization.yaml 支持通过 [Strategic Merge Patch][JSON patch] 来自定义资源。自 3.1.0 起,一个 patch 可以修改多个资源

可以通过指定 patch target 选择器来完成,如下所示:
这可以通过指定 patch 和它所修改的 target 来完成,如下所示:
```yaml
patches:
- path: <PatchFile>
Expand All @@ -26,7 +26,7 @@ patches:

创建一个包含 Deployment 资源的 `kustomization`

<!-- @createDeployment @testAgainstLatestRelease -->
<!-- @createDeployment @test -->
```bash
DEMO_HOME=$(mktemp -d)

Expand Down Expand Up @@ -71,7 +71,7 @@ EOF

声明 [Strategic Merge Patch] 文件以注入 sidecar 容器:

<!-- @addPatch @testAgainstLatestRelease -->
<!-- @addPatch @test -->
```bash
cat <<EOF >$DEMO_HOME/patch.yaml
apiVersion: apps/v1
Expand Down Expand Up @@ -104,7 +104,7 @@ EOF

运行 `kustomize build $DEMO_HOME`,可以在输出中确认两个 Deployment 资源都已正确应用。

<!-- @confirmPatch @testAgainstLatestRelease -->
<!-- @confirmPatch @test -->
```bash
test 2 == \
$(kustomize build $DEMO_HOME | grep "image: docker.io/istio/proxyv2" | wc -l); \
Expand Down Expand Up @@ -156,7 +156,7 @@ spec:
name: busybox
```

## Target selector
## Target 选择

- 选择名称与 `name*` 匹配的资源
```yaml
Expand Down
8 changes: 4 additions & 4 deletions examples/zh/remoteBuild.md
Expand Up @@ -2,11 +2,11 @@

`kustomize build` 可以将 URL 作为参数传入并运行.

运行效果与 clone repo,checkout 特定的 _ref_(commit hash, branch 名称, release tag 等),然后针对所需的目录运行 `kustomize build`
运行效果与如下操作相同:

如果想要要立即尝试此操作,可以按照 [multibases](../multibases/README.md) 示例运行 kustomization 运行构建。然后查看输出中的pod:

<!-- @remoteOverlayBuild @testAgainstLatestRelease -->
<!-- @remoteOverlayBuild @test -->

```bash
target="github.com/kubernetes-sigs/kustomize//examples/multibases/dev/?ref=v1.0.6"
Expand All @@ -17,7 +17,7 @@ test 1 == \

在该示例中运行 overlay 将获得三个 pod(在此 overlay 结合了dev、staging 和 prod 的 bases,以便同时将它们全部发送给所有人):

<!-- @remoteBuild @testAgainstLatestRelease -->
<!-- @remoteBuild @test -->
```bash
target="https://github.com/kubernetes-sigs/kustomize//examples/multibases?ref=v1.0.6"
test 3 == \
Expand All @@ -27,7 +27,7 @@ test 3 == \

将 URL 作为 base :

<!-- @createOverlay @testAgainstLatestRelease -->
<!-- @createOverlay @test -->
```bash
DEMO_HOME=$(mktemp -d)

Expand Down

0 comments on commit e455acc

Please sign in to comment.