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
+ - port: 80
549
+ # By default and for convenience, the targetPort is set to the same value as the port field.
550
+ targetPort: 80
551
+ # ` targetPort` is the port of pod, you would like to expose
552
+ NodePort : 30007
553
+ # `NodePort` is the port of node, you would like to expose
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