Skip to content

Commit f45abb0

Browse files
committed
recommend usage of named port for services without selectors
Signed-off-by: Daman Arora <[email protected]>
1 parent de74866 commit f45abb0

File tree

1 file changed

+3
-3
lines changed
  • content/en/docs/concepts/services-networking

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,8 @@ metadata:
216216
name: my-service
217217
spec:
218218
ports:
219-
- protocol: TCP
219+
- name: http
220+
protocol: TCP
220221
port: 80
221222
targetPort: 9376
222223
```
@@ -238,8 +239,7 @@ metadata:
238239
kubernetes.io/service-name: my-service
239240
addressType: IPv4
240241
ports:
241-
- name: '' # empty because port 9376 is not assigned as a well-known
242-
# port (by IANA)
242+
- name: http # should match with the name of the service port defined above
243243
appProtocol: http
244244
protocol: TCP
245245
port: 9376

0 commit comments

Comments
 (0)