File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
content/en/docs/concepts/services-networking Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -534,6 +534,25 @@ to just expose one or more nodes' IPs directly.
534
534
Note that this Service is visible as `<NodeIP>:spec.ports[*].nodePort`
535
535
and `.spec.clusterIP:spec.ports[*].port`. (If the `--nodeport-addresses` flag in kube-proxy is set, <NodeIP> would be filtered NodeIP(s).)
536
536
537
+ For example :
538
+ ` ` ` yaml
539
+ apiVersion: v1
540
+ kind: Service
541
+ metadata:
542
+ name: my-service
543
+ spec:
544
+ type: NodePort
545
+ selector:
546
+ app: MyApp
547
+ ports:
548
+ # By default and for convenience, the ` targetPort` is set to the same value as the `port` field.
549
+ - port : 80
550
+ targetPort : 80
551
+ # Optional field
552
+ # By default and for convenience, the Kubernetes control plane will allocate a port from a range (default: 30000-32767)
553
+ nodePort : 30007
554
+ ` ` `
555
+
537
556
### Type LoadBalancer {#loadbalancer}
538
557
539
558
On cloud providers which support external load balancers, setting the ` type`
You can’t perform that action at this time.
0 commit comments