Skip to content

Commit edba0fb

Browse files
author
Tom Barnes
committed
Avoid exposing admin host and port by default via Apache.
1 parent b9972a2 commit edba0fb

File tree

3 files changed

+27
-23
lines changed

3 files changed

+27
-23
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: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11

22
# Load Balancing with Apache Web Server
33

4-
This page describes how to setup and start a Apache Web Server for load balancing inside a Kubernets cluster. The configuration and startup can either be automatic when you create a domain using the WebLogic Operator's `create-weblogic-domain.sh` script, or manually if you have an existing WebLogic domain configuration.
4+
This page describes how to setup and start a Apache Web Server for load balancing inside a Kubernetes cluster. The configuration and startup can either be 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 Docker Image for Apache Web Server
77

8-
You need to build the Docker image for Apache Web Server that enbeds Oracle WebLogic Server Proxy Plugin.
8+
You need to build the Docker image for Apache Web Server that embeds the Oracle WebLogic Server Proxy Plugin.
99

1010
1. Download and build the Docker image for the Apache Web Server with 12.2.1.3.0 Oracle WebLogic Server Proxy Plugin. See the instructions in [Apache Web Server with Oracle WebLogic Server Proxy Plugin on Docker](https://github.com/oracle/docker-images/tree/master/OracleWebLogic/samples/12213-webtier-apache).
1111

12-
2. tag your Docker image to `store/oracle/apache:12.2.1.3` using `docker tag` command.
12+
2. Tag your Docker image to `store/oracle/apache:12.2.1.3` using `docker tag` command.
1313

1414
```
1515
@@ -19,7 +19,7 @@ You need to build the Docker image for Apache Web Server that enbeds Oracle WebL
1919

2020
More information about the Apache plugin can be found at: [Apache Web Server with Oracle WebLogic Server Proxy Plugin on Docker](https://docs.oracle.com/middleware/1213/webtier/develop-plugin/apache.htm#PLGWL395).
2121

22-
Once you have access to the Docker image of the Apache Web Server, you can go ahead follow the instructions below to setup and start Kubernetes artifacts for Apache Web Server.
22+
Once you have access to the Docker image of the Apache Web Server, you can go ahead follow the instructions below to setup and start Kubernetes resources for an Apache Web Server.
2323

2424

2525
## Use Apache load balancer with a WebLogic domain created with the WebLogic Operator
@@ -52,7 +52,9 @@ The user can access an application from outside of the Kubernetes cluster via ht
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 admin server and a cluster. The `create-weblogic-domain.sh` script automatically customizes the default behavior based on your domain configuration. The default setting only supports the type of load balancing that uses the root path ("/"). You can further customize the root path of the load balancer with `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 admin 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 only supports the type of load balancing that uses the root path ("/").
56+
57+
You can further customize the root path of the load balancer with `loadBalancerAppPrepath` property in the `create-weblogic-domain-inputs.yaml` file.
5658

5759
```
5860
@@ -62,7 +64,9 @@ loadBalancerAppPrepath: /weblogic
6264
6365
```
6466

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

6771
The generated Kubernetes yaml files look like the following given the domainUID "domain1".
6872

@@ -174,13 +178,13 @@ spec:
174178
175179
value: '/weblogic'
176180
177-
- name: WEBLOGIC_HOST
181+
#- name: WEBLOGIC_HOST
178182
179-
value: 'domain1-admin-server'
183+
# value: 'domain1-admin-server'
180184
181-
- name: WEBLOGIC_PORT
185+
#- name: WEBLOGIC_PORT
182186
183-
value: '7001'
187+
# value: '7001'
184188
185189
readinessProbe:
186190
@@ -349,7 +353,7 @@ subjects:
349353
```
350354

351355

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

354358

355359
```
@@ -406,7 +410,7 @@ loadBalancerVolumePath: <host-config-dir>
406410
407411
```
408412

409-
After the `loadBalancerVolumePath` property is specified, the `create-weblogic-domain.sh` script will use the custom_mod_wl_apache.config file in `<host-config-dir>` directory to replace what is in the Docker image.
413+
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.
410414

411415
The generated yaml files will look similar except with un-commented entries like bellow.
412416

@@ -440,7 +444,7 @@ The generated yaml files will look similar except with un-commented entries like
440444

441445
## Use the Apache load balancer with a manually created WebLogic Domain
442446

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

445449

446450
1. Create your own custom_mod_wl_apache.conf file, and put it in a local dir, say `<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)