Skip to content

Commit 190bf60

Browse files
author
Lily He
committed
Merge branch 'master' of github.com:oracle/weblogic-kubernetes-operator
2 parents f1fc62d + 54d1c9b commit 190bf60

File tree

9 files changed

+69
-12
lines changed

9 files changed

+69
-12
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ please consult this table of contents:
6363
various tasks related to the operator.
6464
* The [Developer guide](site/developer.md) provides details for people who want to understand how the operator is built, tested, and so on. Those who wish to contribute to the operator code will find useful information here. This section also includes
6565
API documentation (Javadoc) and Swagger/OpenAPI documentation for the REST APIs.
66-
* The [Contributing](#contributing-to-the-operator) section provides information about conribution requirements.
66+
* The [Contributing](#contributing-to-the-operator) section provides information about contribution requirements.
6767

6868

6969
# User guide

kubernetes/internal/utility.sh

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,15 +184,35 @@ function toDNS1123Legal {
184184

185185
#
186186
# Function to check if a value is lowercase
187-
# $1 - value to check
188-
# $2 - name of object being checked
187+
# $1 - name of object being checked
188+
# $2 - value to check
189189
function validateLowerCase {
190190
local lcVal=$(toLower $2)
191191
if [ "$lcVal" != "$2" ]; then
192192
validationError "The value of $1 must be lowercase: $2"
193193
fi
194194
}
195195

196+
#
197+
# Function to lowercase a value and make it a legal DNS1123 name
198+
# $1 - value to convert to DNS legal name
199+
function toDNS1123Legal {
200+
local val=`echo $1 | tr "[:upper:]" "[:lower:]"`
201+
val=${val//"_"/"-"}
202+
echo "$val"
203+
}
204+
205+
#
206+
# Function to check if a value is lowercase and legal DNS name
207+
# $1 - name of object being checked
208+
# $2 - value to check
209+
function validateDNS1123LegalName {
210+
local val=$(toDNS1123Legal $2)
211+
if [ "$val" != "$2" ]; then
212+
validationError "The value of $1 contains invalid charaters (uppercase letters or "_"): $2"
213+
fi
214+
}
215+
196216
#
197217
# Function to check if a value is lowercase and legal DNS name
198218
# $1 - value to check

kubernetes/src/test/java/oracle/kubernetes/operator/utils/DomainValues.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ protected String convertNullToEmptyString(String val) {
8787
public DomainValues withTestDefaults() {
8888
return this.adminNodePort("30702")
8989
.adminPort("7002")
90-
.adminServerName("TestAdminServer")
91-
.clusterName("TestCluster")
90+
.adminServerName("test-admin-server")
91+
.clusterName("test-cluster")
9292
.clusterType(CLUSTER_TYPE_DYNAMIC)
9393
.domainName("TestDomain")
9494
.weblogicImage("store/oracle/weblogic:19.1.0.0")
@@ -97,7 +97,7 @@ public DomainValues withTestDefaults() {
9797
.loadBalancerDashboardPort("31315")
9898
.loadBalancerWebPort("31305")
9999
.configuredManagedServerCount("4")
100-
.managedServerNameBase("TestManagedServer")
100+
.managedServerNameBase("test-managed-server")
101101
.managedServerPort("8002")
102102
.initialManagedServerReplicas("3")
103103
.weblogicDomainStorageNFSServer("TestDomainStorageNFSServer")

operator/src/test/java/oracle/kubernetes/operator/steps/ReadHealthStepTest.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import oracle.kubernetes.operator.ProcessingConstants;
2121
import oracle.kubernetes.operator.http.HttpClient;
2222
import oracle.kubernetes.operator.steps.ReadHealthStep.ReadHealthWithHttpClientStep;
23+
import oracle.kubernetes.operator.work.Component;
2324
import oracle.kubernetes.operator.work.NextAction;
2425
import oracle.kubernetes.operator.work.Packet;
2526
import oracle.kubernetes.operator.work.Step;
@@ -79,6 +80,12 @@ PacketStub withServerName(String serverName) {
7980
return this;
8081
}
8182

83+
PacketStub addSpi(Class clazz, Object spiObject) {
84+
Component component = Component.createFor(spiObject);
85+
this.getComponents().put(clazz.getName(), component);
86+
return this;
87+
}
88+
8289
@Override
8390
public Object get(Object key) {
8491
if (HttpClient.KEY.equals(key)) {

site/architecture.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,15 @@ The operator consists of the following two main parts:
77
* The operator itself, a process that runs in a Docker container deployed into a Kubernetes pod and which performs the actual management tasks.
88
* A Kubernetes job which can be used to create a WebLogic domain.
99

10-
The operator is packaged in a Docker image `container-registry.oracle.com/middleware/weblogic-operator:latest`. This image can be deployed to a Kubernetes cluster. It is recommended that the operator be deployed in its own namespace. Only one operator is permitted in a namespace; however, multiple operators may be deployed in a Kubernetes cluster provided they are each in their own namespace and the list of namespaces they manage do not overlap.
10+
The operator is packaged in a [Docker image](https://hub.docker.com/r/oracle/weblogic-kubernetes-operator/) which you can access using the following `docker pull` command:
11+
12+
```
13+
14+
docker pull oracle/weblogic-kubernetes-operator:1.1
15+
16+
```
17+
18+
This image can be deployed to a Kubernetes cluster. It is recommended that the operator be deployed in its own namespace. Only one operator is permitted in a namespace; however, multiple operators may be deployed in a Kubernetes cluster provided they are each in their own namespace and the list of namespaces they manage do not overlap.
1119

1220
Scripts are provided to deploy the operator to a Kubernetes cluster. These scripts also provide options to install and configure a load balancer and Elastic Stack integration.
1321

site/helm-charts.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@
44

55
The WebLogic Kubernetes Operator uses Helm to create and deploy any necessary resources and then run the operator in a Kubernetes cluster. Helm helps you manage Kubernetes applications. Helm charts help you define and install applications into the Kubernetes cluster. The operator's Helm chart is located in the `kubernetes/charts/weblogic-operator` directory.
66

7+
> If you have an old version of the operator installed on your cluster you must remove
8+
it before installing this version. You should remove the deployment (for example `kubectl delete deploy weblogic-operator -n your-namespace`) and the custom
9+
resource definition (for example `kubectl delete crd domain`). If you do not remove
10+
the custom resource definition you may see errors like this:
11+
12+
`Error from server (BadRequest): error when creating "/scratch/output/uidomain/weblogic-domains/uidomain/domain.yaml":
13+
the API version in the data (weblogic.oracle/v2) does not match the expected API version (weblogic.oracle/v1`
14+
15+
716
## Install Helm and Tiller
817

918
Helm has two parts: a client (helm) and a server (tiller). Tiller runs inside of your Kubernetes cluster, and manages releases (installations) of your charts. See https://github.com/kubernetes/helm/blob/master/docs/install.md for detailed instructions on installing helm and tiller.

site/quickstart.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ Use this quick start guide to create a WebLogic deployment in a Kubernetes clust
44
These instructions assume that you are already familiar with Kubernetes. If you need more detailed instructions, please
55
refer to the [User guide](user-guide.md).
66

7+
> If you have an old version of the operator installed on your cluster you must remove
8+
it before installing this version. You should remove the deployment (for example `kubectl delete deploy weblogic-operator -n your-namespace`) and the custom
9+
resource definition (for example `kubectl delete crd domain`). If you do not remove
10+
the custom resource definition you may see errors like this:
11+
12+
`Error from server (BadRequest): error when creating "/scratch/output/uidomain/weblogic-domains/uidomain/domain.yaml":
13+
the API version in the data (weblogic.oracle/v2) does not match the expected API version (weblogic.oracle/v1`
14+
715
## Prerequisites
816
For this exercise, you’ll need a Kubernetes cluster. If you need help setting one up, check out our [cheat sheet](k8s_setup.md).
917

@@ -164,9 +172,14 @@ domain namespace (`sample-domain1-ns`) and the `domainHomeImageBase` (`oracle/we
164172
For example, assuming you named your copy `my-inputs.yaml`:
165173
```
166174
$ cd kubernetes/samples/scripts/create-weblogic-domain/domain-home-in-image
167-
$ ./create-domain.sh -i my-inputs.yaml -o /some/output/directory -e -v
175+
$ ./create-domain.sh -i my-inputs.yaml -o /some/output/directory -u username -p password -e
168176
```
169177

178+
You need to provide the WebLogic administration username and password in the `-u` and `-p` options
179+
respectively, as shown in the example. If you specify the `-e` option, the script will generate the
180+
Kubernetes YAML files *and* apply them to your cluster. If you omit the `-e` option, the
181+
script will just generate the YAML files, but will not take any action on your cluster.
182+
170183
c. Confirm that the operator started the servers for the domain:
171184
* Use `kubectl` to show that the domain resource was created:
172185
```

site/v1.0/creating-domain.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ The following parameters must be provided in the input file.
109109
| `exposeAdminNodePort` | Boolean indicating if the Administration Server is exposed outside of the Kubernetes cluster. | `false` |
110110
| `exposeAdminT3Channel` | Boolean indicating if the T3 administrative channel is exposed outside the Kubernetes cluster. | `false` |
111111
| `initialManagedServerReplicas` | Number of Managed Servers to initially start for the domain. | `2` |
112-
| `javaOptions` | Java options for starting the Administration and Managed Servers. | `-Dweblogic.StdoutDebugEnabled=false` |
112+
| `javaOptions` | Java options for starting the Administration and Managed Servers. A Java option can have references to one or more of the following pre-defined variables to obtain WebLogic domain information: $(DOMAIN_NAME), $(DOMAIN_HOME), $(ADMIN_NAME), $(ADMIN_PORT), and $(SERVER_NAME). | `-Dweblogic.StdoutDebugEnabled=false` |
113113
| `loadBalancer` | Type of load balancer to create. Legal values are `NONE` and `TRAEFIK`. | `TRAEFIK` |
114114
| `loadBalancerDashboardPort` | Node port for the load balancer to accept dashboard traffic. | `30315` |
115115
| `loadBalancerWebPort` | Node port for the load balancer to accept user traffic. | `30305` |

site/v1.1/apache.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ You need to build the Docker image for the Apache HTTP Server that embeds the Or
1818
1919
```
2020

21-
For more information about the Apache plugin, see [Apache HTTP Server with Oracle WebLogic Server Proxy Plugin on Docker](https://docs.oracle.com/middleware/12213/webtier/develop-plugin/apache.htm#PLGWL395).
21+
For more information about the Apache plugin, see [Configuring the Plug-In for Apache HTTP Server](https://docs.oracle.com/middleware/12213/webtier/develop-plugin/apache.htm#PLGWL395).
2222

2323
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.
2424

@@ -250,7 +250,7 @@ You can fine tune the behavior of the Apache plugin by providing your own Apache
250250
loadBalancerVolumePath: <host-config-dir>
251251
```
252252

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

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

@@ -270,7 +270,7 @@ The generated YAML files will look similar except with un-commented entries like
270270

271271
## Use the Apache load balancer with a manually created WebLogic Domain
272272

273-
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.
273+
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.
274274

275275
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).
276276

0 commit comments

Comments
 (0)