Skip to content

Commit d8109bd

Browse files
authored
Merge branch 'master' into feature/integration-tests
2 parents 31f64a1 + de602d7 commit d8109bd

File tree

13 files changed

+112
-88
lines changed

13 files changed

+112
-88
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ The operator can configure services to expose WebLogic applications and features
5252
* How will users authenticate?
5353
* Is the network channel encrypted?
5454

55-
While it is natural to expose web applications outside the cluster, exposing administrative features like the administration console and a T3 channel for WLST should be given more careful consideration. There are alternative options that should be weighed. For example, Kubernetes provides the ability to securely access a shell running in a container in a pod in the cluster. WLST could be executed from such an environment, meaning the T3 communications are entirely within the Kubernetes cluster and therefore more secure.
55+
While it is natural to expose web applications outside the cluster, exposing administrative features like the Administration Console and a T3 channel for WLST should be given more careful consideration. There are alternative options that should be weighed. For example, Kubernetes provides the ability to securely access a shell running in a container in a pod in the cluster. WLST could be executed from such an environment, meaning the T3 communications are entirely within the Kubernetes cluster and therefore more secure.
5656

5757
Oracle recommends careful consideration before deciding to expose any administrative interfaces externally.
5858

5959
# Requirements
6060

6161
The Oracle WebLogic Server Kubernetes Operator has the following requirements:
6262

63-
* Kubernetes 1.7.5+, 1.8.0+ or 1.9.0+ (check with `kubectl version`)
63+
* Kubernetes 1.7.5+, 1.8.0+ (check with `kubectl version`). Note that Kubernetes 1.9.x is not supported yet.
6464
* Flannel networking v0.9.1-amd64 (check with `docker images | grep flannel`)
6565
* Docker 17.03.1.ce (check with `docker version`)
6666
* Oracle WebLogic Server 12.2.1.3.0
@@ -73,10 +73,10 @@ The following features are not certified or supported in the Technology Preview
7373

7474
* Whole Server Migration
7575
* Consensus Leasing
76-
* Node Manager (although it is used internally for the liveness probe and to start WebLogic servers)
76+
* Node Manager (although it is used internally for the liveness probe and to start WebLogic Server instances)
7777
* Dynamic domains (the current certification only covers configured clusters, certification of dynamic clusters is planned at a future date)
7878
* Multicast
79-
* If using a `hostPath` persistent volume, then it must have read/write/many permissions for all container/pods in the WebLogic deployment
79+
* If using a `hostPath` persistent volume, then it must have read/write/many permissions for all container/pods in the WebLogic Server deployment
8080
* Multitenancy
8181
* Production redeployment
8282

@@ -97,11 +97,11 @@ Documentation for APIs is provided here:
9797
If you would rather see the developers demonstrating the operator rather than reading the documentation, then here are your videos:
9898

9999
* [Installing the operator](https://youtu.be/B5UmY2xAJnk) includes the installation and also shows using the operator's REST API.
100-
* [Creating a WebLogic domain with the operator](https://youtu.be/Ey7o8ldKv9Y) shows creation of two WebLogic domains including accessing the administration console and looking at the various resources created in Kubernetes - services, Ingresses, pods, load balancers, etc.
100+
* [Creating a WebLogic domain with the operator](https://youtu.be/Ey7o8ldKv9Y) shows creation of two WebLogic domains including accessing the Administration Console and looking at the various resources created in Kubernetes - services, Ingresses, pods, load balancers, etc.
101101
* [Deploying a web application, scaling a WebLogic cluster with the operator and verifying load balancing](https://youtu.be/hx4OPhNFNDM)
102102
* [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.
103103
* [Scaling a WebLogic cluster with WLDF](https://youtu.be/Q8iZi2e9HvU)
104-
* watch this space, more to come!
104+
* Watch this space, more to come!
105105

106106
Like what you see? Read on for all the nitty-gritty details...
107107

@@ -157,10 +157,10 @@ Please refer to [Scaling a WebLogic cluster](site/scaling.md) for more informati
157157

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

160-
## Load balancing with the Traefik ingress controller
160+
## Load balancing with the Traefik Ingress controller
161161

162162
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.
163-
Please refer to [Load balancing with the Traefik ingress controller](site/traefik.md) for information about current capabilities.
163+
Please refer to [Load balancing with Traefik](site/traefik.md) for information about current capabilities.
164164

165165
[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.)
166166

@@ -169,11 +169,11 @@ Please refer to [Load balancing with the Traefik ingress controller](site/traefi
169169
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:
170170

171171
```
172-
kubectl delete pvc PVC-NAME
172+
kubectl delete pvc PVC-NAME -n NAMESPACE
173173
kubectl delete pv PV-NAME
174174
```
175175

176-
Find the names of the persistent volume claim and the persistent volume in the domain custom resource YAML file, or if it is not available, check for the `domainUID` in the metadata on the persistent volumes.
176+
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.
177177

178178
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.
179179

kubernetes/create-domain-job-inputs.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ persistenceVolumeClaimName: pv001-claim
5252
# if it is not already
5353
persistenceVolumeName: pv001
5454

55+
# Boolean indiciating whether to erase/overwrite an existing data found in the persistent volume
56+
# WARNING: if you set this to true, then ALL data found in the persistent volume will be deleted!
57+
replaceExistingDomain: false
58+
5559
# Boolean indicating if production mode is enabled for the domain
5660
productionModeEnabled: true
5761

kubernetes/create-domain-job.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ function initialize {
273273
validateInputParamsSpecified adminPort adminServerName createDomainScript domainName domainUid clusterName managedServerCount managedServerStartCount managedServerNameBase
274274
validateInputParamsSpecified managedServerPort persistencePath persistenceSize persistenceVolumeClaimName persistenceVolumeName
275275
validateInputParamsSpecified productionModeEnabled secretsMountPath secretName t3ChannelPort exposeAdminT3Channel adminNodePort exposeAdminNodePort
276-
validateInputParamsSpecified namespace loadBalancer loadBalancerWebPort loadBalancerAdminPort loadBalancer
276+
validateInputParamsSpecified namespace loadBalancer loadBalancerWebPort loadBalancerAdminPort loadBalancer replaceExistingDomain
277277
validateStorageClass
278278
validateLoadBalancer
279279
validateImagePullSecretName
@@ -349,6 +349,7 @@ function createYamlFiles {
349349
sed -i -e "s:%T3_CHANNEL_PORT%:${t3ChannelPort}:g" ${jobOutput}
350350
sed -i -e "s:%T3_PUBLIC_ADDRESS%:${t3PublicAddress}:g" ${jobOutput}
351351
sed -i -e "s:%CLUSTER_NAME%:${clusterName}:g" ${jobOutput}
352+
sed -i -e "s:%REPLACE_EXISTING_DOMAIN%:${replaceExistingDomain}:g" ${jobOutput}
352353

353354
# Generate the yaml to create the domain custom resource
354355
echo Generating ${dcrOutput}

kubernetes/internal/domain-job-template.yaml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,16 @@ data:
6060
fail "The domain secret %SECRETS_MOUNT_PATH%/password was not found"
6161
fi
6262
63-
# Do not proceed if the domain already exists
63+
# Check if the domain already exists
6464
domainFolder=${SHARED_PATH}/domain/%DOMAIN_NAME%
6565
if [ -d ${domainFolder} ]; then
66-
fail "The create domain job will not overwrite an existing domain. The domain folder ${domainFolder} already exists"
66+
# check if user asked to replace existing data
67+
if [ "%REPLACE_EXISTING_DOMAIN%" = "true" ]; then
68+
echo "As requested, deleting all data in the peristent volume to make way for new domain!"
69+
rm -rf ${SHARED_PATH}/*
70+
else
71+
fail "The create domain job will not overwrite an existing domain unless you set the parameter 'replaceExistingDomain' to 'true'. The domain folder ${domainFolder} already exists"
72+
fi
6773
fi
6874
6975
# Create the base folders
@@ -177,8 +183,8 @@ data:
177183
sleep 15
178184
echo "Finished waiting for the nodemanager to start"
179185
180-
echo "Update JVM arguments"
181-
echo "Arguments=\${USER_MEM_ARGS} -XX\:+UnlockExperimentalVMOptions -XX\:+UseCGroupMemoryLimitForHeap \${JAVA_OPTIONS}" >> ${startProp}
186+
echo "Update JVM arguments"
187+
echo "Arguments=\${USER_MEM_ARGS} -XX\:+UnlockExperimentalVMOptions -XX\:+UseCGroupMemoryLimitForHeap \${JAVA_OPTIONS}" >> ${startProp}
182188
183189
echo "Start the server"
184190
wlst.sh -skipWLSModuleScanning ${pyFile}
@@ -207,7 +213,7 @@ data:
207213
checkFileExists ${pyFile}
208214
209215
# Create a liveness probe script. It checks a WL server state file maintained by the node manager.
210-
# The script and 'EOF' on the following lines must not be indented!
216+
# The script and 'EOF' on the following lines must not be indented!
211217
212218
scriptFile=${nmdir}/livenessProbe.sh
213219
@@ -317,7 +323,7 @@ data:
317323
done
318324
319325
echo "Successfully Completed"
320-
326+
321327
create-domain.py: |-
322328
# This python script is used to create a WebLogic domain
323329

kubernetes/internal/generate-security-policy.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/usr/bin/env bash
22
# Copyright 2017, 2018, Oracle Corporation and/or its affiliates. All rights reserved.
33
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
44

@@ -44,10 +44,10 @@ else
4444
shift
4545
fi
4646

47-
if [ "$1" == "-o" ] ; then
47+
if [ "$1" = "-o" ] ; then
4848
shift
4949
SCRIPT="$1"
50-
elif [[ "$1" = --output=* ]] ; then
50+
elif [[ "$1" = "--output="* ]] ; then
5151
SCRIPT=`echo "$1" | cut -d \= -f 2`
5252
else
5353
SCRIPT=$SCRIPT_DEFAULT

site/architecture.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ The operator is packaged in a Docker image `container-registry.oracle.com/middle
99

1010
Scripts are provided to deploy the operator to a Kubernetes cluster. These scripts also provide options to install and configure a load balancer and ELK integration.
1111

12-
The operator registers a Kubernetes custom resource definition called `domain.weblogic.oracle` (shortname `domain`, plural `domains`).
12+
The operator registers a Kubernetes custom resource definition called `domain.weblogic.oracle` (shortname `domain`, plural `domains`).
1313

14-
The diagram below shows the general layout of high level components, including optional components, in a Kubernetes cluster that is hosting WebLogic domains and the operator:
14+
The diagram below shows the general layout of high-level components, including optional components, in a Kubernetes cluster that is hosting WebLogic domains and the operator:
1515

1616
![High level architecture](images/high-level-architecture.png)
1717

@@ -32,11 +32,11 @@ This diagram shows the following details:
3232

3333
* A persistent volume is created using one of the available providers. The chosen provider must support “Read Write Many” access mode. A persistent volume claim is created to claim space in that persistent volume. Both the persistent volume and the persistent volume claim are labeled with `weblogic.domainUID` and these labels allow the operator to find the correct volume for a particular domain. There must be a different persistent volume for each domain. The shared state on the persistent volume include the “domain” directory, the “applications” directory, a directory for storing logs and a directory for any file-based persistence stores.
3434

35-
* A pod is created for the WebLogic Administration Server. This pod is labeled with `weblogic.domainUID`, `weblogic.serverName` and `weblogic.domainName`. One container runs in this pod. WebLogic Node Manager and Administration Server processes are run inside this container. The Node Manager process is used as an internal implementation detail for the liveness probe, for patching and to provide monitoring and control capabilities to the administration console. It is not intended to be used for other purposes, and it may be removed in some future release.
35+
* A pod is created for the WebLogic Administration Server. This pod is labeled with `weblogic.domainUID`, `weblogic.serverName` and `weblogic.domainName`. One container runs in this pod. WebLogic Node Manager and Administration Server processes are run inside this container. The Node Manager process is used as an internal implementation detail for the liveness probe, for patching and to provide monitoring and control capabilities to the Administration Console. It is not intended to be used for other purposes, and it may be removed in some future release.
3636
* A `ClusterIP` type service is created for the Administration Server pod. This service provides a stable, well-known network (DNS) name for the Administration Server. This name is derived from the `domainUID` and the Administration Server name, and it is known before starting up any pod. The Administration Server `ListenAddress` is set to this well-known name. `ClusterIP` type services are only visible inside the Kubernetes cluster. They are used to provide the well-known names that all of the servers in a domain use to communicate with each other. This service is labeled with `weblogic.domainUID` and `weblogic.domainName`.
3737
* A `NodePort` type service is created for the Administration Server pod. This service provides HTTP access to the Administration Server to clients that are outside the Kubernetes cluster. This service is intended to be used to access the WebLogic Server Administration Console only. This service is labeled with `weblogic.domainUID` and `weblogic.domainName`.
3838
* If requested when configuring the domain, a second `NodePort` type service is created for the Administration Server pod. This second service is used to expose a WebLogic channel for the T3 protocol. This service provides T3 access to the Administration Server to clients that are outside the Kubernetes cluster. This service is intended to be used for WLST connections to the Administration Server. This service is labeled with `weblogic.domainUID` and `weblogic.domainName`.
39-
* A pod is created for each WebLogic Managed Server. These pods are labeled with `weblogic.domainUID`, `weblogic.serverName` and `weblogic.domainName`. One container runs in each pod. WebLogic Node Manager and Managed Server processes are run inside each of these containers. The Node Manager process is used as an internal implementation detail for the liveness probe. It is not intended to be used for other purposes, and it may be removed in some future release.
39+
* A pod is created for each WebLogic Managed Server. These pods are labeled with `weblogic.domainUID`, `weblogic.serverName` and `weblogic.domainName`. One container runs in each pod. WebLogic Node Manager and Managed Server processes are run inside each of these containers. The Node Manager process is used as an internal implementation detail for the liveness probe. It is not intended to be used for other purposes, and it may be removed in some future release.
4040
* A `NodePort` type service is created for each Managed Server pod that contains a Managed Server that is not part of a WebLogic cluster. These services provide HTTP access to the Managed Servers to clients that are outside the Kubernetes cluster. These services are intended to be used to access applications running on the Managed Servers. These services are labeled with `weblogic.domainUID` and `weblogic.domainName`.
4141
* An Ingress is created for each WebLogic cluster. This Ingress provides load balanced HTTP access to all Managed Servers in that WebLogic cluster. The operator updates the Ingress every time a Managed Server in the WebLogic cluster becomes “ready” or ceases to be able to service requests, such that the Ingress always points to just those Managed Servers that are able to handle user requests. The Ingress is labeled with `weblogic.domainUID`, `weblogic.clusterName` and `weblogic.domainName`. The Ingress is also annotated with a class which is used to match Ingresses to the correct instances of the load balancer. In the Technology Preview release, there is one instance of the load balancer running for each WebLogic cluster, and the load balancers are configured with the root URL path (“/”). More flexible load balancer configuration is planned for a future release.
4242
* If the ELK integration was requested when configuring the operator, there will also be another pod that runs logstash in a container. This pod will publish the logs from all WebLogic Server instances in the domain into ElasticSearch. There is one logstash per domain, but only one ElasticSearch and one Kibana for the entire Kubernetes cluster.
@@ -59,7 +59,7 @@ The operator expects (and requires) that all state be stored outside of the Dock
5959

6060
It is worth providing some background on why this approach was adopted, in addition to the fact that this separation is consistent with other existing operators (for other products) and the Kubernetes “cattle, not pets” philosophy when it comes to containers.
6161

62-
The external state approach allows the operator to treat the Docker images as essentially immutable, read-only, binary images. This means that the image needs to be pulled only once, and that many domains can share the same image. This helps to minimize the amount of bandwidth and storage needed for WebLogic Server Docker images.
62+
The external state approach allows the operator to treat the Docker images as essentially immutable, read-only, binary images. This means that the image needs to be pulled only once, and that many domains can share the same image. This helps to minimize the amount of bandwidth and storage needed for WebLogic Server Docker images.
6363

6464
This approach also eliminates the need to manage any state created in a running container, because all of the state that needs to be preserved is written into either the persistent volume or a database back end. The containers and pods are completely throwaway and can be replaced with new containers and pods as necessary. This makes handling failures and rolling restarts much simpler because there is no need to preserve any state inside a running container.
6565

0 commit comments

Comments
 (0)