Skip to content

Commit a79d85e

Browse files
committed
Merge from develop
2 parents 9cb072f + 88840b6 commit a79d85e

38 files changed

+2057
-1255
lines changed

README.md

Lines changed: 35 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,21 @@ Built with [Wercker](http://www.wercker.com)
44

55
[![wercker status](https://app.wercker.com/status/68ce42623fce7fb2e52d304de8ea7530/m/develop "wercker status")](https://app.wercker.com/project/byKey/68ce42623fce7fb2e52d304de8ea7530)
66

7-
Many organizations are exploring, testing, or actively moving application workloads into a cloud environment, either in house or using an external cloud provider. Kubernetes has emerged as a leading cloud platform and is seeing widespread adoption. But a new computing model does not necessarily mean new applications or workloads; many of the existing application workloads running in environments designed and built over many years, before the ‘cloud era’, are still mission critical today. As such, there is a lot of interest in moving such workloads into a cloud environment, like Kubernetes, without forcing application rewrites, retesting and additional process and cost. There is also a desire to not just run the application in the new environment, but to run it ‘well’ – to adopt some of the idioms of the new environment and to realize some of the benefits of that new environment.
7+
Many organizations are exploring, testing, or actively moving application workloads into a cloud environment, either in house or using an external cloud provider. Kubernetes has emerged as a leading cloud platform and is seeing widespread adoption. But a new computing model does not necessarily mean new applications or workloads; many of the existing application workloads running in environments designed and built over many years, before the ‘cloud era’, are still mission critical today. As such, there is a lot of interest in moving such workloads into a cloud environment, like Kubernetes, without forcing application rewrites, retesting, and additional process and cost. There is also a desire to not just run the application in the new environment, but to run it ‘well’ – to adopt some of the idioms of the new environment and to realize some of the benefits of that new environment.
8+
9+
Oracle has been working with the WebLogic community to find ways to make it as easy as possible for organizations using WebLogic Server to run important workloads, to move those workloads into the cloud. One aspect of that effort is the creation of the Oracle WebLogic Server Kubernetes Operator. This release of the Operator provides a number of features to assist with the management of WebLogic domains in a Kubernetes environment, including:
10+
11+
* A mechanism to create a WebLogic domain on a Kubernetes persistent volume. This persistent volume can reside in NFS.
12+
* A mechanism to define a WebLogic domain as a Kubernetes resource (using a Kubernetes custom resource definition).
13+
* The ability to automatically start servers based on declarative startup parameters and desired states.
14+
* The ability to manage a WebLogic configured or dynamic cluster.
15+
* The ability to automatically expose the WebLogic Server Administration Console outside the Kubernetes cluster (if desired).
16+
* The ability to automatically expose T3 channels outside the Kubernetes domain (if desired).
17+
* The ability to automatically expose HTTP paths on a WebLogic domain outside the Kubernetes domain with load balancing, and to update the load balancer when Managed Servers in the WebLogic domain are started or stopped.
18+
* The ability to scale a WebLogic domain by starting and stopping Managed Servers on demand, or by integrating with a REST API to initiate scaling based on WLDF, Prometheus/Grafana, or other rules.
19+
* The ability to publish Operator and WebLogic Server logs into Elasticsearch and interact with them in Kibana.
820

9-
Oracle has been working with the WebLogic community to find ways to make it as easy as possible for organizations using WebLogic Server to run important workloads, to move those workloads into the cloud. One aspect of that effort is the creation of the Oracle WebLogic Server Kubernetes Operator. The Technology Preview release of the Operator provides a number of features to assist with the management of WebLogic domains in a Kubernetes environment, including:
1021

11-
* A mechanism to create a WebLogic domain on a Kubernetes persistent volume
12-
* A mechanism to define a WebLogic domain as a Kubernetes resource (using a Kubernetes custom resource definition)
13-
* The ability to automatically start servers based on declarative startup parameters and desired states
14-
* The ability to automatically expose the WebLogic Server Administration Console outside the Kubernetes cluster (if desired)
15-
* The ability to automatically expose T3 channels outside the Kubernetes domain (if desired)
16-
* The ability to automatically expose HTTP paths on a WebLogic domain outside the Kubernetes domain with load balancing, and to update the load balancer when Managed Servers in the WebLogic domain are started or stopped
17-
* The ability to scale a WebLogic domain by starting and stopping Managed Servers on demand, or by integrating with a REST API to initiate scaling based on WLDF, Prometheus/Grafana or other rules
18-
* The ability to publish Operator and WebLogic Server logs into ElasticSearch and interact with them in Kibana.
1922

2023
As part of Oracle’s ongoing commitment to open source in general, and to Kubernetes and the Cloud Native Computing Foundation specifically, Oracle has open sourced the Operator and is committed to enhancing it with additional features. Oracle welcomes feedback, issues, pull requests, and feature requests from the WebLogic community.
2124

@@ -41,7 +44,7 @@ In this documentation, several important terms are used and are intended to have
4144
Before using the operator, it is highly recommended that you read the [design philosophy](site/design.md) to develop an understanding of the operator's design, and the [architectural overview](site/architecture.md) to understand its architecture, including how WebLogic domains are deployed in Kubernetes using the operator. It is also worth reading the details of the [Kubernetes RBAC definitions](site/rbac.md) required by the operator.
4245

4346
# Exposing applications outside the Kubernetes cluster
44-
The operator can configure services to expose WebLogic applications and features outside of the Kubernetes cluster. Care should be taken when exposing anything externally to ensure that the appropriate security considerations are taken into account. There is no significant difference between a WebLogic domain running in a Kubernetes cluster and a domain running in a traditional data center in this regard. The same kinds of considerations should be taken into account, for example:
47+
The operator can configure services to expose WebLogic applications and features outside of the Kubernetes cluster. Care should be taken when exposing anything externally to ensure that the appropriate security considerations are taken into account. In this regard, there is no significant difference between a WebLogic domain running in a Kubernetes cluster and a domain running in a traditional data center. The same kinds of considerations should be taken into account, for example:
4548

4649
* Only expose those protocols and ports that need to be exposed.
4750
* Use secure protocols (HTTPS, T3S, and such).
@@ -68,12 +71,11 @@ The Oracle WebLogic Server Kubernetes Operator has the following requirements:
6871

6972
# Restrictions
7073

71-
The following features are not certified or supported in the Technology Preview release at the time of writing:
74+
The following features are not certified or supported in this release:
7275

7376
* Whole Server Migration
7477
* Consensus Leasing
7578
* Node Manager (although it is used internally for the liveness probe and to start WebLogic Server instances)
76-
* Dynamic domains (the current certification only covers configured clusters; certification of dynamic clusters is planned at a future date)
7779
* Multicast
7880
* If using a `hostPath` persistent volume, then it must have read/write/many permissions for all container/pods in the WebLogic Server deployment
7981
* Multitenancy
@@ -97,9 +99,9 @@ If you would rather see the developers demonstrating the operator rather than re
9799

98100
* [Installing the operator](https://youtu.be/B5UmY2xAJnk) includes the installation and also shows using the operator's REST API.
99101
* [Creating a WebLogic domain with the operator](https://youtu.be/Ey7o8ldKv9Y) shows the creation of two WebLogic domains including accessing the Administration Console and looking at the various resources created in Kubernetes - services, Ingresses, pods, load balancers, and such.
100-
* [Deploying a web application, scaling a WebLogic cluster with the operator and verifying load balancing](https://youtu.be/hx4OPhNFNDM)
102+
* [Deploying a web application, scaling a WebLogic cluster with the operator and verifying load balancing](https://youtu.be/hx4OPhNFNDM).
101103
* [Using WLST against a domain running in Kubernetes](https://youtu.be/eY-KXEk8rI4) shows how to create a data source for an Oracle database that is also running in Kubernetes.
102-
* [Scaling a WebLogic cluster with WLDF](https://youtu.be/Q8iZi2e9HvU)
104+
* [Scaling a WebLogic cluster with WLDF](https://youtu.be/Q8iZi2e9HvU).
103105
* Watch this space, more to come!
104106

105107
Like what you see? Read on for all the nitty-gritty details...
@@ -125,7 +127,7 @@ All of the [installation steps are explained in detail here](site/installation.m
125127

126128
## Using the operator's REST services
127129

128-
The operator provides a REST API that can be used to obtain information about the configuration and to initiate scaling actions. Please refer to [Using the operator's REST services](site/rest.md) for details about how to use the REST APIs.
130+
The operator provides a REST API that you can use to obtain information about the configuration and to initiate scaling actions. Please refer to [Using the operator's REST services](site/rest.md) for details about how to use the REST APIs.
129131

130132
## Creating a WebLogic domain with the operator
131133

@@ -156,16 +158,25 @@ Please refer to [Scaling a WebLogic cluster](site/scaling.md) for more informati
156158

157159
Please refer to [Shutting down a domain](site/shutdown-domain.md) for information about how to shut down a domain running in Kubernetes.
158160

159-
## Load balancing with the Traefik Ingress controller
160161

161-
The initial Technology Preview release of the operator supports only the Traefik load balancer/Ingress controller. Support for other load balancers is planned in the future.
162-
Please refer to [Load balancing with Traefik](site/traefik.md) for information about current capabilities.
162+
## Load balancing with an Ingress controller or a web server
163+
164+
You can choose a load balancer provider for your WebLogic domains running in a Kubernetes cluster. Please refer to Load balancing with Voyager Ingress Controller, [Load balancing with Traefik Ingress Controller](site/traefik.md), and [Load balancing with Apache Web Server](site/apache.md) for information about the current capabilities and setup instructions for each of the supported load balancers.
165+
163166

164167
[comment]: # (Exporting operator logs to ELK. The operator provides an option to export its log files to the ELK stack. Please refer to [ELK integration]site/elk.md for information about this capability.)
165168

166169
## Removing a domain
167170

168-
To permanently remove a domain from a Kubernetes cluster, first shut down the domain using the instructions provided above in the section titled “Shutting down a domain”, then remove the persistent volume claim and the persistent volume using these commands:
171+
To permanently remove the Kubernetes resources for a domain from a Kubernetes cluster, run the [Delete WebLogic domain resources](kubernetes/delete-weblogic-domain-resources.sh) script. This script will delete a specific domain, or all domains, and all the Kubernetes resources associated with a set of given domains. The script will also attempt a clean shutdown of a domain’s WebLogic pods before deleting its resources.  You can run the script in a test mode to show what would be shutdown and deleted without actually performing the shutdowns and deletions.   For script help, use its `-h` option.
172+
173+
The script will remove only domain-related resources which are labeled with the `domainUID` label, such as resources created by the [Create WebLogic domain](kubernetes/create-weblogic-domain.sh) script or the [integration tests](src/integration-tests/bash/run.sh).  If you manually created resources and have not labelled them with a `domainUID`, the script will not remove them.   One way to label a resource that has already been deployed is:
174+
175+
```
176+
kubectl -n <Namespace> label <ResourceType> <ResourceName> domainUID=<domainUID>
177+
```
178+
179+
To manually remove the persistent volume claim and the persistent volume, use these commands:
169180

170181
```
171182
kubectl delete pvc PVC-NAME -n NAMESPACE
@@ -174,7 +185,7 @@ kubectl delete pv PV-NAME
174185

175186
Find the names of the persistent volume claim (represented above as `PVC-NAME`) and the persistent volume (represented as `PV-NAME`) in the domain custom resource YAML file, or if it is not available, check for the `domainUID` in the metadata on the persistent volumes. Replace `NAMESPACE` with the namespace that the operator is running in.
176187

177-
To permanently delete the actual domain configuration, delete the physical volume using the appropriate tools. For example, if the persistent volume used the `HostPath provider`, then delete the corresponding directory on the Kubernetes master.
188+
To permanently delete the actual WebLogic domain configuration and domain home, delete the physical volume using the appropriate tools. For example, if the persistent volume used the `HostPath` provider, then delete the corresponding directory on the Kubernetes master.
178189

179190
## Removing the operator
180191

@@ -193,7 +204,7 @@ To remove more than one operator, repeat these steps for each operator namespace
193204

194205
# Recent changes
195206

196-
See [Recent changes](site/recent-changes.md) for recent changes to the operator, including any backwards incompatible changes.
207+
See [Recent changes](site/recent-changes.md) for recent changes to the operator, including any backward incompatible changes.
197208

198209

199210
# Developer guide
@@ -214,7 +225,7 @@ If you have any questions about a possible submission, feel free to open an issu
214225

215226
Pull requests can be made under The Oracle Contributor Agreement (OCA), which is available at [https://www.oracle.com/technetwork/community/oca-486395.html](https://www.oracle.com/technetwork/community/oca-486395.html).
216227

217-
For pull requests to be accepted, the bottom of the commit message must have the following line using the contributor’s name and e-mail address as it appears in the OCA Signatories list.
228+
For pull requests to be accepted, the bottom of the commit message must have the following line, using the contributor’s name and e-mail address as it appears in the OCA Signatories list.
218229

219230
```
220231
Signed-off-by: Your Name <[email protected]>
@@ -231,7 +242,7 @@ Only pull requests from committers that can be verified as having signed the OCA
231242
## Pull request process
232243

233244
* Fork the repository.
234-
* Create a branch in your fork to implement the changes. We recommend using the issue number as part of your branch name, e.g. `1234-fixes`.
245+
* Create a branch in your fork to implement the changes. We recommend using the issue number as part of your branch name, for example, `1234-fixes`.
235246
* Ensure that any documentation is updated with the changes that are required by your fix.
236247
* Ensure that any samples are updated if the base image has been changed.
237248
* Submit the pull request. Do not leave the pull request blank. Explain exactly what your changes are meant to do and provide simple steps on how to validate your changes. Ensure that you reference the issue you created as well. We will assign the pull request to 2-3 people for review before it is merged.

kubernetes/create-weblogic-domain-inputs.yaml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,19 @@ exposeAdminNodePort: false
8989
# Name of the domain namespace
9090
namespace: default
9191

92-
# Load balancer to deploy. Supported values are:TRAEFIK, NONE
92+
# Load balancer to deploy. Supported values are: APACHE, TRAEFIK, VOYAGER, NONE
9393
loadBalancer: TRAEFIK
9494

95+
# Load balancer app prepath used for APACHE load balancer
96+
# This defines the /location in the built-in Apache plugin configuration module for WebLogic
97+
loadBalancerAppPrepath: /
98+
99+
# Docker volume path for APACHE. By default, it is empty, which causes the volume mount be
100+
# disabled and, thereforem the built-in Apache plugin config be used.
101+
# Use this to provide your own Apache plugin configuration as needed; simply define this
102+
# path and put your own custom_mod_wl_apache.conf file under this path.
103+
loadBalancerVolumePath:
104+
95105
# Load balancer web port
96106
loadBalancerWebPort: 30305
97107

kubernetes/delete-weblogic-domain-resources.sh

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ cat << EOF
5353
EOF
5454
}
5555

56-
5756
#
5857
# getDomainResources domain(s) outfilename
5958
#
@@ -75,8 +74,12 @@ function getDomainResources {
7574
LABEL_SELECTOR="weblogic.domainUID in ($1)"
7675
fi
7776

78-
# first, let's get all namespaced types with -l $LABEL_SELECTOR
77+
# clean the output file
78+
if [ -e $2 ]; then
79+
rm $2
80+
fi
7981

82+
# first, let's get all namespaced types with -l $LABEL_SELECTOR
8083
NAMESPACED_TYPES="pod,job,deploy,rs,service,pvc,ingress,cm,serviceaccount,role,rolebinding,secret"
8184

8285
# if domain crd exists, look for domains too:
@@ -85,10 +88,15 @@ function getDomainResources {
8588
NAMESPACED_TYPES="domain,$NAMESPACED_TYPES"
8689
fi
8790

91+
VOYAGER_ING_NAME="ingresses.voyager.appscode.com"
92+
if [ `kubectl get crd $VOYAGER_ING_NAME |grep $VOYAGER_ING_NAME | wc -l` = 1 ]; then
93+
NAMESPACED_TYPES="$VOYAGER_ING_NAME,$NAMESPACED_TYPES"
94+
fi
95+
8896
kubectl get $NAMESPACED_TYPES \
8997
-l "$LABEL_SELECTOR" \
9098
-o=jsonpath='{range .items[*]}{.kind}{" "}{.metadata.name}{" -n "}{.metadata.namespace}{"\n"}{end}' \
91-
--all-namespaces=true > $2
99+
--all-namespaces=true >> $2
92100

93101
# now, get all non-namespaced types with -l $LABEL_SELECTOR
94102

@@ -137,8 +145,8 @@ function deleteDomains {
137145
# get a count of all k8s resources with matching domain-uid labels
138146
local allcount=`wc -l $tempfile | awk '{ print $1 }'`
139147

140-
# get a count of all WLS pods (any pod with a matching domain-uid label that doesn't have 'traefik' embedded in its name)
141-
local podcount=`grep "^Pod" $tempfile | grep -v traefik | wc -l | awk '{ print $1 }'`
148+
# get a count of all WLS pods (any pod with a matching domain-uid label that doesn't have 'traefik' or 'apache' embedded in its name)
149+
local podcount=`grep "^Pod" $tempfile | grep -v traefik | grep -v apache | wc -l | awk '{ print $1 }'`
142150

143151
local mnow=`date +%s`
144152

@@ -196,9 +204,9 @@ function deleteDomains {
196204
# for each namespace with leftover resources, try delete them
197205
cat $tempfile | awk '{ print $4 }' | grep -v "^$" | sort -u | while read line; do
198206
if [ "$test_mode" = "true" ]; then
199-
echo kubectl -n $line delete $NAMESPACED_TYPES -l "$LABEL_SELECTOR"
207+
echo kubectl -n $line delete $NAMESPACED_TYPES -l "$LABEL_SELECTOR"
200208
else
201-
kubectl -n $line delete $NAMESPACED_TYPES -l "$LABEL_SELECTOR"
209+
kubectl -n $line delete $NAMESPACED_TYPES -l "$LABEL_SELECTOR"
202210
fi
203211
done
204212

@@ -260,3 +268,4 @@ if [ ! -x "$(command -v kubectl)" ]; then
260268
fi
261269

262270
deleteDomains "${domains}" "${maxwaitsecs:-$default_maxwaitsecs}"
271+

0 commit comments

Comments
 (0)