Skip to content

Commit 8e31674

Browse files
authored
Merge pull request #108 from ckscks038038/fix-label-doc
Fix incorrect label example in deployment selector explanation
2 parents 0b94a5c + f149ac9 commit 8e31674

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/deployment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ spec:
3939
4040
其中 `kind` 表示我们要创建的资源是 `deployment` 类型, `metadata.name` 表示要创建的 deployment 的名字,这个名字需要是**唯一**的。
4141

42-
在 `spec` 里面表示,首先 `replicas` 表示的是部署的 pod 副本数量,`selector` 里面表示的是 `deployment` 资源和 `pod` 资源关联的方式,这里表示 `deployment` 会管理 (selector) 所有 `labels=hellok8s` 的 pod。
42+
在 `spec` 里面表示,首先 `replicas` 表示的是部署的 pod 副本数量,`selector` 里面表示的是 `deployment` 资源和 `pod` 资源关联的方式,这里表示 `deployment` 会管理 (selector) 所有 `labels=app: hellok8s` 的 pod。
4343

4444
`template` 的内容是用来定义 `pod` 资源的,你会发现和作业一:Hellok8s Pod 资源的定义是差不多的,唯一的区别是我们需要加上 `metadata.labels` 来和上面的 `selector.matchLabels` 对应起来。来表明 pod 是被 deployment 管理,不用在`template` 里面加上 `metadata.name` 是因为 deployment 会主动为我们创建 pod 的唯一`name`。
4545

0 commit comments

Comments
 (0)