Skip to content

Commit f9ebc90

Browse files
[en] update en docs to use recommended labels
1 parent 580c643 commit f9ebc90

File tree

14 files changed

+64
-65
lines changed

14 files changed

+64
-65
lines changed

content/en/docs/concepts/configuration/overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ DNS server watches the Kubernetes API for new `Services` and creates a set of DN
6363

6464
## Using Labels
6565

66-
- Define and use [labels](/docs/concepts/overview/working-with-objects/labels/) that identify __semantic attributes__ of your application or Deployment, such as `{ app: myapp, tier: frontend, phase: test, deployment: v3 }`. You can use these labels to select the appropriate Pods for other resources; for example, a Service that selects all `tier: frontend` Pods, or all `phase: test` components of `app: myapp`. See the [guestbook](http://github.com/kubernetes/examples/tree/master/guestbook/) app for examples of this approach.
66+
- Define and use [labels](/docs/concepts/overview/working-with-objects/labels/) that identify __semantic attributes__ of your application or Deployment, such as `{ app.kubernetes.io/name: MyApp, tier: frontend, phase: test, deployment: v3 }`. You can use these labels to select the appropriate Pods for other resources; for example, a Service that selects all `tier: frontend` Pods, or all `phase: test` components of `app.kubernetes.io/name: MyApp`. See the [guestbook](http://github.com/kubernetes/examples/tree/master/guestbook/) app for examples of this approach.
6767

6868
A Service can be made to span multiple Deployments by omitting release-specific labels from its selector. When you need to update a running service without downtime, use a [Deployment](/docs/concepts/workloads/controllers/deployment/).
6969

content/en/docs/concepts/services-networking/dual-stack.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ IPv4/IPv6 dual-stack on your Kubernetes cluster provides the following features:
3737

3838
The following prerequisites are needed in order to utilize IPv4/IPv6 dual-stack Kubernetes clusters:
3939

40-
* Kubernetes 1.20 or later
40+
* Kubernetes 1.20 or later
4141

4242
For information about using dual-stack services with earlier
4343
Kubernetes versions, refer to the documentation for that version
@@ -95,7 +95,7 @@ set the `.spec.ipFamilyPolicy` field to one of the following values:
9595

9696
If you would like to define which IP family to use for single stack or define the order of IP
9797
families for dual-stack, you can choose the address families by setting an optional field,
98-
`.spec.ipFamilies`, on the Service.
98+
`.spec.ipFamilies`, on the Service.
9999

100100
{{< note >}}
101101
The `.spec.ipFamilies` field is immutable because the `.spec.ClusterIP` cannot be reallocated on a
@@ -133,11 +133,11 @@ These examples demonstrate the behavior of various dual-stack Service configurat
133133
address assignments. The field `.spec.ClusterIPs` is the primary field, and contains both assigned
134134
IP addresses; `.spec.ClusterIP` is a secondary field with its value calculated from
135135
`.spec.ClusterIPs`.
136-
136+
137137
* For the `.spec.ClusterIP` field, the control plane records the IP address that is from the
138-
same address family as the first service cluster IP range.
138+
same address family as the first service cluster IP range.
139139
* On a single-stack cluster, the `.spec.ClusterIPs` and `.spec.ClusterIP` fields both only list
140-
one address.
140+
one address.
141141
* On a cluster with dual-stack enabled, specifying `RequireDualStack` in `.spec.ipFamilyPolicy`
142142
behaves the same as `PreferDualStack`.
143143

@@ -174,7 +174,7 @@ dual-stack.)
174174
kind: Service
175175
metadata:
176176
labels:
177-
app: MyApp
177+
app.kubernetes.io/name: MyApp
178178
name: my-service
179179
spec:
180180
clusterIP: 10.0.197.123
@@ -188,7 +188,7 @@ dual-stack.)
188188
protocol: TCP
189189
targetPort: 80
190190
selector:
191-
app: MyApp
191+
app.kubernetes.io/name: MyApp
192192
type: ClusterIP
193193
status:
194194
loadBalancer: {}
@@ -214,7 +214,7 @@ dual-stack.)
214214
kind: Service
215215
metadata:
216216
labels:
217-
app: MyApp
217+
app.kubernetes.io/name: MyApp
218218
name: my-service
219219
spec:
220220
clusterIP: None
@@ -228,7 +228,7 @@ dual-stack.)
228228
protocol: TCP
229229
targetPort: 80
230230
selector:
231-
app: MyApp
231+
app.kubernetes.io/name: MyApp
232232
```
233233

234234
#### Switching Services between single-stack and dual-stack

content/en/docs/concepts/services-networking/service-traffic-policy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ metadata:
4343
name: my-service
4444
spec:
4545
selector:
46-
app: MyApp
46+
app.kubernetes.io/name: MyApp
4747
ports:
4848
- protocol: TCP
4949
port: 80

content/en/docs/concepts/services-networking/service.md

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ The name of a Service object must be a valid
7575
[RFC 1035 label name](/docs/concepts/overview/working-with-objects/names#rfc-1035-label-names).
7676

7777
For example, suppose you have a set of Pods where each listens on TCP port 9376
78-
and contains a label `app=MyApp`:
78+
and contains a label `app.kubernetes.io/name=MyApp`:
7979

8080
```yaml
8181
apiVersion: v1
@@ -84,15 +84,15 @@ metadata:
8484
name: my-service
8585
spec:
8686
selector:
87-
app: MyApp
87+
app.kubernetes.io/name: MyApp
8888
ports:
8989
- protocol: TCP
9090
port: 80
9191
targetPort: 9376
9292
```
9393
9494
This specification creates a new Service object named "my-service", which
95-
targets TCP port 9376 on any Pod with the `app=MyApp` label.
95+
targets TCP port 9376 on any Pod with the `app.kubernetes.io/name=MyApp` label.
9696

9797
Kubernetes assigns this Service an IP address (sometimes called the "cluster IP"),
9898
which is used by the Service proxies
@@ -126,7 +126,7 @@ spec:
126126
ports:
127127
- containerPort: 80
128128
name: http-web-svc
129-
129+
130130
---
131131
apiVersion: v1
132132
kind: Service
@@ -144,9 +144,9 @@ spec:
144144

145145

146146
This works even if there is a mixture of Pods in the Service using a single
147-
configured name, with the same network protocol available via different
148-
port numbers. This offers a lot of flexibility for deploying and evolving
149-
your Services. For example, you can change the port numbers that Pods expose
147+
configured name, with the same network protocol available via different
148+
port numbers. This offers a lot of flexibility for deploying and evolving
149+
your Services. For example, you can change the port numbers that Pods expose
150150
in the next version of your backend software, without breaking clients.
151151

152152
The default protocol for Services is TCP; you can also use any other
@@ -159,7 +159,7 @@ Each port definition can have the same `protocol`, or a different one.
159159
### Services without selectors
160160

161161
Services most commonly abstract access to Kubernetes Pods thanks to the selector,
162-
but when used with a corresponding Endpoints object and without a selector, the Service can abstract other kinds of backends,
162+
but when used with a corresponding Endpoints object and without a selector, the Service can abstract other kinds of backends,
163163
including ones that run outside the cluster. For example:
164164

165165
* You want to have an external database cluster in production, but in your
@@ -222,10 +222,10 @@ In the example above, traffic is routed to the single endpoint defined in
222222
the YAML: `192.0.2.42:9376` (TCP).
223223

224224
{{< note >}}
225-
The Kubernetes API server does not allow proxying to endpoints that are not mapped to
226-
pods. Actions such as `kubectl proxy <service-name>` where the service has no
227-
selector will fail due to this constraint. This prevents the Kubernetes API server
228-
from being used as a proxy to endpoints the caller may not be authorized to access.
225+
The Kubernetes API server does not allow proxying to endpoints that are not mapped to
226+
pods. Actions such as `kubectl proxy <service-name>` where the service has no
227+
selector will fail due to this constraint. This prevents the Kubernetes API server
228+
from being used as a proxy to endpoints the caller may not be authorized to access.
229229
{{< /note >}}
230230

231231
An ExternalName Service is a special case of Service that does not have
@@ -289,7 +289,7 @@ There are a few reasons for using proxying for Services:
289289

290290
Later in this page you can read about various kube-proxy implementations work. Overall,
291291
you should note that, when running `kube-proxy`, kernel level rules may be
292-
modified (for example, iptables rules might get created), which won't get cleaned up,
292+
modified (for example, iptables rules might get created), which won't get cleaned up,
293293
in some cases until you reboot. Thus, running kube-proxy is something that should
294294
only be done by an administrator which understands the consequences of having a
295295
low level, privileged network proxying service on a computer. Although the `kube-proxy`
@@ -423,7 +423,7 @@ metadata:
423423
name: my-service
424424
spec:
425425
selector:
426-
app: MyApp
426+
app.kubernetes.io/name: MyApp
427427
ports:
428428
- name: http
429429
protocol: TCP
@@ -636,7 +636,7 @@ to specify IP address ranges that kube-proxy should consider as local to this no
636636

637637
For example, if you start kube-proxy with the `--nodeport-addresses=127.0.0.0/8` flag,
638638
kube-proxy only selects the loopback interface for NodePort Services.
639-
The default for `--nodeport-addresses` is an empty list.
639+
The default for `--nodeport-addresses` is an empty list.
640640
his means that kube-proxy should consider all available network interfaces for NodePort.
641641
(That's also compatible with earlier Kubernetes releases).
642642

@@ -666,7 +666,7 @@ metadata:
666666
spec:
667667
type: NodePort
668668
selector:
669-
app: MyApp
669+
app.kubernetes.io/name: MyApp
670670
ports:
671671
# By default and for convenience, the `targetPort` is set to the same value as the `port` field.
672672
- port: 80
@@ -692,7 +692,7 @@ metadata:
692692
name: my-service
693693
spec:
694694
selector:
695-
app: MyApp
695+
app.kubernetes.io/name: MyApp
696696
ports:
697697
- protocol: TCP
698698
port: 80
@@ -765,13 +765,13 @@ You must explicitly remove the `nodePorts` entry in every Service port to de-all
765765
`spec.loadBalancerClass` enables you to use a load balancer implementation other than the cloud provider default.
766766
By default, `spec.loadBalancerClass` is `nil` and a `LoadBalancer` type of Service uses
767767
the cloud provider's default load balancer implementation if the cluster is configured with
768-
a cloud provider using the `--cloud-provider` component flag.
768+
a cloud provider using the `--cloud-provider` component flag.
769769
If `spec.loadBalancerClass` is specified, it is assumed that a load balancer
770770
implementation that matches the specified class is watching for Services.
771771
Any default load balancer implementation (for example, the one provided by
772772
the cloud provider) will ignore Services that have this field set.
773773
`spec.loadBalancerClass` can be set on a Service of type `LoadBalancer` only.
774-
Once set, it cannot be changed.
774+
Once set, it cannot be changed.
775775
The value of `spec.loadBalancerClass` must be a label-style identifier,
776776
with an optional prefix such as "`internal-vip`" or "`example.com/internal-vip`".
777777
Unprefixed names are reserved for end-users.
@@ -1073,7 +1073,7 @@ There are other annotations to manage Classic Elastic Load Balancers that are de
10731073
10741074
# A list of existing security groups to be configured on the ELB created. Unlike the annotation
10751075
# service.beta.kubernetes.io/aws-load-balancer-extra-security-groups, this replaces all other
1076-
# security groups previously assigned to the ELB and also overrides the creation
1076+
# security groups previously assigned to the ELB and also overrides the creation
10771077
# of a uniquely generated security group for this ELB.
10781078
# The first security group ID on this list is used as a source to permit incoming traffic to
10791079
# target worker nodes (service traffic and health checks).
@@ -1087,7 +1087,7 @@ There are other annotations to manage Classic Elastic Load Balancers that are de
10871087
# generated security group in place, this ensures that every ELB
10881088
# has a unique security group ID and a matching permit line to allow traffic to the target worker nodes
10891089
# (service traffic and health checks).
1090-
# Security groups defined here can be shared between services.
1090+
# Security groups defined here can be shared between services.
10911091
service.beta.kubernetes.io/aws-load-balancer-extra-security-groups: "sg-53fae93f,sg-42efd82e"
10921092
10931093
# A comma separated list of key-value pairs which are used
@@ -1263,7 +1263,7 @@ metadata:
12631263
name: my-service
12641264
spec:
12651265
selector:
1266-
app: MyApp
1266+
app.kubernetes.io/name: MyApp
12671267
ports:
12681268
- name: http
12691269
protocol: TCP
@@ -1481,4 +1481,3 @@ followed by the data from the client.
14811481
* Read [Connecting Applications with Services](/docs/concepts/services-networking/connect-applications-service/)
14821482
* Read about [Ingress](/docs/concepts/services-networking/ingress/)
14831483
* Read about [EndpointSlices](/docs/concepts/services-networking/endpoint-slices/)
1484-

content/en/docs/concepts/workloads/pods/init-containers.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Init containers are exactly like regular containers, except:
2828
* Init containers always run to completion.
2929
* Each init container must complete successfully before the next one starts.
3030

31-
If a Pod's init container fails, the kubelet repeatedly restarts that init container until it succeeds.
31+
If a Pod's init container fails, the kubelet repeatedly restarts that init container until it succeeds.
3232
However, if the Pod has a `restartPolicy` of Never, and an init container fails during startup of that Pod, Kubernetes treats the overall Pod as failed.
3333

3434
To specify an init container for a Pod, add the `initContainers` field into
@@ -115,7 +115,7 @@ kind: Pod
115115
metadata:
116116
name: myapp-pod
117117
labels:
118-
app: myapp
118+
app.kubernetes.io/name: MyApp
119119
spec:
120120
containers:
121121
- name: myapp-container
@@ -159,7 +159,7 @@ The output is similar to this:
159159
Name: myapp-pod
160160
Namespace: default
161161
[...]
162-
Labels: app=myapp
162+
Labels: app.kubernetes.io/name=MyApp
163163
Status: Pending
164164
[...]
165165
Init Containers:

content/en/docs/tasks/debug/debug-application/debug-statefulset.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ This task shows you how to debug a StatefulSet.
2424

2525
## Debugging a StatefulSet
2626

27-
In order to list all the pods which belong to a StatefulSet, which have a label `app=myapp` set on them,
27+
In order to list all the pods which belong to a StatefulSet, which have a label `app.kubernetes.io/name=MyApp` set on them,
2828
you can use the following:
2929

3030
```shell
31-
kubectl get pods -l app=myapp
31+
kubectl get pods -l app.kubernetes.io/name=MyApp
3232
```
3333

3434
If you find that any Pods listed are in `Unknown` or `Terminating` state for an extended period of time,

content/en/docs/tasks/network/validate-dual-stack.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ spec:
134134
protocol: TCP
135135
targetPort: 9376
136136
selector:
137-
app: MyApp
137+
app.kubernetes.io/name: MyApp
138138
sessionAffinity: None
139139
type: ClusterIP
140140
status:
@@ -158,7 +158,7 @@ apiVersion: v1
158158
kind: Service
159159
metadata:
160160
labels:
161-
app: MyApp
161+
app.kubernetes.io/name: MyApp
162162
name: my-service
163163
spec:
164164
clusterIP: fd00::5118
@@ -172,7 +172,7 @@ spec:
172172
protocol: TCP
173173
targetPort: 80
174174
selector:
175-
app: MyApp
175+
app.kubernetes.io/name: MyApp
176176
sessionAffinity: None
177177
type: ClusterIP
178178
status:
@@ -187,7 +187,7 @@ Create the following Service that explicitly defines `PreferDualStack` in `.spec
187187
The `kubectl get svc` command will only show the primary IP in the `CLUSTER-IP` field.
188188

189189
```shell
190-
kubectl get svc -l app=MyApp
190+
kubectl get svc -l app.kubernetes.io/name=MyApp
191191
192192
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
193193
my-service ClusterIP 10.0.216.242 <none> 80/TCP 5s
@@ -197,15 +197,15 @@ my-service ClusterIP 10.0.216.242 <none> 80/TCP 5s
197197
Validate that the Service gets cluster IPs from the IPv4 and IPv6 address blocks using `kubectl describe`. You may then validate access to the service via the IPs and ports.
198198

199199
```shell
200-
kubectl describe svc -l app=MyApp
200+
kubectl describe svc -l app.kubernetes.io/name=MyApp
201201
```
202202

203203
```
204204
Name: my-service
205205
Namespace: default
206-
Labels: app=MyApp
206+
Labels: app.kubernetes.io/name=MyApp
207207
Annotations: <none>
208-
Selector: app=MyApp
208+
Selector: app.kubernetes.io/name=MyApp
209209
Type: ClusterIP
210210
IP Family Policy: PreferDualStack
211211
IP Families: IPv4,IPv6
@@ -220,14 +220,14 @@ Events: <none>
220220
221221
### Create a dual-stack load balanced Service
222222
223-
If the cloud provider supports the provisioning of IPv6 enabled external load balancers, create the following Service with `PreferDualStack` in `.spec.ipFamilyPolicy`, `IPv6` as the first element of the `.spec.ipFamilies` array and the `type` field set to `LoadBalancer`.
223+
If the cloud provider supports the provisioning of IPv6 enabled external load balancers, create the following Service with `PreferDualStack` in `.spec.ipFamilyPolicy`, `IPv6` as the first element of the `.spec.ipFamilies` array and the `type` field set to `LoadBalancer`.
224224
225225
{{< codenew file="service/networking/dual-stack-prefer-ipv6-lb-svc.yaml" >}}
226226
227227
Check the Service:
228228
229229
```shell
230-
kubectl get svc -l app=MyApp
230+
kubectl get svc -l app.kubernetes.io/name=MyApp
231231
```
232232

233233
Validate that the Service receives a `CLUSTER-IP` address from the IPv6 address block along with an `EXTERNAL-IP`. You may then validate access to the service via the IP and port.

content/en/docs/tasks/run-application/delete-stateful-set.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ For example:
5050
kubectl delete -f <file.yaml> --cascade=orphan
5151
```
5252

53-
By passing `--cascade=orphan` to `kubectl delete`, the Pods managed by the StatefulSet are left behind even after the StatefulSet object itself is deleted. If the pods have a label `app=myapp`, you can then delete them as follows:
53+
By passing `--cascade=orphan` to `kubectl delete`, the Pods managed by the StatefulSet are left behind even after the StatefulSet object itself is deleted. If the pods have a label `app.kubernetes.io/name=MyApp`, you can then delete them as follows:
5454

5555
```shell
56-
kubectl delete pods -l app=myapp
56+
kubectl delete pods -l app.kubernetes.io/name=MyApp
5757
```
5858

5959
### Persistent Volumes
@@ -70,13 +70,13 @@ To delete everything in a StatefulSet, including the associated pods, you can ru
7070

7171
```shell
7272
grace=$(kubectl get pods <stateful-set-pod> --template '{{.spec.terminationGracePeriodSeconds}}')
73-
kubectl delete statefulset -l app=myapp
73+
kubectl delete statefulset -l app.kubernetes.io/name=MyApp
7474
sleep $grace
75-
kubectl delete pvc -l app=myapp
75+
kubectl delete pvc -l app.kubernetes.io/name=MyApp
7676

7777
```
7878

79-
In the example above, the Pods have the label `app=myapp`; substitute your own label as appropriate.
79+
In the example above, the Pods have the label `app.kubernetes.io/name=MyApp`; substitute your own label as appropriate.
8080

8181
### Force deletion of StatefulSet pods
8282

0 commit comments

Comments
 (0)