From c0ff0d942efdcfd898fd88c1a807f1c23e2d21b9 Mon Sep 17 00:00:00 2001 From: Richard Killen Date: Thu, 16 Jan 2020 13:26:06 -0600 Subject: [PATCH 1/6] Linked to new document --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index cd739f6d3..bf114edd4 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ Many organizations are using WebLogic Server, with or without other Oracle Fusio - [Custom Security Providers](site/security_providers.md#custom-security-providers) - [Modeling WebLogic Users, Groups, and Roles](site/security_users_groups_roles.md) - [ODL Configuration](site/odl_configuration.md) + - [Configuring Oracle WebLogic Server Kubernetes Operator](site/kubernetes.md) - [Variable Injection](site/variable_injection.md) - [Model Filters](site/tool_filters.md) - [Downloading and Installing](#downloading-and-installing-the-software) From 71477e3944fceb01765cbae6449c644cfa38d244 Mon Sep 17 00:00:00 2001 From: Richard Killen Date: Thu, 16 Jan 2020 16:00:17 -0600 Subject: [PATCH 2/6] Added README for configuring Operator --- site/kubernetes.md | 87 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 site/kubernetes.md diff --git a/site/kubernetes.md b/site/kubernetes.md new file mode 100644 index 000000000..71d0679d2 --- /dev/null +++ b/site/kubernetes.md @@ -0,0 +1,87 @@ +## 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. + +The Extract Domain Resource Tool is available with WDT releases 1.7.0 and later. + +More information about the Oracle WebLogic Server Kubernetes Operator can be found [here](https://github.com/oracle/weblogic-kubernetes-operator). + +Here is an example command line for the Extract Domain Resource Tool: +``` +/bin/extractDomainResource.sh -oracle_home /tmp/oracle -domain_home /u01/mydomain -model_file /tmp/mymodel.yaml -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 `kubernetes` section in the model, or that section is empty. +```yaml +apiVersion: weblogic.oracle/v6 +kind: Domain +metadata: + name: DemoDomain +spec: + domainHome: /u01/mydomain + imagePullSecrets: + - name: '--FIX ME--' + webLogicCredentialsSecret: '--FIX ME--' + clusters: + - clusterName: mycluster + replicas: 2 + - clusterName: mycluster3 + replicas: 4 +``` + +For this example, the user is expected to fill in the secrets information identified by `--FIX ME--` in the domain resource output. The value for `domainHome` was set 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. + +For more advanced configurations, 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: + imagePullSecrets: + WEBLOGIC_IMAGE_PULL_SECRET_NAME: + webLogicCredentialsSecret: + name: WEBLOGIC_CREDENTIALS_SECRET_NAME + serverPod: + env: + USER_MEM_ARGS: + value: '-XX:+UseContainerSupport -Djava.security.egd=file:/dev/./urandom' + JAVA_OPTIONS: + value: '-Dmydir=/home/me' +``` + +For this example, the resulting domain resource file would contain: +```yaml +metadata: + name: myName + namespace: myNamespace +spec: + 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. + +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. From 9e678399529f86580c443ad3607540165ae02cb6 Mon Sep 17 00:00:00 2001 From: Richard Killen Date: Fri, 17 Jan 2020 13:46:18 -0600 Subject: [PATCH 3/6] Added default image value, image in example --- site/kubernetes.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/site/kubernetes.md b/site/kubernetes.md index 71d0679d2..fbcd07aed 100644 --- a/site/kubernetes.md +++ b/site/kubernetes.md @@ -19,6 +19,7 @@ metadata: name: DemoDomain spec: domainHome: /u01/mydomain + image: '--FIX ME--' imagePullSecrets: - name: '--FIX ME--' webLogicCredentialsSecret: '--FIX ME--' @@ -29,7 +30,7 @@ spec: replicas: 4 ``` -For this example, the user is expected to fill in the secrets information identified by `--FIX ME--` in the domain resource output. The value for `domainHome` was set 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. +For this example, the user is expected to fill in the image and secrets information identified by `--FIX ME--` in the domain resource output. The value for `domainHome` was set 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. For more advanced configurations, 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 @@ -38,6 +39,7 @@ kubernetes: name: myName namespace: myNamespace spec: + image: 'my.repo/my-image:2.0' imagePullSecrets: WEBLOGIC_IMAGE_PULL_SECRET_NAME: webLogicCredentialsSecret: @@ -56,6 +58,7 @@ metadata: name: myName namespace: myNamespace spec: + image: 'my.repo/my-image:2.0' imagePullSecrets: - name: WEBLOGIC_IMAGE_PULL_SECRET_NAME webLogicCredentialsSecret: From 376e6890b11a2884b95c691d76ca6529d47637a0 Mon Sep 17 00:00:00 2001 From: Richard Killen Date: Fri, 17 Jan 2020 19:54:02 -0600 Subject: [PATCH 4/6] Updated from review comments --- site/kubernetes.md | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/site/kubernetes.md b/site/kubernetes.md index fbcd07aed..39e96df58 100644 --- a/site/kubernetes.md +++ b/site/kubernetes.md @@ -2,16 +2,18 @@ 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. -The Extract Domain Resource Tool is available with WDT releases 1.7.0 and later. +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://github.com/oracle/weblogic-kubernetes-operator). +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: ``` -/bin/extractDomainResource.sh -oracle_home /tmp/oracle -domain_home /u01/mydomain -model_file /tmp/mymodel.yaml -domain_resource_file /tmp/operator/domain-resource.yaml +/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 `kubernetes` section in the model, or that section is empty. +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 @@ -30,9 +32,11 @@ spec: replicas: 4 ``` -For this example, the user is expected to fill in the image and secrets information identified by `--FIX ME--` in the domain resource output. The value for `domainHome` was set 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. +In this example, the value for `domainHome` was set 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, 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. +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: @@ -43,7 +47,7 @@ kubernetes: imagePullSecrets: WEBLOGIC_IMAGE_PULL_SECRET_NAME: webLogicCredentialsSecret: - name: WEBLOGIC_CREDENTIALS_SECRET_NAME + name: '@@PROP:mySecret@@' serverPod: env: USER_MEM_ARGS: @@ -51,6 +55,7 @@ kubernetes: 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 From 06b1fa89d915532770bc796e98b409caf16d94cd Mon Sep 17 00:00:00 2001 From: Richard Killen Date: Tue, 21 Jan 2020 13:56:44 -0600 Subject: [PATCH 5/6] Updated for changes to imagePullPolicy and imagePullSecrets --- site/kubernetes.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/site/kubernetes.md b/site/kubernetes.md index 39e96df58..79a960b45 100644 --- a/site/kubernetes.md +++ b/site/kubernetes.md @@ -88,6 +88,8 @@ The syntax of the `spec/serverPod/env` and other list sections in the WDT model 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`. From 889164eba22d7bfe59ce16b3849a5ffd920d7e20 Mon Sep 17 00:00:00 2001 From: Richard Killen Date: Wed, 22 Jan 2020 09:35:31 -0600 Subject: [PATCH 6/6] Updated from review comments --- site/kubernetes.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/site/kubernetes.md b/site/kubernetes.md index 79a960b45..8b9f57b54 100644 --- a/site/kubernetes.md +++ b/site/kubernetes.md @@ -10,7 +10,7 @@ NOTE: The Extract Domain Resource Tool is available with WDT releases 1.7.0 and Here is an example command line for the Extract Domain Resource Tool: ``` -/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 +/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. @@ -32,7 +32,7 @@ spec: replicas: 4 ``` -In this example, the value for `domainHome` was set 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. +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.