Skip to content

Commit 770459b

Browse files
authored
Merge pull request #129 from oracle/remove-as-node-port
Remove AS node port
2 parents b833af4 + a2e12cb commit 770459b

File tree

5 files changed

+16
-42
lines changed

5 files changed

+16
-42
lines changed

kubernetes/internal/domain-custom-resource-template.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ spec:
2828
asName: "%ADMIN_SERVER_NAME%"
2929
# The Admin Server's ListenPort
3030
asPort: %ADMIN_PORT%
31-
# The Admin Server's NodePort
32-
%EXPOSE_ADMIN_PORT_PREFIX%asNodePort: %ADMIN_NODE_PORT%
3331
# startupControl legal values are "ALL", "ADMIN", "SPECIFIED", or "AUTO"
3432
# This determines which WebLogic Servers the Operator will start up when it discovers this Domain
3533
# - "ALL" will start up all defined servers
@@ -49,6 +47,8 @@ spec:
4947
- desiredState: "RUNNING"
5048
# the name of the server to apply these rules to
5149
serverName: "%ADMIN_SERVER_NAME%"
50+
# The Admin Server's NodePort
51+
%EXPOSE_ADMIN_PORT_PREFIX%nodePort: %ADMIN_NODE_PORT%
5252
# an (optional) list of environment variable to be set on the server
5353
env:
5454
- name: JAVA_OPTIONS

src-generated-swagger/main/java/oracle/kubernetes/operator/domain/model/oracle/kubernetes/weblogic/domain/v1/DomainSpec.java

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@ public class DomainSpec {
4949
@SerializedName("asPort")
5050
private Integer asPort = null;
5151

52-
@SerializedName("asNodePort")
53-
private Integer asNodePort = null;
54-
5552
@SerializedName("exportT3Channels")
5653
private List<String> exportT3Channels = null;
5754

@@ -205,28 +202,6 @@ public void setAsPort(Integer asPort) {
205202
this.asPort = asPort;
206203
}
207204

208-
public DomainSpec asNodePort(Integer asNodePort) {
209-
this.asNodePort = asNodePort;
210-
return this;
211-
}
212-
213-
/**
214-
* Administration server NodePort port. The port on each node on which the
215-
* administration server will be exposed. If specified, this value must be an
216-
* unused port. By default, the administration server will not be exposed
217-
* outside the Kubernetes cluster.
218-
*
219-
* @return asNodePort
220-
**/
221-
@ApiModelProperty(value = "Administration server NodePort port. The port on each node on which the administration server will be exposed. If specified, this value must be an unused port. By default, the administration server will not be exposed outside the Kubernetes cluster.")
222-
public Integer getAsNodePort() {
223-
return asNodePort;
224-
}
225-
226-
public void setAsNodePort(Integer asNodePort) {
227-
this.asNodePort = asNodePort;
228-
}
229-
230205
public DomainSpec exportT3Channels(List<String> exportT3Channels) {
231206
this.exportT3Channels = exportT3Channels;
232207
return this;
@@ -379,7 +354,6 @@ public boolean equals(java.lang.Object o) {
379354
&& Objects.equals(this.adminSecret, oracleKubernetesWeblogicDomainV1DomainSpec.adminSecret)
380355
&& Objects.equals(this.asName, oracleKubernetesWeblogicDomainV1DomainSpec.asName)
381356
&& Objects.equals(this.asPort, oracleKubernetesWeblogicDomainV1DomainSpec.asPort)
382-
&& Objects.equals(this.asNodePort, oracleKubernetesWeblogicDomainV1DomainSpec.asNodePort)
383357
&& Objects.equals(this.exportT3Channels, oracleKubernetesWeblogicDomainV1DomainSpec.exportT3Channels)
384358
&& Objects.equals(this.startupControl, oracleKubernetesWeblogicDomainV1DomainSpec.startupControl)
385359
&& Objects.equals(this.serverStartup, oracleKubernetesWeblogicDomainV1DomainSpec.serverStartup)
@@ -389,7 +363,7 @@ public boolean equals(java.lang.Object o) {
389363

390364
@Override
391365
public int hashCode() {
392-
return Objects.hash(domainUID, domainName, image, imagePullPolicy, adminSecret, asName, asPort, asNodePort,
366+
return Objects.hash(domainUID, domainName, image, imagePullPolicy, adminSecret, asName, asPort,
393367
exportT3Channels, startupControl, serverStartup, clusterStartup, replicas);
394368
}
395369

@@ -405,7 +379,6 @@ public String toString() {
405379
sb.append(" adminSecret: ").append(toIndentedString(adminSecret)).append("\n");
406380
sb.append(" asName: ").append(toIndentedString(asName)).append("\n");
407381
sb.append(" asPort: ").append(toIndentedString(asPort)).append("\n");
408-
sb.append(" asNodePort: ").append(toIndentedString(asNodePort)).append("\n");
409382
sb.append(" exportT3Channels: ").append(toIndentedString(exportT3Channels)).append("\n");
410383
sb.append(" startupControl: ").append(toIndentedString(startupControl)).append("\n");
411384
sb.append(" serverStartup: ").append(toIndentedString(serverStartup)).append("\n");

src/integration-tests/bash/run.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,15 +1105,15 @@ function verify_admin_server_ext_service {
11051105

11061106
trace "verify that admin server REST and console are accessible from outside of the kubernetes cluster"
11071107

1108-
local get_configured_nodePort="kubectl get domains -n $NAMESPACE -o jsonpath='{.items[?(@.metadata.name == \"$DOMAIN_UID\")].spec.asNodePort}'"
1108+
local get_configured_nodePort="kubectl get domains -n $NAMESPACE -o jsonpath='{.items[?(@.metadata.name == \"$DOMAIN_UID\")].spec.serverStartup[?(@.serverName == \"admin-server\")].nodePort}'"
11091109

11101110
local configuredNodePort=`eval $get_configured_nodePort`
11111111

1112-
trace "configured asNodePort in domain $DOMAIN_UID is ${configuredNodePort}"
1112+
trace "configured NodePort for the admin server in domain $DOMAIN_UID is ${configuredNodePort}"
11131113

11141114
if [ -z ${configuredNodePort} ]; then
11151115
kubectl describe domain $DOMAIN_UID -n $NAMESPACE
1116-
trace "Either domain $DOMAIN_UID does not exist or asNodePort is not configured in domain $DOMAIN_UID. Skipping this verify"
1116+
trace "Either domain $DOMAIN_UID does not exist or no NodePort is not configured for the admin server in domain $DOMAIN_UID. Skipping this verify"
11171117
return
11181118
fi
11191119

@@ -1130,7 +1130,7 @@ function verify_admin_server_ext_service {
11301130
fi
11311131

11321132
if [ "$nodePort" -ne "$configuredNodePort" ]; then
1133-
fail "Configured asNodePort of ${configuredNodePort} is different from nodePort found in service ${ADMIN_SERVER_NODEPORT_SERVICE}: ${nodePort}"
1133+
fail "Configured NodePort of ${configuredNodePort} for the admin server is different from nodePort found in service ${ADMIN_SERVER_NODEPORT_SERVICE}: ${nodePort}"
11341134
fi
11351135

11361136
local TEST_REST_URL="http://${NODEPORT_HOST}:${nodePort}/management/weblogic/latest/serverRuntime"

src/main/java/oracle/kubernetes/operator/Main.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,15 @@ public NextAction apply(Packet packet) {
655655

656656
packet.put(ProcessingConstants.SERVER_NAME, spec.getAsName());
657657
packet.put(ProcessingConstants.PORT, spec.getAsPort());
658-
packet.put(ProcessingConstants.NODE_PORT, spec.getAsNodePort());
658+
List<ServerStartup> ssl = spec.getServerStartup();
659+
if (ssl != null) {
660+
for (ServerStartup ss : ssl) {
661+
if (ss.getServerName().equals(spec.getAsName())) {
662+
packet.put(ProcessingConstants.NODE_PORT, ss.getNodePort());
663+
break;
664+
}
665+
}
666+
}
659667
return doNext(packet);
660668
}
661669
}
@@ -1001,9 +1009,6 @@ public NextAction apply(Packet packet) {
10011009
if (serverStartup != null) {
10021010
nodePort = serverStartup.getNodePort();
10031011
}
1004-
if (nodePort == null && serverName.equals(spec.getAsName())) {
1005-
nodePort = spec.getAsNodePort();
1006-
}
10071012

10081013
p.put(ProcessingConstants.SERVER_NAME, serverName);
10091014
if (ssi.clusterConfig != null) {

swagger/domain.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1520,10 +1520,6 @@
15201520
"description": "Administration server port. Note: Possibly temporary as we could find this value through domain home inspection.",
15211521
"type": "integer"
15221522
},
1523-
"asNodePort": {
1524-
"description": "Administration server NodePort port. The port on each node on which the administration server will be exposed. If specified, this value must be an unused port. By default, the administration server will not be exposed outside the Kubernetes cluster.",
1525-
"type": "integer"
1526-
},
15271523
"exportT3Channels": {
15281524
"description": "List of specific T3 channels to export. Named T3 Channels will be exposed using NodePort Services. The internal and external ports must match; therefore, it is required that the channel's port in the WebLogic configuration be a legal and unique value in the Kubernetes cluster's legal NodePort port range.",
15291525
"type": "array",

0 commit comments

Comments
 (0)