@@ -15,7 +15,7 @@ You can visualize and manage Kubernetes objects with more tools than kubectl and
15
15
the dashboard. A common set of labels allows tools to work interoperably, describing
16
16
objects in a common manner that all tools can understand.
17
17
-->
18
- 除了 kubectl 和 dashboard 之外,你可以使用其他工具来可视化和管理 Kubernetes 对象。
18
+ 除了 kubectl 和 dashboard 之外,你还可以使用其他工具来可视化和管理 Kubernetes 对象。
19
19
一组通用的标签可以让多个工具之间相互操作,用所有工具都能理解的通用方式描述对象。
20
20
21
21
<!--
@@ -33,8 +33,8 @@ a platform as a service (PaaS) and doesn't have or enforce a formal notion of an
33
33
Instead, applications are informal and described with metadata. The definition of
34
34
what an application contains is loose.
35
35
-->
36
- 元数据围绕 _ 应用 (application)_ 的概念进行组织。Kubernetes 不是
37
- 平台即服务 (PaaS),没有或强制执行正式的应用程序概念。
36
+ 元数据围绕 ** 应用 (application)** 的概念进行组织。Kubernetes
37
+ 不是平台即服务 (PaaS),没有或强制执行正式的应用程序概念。
38
38
相反,应用程序是非正式的,并使用元数据进行描述。应用程序包含的定义是松散的。
39
39
40
40
{{< note >}}
@@ -50,15 +50,17 @@ Shared labels and annotations share a common prefix: `app.kubernetes.io`. Labels
50
50
without a prefix are private to users. The shared prefix ensures that shared labels
51
51
do not interfere with custom user labels.
52
52
-->
53
- 共享标签和注解都使用同一个前缀:` app.kubernetes.io ` 。没有前缀的标签是用户私有的。共享前缀可以确保共享标签不会干扰用户自定义的标签。
53
+ 共享标签和注解都使用同一个前缀:` app.kubernetes.io ` 。没有前缀的标签是用户私有的。
54
+ 共享前缀可以确保共享标签不会干扰用户自定义的标签。
54
55
55
56
<!--
56
57
## Labels
57
58
58
59
In order to take full advantage of using these labels, they should be applied
59
60
on every resource object.
60
61
-->
61
- ## 标签
62
+ ## 标签 {#labels}
63
+
62
64
为了充分利用这些标签,应该在每个资源对象上都使用它们。
63
65
64
66
<!--
@@ -70,17 +72,16 @@ on every resource object.
70
72
| `app.kubernetes.io/component` | The component within the architecture | `database` | string |
71
73
| `app.kubernetes.io/part-of` | The name of a higher level application this one is part of | `wordpress` | string |
72
74
| `app.kubernetes.io/managed-by` | The tool being used to manage the operation of an application | `helm` | string |
73
- | `app.kubernetes.io/created-by` | The controller/user who created this resource | `controller-manager` | string |
74
75
-->
75
76
| 键 | 描述 | 示例 | 类型 |
76
77
| ----------------------------------- | --------------------- | -------- | ---- |
77
78
| ` app.kubernetes.io/name ` | 应用程序的名称 | ` mysql ` | 字符串 |
78
79
| ` app.kubernetes.io/instance ` | 用于唯一确定应用实例的名称 | ` mysql-abcxzy ` | 字符串 |
79
- | ` app.kubernetes.io/version ` | 应用程序的当前版本(例如,语义版本, 修订版哈希等) | ` 5.7.21 ` | 字符串 |
80
+ | ` app.kubernetes.io/version ` | 应用程序的当前版本(例如语义版本、 修订版哈希等) | ` 5.7.21 ` | 字符串 |
80
81
| ` app.kubernetes.io/component ` | 架构中的组件 | ` database ` | 字符串 |
81
82
| ` app.kubernetes.io/part-of ` | 此级别的更高级别应用程序的名称 | ` wordpress ` | 字符串 |
82
83
| ` app.kubernetes.io/managed-by ` | 用于管理应用程序的工具 | ` helm ` | 字符串 |
83
- | ` app.kubernetes.io/created-by ` | 创建该资源的控制器或者用户 | ` controller-manager ` | 字符串 |
84
+
84
85
<!--
85
86
To illustrate these labels in action, consider the following {{< glossary_tooltip text="StatefulSet" term_id="statefulset" >}} object:
86
87
-->
@@ -98,7 +99,6 @@ metadata:
98
99
app.kubernetes.io/component : database
99
100
app.kubernetes.io/part-of : wordpress
100
101
app.kubernetes.io/managed-by : helm
101
- app.kubernetes.io/created-by : controller-manager
102
102
` ` `
103
103
104
104
<!--
@@ -114,9 +114,10 @@ an instance name, represented as `app.kubernetes.io/instance` with a value of
114
114
` wordpress-abcxzy` . This enables the application and instance of the application
115
115
to be identifiable. Every instance of an application must have a unique name.
116
116
-->
117
- # # 应用和应用实例
117
+ # # 应用和应用实例 {#application-and-instances-of-applications}
118
118
119
- 应用可以在 Kubernetes 集群中安装一次或多次。在某些情况下,可以安装在同一命名空间中。例如,可以不止一次地为不同的站点安装不同的 WordPress。
119
+ 应用可以在 Kubernetes 集群中安装一次或多次。在某些情况下,可以安装在同一命名空间中。
120
+ 例如,可以不止一次地为不同的站点安装不同的 WordPress。
120
121
121
122
应用的名称和实例的名称是分别记录的。例如,WordPress 应用的
122
123
` app.kubernetes.io/name` 为 `wordpress`,而其实例名称
@@ -126,7 +127,7 @@ to be identifiable. Every instance of an application must have a unique name.
126
127
<!--
127
128
# # Examples
128
129
-->
129
- # # 示例
130
+ # # 示例 {#examples}
130
131
131
132
<!--
132
133
To illustrate different ways to use these labels the following examples have varying complexity.
@@ -141,12 +142,14 @@ To illustrate different ways to use these labels the following examples have var
141
142
<!--
142
143
Consider the case for a simple stateless service deployed using `Deployment` and `Service` objects. The following two snippets represent how the labels could be used in their simplest form.
143
144
-->
144
- 考虑使用 `Deployment` 和 `Service` 对象部署的简单无状态服务的情况。以下两个代码段表示如何以最简单的形式使用标签。
145
+ 考虑使用 `Deployment` 和 `Service` 对象部署的简单无状态服务的情况。
146
+ 以下两个代码段表示如何以最简单的形式使用标签。
145
147
146
148
<!--
147
149
The `Deployment` is used to oversee the pods running the application itself.
148
150
-->
149
- 下面的 `Deployment` 用于监督运行应用本身的 pods。
151
+ 下面的 `Deployment` 用于监督运行应用本身的那些 Pod。
152
+
150
153
` ` ` yaml
151
154
apiVersion: apps/v1
152
155
kind: Deployment
@@ -161,6 +164,7 @@ metadata:
161
164
The `Service` is used to expose the application.
162
165
-->
163
166
下面的 `Service` 用于暴露应用。
167
+
164
168
` ` ` yaml
165
169
apiVersion: v1
166
170
kind: Service
@@ -183,8 +187,8 @@ the start of objects used to deploy this application.
183
187
184
188
The start to the following `Deployment` is used for WordPress :
185
189
-->
186
- 考虑一个稍微复杂的应用:一个使用 Helm 安装的 Web 应用(WordPress),其中
187
- 使用了数据库 (MySQL)。以下代码片段说明用于部署此应用程序的对象的开始。
190
+ 考虑一个稍微复杂的应用:一个使用 Helm 安装的 Web 应用(WordPress),
191
+ 其中使用了数据库 (MySQL)。以下代码片段说明用于部署此应用程序的对象的开始。
188
192
189
193
以下 `Deployment` 的开头用于 WordPress:
190
194
@@ -225,6 +229,7 @@ metadata:
225
229
MySQL is exposed as a `StatefulSet` with metadata for both it and the larger application it belongs to :
226
230
-->
227
231
MySQL 作为一个 `StatefulSet` 暴露,包含它和它所属的较大应用程序的元数据:
232
+
228
233
` ` ` yaml
229
234
apiVersion: apps/v1
230
235
kind: StatefulSet
@@ -243,6 +248,7 @@ metadata:
243
248
The `Service` is used to expose MySQL as part of WordPress :
244
249
-->
245
250
` Service` 用于将 MySQL 作为 WordPress 的一部分暴露:
251
+
246
252
` ` ` yaml
247
253
apiVersion: v1
248
254
kind: Service
@@ -258,6 +264,6 @@ metadata:
258
264
` ` `
259
265
260
266
<!--
261
- With the MySQL `StatefulSet` and `Service` you'll notice information about both MySQL and Wordpress , the broader application, are included.
267
+ With the MySQL `StatefulSet` and `Service` you'll notice information about both MySQL and WordPress , the broader application, are included.
262
268
-->
263
- 使用 MySQL `StatefulSet` 和 `Service`,你会注意到有关 MySQL 和 Wordpress 的信息,包括更广泛的应用程序。
269
+ 使用 MySQL `StatefulSet` 和 `Service`,你会注意到有关 MySQL 和 WordPress 的信息,包括更广泛的应用程序。
0 commit comments