Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion kubernetes/samples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Sample scripts

* [Sample Secret for WebLogic Amin Credentials](scripts/create-weblogic-domain/create-weblogic-credentials.sh) for creating a Kubernetes secret that contains the admin server credentials. This secret can then be used in creating a WebLogic domain custom resource.
* [Sample secret for WebLogic admin credentials](scripts/create-weblogic-domain/create-weblogic-credentials.sh) for creating a Kubernetes secret that contains the Administration Server credentials. This secret can be used in creating a WebLogic domain custom resource.
* [Sample PV and PVC](scripts/create-weblogic-domain-pv-pvc/README.md) for creating a PV or PVC that can be used by a domain custom resource as the persistent storage for the WebLogic domain home or log files.
* [Sample domain home on a persistent volume](scripts/create-weblogic-domain/domain-home-on-pv/README.md) for creating a WebLogic domain home on an existing PV or PVC, and the domain customer resource YAML file for deploying the generated WebLogic domain.
* [Sample Elasticsearch and Kibana configuration](scripts/elasticsearch_and_kibana.yaml) for configuring the Elasticsearch and Kibana deployments and services for the operator's logs.
Expand Down
3 changes: 2 additions & 1 deletion kubernetes/samples/charts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ The Oracle WebLogic Server Kubernetes Operator supports three load balancers: TR

* [traefik](traefik/README.md)
* [voyager](voyager/README.md)
* [apache-samples](apache-samples/README.md)
* apache-samples [custom-sample](apache-samples/custom-sample/README.md)
* apache-samples [default-sample](apache-samples/default-sample/README.md)
* [ingress-per-domain](ingress-per-domain/README.md)
* [apache-webtier](apache-webtier/README.md)

Expand Down
89 changes: 48 additions & 41 deletions kubernetes/samples/charts/apache-samples/custom-sample/README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,43 @@
# Apache Load Balancer custom sample
In this sample, we will configure Apache webtier as a load balancer for multiple WebLogic domains using custom configuration. We will demonstrate how to use Apache webtier to handle traffic to the multiple backend WebLogic domains.
# Apache load balancer custom sample
In this sample, we will configure the Apache webtier as a load balancer for multiple WebLogic domains using a custom configuration. We will demonstrate how to use the Apache webtier to handle traffic to multiple backend WebLogic domains.

## 1. Create Namespace
In this sample, both Apache webtier and WebLogic domain instances are located in the namespace `apache-sample`.
## 1. Create a namespace
In this sample, both the Apache webtier and WebLogic domain instances are located in the namespace `apache-sample`.
```
$ kubectl create namespace apache-sample
```

## 2. Create WebLogic Domains
Now we need to prepare some backends for Apache webtier to do load balancing. Please refer the sample https://github.com/oracle/weblogic-kubernetes-operator/tree/develop/kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv to create two WebLogic domains under the namespace `apache-sample`.
## 2. Create WebLogic domains
We need to prepare some backend domains for load balancing by the Apache webtier. Refer to the sample, https://github.com/oracle/weblogic-kubernetes-operator/tree/develop/kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv, to create two WebLogic domains under the namespace `apache-sample`.

The first domain uses the following custom configuration parameters:
- namespace: apache-sample
- domainUID: domain1
- clusterName: cluster-1
- adminServerName: admin-server
- adminPort: 7001
- adminNodePort: 30701
- managedServerPort: 8001
- namespace: `apache-sample`
- domainUID: `domain1`
- clusterName: `cluster-1`
- adminServerName: `admin-server`
- adminPort: `7001`
- adminNodePort: `30701`
- managedServerPort: `8001`

The second domain uses the following custom configuration parameters:
- namespace: apache-sample
- domainUID: domain2
- clusterName: cluster-1
- adminServerName: admin-server
- adminPort: 7011
- adminNodePort: 30702
- managedServerPort: 8021
- namespace: `apache-sample`
- domainUID: `domain2`
- clusterName: `cluster-1`
- adminServerName: `admin-server`
- adminPort: `7011`
- adminNodePort: `30702`
- managedServerPort: `8021`

After the domains are successfully created, deploy the sample web application testwebapp.war on each domain cluster through the admin console. The sample web application is located in the kubernetes/samples/charts/application directory.
After the domains are successfully created, deploy the sample web application, `testwebapp.war`, on each domain cluster using the WLS Administration Console. The sample web application is located in the `kubernetes/samples/charts/application` directory.

## 3. Build Apache Webtier Docker Image
Please refer the sample https://github.com/oracle/docker-images/tree/master/OracleWebLogic/samples/12213-webtier-apache to build Apache webtier docker image.
## 3. Build the Apache webtier Docker image
Refer to the sample, https://github.com/oracle/docker-images/tree/master/OracleWebLogic/samples/12213-webtier-apache, to build the Apache webtier Docker image.

## 4. Provide the custom Apache plugin configuration
In this sample, we will provide a custom Apache plugin configuration to fine tune the behavior of Apache.

* Create a custom Apache plugin configuration file named `custom_mod_wl_apache.conf`. The file content is similar to below.

## 4. Provide Custom Apache Plugin Configuration
In this sample we will provide custom Apache plugin configuration to fine tune the behavior of Apache.
- Create a custom Apache plugin configuration file named `custom_mod_wl_apache.conf`. The file content is similar as below.
```
# Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
#
Expand All @@ -55,9 +57,9 @@ WebLogicPort ${WEBLOGIC_PORT}
</Location>

# Directive for all application deployed on weblogic cluster with a prepath defined by LOCATION variable
# For example, if the LOCAITON is set to '/weblogic', all applications deployed on the cluster can be accessed via
# For example, if the LOCAITON is set to '/weblogic', all applications deployed on the cluster can be accessed via
# http://myhost:myport/weblogic/application_end_url
# where 'myhost' is the IP of the machine that runs the Apache web tier, and
# where 'myhost' is the IP of the machine that runs the Apache web tier, and
# 'myport' is the port that the Apache web tier is publicly exposed to.
# Note that LOCATION cannot be set to '/' unless this is the only Location module configured.
<Location /weblogic1>
Expand All @@ -77,10 +79,12 @@ WebLogicCluster domain2-cluster-cluster-1:8021
PathTrim /weblogic2
</Location>
```
- Place the `custom_mod_wl_apache.conf` file in a local directory `<host-config-dir>` on the host machine.

## 5. Prepare Your Own Certificate and Private Key
In production, Oracle strongly recommends that you provide your own certificates. Run following commands to to generate your own certificate and private key using openssl.
* Place the `custom_mod_wl_apache.conf` file in a local directory `<host-config-dir>` on the host machine.

## 5. Prepare your own certificate and private key
In production, Oracle strongly recommends that you provide your own certificates. Run the following commands to generate your own certificate and private key using `openssl`.

```
$ cd kubernetes/samples/charts/apache-samples/custom-sample
$ export VIRTUAL_HOST_NAME=apache-sample-host
Expand All @@ -89,20 +93,22 @@ $ export SSL_CERT_KEY_FILE=apache-sample.key
$ sh certgen.sh
```

## 6. Prepare the Input Values for Apache Webtier Helm Chart
Run following commands to prepare the input value file for Apache webtier helm chart.
## 6. Prepare the input values for the Apache webtier Helm chart
Run the following commands to prepare the input value file for the Apache webtier Helm chart.

```
$ base64 -i ${SSL_CERT_FILE} | tr -d '\n'
$ base64 -i ${SSL_CERT_KEY_FILE} | tr -d '\n'
$ touch input.yaml
```
Edit the input parameters file `input.yaml`, the file content is similar as below.
Edit the input parameters file, `input.yaml`. The file content is similar to below.

```
# Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
#
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.

# Use this to provide your own Apache webtier configuration as needed; simply define this
# Use this to provide your own Apache webtier configuration as needed; simply define this
# path and put your own custom_mod_wl_apache.conf file under this path.
volumePath: <host-config-dir>

Expand All @@ -120,26 +126,27 @@ customCert: <cert_data>
customKey: <key_data>
```

## 7. Install Apache Webtier Helm Chart
Apache webtier helm chart is located in kubernetes/samples/charts/apache-webtier directory. Install Apache webtier helm chart to apache-sample namespace with specified input parameters:
## 7. Install the Apache webtier Helm chart
The Apache webtier Helm chart is located in the `kubernetes/samples/charts/apache-webtier` directory. Install the Apache webtier Helm chart to the `apache-sample` namespace with the specified input parameters:

```
$ cd kubernetes/samples/charts
$ helm install --name my-release --values apache-samples/custom-sample/input.yaml --namespace apache-sample apache-webtier
```

## 8. Run the Sample Application
Now you can send requests to different WebLogic domains with the unique entry point of Apache with different path. Alternatively, you can access the URLs in a web browser.
## 8. Run the sample application
Now you can send requests to different WebLogic domains with the unique entry point of Apache with different paths. Alternatively, you can access the URLs in a web browser.
```
$ curl --silent http://${HOSTNAME}:30305/weblogic1/testwebapp/
$ curl --silent http://${HOSTNAME}:30305/weblogic2/testwebapp/
```
You can also use SSL URLs to send requests to different WebLogic domains. Access the SSL URL via the curl command or a web browser.
Also, you can use SSL URLs to send requests to different WebLogic domains. Access the SSL URL via the `curl` command or a web browser.
```
$ curl -k --silent https://${HOSTNAME}:30443/weblogic1/testwebapp/
$ curl -k --silent https://${HOSTNAME}:30443/weblogic2/testwebapp/
```

## 9. Uninstall Apache Webtier
## 9. Uninstall the Apache webtier
```
$ helm delete --purge my-release
```
38 changes: 19 additions & 19 deletions kubernetes/samples/charts/apache-samples/default-sample/README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
# Apache Load Balancer default sample
In this sample, we will configure Apache webtier as a load balancer for WebLogic domain using the default configuration. We will demonstrate how to use Apache webtier to handle traffic to the backend WebLogic domain.
# Apache load balancer default sample
In this sample, we will configure the Apache webtier as a load balancer for a WebLogic domain using the default configuration. We will demonstrate how to use the Apache webtier to handle traffic to a backend WebLogic domain.

## 1. Create WebLogic Domain
Now we need to prepare backend for Apache webtier to do load balancing. Please refer the sample https://github.com/oracle/weblogic-kubernetes-operator/tree/develop/kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv to create a WebLogic domain. Keep the default values for the following configuration parameters:
- namespace: default
- domainUID: domain1
- clusterName: cluster-1
- adminServerName: admin-server
- adminPort: 7001
- managedServerPort: 8001
## 1. Create a WebLogic domain
We need to prepare a backend domain for load balancing by the Apache webtier. Refer to the sample, https://github.com/oracle/weblogic-kubernetes-operator/tree/develop/kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv, to create a WebLogic domain. Keep the default values for the following configuration parameters:
- namespace: `default`
- domainUID: `domain1`
- clusterName: `cluster-1`
- adminServerName: `admin-server`
- adminPort: `7001`
- managedServerPort: `8001`

After the domain is successfully created, deploy the sample web application testwebapp.war on the domain cluster through the admin console. The sample web application is located in the kubernetes/samples/charts/application directory.
After the domain is successfully created, deploy the sample web application, `testwebapp.war`, on the domain cluster using the WLS Administration Console. The sample web application is located in the `kubernetes/samples/charts/application` directory.

## 2. Build Apache Webtier Docker Image
Please refer the sample https://github.com/oracle/docker-images/tree/master/OracleWebLogic/samples/12213-webtier-apache to build Apache webtier docker image.
## 2. Build the Apache webtier Docker image
Refer to the sample, https://github.com/oracle/docker-images/tree/master/OracleWebLogic/samples/12213-webtier-apache, to build the Apache webtier Docker image.

## 3. Install Apache Webtier with Helm Chart
Apache webtier helm chart is located at https://github.com/oracle/weblogic-kubernetes-operator/blob/develop/kubernetes/samples/charts/apache-webtier.
Install Apache webtier helm chart to default namespace with default settings:
## 3. Install the Apache webtier with a Helm chart
The Apache webtier Helm chart is located at https://github.com/oracle/weblogic-kubernetes-operator/blob/develop/kubernetes/samples/charts/apache-webtier.
Install the Apache webtier Helm chart into the default namespace with the default settings:
```
$ cd kubernetes/samples/charts
$ helm install --name my-release apache-webtier
```

## 4. Run the sample application
Now you can send request to WebLogic domain with the unique entry point of Apache. Alternatively, you can access the URL in a web browser.
Now you can send request to the WebLogic domain with the unique entry point of Apache. Alternatively, you can access the URL in a web browser.
```
$ curl --silent http://${HOSTNAME}:30305/weblogic/testwebapp/
```
You can also use SSL URL to send request to WebLogic domain. Access the SSL URL via the curl command or a web browser.
You can also use an SSL URL to send requests to the WebLogic domain. Access the SSL URL via the `curl` command or a web browser.
```
$ curl -k --silent https://${HOSTNAME}:30443/weblogic/testwebapp/
```

## 5. Uninstall Apache Webtier
## 5. Uninstall the Apache webtier
```
$ helm delete --purge my-release
```
Loading