You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/nw-exposing-service.adoc
+32-4Lines changed: 32 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,18 +72,28 @@ HTTP/1.1 200 OK
72
72
73
73
endif::nodeport[]
74
74
ifdef::nodeport[]
75
-
. To expose a node port for the application, enter the following command. {product-title} automatically selects an available port in the `30000-32767` range.
75
+
. To expose a node port for the application, modify the custom resource definition (CRD) of a service by entering the following command:
76
76
+
77
77
[source,terminal]
78
78
----
79
-
$ oc expose service nodejs-ex --type=NodePort --name=nodejs-ex-nodeport --generator="service/v2"
79
+
$ oc edit svc <service_name>
80
80
----
81
81
+
82
82
.Example output
83
-
[source,terminal]
83
+
[source,yaml]
84
84
----
85
-
service/nodejs-ex-nodeport exposed
85
+
spec:
86
+
ports:
87
+
- name: 8443-tcp
88
+
nodePort: 30327 <1>
89
+
port: 8443
90
+
protocol: TCP
91
+
targetPort: 8443
92
+
sessionAffinity: None
93
+
type: NodePort <2>
86
94
----
95
+
<1> Optional: Specify the node port range for the application. By default, {product-title} selects an available port in the `30000-32767` range.
96
+
<2> Define the service type.
87
97
88
98
. Optional: To confirm the service is available with a node port exposed, enter the following command:
0 commit comments