Skip to content

Commit 4c2947b

Browse files
authored
Merge pull request #240 from oracle/tbarnes/apachefix
Avoid exposing admin host and port by default via Apache.
2 parents 473335f + a7a062b commit 4c2947b

File tree

3 files changed

+23
-21
lines changed

3 files changed

+23
-21
lines changed

kubernetes/internal/weblogic-domain-apache-template.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ spec:
5050
value: '%DOMAIN_UID%-cluster-%CLUSTER_NAME_LC%:%MANAGED_SERVER_PORT%'
5151
- name: LOCATION
5252
value: '%WEB_APP_PREPATH%'
53-
- name: WEBLOGIC_HOST
54-
value: '%DOMAIN_UID%-%ADMIN_SERVER_NAME%'
55-
- name: WEBLOGIC_PORT
56-
value: '%ADMIN_PORT%'
53+
#- name: WEBLOGIC_HOST
54+
# value: '%DOMAIN_UID%-%ADMIN_SERVER_NAME%'
55+
#- name: WEBLOGIC_PORT
56+
# value: '%ADMIN_PORT%'
5757
readinessProbe:
5858
tcpSocket:
5959
port: 80

operator/src/test/java/oracle/kubernetes/operator/create/CreateDomainGeneratedFilesBaseTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -475,12 +475,12 @@ protected ExtensionsV1beta1Deployment getExpectedApacheDeployment() {
475475
.addEnvItem(newEnvVar()
476476
.name("LOCATION")
477477
.value(getInputs().getLoadBalancerAppPrepath()))
478-
.addEnvItem(newEnvVar()
479-
.name("WEBLOGIC_HOST")
480-
.value(getInputs().getDomainUID() + "-" + getInputs().getAdminServerName()))
481-
.addEnvItem(newEnvVar()
482-
.name("WEBLOGIC_PORT")
483-
.value(getInputs().getAdminPort()))
478+
// .addEnvItem(newEnvVar()
479+
// .name("WEBLOGIC_HOST")
480+
// .value(getInputs().getDomainUID() + "-" + getInputs().getAdminServerName()))
481+
// .addEnvItem(newEnvVar()
482+
// .name("WEBLOGIC_PORT")
483+
// .value(getInputs().getAdminPort()))
484484
.readinessProbe(newProbe()
485485
.tcpSocket(newTCPSocketAction()
486486
.port(newIntOrString(80)))

site/apache.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
# Load balancing with the Apache HTTP Server
33

4-
This document describes how to set up and start an Apache HTTP Server for load balancing inside a Kubernets cluster. The configuration and startup can be either automatic, when you create a domain using the WebLogic Operator's `create-weblogic-domain.sh` script, or manual, if you have an existing WebLogic domain configuration.
4+
This document describes how to set up and start an Apache HTTP Server for load balancing inside a Kubernetes cluster. The configuration and startup can be either automatic, when you create a domain using the WebLogic Operator's `create-weblogic-domain.sh` script, or manual, if you have an existing WebLogic domain configuration.
55

66
## Build the Docker image for the Apache HTTP Server
77

@@ -19,7 +19,7 @@ You need to build the Docker image for the Apache HTTP Server that embeds the Or
1919

2020
For more information about the Apache plugin, see [Apache HTTP Server with Oracle WebLogic Server Proxy Plugin on Docker](https://docs.oracle.com/middleware/1213/webtier/develop-plugin/apache.htm#PLGWL395).
2121

22-
After you have access to the Docker image of the Apache HTTP Server, you can follow the instructions below to set up and start the Kubernetes artifacts for the Apache HTTP Server.
22+
After you have access to the Docker image of the Apache HTTP Server, you can follow the instructions below to set up and start the Kubernetes resources for the Apache HTTP Server.
2323

2424

2525
## Use the Apache load balancer with a WebLogic domain created with the WebLogic Operator
@@ -52,7 +52,7 @@ Users can access an application from outside of the Kubernetes cluster by using
5252

5353
### Use the default plugin WL module configuration
5454

55-
By default, the Apache Docker image supports a simple WebLogic Server proxy plugin configuration for a single WebLogic domain with an Administration Server and a cluster. The `create-weblogic-domain.sh` script automatically customizes the default behavior based on your domain configuration. The default setting supports only the type of load balancing that uses the root path ("/"). You can further customize the root path of the load balancer with the `loadBalancerAppPrepath` property in the `create-weblogic-domain-inputs.yaml` file.
55+
By default, the Apache Docker image supports a simple WebLogic Server proxy plugin configuration for a single WebLogic domain with an Administration Server and a cluster. The `create-weblogic-domain.sh` script automatically customizes the default behavior based on your domain configuration by generating a customized Kubernetes resources YAML file for Apache named `weblogic-domain-apache.yaml`. The default setting supports only the type of load balancing that uses the root path ("/"). You can further customize the root path of the load balancer with the `loadBalancerAppPrepath` property in the `create-weblogic-domain-inputs.yaml` file.
5656

5757
```
5858
@@ -62,7 +62,9 @@ loadBalancerAppPrepath: /weblogic
6262
6363
```
6464

65-
Users can then access an application from outside of the Kubernetes cluster by using `http://<host>:30305/weblogic/<application-url>,` and the administrator can access the Administration Console by using `http://<host>:30305/console`.
65+
It is sometimes, but rarely, desirable to expose a WebLogic Administration Server host and port through a load balancer to a public network. If this is needed, then, after the `weblogic-domain-apache.yaml` file is generated, you can customize exposure of the WebLogic Administration Server host and port by uncommenting the `WEBLOGIC_HOST` and `WEBLOGIC_PORT` environment variables in the file. If this file's resources have already been deployed (as happens automatically when running `create-weblogic-domain.sh`), one way to make the change is to delete the file's running Kubernetes resources using `kubectl delete -f weblogic-domain-apache.yaml`, and then deploy them again via `kubectl create -f weblogic-domain-apache.yaml`.
66+
67+
Users can then access an application from outside of the Kubernetes cluster by using `http://<host>:30305/weblogic/<application-url>,` and, if the WebLogic Administration Server host and port environment variables are uncommented below, an adminstrator can access the Administration Console using `http://<host>:30305/console`.
6668

6769
The generated Kubernetes YAML files look like the following, given the `domainUID`, "`domain1`".
6870

@@ -174,13 +176,13 @@ spec:
174176
175177
value: '/weblogic'
176178
177-
- name: WEBLOGIC_HOST
179+
#- name: WEBLOGIC_HOST
178180
179-
value: 'domain1-admin-server'
181+
# value: 'domain1-admin-server'
180182
181-
- name: WEBLOGIC_PORT
183+
#- name: WEBLOGIC_PORT
182184
183-
value: '7001'
185+
# value: '7001'
184186
185187
readinessProbe:
186188
@@ -349,7 +351,7 @@ subjects:
349351
```
350352

351353

352-
Here are examples of the Kubernetes artifacts created by the WebLogic Operator:
354+
Here are examples of the Kubernetes resources created by the WebLogic Operator:
353355

354356

355357
```
@@ -406,7 +408,7 @@ loadBalancerVolumePath: <host-config-dir>
406408
407409
```
408410

409-
After the `loadBalancerVolumePath` property is specified, the `create-weblogic-domain.sh` script will use the `custom_mod_wl_apache.config` file in the `<host-config-dir>` directory to replace what is in the Docker image.
411+
After the `loadBalancerVolumePath` property is specified, the `create-weblogic-domain.sh` script will use the `custom_mod_wl_apache.conf` file in `<host-config-dir>` directory to replace what is in the Docker image.
410412

411413
The generated YAML files will look similar except with un-commented entries like below:
412414

@@ -440,7 +442,7 @@ The generated YAML files will look similar except with un-commented entries like
440442

441443
## Use the Apache load balancer with a manually created WebLogic Domain
442444

443-
If your WebLogic domain is not created by the WebLogic Operator, you need to manually create and start all Kubernetes' artifacts for the Apache HTTP Server.
445+
If your WebLogic domain is not created by the WebLogic Operator, you need to manually create and start all Kubernetes' resources for the Apache HTTP Server.
444446

445447

446448
1. Create your own `custom_mod_wl_apache.conf` file, and put it in a local directory, for example, `<host-conf-dir>`. See the instructions in [Apache Web Server with Oracle WebLogic Server Proxy Plugin on Docker](https://docs.oracle.com/middleware/1213/webtier/develop-plugin/apache.htm#PLGWL395).

0 commit comments

Comments
 (0)