Skip to content

Commit ec1a6fd

Browse files
committed
Merge remote-tracking branch 'origin/develop' into thirdparty-dependencies
2 parents 73513b4 + fbbc6e0 commit ec1a6fd

File tree

8 files changed

+334
-120
lines changed

8 files changed

+334
-120
lines changed

README.md

Lines changed: 31 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -6,132 +6,53 @@ Built with [Wercker](http://www.wercker.com)
66

77
Oracle is finding ways for organizations using WebLogic Server to run important workloads, to move those workloads into the cloud. By certifying on industry standards, such as Docker and Kubernetes, WebLogic now runs in a cloud neutral infrastructure. In addition, we've provided an open-source Oracle WebLogic Server Kubernetes Operator (the “operator”) which has several key features to assist you with deploying and managing WebLogic domains in a Kubernetes environment. You can:
88

9-
* Create WebLogic domains on a Kubernetes persistent volume. This persistent volume can reside in an NFS.
9+
* Create WebLogic domains in a Kubernetes persistent volume. This persistent volume can reside in an NFS file system or other Kubernetes volume types.
1010
* Create a WebLogic domain in a Docker image.
1111
* Override certain aspects of the WebLogic domain configuration.
12-
* Define WebLogic domains as a Kubernetes resource (using a Kubernetes custom resource definition).
13-
* Start servers based on declarative startup parameters and desired states.
12+
* Define WebLogic domains as a Kubernetes resource (using a Kubernetes custom resource definition).
13+
* Start servers based on declarative startup parameters and desired states.
1414
* Manage WebLogic configured or dynamic clusters.
15-
* Expose the WebLogic Server Administration Console outside the Kubernetes cluster, if desired.
16-
* Expose T3 channels outside the Kubernetes domain, if desired.
17-
* Expose HTTP paths on a WebLogic domain outside the Kubernetes domain with load balancing and update the load balancer when Managed Servers in the WebLogic domain are started or stopped.
15+
* Expose the WebLogic Server Administration Console outside the Kubernetes cluster, if desired.
16+
* Expose T3 channels outside the Kubernetes domain, if desired.
17+
* Expose HTTP paths on a WebLogic domain outside the Kubernetes domain with load balancing and update the load balancer when Managed Servers in the WebLogic domain are started or stopped.
1818
* Scale WebLogic domains 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.
1919
* Publish operator and WebLogic Server logs into Elasticsearch and interact with them in Kibana.
2020

2121
The fastest way to experience the operator is to follow the [Quick start guide](site/quickstart.md), or you can peruse our [documentation](site), read our blogs, or try out the [samples](kubernetes/samples/README.md).
2222

23+
# About this documentation
2324

24-
# Important terms
25+
This documentation includes sections aimed at different audiences. To help you find what you are looking for more easily,
26+
please consult this table of contents:
2527

26-
This documentation uses several important terms which are intended to have a specific meaning.
28+
* The [Quick start guide](site/quickstart.md) explains how to just get the operator running quickly, using all the defaults, nothing special.
29+
* The [User guide](site/user-guide.md) contains detailed information for users of the operator, including how to install and configure it,
30+
and how to use it to create and manage WebLogic domains.
31+
* Our [samples](#samples) provide detailed example code and instructions that show you how to perform
32+
various tasks related to the operator.
33+
* The [Developer guide](site/developer.md) provides details for people who want to understand how the operator is built, tested, and so on,
34+
and those who wish to contribute to the operator code will find useful information here. This section also includes
35+
API documentation (JavaDoc) and Swagger/OpenAPI documentation for the REST APIs.
36+
* The [Contributing](#contributing-to-the-operator) section provides information about conribution requirements.
2737

28-
|Term | Definition |
29-
| --- | --- |
30-
| Cluster | Because this term is ambiguous, it will be prefixed to indicate which type of cluster is meant. A WebLogic cluster is a group of Managed Servers that together host some application or component and which are able to share load and state between them. A Kubernetes cluster is a group of machines (“nodes”) that all host Kubernetes resources, like pods and services, and which appear to the external user as a single entity. If the term “cluster” is not prefixed, it should be assumed to mean a Kubernetes cluster. |
31-
| Domain | A WebLogic domain is a group of related applications and resources along with the configuration information necessary to run them. |
32-
| Ingress | A Kubernetes Ingress provides access to applications and services in a Kubernetes environment to external clients. An Ingress may also provide additional features like load balancing. |
33-
| Namespace | A Kubernetes namespace is a named entity that can be used to group together related objects, for example, pods and services. |
34-
| Operator | A Kubernetes operator is software that performs management of complex applications. |
35-
|Pod | A Kubernetes pod contains one or more containers and is the object that provides the execution environment for an instance of an application component, such as a web server or database. |
36-
| Job | A Kubernetes job is a type of controller that creates one or more pods that run to completion to complete a specific task. |
37-
| Secret | A Kubernetes secret is a named object that can store secret information like usernames, passwords, X.509 certificates, or any other arbitrary data. |
38-
|Service | A Kubernetes service exposes application endpoints inside a pod to other pods, or outside the Kubernetes cluster. A service may also provide additional features like load balancing. |
3938

40-
# Getting started
39+
# User guide
4140

42-
Before using the operator, you might want to 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. Also, worth reading are the details of the [Kubernetes RBAC definitions](site/rbac.md) required by the operator.
41+
The [User guide](site/user-guide.md) provides detailed information about all aspects of using the operator including:
4342

44-
## Prerequisites
43+
* installing and configuring the operator,
44+
* using the operator to create and manage WebLogic domains,
45+
* manually creating WebLogic domains to be managed by the operator,
46+
* scaling WebLogic clusters,
47+
* configuring Kubernetes load balancers,
48+
* configuring Elasticsearch and Kibana to access the operator's log files,
49+
* shutting down domains,
50+
* removing/deleting domains,
51+
* and much more!
4552

46-
* Kubernetes 1.10.11+, 1.11.5+, and 1.12.3+ (check with `kubectl version`).
47-
* Flannel networking v0.9.1-amd64 (check with `docker images | grep flannel`)
48-
* Docker 18.03.1.ce (check with `docker version`)
49-
* Oracle WebLogic Server 12.2.1.3.0
53+
# Samples
5054

51-
## Set up your Kubernetes cluster
52-
53-
If you need help setting up a Kubernetes environment, check our [cheat sheet](site/k8s_setup.md).
54-
55-
## Manage your Kubernetes environment
56-
57-
After creating Kubernetes clusters, you can optionally:
58-
* Create load balancers to direct traffic to backend domains.
59-
* Configure Kibana and Elasticsearch for your operator logs.
60-
61-
### Creating load balancers
62-
63-
Use these [scripts and Helm charts](kubernetes/samples/README.md) to install Traefik, Apache, or Voyager load balancers.
64-
65-
### Configuring Kibana and Elasticsearch
66-
67-
You can send the operator logs to Elasticsearch, to be displayed in Kibana. Use this [sample script](kubernetes/samples/scripts/elasticsearch_and_kibana.yaml) to configure Elasticsearch and Kibana deployments and services.
68-
69-
## Create and manage the operator
70-
71-
An operator is an application-specific controller that extends Kubernetes to create, configure, and manage instances of complex applications. The WebLogic Kubernetes Operator follows the standard Kubernetes Operator pattern, and simplifies the management and operation of WebLogic domains and deployments. You can find the operator image in [Docker Hub](https://hub.docker.com/r/oracle/weblogic-kubernetes-operator/).
72-
73-
In your Kubernetes cluster you can have one or more operators that manage one or more WebLogic domains (running in a cluster). We provide a Helm chart to create the operator. (Point to the documentation and sample that describes how to do the steps below.)
74-
75-
76-
### Starting the operator
77-
78-
* Create the namespace and service account for the operator (See the script and doc that describe how to do these.)
79-
* Edit the operator input YAML
80-
* Start the operator with a Helm chart
81-
82-
### Modifying the operator
83-
84-
(images, RBAC roles, ...)
85-
86-
### Shutting down the operator
87-
(See the operator sample README section that describes how to shutdown and delete all resources for the operator.)
88-
89-
## Create and manage WebLogic domains
90-
91-
In this version of the operator, a WebLogic domain can be persisted either to a persistent volume (PV) or in a Docker image.
92-
(Describe the pros and cons of both these approaches.)
93-
94-
* WebLogic binary image when domain is persisted to a PV (as in Operator v1.1)
95-
* WebLogic domain image where the domain is persisted to a Docker image (new for Operator v2.0). The WebLogic domain image will contain the WebLogic binaries, domain configuration, and applications.
96-
97-
You create the WebLogic domain inside of a Docker image or in a PV using WebLogic Scripting Tool (WLST) or WebLogic Deploy Tooling (WDT).
98-
* (Describe the advantages of using WDT. See samples, Domain in image WDT, Domain in image WLST, Domain in PV WDT, Domain in PV WLST.)
99-
100-
(What images do we need before we get started? Operator 2.0 requires you to patch your WebLogic image 12.2.1.3 with patch #.)
101-
102-
### Preparing the Kubernetes cluster to run WebLogic domains
103-
104-
Perform these steps to prepare your Kubernetes cluster to run a WebLogic domain:
105-
106-
* Create the domain namespace. One or more domains can share a namespace.
107-
* Define RBAC roles for the domain.
108-
* Create a Kubernetes secret for the Administration Server boot credentials.
109-
* Optionally, [create a PV & persistent volume claim (PVC)](kubernetes/samples/scripts/create-weblogic-domain-pv-pvc/README.md) which can hold the domain home, logs, and application binaries.
110-
* [Configure a load balancer](kubernetes/samples/charts/README.md) to manage the domains and ingresses.
111-
112-
### Creating and managing WebLogic domains
113-
114-
To create and manage a WebLogic domain in Kubernetes we create a deployment type, the domain custom resource. The operator introspects the custom resource and manages the domain deployment to adjust to the definitions in the custom resource. This custom resource can also be managed using the Kubernetes command-line interface `kubectl`.
115-
* (Point to documentation how to edit the domain inputs YAML and how to create the domain custom resource.)
116-
* Create Ingress controllers if you are using a load balancer that supports them, such as Traefik or Voyager.
117-
118-
### Managing lifecycle operations
119-
120-
In Operator 2.0 you can perform lifecycle operations on WebLogic servers, clusters, or domains.
121-
* Point to the documentation on how to manage lifecycle operations.
122-
123-
### Modifying domain configurations
124-
You can modify the WebLogic domain configuration for both the domain in PV and the domain in image:
125-
126-
* When the domain is in a PV, use WLST or WDT to change the configuration.
127-
* Use configuration overrides when using the domain in image.(Check with Tom B, "The automatic and custom overrides apply to all domains - not just domain-in-image domains." Point to the documentation.)
128-
129-
### Patching WebLogic and performing application updates
130-
131-
### Shutting down domains
132-
133-
### Deleting domains
134-
(Point to sample)
55+
**TODO** put a list of samples here with a summary and links
13556

13657
# Developer guide
13758

model/src/main/java/oracle/kubernetes/weblogic/domain/ClusterConfigurator.java

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,57 @@ ClusterConfigurator withReadinessProbeSettings(
2828
ClusterConfigurator withLivenessProbeSettings(
2929
Integer initialDelay, Integer timeout, Integer period);
3030

31+
/**
32+
* Add a node label to the Cluster's node selector
33+
*
34+
* @param labelKey the pod label key
35+
* @param labelValue the pod label value
36+
* @return this object
37+
*/
3138
ClusterConfigurator withNodeSelector(String labelKey, String labelValue);
3239

40+
/**
41+
* Add a resource requirement at cluster level. The requests for memory are measured in bytes. You
42+
* can express memory as a plain integer or as a fixed-point integer using one of these suffixes:
43+
* E, P, T, G, M, K. You can also use the power-of-two equivalents: Ei, Pi, Ti, Gi, Mi, Ki. The
44+
* requests for cpu are mesured in cpu units and can be expressed in millicores i.e. 100m is the
45+
* same as 0.1
46+
*
47+
* @param resource the resource to be added as requirement cpu or memory
48+
* @param quantity the quantity required for the resource
49+
* @return this object
50+
*/
3351
ClusterConfigurator withRequestRequirement(String resource, String quantity);
3452

53+
/**
54+
* Add a resource limit at cluster level, the requests for memory are measured in bytes. You can
55+
* express memory as a plain integer or as a fixed-point integer using one of these suffixes: E,
56+
* P, T, G, M, K. You can also use the power-of-two equivalents: Ei, Pi, Ti, Gi, Mi, Ki. The
57+
* requests for cpu are mesured in cpu units and can be expressed in millicores i.e. 100m is the
58+
* same as 0.1
59+
*
60+
* @param resource the resource to be added as requirement cpu or memory
61+
* @param quantity the quantity required for the resource
62+
* @return this object
63+
*/
3564
ClusterConfigurator withLimitRequirement(String resource, String quantity);
3665

66+
/**
67+
* Add security constraints at container level, if the same constraint is also defined at pod
68+
* level then container constraint take precedence
69+
*
70+
* @param containerSecurityContext the security context object
71+
* @return this object
72+
*/
3773
ClusterConfigurator withContainerSecurityContext(V1SecurityContext containerSecurityContext);
3874

75+
/**
76+
* Add security constraints at container level, if the same constraint is also defined at pod
77+
* level then container constraint take precedence
78+
*
79+
* @param podSecurityContext
80+
* @return this object
81+
*/
3982
ClusterConfigurator withPodSecurityContext(V1PodSecurityContext podSecurityContext);
4083

4184
ClusterConfigurator withAdditionalVolume(String name, String path);
@@ -50,5 +93,17 @@ ClusterConfigurator withLivenessProbeSettings(
5093

5194
ClusterConfigurator withServiceAnnotation(String name, String value);
5295

96+
/**
97+
* Tells the operator whether the customer wants to restart the server pods. The value can be any
98+
* String and it can be defined on domain, cluster or server to restart the different pods. After
99+
* the value is added, the corresponding pods will be terminated and created again. If customer
100+
* modifies the value again after the pods were recreated, then the pods will again be terminated
101+
* and recreated.
102+
*
103+
* @since 2.0
104+
* @param restartVersion If preseent, every time this value is updated the operator will restart
105+
* the required servers
106+
* @return this object
107+
*/
53108
ClusterConfigurator withRestartVersion(String restartVersion);
54109
}

model/src/main/java/oracle/kubernetes/weblogic/domain/DomainConfigurator.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,9 +267,15 @@ public abstract DomainConfigurator withPodSecurityContext(
267267
V1PodSecurityContext podSecurityContext);
268268

269269
/**
270-
* Set the restart version for the Domain
270+
* Tells the operator whether the customer wants to restart the server pods. The value can be any
271+
* String and it can be defined on domain, cluster or server to restart the different pods. After
272+
* the value is added, the corresponding pods will be terminated and created again. If customer
273+
* modifies the value again after the pods were recreated, then the pods will again be terminated
274+
* and recreated.
271275
*
272-
* @param restartVersion
276+
* @since 2.0
277+
* @param restartVersion If preseent, every time this value is updated the operator will restart
278+
* the required servers
273279
* @return this object
274280
*/
275281
public abstract DomainConfigurator withRestartVersion(String restartVersion);

model/src/main/java/oracle/kubernetes/weblogic/domain/ServerConfigurator.java

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,57 @@ ServerConfigurator withLivenessProbeSettings(
2424
ServerConfigurator withReadinessProbeSettings(
2525
Integer initialDelay, Integer timeout, Integer period);
2626

27+
/**
28+
* Add a node label to the Servers's node selector
29+
*
30+
* @param labelKey the pod label key
31+
* @param labelValue the pod label value
32+
* @return this object
33+
*/
2734
ServerConfigurator withNodeSelector(String labelKey, String labelValue);
2835

36+
/**
37+
* Add a resource requirement at server level. The requests for memory are measured in bytes. You
38+
* can express memory as a plain integer or as a fixed-point integer using one of these suffixes:
39+
* E, P, T, G, M, K. You can also use the power-of-two equivalents: Ei, Pi, Ti, Gi, Mi, Ki. The
40+
* requests for cpu are mesured in cpu units and can be expressed in millicores i.e. 100m is the
41+
* same as 0.1
42+
*
43+
* @param resource the resource to be added as requirement cpu or memory
44+
* @param quantity the quantity required for the resource
45+
* @return this object
46+
*/
2947
ServerConfigurator withRequestRequirement(String resource, String quantity);
3048

49+
/**
50+
* Add a resource limit at server level, the requests for memory are measured in bytes. You can
51+
* express memory as a plain integer or as a fixed-point integer using one of these suffixes: E,
52+
* P, T, G, M, K. You can also use the power-of-two equivalents: Ei, Pi, Ti, Gi, Mi, Ki. The
53+
* requests for cpu are mesured in cpu units and can be expressed in millicores i.e. 100m is the
54+
* same as 0.1
55+
*
56+
* @param resource the resource to be added as requirement cpu or memory
57+
* @param quantity the quantity required for the resource
58+
* @return this object
59+
*/
3160
ServerConfigurator withLimitRequirement(String resource, String quantity);
3261

62+
/**
63+
* Add security constraints at container level, if the same constraint is also defined at pod
64+
* level then container constraint take precedence
65+
*
66+
* @param containerSecurityContext the security context object
67+
* @return this object
68+
*/
3369
ServerConfigurator withContainerSecurityContext(V1SecurityContext containerSecurityContext);
3470

71+
/**
72+
* Add security constraints at container level, if the same constraint is also defined at pod
73+
* level then container constraint take precedence
74+
*
75+
* @param podSecurityContext
76+
* @return this object
77+
*/
3578
ServerConfigurator withPodSecurityContext(V1PodSecurityContext podSecurityContext);
3679

3780
ServerConfigurator withAdditionalVolume(String name, String path);
@@ -46,5 +89,17 @@ ServerConfigurator withReadinessProbeSettings(
4689

4790
ServerConfigurator withServiceAnnotation(String name, String value);
4891

92+
/**
93+
* Tells the operator whether the customer wants to restart the server pods. The value can be any
94+
* String and it can be defined on domain, cluster or server to restart the different pods. After
95+
* the value is added, the corresponding pods will be terminated and created again. If customer
96+
* modifies the value again after the pods were recreated, then the pods will again be terminated
97+
* and recreated.
98+
*
99+
* @since 2.0
100+
* @param restartVersion If preseent, every time this value is updated the operator will restart
101+
* the required servers
102+
* @return this object
103+
*/
49104
ServerConfigurator withRestartVersion(String restartVersion);
50105
}

model/src/main/java/oracle/kubernetes/weblogic/domain/v2/BaseConfiguration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,11 +219,11 @@ void addServiceAnnotations(String name, String value) {
219219
serverPod.addServiceAnnotations(name, value);
220220
}
221221

222-
public String getRestartVersion() {
222+
String getRestartVersion() {
223223
return restartVersion;
224224
}
225225

226-
public void setRestartVersion(String restartVersion) {
226+
void setRestartVersion(String restartVersion) {
227227
this.restartVersion = restartVersion;
228228
}
229229

operator/src/main/java/oracle/kubernetes/operator/JobWatcher.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public class JobWatcher extends Watcher<V1Job> implements WatchListener<V1Job> {
4646
* @param factory thread factory
4747
* @param ns Namespace
4848
* @param initialResourceVersion Initial resource version or empty string
49+
* @param tuning Tuning parameters for the watch, for example watch lifetime
4950
* @param isStopping Stop signal
5051
* @return Job watcher for the namespace
5152
*/

0 commit comments

Comments
 (0)