You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: site/developer.md
+19-19Lines changed: 19 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
1
# Developer guide
2
2
3
-
This page provides information for developers who wish to understand or contribute to the code.
3
+
This guide provides information for developers who wish to understand or contribute to the code.
4
4
5
5
## Requirements
6
6
7
-
The following software are required to obtain and build the operator:
7
+
The following software is required to obtain and build the operator:
8
8
9
9
* Git (1.8 or later recommended)
10
10
* Apache Maven (3.3 or later recommended)
@@ -77,9 +77,9 @@ These tests assume that the RBAC definitions exist on the Kubernetes cluster.
77
77
78
78
To create them, first, make a copy of the inputs file (`create-weblogic-operator-inputs.yaml`) and update it.
79
79
80
-
Next, choose and create a directory that generated operatorrelated files will be stored in, e.g. /path/to/weblogic-operator-output-directory.
80
+
Next, choose and create a directory that generated operator-related files will be stored in, for example, `/path/to/weblogic-operator-output-directory`.
81
81
82
-
Finally, run the operator installation script with the "generate only" option as shown below, pointing it at your inputs file and your output directory. (see the [installation](installation.md) page for details about this script and the inputs):
82
+
Finally, run the operator installation script with the "generate only" option as shown below, pointing it at your inputs file and your output directory. (See the [installation](installation.md) page for details about this script and the inputs):
83
83
84
84
```
85
85
./create-weblogic-operator.sh -g \
@@ -113,7 +113,7 @@ After you have run the build (that is, `mvn clean install`), create the Docker i
We recommend that you use a tag other than `latest` to make it easy to distinguish your image from the "real" one. In the example above, we just put in the GitHub ID of the developer.
116
+
We recommend that you use a tag other than `latest` to make it easy to distinguish your image from the "real" one. In the example above, we used the GitHub ID of the developer.
117
117
118
118
Next, upload your image to your Kubernetes server as follows:
Verify that you have the right image by running `docker images | grep webloogic-kubernetes-operator` on both machines and comparing the image ID.
128
+
Verify that you have the right image by running `docker images | grep webloogic-kubernetes-operator` on both machines and comparing the image IDs.
129
129
130
130
To create and deploy the operator, first, make a copy of the inputs file (`create-weblogic-operator-inputs.yaml`) and update it, making sure that `weblogicOperatorImagePullPolicy` is set to `Never` and `weblogicOperatorImage` matches the name you used in your `docker build` command.
131
131
132
-
Next, choose and create a directory that generated operatorrelated files will be stored in, e.g. /path/to/weblogic-operator-output-directory.
132
+
Next, choose and create a directory that generated operator-related files will be stored in, for example, `/path/to/weblogic-operator-output-directory`.
133
133
134
134
Finally, run the operator installation script to deploy the operator, pointing it at your inputs file and your output directory:
135
135
@@ -145,7 +145,7 @@ Finally, run the operator installation script to deploy the operator, pointing i
145
145
This project has adopted the following coding standards:
146
146
147
147
* All indents are two spaces.
148
-
* Javadoc must be provided for all public packages, classes and methods and must include all parameters and returns. Javadoc is not required for methods that override or implement methods that are already documented.
148
+
* Javadoc must be provided for all public packages, classes, and methods, and must include all parameters and returns. Javadoc is not required for methods that override or implement methods that are already documented.
149
149
* All non-trivial methods should include `LOGGER.entering()` and `LOGGER.exiting()` calls.
150
150
* The `LOGGER.exiting()` call should include the value that is going to be returned from the method, unless that value includes a credential or other sensitive information.
151
151
* All logged messages must be internationalized using the resource bundle `src/main/resources/Operator.properties` and using a key itemized in `src/main/java/oracle/kubernetes/operator/logging/MessageKeys.java`.
@@ -156,28 +156,28 @@ This project has adopted the following coding standards:
156
156
157
157
This project has the following directory structure:
158
158
159
-
* docs: Generated javadoc and swagger
160
-
* kubernetes: BASH scripts and YAML templates for operator installation and WebLogic domain creation job.
161
-
* site: This documentation
162
-
* src/main/java: Java source code for the operator
163
-
* src/test/java: Java unit-tests for the operator
164
-
* src-generated-swagger: Snapshot of Java source files generated from the domain custom resource's swagger
165
-
* swagger: Swagger files for Kubernetes API server and domain custom resource
159
+
*`docs`: Generated javadoc and Swagger
160
+
*`kubernetes`: BASH scripts and YAML templates for operator installation and WebLogic domain creation job.
161
+
*`site`: This documentation
162
+
*`src/main/java`: Java source code for the operator
163
+
*`src/test/java`: Java unit-tests for the operator
164
+
*`src-generated-swagger`: Snapshot of Java source files generated from the domain custom resource's Swagger
165
+
*`swagger`: Swagger files for the Kubernetes API server and domain custom resource
166
166
167
167
### Watch package
168
168
169
-
The Watch API in the Kubernetes Java client provides a watch capability across a specific list of resources for a limited amount of time. As such it is not ideally suited for our use case, where a continuous stream of watches was desired, with watch events generated in real time. The watch-wrapper in this repository extends the default Watch API to provide a continuous stream of watch events until the stream is specifically closed. It also provides `resourceVersion` tracking to exclude events that have already been seen. The watch-wrapper provides callbacks so events, as they occur, can trigger actions.
169
+
The Watch API in the Kubernetes Java client provides a watch capability across a specific list of resources for a limited amount of time. As such, it is not ideally suited for our use case, where a continuous stream of watches is desired, with watch events generated in real time. The watch-wrapper in this repository extends the default Watch API to provide a continuous stream of watch events until the stream is specifically closed. It also provides `resourceVersion` tracking to exclude events that have already been seen. The watch-wrapper provides callbacks so events, as they occur, can trigger actions.
170
170
171
171
## Asynchronous call model
172
172
173
173
Our expectation is that certain customers will task the operator with managing thousands of WebLogic domains across dozens of Kubernetes namespaces. Therefore, we have designed the operator with an efficient user-level threads pattern based on a simplified version of the code from the JAX-WS reference implementation. We have then used that pattern to implement an asynchronous call model for Kubernetes API requests. This call model has built-in support for timeouts, retries with exponential back-off, and lists that exceed the requested maximum size using the continuance functionality.
174
174
175
-
### User-level Thread Pattern
175
+
### User-Level Thread Pattern
176
176
177
177
The user-level thread pattern is implemented by the classes in the `oracle.kubernetes.operator.work` package.
178
178
179
179
*`Engine`: The executor service and factory for `Fibers`.
180
-
*`Fiber`: The user-level thread. `Fibers` represent the execution of a single processing flow through a series of `Steps`. `Fibers` may be suspended and later resumed and do not consume a `Thread` while suspended.
180
+
*`Fiber`: The user-level thread. `Fibers` represent the execution of a single processing flow through a series of `Steps`. `Fibers` may be suspended and later resumed, and do not consume a `Thread` while suspended.
181
181
*`Step`: Individual CPU-bound activity in a processing flow.
182
182
*`Packet`: Context of the processing flow.
183
183
*`NextAction`: Used by a `Step` when it returns control to the `Fiber` to indicate what should happen next. Common 'next actions' are to execute another `Step` or to suspend the `Fiber`.
@@ -298,6 +298,6 @@ In this sample, the developer is using the pattern to list pods from the default
298
298
299
299
Notice that the required parameters, such as `namespace`, are method arguments, but optional parameters are designated using a simplified builder pattern using `with()` and a lambda.
300
300
301
-
The default behavior of `onFailure()` will retry with exponential backoff the request on status codes `429 (TooManyRequests)`, `500 (InternalServerError)`, `503 (ServiceUnavailable)`, `504 (ServerTimeout)` or a simple timeout with no response from the server.
301
+
The default behavior of `onFailure()` will retry with an exponential backoff the request on status codes `429 (TooManyRequests)`, `500 (InternalServerError)`, `503 (ServiceUnavailable)`, `504 (ServerTimeout)` or a simple timeout with no response from the server.
302
302
303
303
If the server responds with status code `409 (Conflict)`, then this indicates an optimistic locking failure. Common use cases are that the code read a Kubernetes object in one asynchronous step, modified the object, and attempted to replace the object in another asynchronous step; however, another activity replaced that same object in the interim. In this case, retrying the request would give the same result. Therefore, developers may provide an "on conflict" step when calling `super.onFailure()`. The conflict step will be invoked after an exponential backoff delay. In this example, that conflict step should be the step that reads the existing Kubernetes object.
0 commit comments