-
Notifications
You must be signed in to change notification settings - Fork 91
Kubernetes operator configuration doc #522
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
c0ff0d9
Linked to new document
rakillen 71477e3
Added README for configuring Operator
rakillen 9e67839
Added default image value, image in example
rakillen 376e689
Updated from review comments
rakillen 06b1fa8
Updated for changes to imagePullPolicy and imagePullSecrets
rakillen 4cc5df4
Merge branch 'master' into kubernetes-doc
ddsharpe 889164e
Updated from review comments
rakillen 52defa8
Merge remote-tracking branch 'origin/kubernetes-doc' into kubernetes-doc
rakillen 6a957e5
Merge branch 'master' into kubernetes-doc
ddsharpe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
## Configuring Oracle WebLogic Server Kubernetes Operator | ||
|
||
The Extract Domain Resource Tool can be used to create a domain resource file for use with the Oracle WebLogic Server Kubernetes Operator. This allows the domain configuration and the Kubernetes container configuration to be specified in a single model file. | ||
|
||
This is especially useful when making configuration changes to the domain that also need to be reflected in the domain resource file. For example, adding a cluster to the domain only requires that it be added to the `topology` section of the WDT model, then a new domain resource file can be generated to apply to Kubernetes. | ||
|
||
More information about the Oracle WebLogic Server Kubernetes Operator can be found [here](https://oracle.github.io/weblogic-kubernetes-operator). | ||
|
||
NOTE: The Extract Domain Resource Tool is available with WDT releases 1.7.0 and later. | ||
|
||
Here is an example command line for the Extract Domain Resource Tool: | ||
``` | ||
<wls-deploy-home>/bin/extractDomainResource.sh -oracle_home /tmp/oracle -domain_home /u01/mydomain -model_file /tmp/mymodel.yaml -variable_file /tmp/my.properties -domain_resource_file /tmp/operator/domain-resource.yaml | ||
``` | ||
|
||
For the simplest case, the Extract Domain Resource Tool will create a sparse domain file. This is what is generated when there is not a `kubernetes` section in the model, or that section is empty. | ||
```yaml | ||
apiVersion: weblogic.oracle/v6 | ||
kind: Domain | ||
metadata: | ||
name: DemoDomain | ||
spec: | ||
domainHome: /u01/mydomain | ||
image: '--FIX ME--' | ||
imagePullSecrets: | ||
- name: '--FIX ME--' | ||
webLogicCredentialsSecret: '--FIX ME--' | ||
clusters: | ||
rakillen marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- clusterName: mycluster | ||
replicas: 2 | ||
- clusterName: mycluster3 | ||
replicas: 4 | ||
``` | ||
|
||
In this example, the value for `domainHome` was set as an input parameter to the extractDomainResource script from the command line. The `kind` and `name` were set to the domain name derived from the topology section of the model, or the default `base_domain`. The cluster entries are pulled from the topology section of the model, and their replica counts were derived from the number of servers for each cluster. | ||
|
||
The user is expected to fill in the image and secrets information identified by `--FIX ME--` in the domain resource output. | ||
|
||
For more advanced configurations, including pre-populating the `--FIX ME--` values, the user can populate the `kubernetes` section of the WDT model, and those values will appear in the resulting domain resources file. This model section overrides and adds some values to the result. | ||
```yaml | ||
kubernetes: | ||
metadata: | ||
name: myName | ||
namespace: myNamespace | ||
spec: | ||
image: 'my.repo/my-image:2.0' | ||
imagePullSecrets: | ||
WEBLOGIC_IMAGE_PULL_SECRET_NAME: | ||
webLogicCredentialsSecret: | ||
name: '@@PROP:mySecret@@' | ||
serverPod: | ||
env: | ||
USER_MEM_ARGS: | ||
value: '-XX:+UseContainerSupport -Djava.security.egd=file:/dev/./urandom' | ||
JAVA_OPTIONS: | ||
value: '-Dmydir=/home/me' | ||
``` | ||
This example uses `@@PROP:mySecret@@` to pull the value for `webLogicCredentialsSecret` from the variables file specified on the command line. This can be done with any of the values in the `kubernetes` section of the model. More details about using model variables can be found [here](../README.md/#simple-example). | ||
|
||
For this example, the resulting domain resource file would contain: | ||
```yaml | ||
metadata: | ||
name: myName | ||
namespace: myNamespace | ||
spec: | ||
image: 'my.repo/my-image:2.0' | ||
imagePullSecrets: | ||
- name: WEBLOGIC_IMAGE_PULL_SECRET_NAME | ||
webLogicCredentialsSecret: | ||
name: WEBLOGIC_CREDENTIALS_SECRET_NAME | ||
serverPod: | ||
env: | ||
- name: USER_MEM_ARGS | ||
value: '-XX:+UseContainerSupport -Djava.security.egd=file:/dev/./urandom' | ||
- name: JAVA_OPTIONS | ||
value: '-Dmydir=/home/me' | ||
domainHome: /u01/mine/domain | ||
clusters: | ||
- clusterName: mycluster | ||
replicas: 2 | ||
- clusterName: mycluster3 | ||
replicas: 4 | ||
apiVersion: weblogic.oracle/v6 | ||
kind: Domain | ||
``` | ||
|
||
The syntax of the `spec/serverPod/env` and other list sections in the WDT model are different from the syntax in the target file. The WDT tools do not recognize the hyphenated list syntax, so these elements are specified in a similar manner to other model lists. | ||
|
||
If clusters are specified in the `kubernetes/spec` section of the model, those clusters will be configured in the domain resource file, and clusters from the `topology` section will be disregarded. | ||
|
||
If the WDT model has a value of `Never` for `spec/imagePullPolicy`, the `imagePullSecrets` default value will not be added. | ||
|
||
A full list of sections and variables supported by the Oracle WebLogic Server Kubernetes Operator is available [here](https://github.com/oracle/weblogic-kubernetes-operator/blob/master/docs/domains/Domain.md). | ||
|
||
The Extract Domain Resource Tool supports a subset of these sections, including `metadata`, `serverPod`, and `spec`. | ||
|
||
The content in the `kubernetes` section is not generated when a model is discovered by the Discover Domain Tool. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.