From 107850aa7b142043e5b8a9198d62f3e14920d653 Mon Sep 17 00:00:00 2001 From: Sankar Periyathambi Neelakandan <45743425+sankarpn@users.noreply.github.com> Date: Thu, 8 Dec 2022 14:30:39 -0800 Subject: [PATCH 1/9] pass bash as executable and rest of the parameters as arguments (#3731) * pass bash as executable and rest of the parameters as arguments, otherwise, this fails when running targets in windows OS --- pom.xml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 5c99cbbf08c..b03b350f9f7 100644 --- a/pom.xml +++ b/pom.xml @@ -189,10 +189,11 @@ exec - ../validateCLI.sh - - .. - + bash + + ../validateCLI.sh + .. + From e25477dab378235366d3603b9adafa540b2fa8e8 Mon Sep 17 00:00:00 2001 From: Tom Barnes Date: Thu, 8 Dec 2022 23:31:37 +0100 Subject: [PATCH 2/9] fix nightly regression in IT FMW (#3734) * fix nightly regression in IT FMW --- .../domain-home-in-image/create-domain.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kubernetes/samples/scripts/create-fmw-infrastructure-domain/domain-home-in-image/create-domain.sh b/kubernetes/samples/scripts/create-fmw-infrastructure-domain/domain-home-in-image/create-domain.sh index 46dbb85ac18..8ed6a4d219a 100755 --- a/kubernetes/samples/scripts/create-fmw-infrastructure-domain/domain-home-in-image/create-domain.sh +++ b/kubernetes/samples/scripts/create-fmw-infrastructure-domain/domain-home-in-image/create-domain.sh @@ -113,8 +113,8 @@ initOutputDir() { # try to execute image builder to see whether it is available validateImageBuilderAvailable() { - if ! [ -x "$(command -v ${WLSIMG_BUILDER})" ]; then - validationError "${WLSIMG_BUILDER} is not installed" + if ! [ -x "$(command -v ${WLSIMG_BUILDER:-docker})" ]; then + validationError "${WLSIMG_BUILDER:-docker} is not installed" fi } From d7b4685da94356041b5e8a0def11b483c49acfba Mon Sep 17 00:00:00 2001 From: Huiling Zhao <41090416+hzhao-github@users.noreply.github.com> Date: Thu, 8 Dec 2022 14:32:09 -0800 Subject: [PATCH 3/9] Added test for retry improvements to cover introspect failure retry count exceeded error msg to domain status failure msg (#3716) --- .../kubernetes/ItRetryImprovements.java | 6 +++++- .../weblogic/kubernetes/utils/DomainUtils.java | 17 ++++++++++++++--- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItRetryImprovements.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItRetryImprovements.java index af8e7fb8411..794a3fb232a 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItRetryImprovements.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItRetryImprovements.java @@ -404,11 +404,15 @@ void testRetryOccursAndErrorFromIntrospectorLoggedInOperator() throws Exception testUntil(() -> checkPodLogContainsRegex(createDomainFailedMsgRegex, operatorPodName, opNamespace), logger, "{0} is found in Operator log", createDomainFailedMsgRegex); - // verify that SEVERE and createDomainFailedMsgRegex message found in Operator log + // verify that SEVERE and createDomainFailedMsgRegex message found in introspector log testUntil(() -> checkInUncompletedIntroPodLogContainsRegex(createDomainFailedMsgRegex, domainUid, domainNamespace), logger, "{0} is found in introspector log", createDomainFailedMsgRegex); + // verify that SEVERE and createDomainFailedMsgRegex message found in domain status + testUntil(() -> findStringInDomainStatusMessage(domainNamespace, domainUid, createDomainFailedMsgRegex, "true"), + logger, "{0} is found in domain status message", createDomainFailedMsgRegex); + Callable configMapExist = assertDoesNotThrow(() -> configMapExist(domainNamespace, badModelFileCm)); if (configMapExist.call().booleanValue()) { diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/utils/DomainUtils.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/utils/DomainUtils.java index 6859d16fa74..a68a94c6fdc 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/utils/DomainUtils.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/utils/DomainUtils.java @@ -1212,14 +1212,25 @@ public static DomainResource getAndValidateInitialDomain(String domainNamespace, * @return true if regex found, false otherwise. */ @Nonnull - public static boolean findStringInDomainStatusMessage(String domainNamespace, String domainUid, String regex) { + public static boolean findStringInDomainStatusMessage(String domainNamespace, + String domainUid, + String regex, + String... multupleMessage) { // get the domain status message StringBuffer getDomainInfoCmd = new StringBuffer(KUBERNETES_CLI + " get domain/"); getDomainInfoCmd .append(domainUid) .append(" -n ") - .append(domainNamespace) - .append(" -o jsonpath='{.status.message}' --ignore-not-found"); + .append(domainNamespace); + + if (multupleMessage.length == 0) { + // get single field of domain message + getDomainInfoCmd.append(" -o jsonpath='{.status.message}' --ignore-not-found"); + } else { + // use [,] to get side by side multiple fields of the domain status message + getDomainInfoCmd.append(" -o jsonpath=\"{.status.conditions[*]['status', 'message']}\" --ignore-not-found"); + } + getLogger().info("Command to get domain status message: " + getDomainInfoCmd); CommandParams params = new CommandParams().defaults(); From 92315cc72dd140eae35a94793d0f934a73d2d55a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 9 Dec 2022 19:08:18 -0500 Subject: [PATCH 4/9] Bump client-java-version from 16.0.2 to 17.0.0 (#3737) Bumps `client-java-version` from 16.0.2 to 17.0.0. Updates `client-java` from 16.0.2 to 17.0.0 - [Release notes](https://github.com/kubernetes-client/java/releases) - [Changelog](https://github.com/kubernetes-client/java/blob/master/CHANGELOG.md) - [Commits](https://github.com/kubernetes-client/java/compare/v16.0.2...v17.0.0) Updates `client-java-api` from 16.0.2 to 17.0.0 - [Release notes](https://github.com/kubernetes-client/java/releases) - [Changelog](https://github.com/kubernetes-client/java/blob/master/CHANGELOG.md) - [Commits](https://github.com/kubernetes-client/java/compare/v16.0.2...v17.0.0) Updates `client-java-extended` from 16.0.2 to 17.0.0 - [Release notes](https://github.com/kubernetes-client/java/releases) - [Changelog](https://github.com/kubernetes-client/java/blob/master/CHANGELOG.md) - [Commits](https://github.com/kubernetes-client/java/compare/v16.0.2...v17.0.0) Updates `client-java-api-fluent` from 16.0.2 to 17.0.0 - [Release notes](https://github.com/kubernetes-client/java/releases) - [Changelog](https://github.com/kubernetes-client/java/blob/master/CHANGELOG.md) - [Commits](https://github.com/kubernetes-client/java/compare/v16.0.2...v17.0.0) --- updated-dependencies: - dependency-name: io.kubernetes:client-java dependency-type: direct:production update-type: version-update:semver-major - dependency-name: io.kubernetes:client-java-api dependency-type: direct:production update-type: version-update:semver-major - dependency-name: io.kubernetes:client-java-extended dependency-type: direct:development update-type: version-update:semver-major - dependency-name: io.kubernetes:client-java-api-fluent dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b03b350f9f7..afc24e42d93 100644 --- a/pom.xml +++ b/pom.xml @@ -659,7 +659,7 @@ 3.23.1 2.11.0 4.2.0 - 16.0.2 + 17.0.0 1.7.22 4.10.0 5.9.1 From f749703040759c4f66b71b86c6c8e5ed192cec91 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 9 Dec 2022 19:08:32 -0500 Subject: [PATCH 5/9] Bump dependency-check-maven from 7.4.0 to 7.4.1 (#3738) Bumps [dependency-check-maven](https://github.com/jeremylong/DependencyCheck) from 7.4.0 to 7.4.1. - [Release notes](https://github.com/jeremylong/DependencyCheck/releases) - [Changelog](https://github.com/jeremylong/DependencyCheck/blob/main/CHANGELOG.md) - [Commits](https://github.com/jeremylong/DependencyCheck/compare/v7.4.0...v7.4.1) --- updated-dependencies: - dependency-name: org.owasp:dependency-check-maven dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index afc24e42d93..b158469dd90 100644 --- a/pom.xml +++ b/pom.xml @@ -675,7 +675,7 @@ 2.14.1 1.33 2.10 - 7.4.0 + 7.4.1 1.2.11 ${project.basedir}/src-generated-swagger ${root-generated-swagger}/main/java From 07275b0cce1db2aff47a76fd39e17b6f28ed4c7c Mon Sep 17 00:00:00 2001 From: Sankar Periyathambi Neelakandan <45743425+sankarpn@users.noreply.github.com> Date: Fri, 9 Dec 2022 16:08:53 -0800 Subject: [PATCH 6/9] Introduce custom condition factory (#3740) * Since introspector pod is created and deleted within seconds the existing conditionfactory objects are not useful to catch the introspector pod lifecycle. Introducing this custom condition factort to start the checking right away. --- .../kubernetes/ItMiiClusterResource.java | 8 +++++-- .../kubernetes/utils/CommonTestUtils.java | 13 ++++++++++++ .../weblogic/kubernetes/utils/PodUtils.java | 21 +++++++++++++++++++ 3 files changed, 40 insertions(+), 2 deletions(-) diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiClusterResource.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiClusterResource.java index c3af3fbef71..2fdf99574f9 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiClusterResource.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiClusterResource.java @@ -32,6 +32,7 @@ import oracle.weblogic.kubernetes.annotations.IntegrationTest; import oracle.weblogic.kubernetes.annotations.Namespaces; import oracle.weblogic.kubernetes.logging.LoggingFacade; +import org.awaitility.core.ConditionFactory; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.MethodOrderer; @@ -67,6 +68,7 @@ import static oracle.weblogic.kubernetes.utils.ClusterUtils.stopCluster; import static oracle.weblogic.kubernetes.utils.CommonMiiTestUtils.verifyPodsNotRolled; import static oracle.weblogic.kubernetes.utils.CommonTestUtils.checkPodReadyAndServiceExists; +import static oracle.weblogic.kubernetes.utils.CommonTestUtils.createCustomConditionFactory; import static oracle.weblogic.kubernetes.utils.CommonTestUtils.getNextFreePort; import static oracle.weblogic.kubernetes.utils.CommonTestUtils.testUntil; import static oracle.weblogic.kubernetes.utils.CommonTestUtils.withLongRetryPolicy; @@ -254,7 +256,8 @@ void testAddReplaceClusterResource() { //verify the introspector pod is created and runs String introspectPodNameBase2 = getIntrospectJobName(domainUid); - checkPodExists(introspectPodNameBase2, domainUid, domainNamespace); + ConditionFactory customConditionFactory = createCustomConditionFactory(0, 1, 5); + checkPodExists(customConditionFactory, introspectPodNameBase2, domainUid, domainNamespace); checkPodDoesNotExist(introspectPodNameBase2, domainUid, domainNamespace); // check managed server pods from cluster-1 are shutdown @@ -363,7 +366,8 @@ void testDomainStatusMatchesClusterResourceStatus() { //verify the introspector pod is created and runs String introspectPodNameBase2 = getIntrospectJobName(domainUid); - checkPodExists(introspectPodNameBase2, domainUid, domainNamespace); + ConditionFactory customConditionFactory = createCustomConditionFactory(0, 1, 5); + checkPodExists(customConditionFactory, introspectPodNameBase2, domainUid, domainNamespace); checkPodDoesNotExist(introspectPodNameBase2, domainUid, domainNamespace); // check managed server pods from cluster-1 are shutdown diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/utils/CommonTestUtils.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/utils/CommonTestUtils.java index e505ff422bb..eb6d131d6b5 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/utils/CommonTestUtils.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/utils/CommonTestUtils.java @@ -129,6 +129,19 @@ private static ConditionFactory createStandardRetryPolicyWithAtMost(long minutes private static final String TMP_FILE_NAME = "temp-download-file.out"; + /** + * Create a condition factory with custom values for pollDelay, pollInterval and atMost time. + * + * @param polldelay starting delay before checking for the condition in seconds + * @param pollInterval interval time between checking for the condition in seconds + * @param atMostMinutes how long should it wait for the condition becomes true in minutes + * @return ConditionFactory custom condition factory + */ + public static ConditionFactory createCustomConditionFactory(int polldelay, int pollInterval, int atMostMinutes) { + return with().pollDelay(polldelay, SECONDS) + .and().with().pollInterval(pollInterval, SECONDS) + .atMost(atMostMinutes, MINUTES).await(); + } /** * Test assertion using standard retry policy over time until it passes or the timeout expires. diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/utils/PodUtils.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/utils/PodUtils.java index b1c8357f73a..08fedf82427 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/utils/PodUtils.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/utils/PodUtils.java @@ -94,6 +94,27 @@ public static void checkPodExists(String podName, String domainUid, String domai domainNamespace); } + /** + * Check pod exists in the specified namespace. + * + * @param conditionFactory Configuration for Awaitility condition factory + * @param podName pod name to check + * @param domainUid the label the pod is decorated with + * @param domainNamespace the domain namespace in which the domain exists + */ + public static void checkPodExists(ConditionFactory conditionFactory, String podName, + String domainUid, String domainNamespace) { + LoggingFacade logger = getLogger(); + testUntil(conditionFactory, + assertDoesNotThrow(() -> podExists(podName, domainUid, domainNamespace), + String.format("podExists failed with ApiException for pod %s in namespace %s", + podName, domainNamespace)), + logger, + "pod {0} to be created in namespace {1}", + podName, + domainNamespace); + } + /** * Check pod is ready. * From 50068e58ebde8feeb1055b454fd68119805decc9 Mon Sep 17 00:00:00 2001 From: Johnny Shum Date: Fri, 9 Dec 2022 18:10:12 -0600 Subject: [PATCH 7/9] Expand istio virtual service samples (#3739) --- .../accessing-the-domain/istio/istio.md | 63 +++++++++++++++++-- 1 file changed, 58 insertions(+), 5 deletions(-) diff --git a/documentation/4.0/content/managing-domains/accessing-the-domain/istio/istio.md b/documentation/4.0/content/managing-domains/accessing-the-domain/istio/istio.md index b7e6886fa5e..cc1b66b7cd4 100644 --- a/documentation/4.0/content/managing-domains/accessing-the-domain/istio/istio.md +++ b/documentation/4.0/content/managing-domains/accessing-the-domain/istio/istio.md @@ -175,7 +175,7 @@ spec: istio: ingressgateway servers: - hosts: - - '*' + - 'yourdomain.dns.com' port: name: http number: 80 @@ -190,7 +190,7 @@ spec: gateways: - domain1-gateway hosts: - - '*' + - 'yourdomain.dns.com' http: - match: - uri: @@ -416,13 +416,13 @@ See Istio [Destination Rule](https://istio.io/latest/docs/reference/config/netwo Ingress gateway provides similar functions to `Kubernetes Ingress` but with more advanced functionality. -For example, to configure an Ingress gateway for SSL termination at the gateway: +I. For example, to configure an Ingress gateway for SSL termination at the gateway: 1. Create a TLS certificate and secret. ```text $ openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /tmp/tls1.key -out /tmp/tls1.crt -subj "/CN=secure-domain.org" -$ kubectl -n weblogic-domain1 create secret tls domain1-tls-cert --key /tmp/tls1.key --cert /tmp/tls1.crt +$ kubectl -n istio-system create secret tls domain1-tls-cert --key /tmp/tls1.key --cert /tmp/tls1.crt ``` 2. Create the Ingress gateway. @@ -453,8 +453,36 @@ spec: hosts: - 'regular-domain.org' ``` + +If you are accessing the WebLogic Console through a secure gateway with SSL termination at the gateway level, enable + `WeblogicPluginEnabled` in the WebLogic domain and add the appropriate request headers. For example, + +If you are using WDT, add the `resources` section in the model YAML file. + +```text + resources: + WebAppContainer: + WeblogicPluginEnabled: true +``` + +If you are using WLST, set the `WeblogicPluginEnabled` for each server and cluster + +```text + set('WeblogicPluginEnabled',true) +``` -For example, to configure an Ingress gateway for SSL passthrough: +Set the request headers in the virtual service: (Use `kubectl explain virtualservice.spec.http.route.headers` for help) + +```text + headers: + request: + remove: ['WL-Proxy-Client-IP', 'WL-Proxy-SSL'] + set: + X-Forwarded-Proto: https + WL-Proxy-SSL: 'true' +``` + +II. For example, to configure an Ingress gateway for SSL passthrough: ```text @@ -483,4 +511,29 @@ spec: - 'regular-domain.org' ``` +The virtual service will then configure to match the `tls` rule. + +```text +apiVersion: networking.istio.io/v1alpha3 +kind: VirtualService +metadata: + name: sample-domain1-virtualservice + namespace: sample-domain1-ns +spec: + gateways: + - sample-domain1-gateway + hosts: + - secure-domain.org + tls: + - match: + - port: 443 + sniHosts: + - secure-domain.org + route: + - destination: + host: sample-domain1-admin-server + port: + number: 9002 +``` + See Istio [Ingress](https://istio.io/latest/docs/tasks/traffic-management/ingress). From 70071921f031fe26da4ffba0a9664840a7e42e27 Mon Sep 17 00:00:00 2001 From: Anthony Lai Date: Fri, 9 Dec 2022 16:12:03 -0800 Subject: [PATCH 8/9] OWLS-104468 Update create-weblogic-domain samples to use Operator 4.0 Domain and Cluster resources (#3735) * Update create-weblogic-domain samples to use Operator 4.0 Domain and Cluster resources --- .../scripts/common/domain-template.yaml | 24 ++- .../scripts/common/jrf-domain-template.yaml | 32 +++- kubernetes/samples/scripts/common/utility.sh | 20 ++- kubernetes/samples/scripts/common/validate.sh | 10 +- .../scripts/common/wdt-and-wit-utility.sh | 1 + .../create-domain-inputs.yaml | 4 +- .../create-domain-inputs.yaml | 6 +- .../wdt_k8s_model_template.yaml | 152 +++++++++-------- .../create-domain-inputs.yaml | 4 +- .../create-domain-inputs.yaml | 6 +- .../domain-home-on-pv/update-domain.sh | 2 +- .../wdt_k8s_model_template.yaml | 155 +++++++++--------- .../wdt_k8s_model_template_updated.yaml | 108 ++++++++++++ 13 files changed, 345 insertions(+), 179 deletions(-) create mode 100644 kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/wdt_k8s_model_template_updated.yaml diff --git a/kubernetes/samples/scripts/common/domain-template.yaml b/kubernetes/samples/scripts/common/domain-template.yaml index 2326dd87bca..ff19b338970 100644 --- a/kubernetes/samples/scripts/common/domain-template.yaml +++ b/kubernetes/samples/scripts/common/domain-template.yaml @@ -3,7 +3,7 @@ # # This is an example of how to define a Domain resource. # -apiVersion: "weblogic.oracle/v8" +apiVersion: "weblogic.oracle/v9" kind: Domain metadata: name: %DOMAIN_UID% @@ -83,12 +83,26 @@ spec: # Uncomment to export the T3Channel as a service %EXPOSE_T3_CHANNEL_PREFIX% - channelName: T3Channel - # clusters is used to configure the desired behavior for starting member servers of a cluster. - # If you use this entry, then the rules will be applied to ALL servers that are members of the named clusters. + # References to Cluster resources that describe the lifecycle options for all + # the Managed Server members of a WebLogic cluster, including Java + # options, environment variables, additional Pod content, and the ability to + # explicitly start, stop, or restart cluster members. The Cluster resource + # must describe a cluster that already exists in the WebLogic domain + # configuration. clusters: - - clusterName: %CLUSTER_NAME% - replicas: %INITIAL_MANAGED_SERVER_REPLICAS% + - name: %DOMAIN_UID%-%CLUSTER_NAME% + # The number of managed servers to start for unlisted clusters # replicas: 1 +--- +# This is an example of how to define a Cluster resource. +apiVersion: weblogic.oracle/v1 +kind: Cluster +metadata: + name: %DOMAIN_UID%-%CLUSTER_NAME% + namespace: %NAMESPACE% +spec: + clusterName: %CLUSTER_NAME% + replicas: %INITIAL_MANAGED_SERVER_REPLICAS% diff --git a/kubernetes/samples/scripts/common/jrf-domain-template.yaml b/kubernetes/samples/scripts/common/jrf-domain-template.yaml index 9f519946908..c4984ea5f57 100644 --- a/kubernetes/samples/scripts/common/jrf-domain-template.yaml +++ b/kubernetes/samples/scripts/common/jrf-domain-template.yaml @@ -3,7 +3,7 @@ # # This is an example of how to define a Domain resource. # -apiVersion: "weblogic.oracle/v8" +apiVersion: "weblogic.oracle/v9" kind: Domain metadata: name: %DOMAIN_UID% @@ -49,11 +49,11 @@ spec: # data storage directories are determined from the WebLogic domain home configuration. dataHome: "%DATA_HOME%" - # serverStartPolicy legal values are "NEVER", "IF_NEEDED", or "ADMIN_ONLY" + # serverStartPolicy legal values are "Never, "IfNeeded", or "AdminOnly" # This determines which WebLogic Servers the Operator will start up when it discovers this Domain - # - "NEVER" will not start any server in the domain - # - "ADMIN_ONLY" will start up only the administration server (no managed servers will be started) - # - "IF_NEEDED" will start all non-clustered servers, including the administration server and clustered servers up to the replica count + # - "Never" will not start any server in the domain + # - "AdminOnly" will start up only the administration server (no managed servers will be started) + # - "IfNeeded" will start all non-clustered servers, including the administration server and clustered servers up to the replica count serverStartPolicy: %SERVER_START_POLICY% serverPod: @@ -87,12 +87,26 @@ spec: - name: USER_MEM_ARGS value: "-Djava.security.egd=file:/dev/./urandom -Xms512m -Xmx1024m " - # clusters is used to configure the desired behavior for starting member servers of a cluster. - # If you use this entry, then the rules will be applied to ALL servers that are members of the named clusters. + # References to Cluster resources that describe the lifecycle options for all + # the Managed Server members of a WebLogic cluster, including Java + # options, environment variables, additional Pod content, and the ability to + # explicitly start, stop, or restart cluster members. The Cluster resource + # must describe a cluster that already exists in the WebLogic domain + # configuration. clusters: - - clusterName: %CLUSTER_NAME% - replicas: %INITIAL_MANAGED_SERVER_REPLICAS% + - name: %DOMAIN_UID%-%CLUSTER_NAME% + # The number of managed servers to start for unlisted clusters # replicas: 1 +--- +# This is an example of how to define a Cluster resource. +apiVersion: weblogic.oracle/v1 +kind: Cluster +metadata: + name: %DOMAIN_UID%-%CLUSTER_NAME% + namespace: %NAMESPACE% +spec: + clusterName: %CLUSTER_NAME% + replicas: %INITIAL_MANAGED_SERVER_REPLICAS% diff --git a/kubernetes/samples/scripts/common/utility.sh b/kubernetes/samples/scripts/common/utility.sh index fa51da512e6..b2b1c985710 100644 --- a/kubernetes/samples/scripts/common/utility.sh +++ b/kubernetes/samples/scripts/common/utility.sh @@ -289,24 +289,27 @@ getKubernetesClusterIP() { # buildServerPodResources() { + level1_indent=" " + level2_indent="${level1_indent} " + if [ -n "${serverPodMemoryRequest}" ]; then - local memoryRequest=" memory\: \"${serverPodMemoryRequest}\"\n" + local memoryRequest="${level2_indent}memory\: \"${serverPodMemoryRequest}\"\n" fi if [ -n "${serverPodCpuRequest}" ]; then - local cpuRequest=" cpu\: \"${serverPodCpuRequest}\"\n" + local cpuRequest="${level2_indent}cpu\: \"${serverPodCpuRequest}\"\n" fi if [ -n "${memoryRequest}" ] || [ -n "${cpuRequest}" ]; then - local requests=" requests\: \n$memoryRequest $cpuRequest" + local requests="${level1_indent}requests\: \n${memoryRequest}${cpuRequest}" fi if [ -n "${serverPodMemoryLimit}" ]; then - local memoryLimit=" memory\: \"${serverPodMemoryLimit}\"\n" + local memoryLimit="${level2_indent}memory\: \"${serverPodMemoryLimit}\"\n" fi if [ -n "${serverPodCpuLimit}" ]; then - local cpuLimit=" cpu\: \"${serverPodCpuLimit}\"\n" + local cpuLimit="${level2_indent}cpu\: \"${serverPodCpuLimit}\"\n" fi if [ -n "${memoryLimit}" ] || [ -n "${cpuLimit}" ]; then - local limits=" limits\: \n$memoryLimit $cpuLimit" + local limits="${level1_indent}limits\: \n${memoryLimit}${cpuLimit}" fi if [ -n "${requests}" ] || [ -n "${limits}" ]; then @@ -654,11 +657,13 @@ createFiles() { # # Function to markup the wdt model file +# $1 - Name of wdt model file. Optional. Defaults to wdt_k8s_model_template.yaml # updateModelFile() { # Update the wdt model file with kubernetes section modelFile="${domainOutputDir}/tmp/wdt_model.yaml" - cat ${scriptDir}/wdt_k8s_model_template.yaml >> ${modelFile} + model_template_file=${1:-wdt_k8s_model_template.yaml} + cat ${scriptDir}/${model_template_file} >> ${modelFile} sed -i -e "s:%DOMAIN_UID%:${domainUID}:g" ${modelFile} sed -i -e "s:%NAMESPACE%:$namespace:g" ${modelFile} @@ -688,6 +693,7 @@ updateModelFile() { sed -i -e "s:%EXPOSE_ADMIN_PORT_PREFIX%:${exposeAdminNodePortPrefix}:g" ${modelFile} sed -i -e "s:%ADMIN_NODE_PORT%:${adminNodePort}:g" ${modelFile} sed -i -e "s:%CLUSTER_NAME%:${clusterName}:g" ${modelFile} + sed -i -e "s:%CLUSTER_NAME2%:${clusterName2}:g" ${modelFile} sed -i -e "s:%INITIAL_MANAGED_SERVER_REPLICAS%:${initialManagedServerReplicas}:g" ${modelFile} # MII settings are used for model-in-image integration testing sed -i -e "s:%MII_PREFIX%:${miiPrefix}:g" ${modelFile} diff --git a/kubernetes/samples/scripts/common/validate.sh b/kubernetes/samples/scripts/common/validate.sh index 3ffc9f38dad..59441c41ab1 100755 --- a/kubernetes/samples/scripts/common/validate.sh +++ b/kubernetes/samples/scripts/common/validate.sh @@ -262,16 +262,16 @@ validateServerStartPolicy() { validateInputParamsSpecified serverStartPolicy if [ ! -z "${serverStartPolicy}" ]; then case ${serverStartPolicy} in - "NEVER") + "Never") ;; - "ALWAYS") + "Always") ;; - "IF_NEEDED") + "IfNeeded") ;; - "ADMIN_ONLY") + "AdminOnly") ;; *) - validationError "Invalid value for serverStartPolicy: ${serverStartPolicy}. Valid values are 'NEVER', 'ALWAYS', 'IF_NEEDED', and 'ADMIN_ONLY'." + validationError "Invalid value for serverStartPolicy: ${serverStartPolicy}. Valid values are 'Never', 'Always', 'IfNeeded', and 'AdminOnly'." ;; esac fi diff --git a/kubernetes/samples/scripts/common/wdt-and-wit-utility.sh b/kubernetes/samples/scripts/common/wdt-and-wit-utility.sh index d5cbbd04a6a..789b486db91 100755 --- a/kubernetes/samples/scripts/common/wdt-and-wit-utility.sh +++ b/kubernetes/samples/scripts/common/wdt-and-wit-utility.sh @@ -221,6 +221,7 @@ run_wdt() { -domain_home $domain_home_dir -model_file $model_final -variable_file $inputs_final + -target wko4 " echo @@ "Info: About to run the following WDT command:" echo "${cmd}" diff --git a/kubernetes/samples/scripts/create-fmw-infrastructure-domain/domain-home-in-image/create-domain-inputs.yaml b/kubernetes/samples/scripts/create-fmw-infrastructure-domain/domain-home-in-image/create-domain-inputs.yaml index b0e7b433e18..a7b7404a9cd 100644 --- a/kubernetes/samples/scripts/create-fmw-infrastructure-domain/domain-home-in-image/create-domain-inputs.yaml +++ b/kubernetes/samples/scripts/create-fmw-infrastructure-domain/domain-home-in-image/create-domain-inputs.yaml @@ -20,8 +20,8 @@ domainUID: domain1 domainHome: /u01/oracle/user_projects/domains/domain1 # Determines which OracleFMWInfrastructure Servers the operator will start up -# Legal values are "NEVER", "IF_NEEDED", or "ADMIN_ONLY" -serverStartPolicy: IF_NEEDED +# Legal values are "Never", "IfNeeded", or "AdminOnly" +serverStartPolicy: IfNeeded # Cluster name clusterName: cluster-1 diff --git a/kubernetes/samples/scripts/create-fmw-infrastructure-domain/domain-home-on-pv/create-domain-inputs.yaml b/kubernetes/samples/scripts/create-fmw-infrastructure-domain/domain-home-on-pv/create-domain-inputs.yaml index f49be247606..11848eb7ca3 100644 --- a/kubernetes/samples/scripts/create-fmw-infrastructure-domain/domain-home-on-pv/create-domain-inputs.yaml +++ b/kubernetes/samples/scripts/create-fmw-infrastructure-domain/domain-home-on-pv/create-domain-inputs.yaml @@ -18,9 +18,9 @@ domainUID: domain1 # If not specified, the value is derived from the domainUID as /shared/domains/ domainHome: /shared/domains/domain1 -# Determines which WebLogic Servers the operator will start up -# Legal values are "NEVER", "IF_NEEDED", or "ADMIN_ONLY" -serverStartPolicy: IF_NEEDED +# Determines which OracleFMWInfrastructure Servers the operator will start up +# Legal values are "Never", "IfNeeded", or "AdminOnly" +serverStartPolicy: IfNeeded # Cluster name clusterName: cluster-1 diff --git a/kubernetes/samples/scripts/create-fmw-infrastructure-domain/domain-home-on-pv/wdt_k8s_model_template.yaml b/kubernetes/samples/scripts/create-fmw-infrastructure-domain/domain-home-on-pv/wdt_k8s_model_template.yaml index 0320dcddb47..a3af52a5c8f 100644 --- a/kubernetes/samples/scripts/create-fmw-infrastructure-domain/domain-home-on-pv/wdt_k8s_model_template.yaml +++ b/kubernetes/samples/scripts/create-fmw-infrastructure-domain/domain-home-on-pv/wdt_k8s_model_template.yaml @@ -6,84 +6,98 @@ # extractDomainResource script to generate a domain.yaml # kubernetes: - apiVersion: "weblogic.oracle/v8" - kind: Domain - metadata: - name: %DOMAIN_UID% - namespace: "%NAMESPACE%" - labels: - #weblogic.resourceVersion: "domain-v2" - weblogic.domainUID: %DOMAIN_UID% - spec: - # The WebLogic Domain Home - domainHome: %DOMAIN_HOME% + domain: + metadata: + name: %DOMAIN_UID% + namespace: "%NAMESPACE%" + spec: + # The WebLogic Domain Home + domainHome: %DOMAIN_HOME% - # The domain home source type - # Set to PersistentVolume for domain-in-pv, Image for domain-in-image, or FromModel for model-in-image - domainHomeSourceType: %DOMAIN_HOME_SOURCE_TYPE% + # The domain home source type + # Set to PersistentVolume for domain-in-pv, Image for domain-in-image, or FromModel for model-in-image + domainHomeSourceType: %DOMAIN_HOME_SOURCE_TYPE% - # The WebLogic Server Docker image that the Operator uses to start the domain - image: "%WEBLOGIC_IMAGE%" + # The WebLogic Server Docker image that the Operator uses to start the domain + image: "%WEBLOGIC_IMAGE%" - # imagePullPolicy defaults to "Always" if image version is :latest - imagePullPolicy: %WEBLOGIC_IMAGE_PULL_POLICY% + # imagePullPolicy defaults to "Always" if image version is :latest + imagePullPolicy: %WEBLOGIC_IMAGE_PULL_POLICY% - # Identify which Secret contains the credentials for pulling an image - %WEBLOGIC_IMAGE_PULL_SECRET_PREFIX%imagePullSecrets: - %WEBLOGIC_IMAGE_PULL_SECRET_PREFIX% - name: "%WEBLOGIC_IMAGE_PULL_SECRET_NAME%" - # Identify which Secret contains the WebLogic Admin credentials (note that there is an example of - # how to create that Secret at the end of this file) - webLogicCredentialsSecret: - name: '%WEBLOGIC_CREDENTIALS_SECRET_NAME%' + # Identify which Secret contains the credentials for pulling an image + %WEBLOGIC_IMAGE_PULL_SECRET_PREFIX%imagePullSecrets: + %WEBLOGIC_IMAGE_PULL_SECRET_PREFIX% - name: "%WEBLOGIC_IMAGE_PULL_SECRET_NAME%" + # Identify which Secret contains the WebLogic Admin credentials (note that there is an example of + # how to create that Secret at the end of this file) + webLogicCredentialsSecret: + name: '%WEBLOGIC_CREDENTIALS_SECRET_NAME%' - # Whether to include the server out file into the pod's stdout, default is true - includeServerOutInPodLog: %INCLUDE_SERVER_OUT_IN_POD_LOG% + # Whether to include the server out file into the pod's stdout, default is true + includeServerOutInPodLog: %INCLUDE_SERVER_OUT_IN_POD_LOG% - # Whether to enable log home - %LOG_HOME_ON_PV_PREFIX%logHomeEnabled: %LOG_HOME_ENABLED% + # Whether to enable log home + %LOG_HOME_ON_PV_PREFIX%logHomeEnabled: %LOG_HOME_ENABLED% - # Whether to write HTTP access log file to log home - #%LOG_HOME_ON_PV_PREFIX%httpAccessLogInLogHome: %HTTP_ACCESS_LOG_IN_LOG_HOME% + # Whether to write HTTP access log file to log home + #%LOG_HOME_ON_PV_PREFIX%httpAccessLogInLogHome: %HTTP_ACCESS_LOG_IN_LOG_HOME% - # The in-pod location for domain log, server logs, server out, and Node Manager log files - %LOG_HOME_ON_PV_PREFIX%logHome: %LOG_HOME% - # An (optional) in-pod location for data storage of default and custom file stores. - # If not specified or the value is either not set or empty (e.g. dataHome: "") then the - # data storage directories are determined from the WebLogic domain home configuration. - dataHome: "%DATA_HOME%" + # The in-pod location for domain log, server logs, server out, and Node Manager log files + %LOG_HOME_ON_PV_PREFIX%logHome: %LOG_HOME% + # An (optional) in-pod location for data storage of default and custom file stores. + # If not specified or the value is either not set or empty (e.g. dataHome: "") then the + # data storage directories are determined from the WebLogic domain home configuration. + dataHome: "%DATA_HOME%" - replicas: %INITIAL_MANAGED_SERVER_REPLICAS% + replicas: %INITIAL_MANAGED_SERVER_REPLICAS% - # serverStartPolicy legal values are "NEVER", "IF_NEEDED", or "ADMIN_ONLY" - # This determines which WebLogic Servers the Operator will start up when it discovers this Domain - # - "NEVER" will not start any server in the domain - # - "ADMIN_ONLY" will start up only the administration server (no managed servers will be started) - # - "IF_NEEDED" will start all non-clustered servers, including the administration server and clustered servers up to the replica count - serverStartPolicy: %SERVER_START_POLICY% + # serverStartPolicy legal values are "Never, "IfNeeded", or "AdminOnly" + # This determines which WebLogic Servers the Operator will start up when it discovers this Domain + # - "Never" will not start any server in the domain + # - "AdminOnly" will start up only the administration server (no managed servers will be started) + # - "IfNeeded" will start all non-clustered servers, including the administration server and clustered servers up to the replica count + serverStartPolicy: %SERVER_START_POLICY% - serverPod: - # an (optional) list of environment variable to be set on the servers - env: - - name: JAVA_OPTIONS - value: "%JAVA_OPTIONS%" - - name: USER_MEM_ARGS - value: "-Djava.security.egd=file:/dev/./urandom " - %OPTIONAL_SERVERPOD_RESOURCES% - %LOG_HOME_ON_PV_PREFIX%volumes: - %LOG_HOME_ON_PV_PREFIX% - name: 'weblogic-domain-storage-volume' - %LOG_HOME_ON_PV_PREFIX% persistentVolumeClaim: - %LOG_HOME_ON_PV_PREFIX% claimName: '%DOMAIN_PVC_NAME%' - %LOG_HOME_ON_PV_PREFIX%volumeMounts: - %LOG_HOME_ON_PV_PREFIX% - name: 'weblogic-domain-storage-volume' - %LOG_HOME_ON_PV_PREFIX% mountPath: %DOMAIN_ROOT_DIR% - - # adminServer is used to configure the desired behavior for starting the administration server. - adminServer: - %EXPOSE_ANY_CHANNEL_PREFIX%adminService: - %EXPOSE_ANY_CHANNEL_PREFIX% channels: - # The Admin Server's NodePort - %EXPOSE_ANY_CHANNEL_PREFIX% - channelName: default - %EXPOSE_ADMIN_PORT_PREFIX% nodePort: %ADMIN_NODE_PORT% - # Uncomment to export the T3Channel as a service - %EXPOSE_T3_CHANNEL_PREFIX% - channelName: T3Channel + serverPod: + # an (optional) list of environment variable to be set on the servers + env: + - name: JAVA_OPTIONS + value: "%JAVA_OPTIONS%" + - name: USER_MEM_ARGS + value: "-Djava.security.egd=file:/dev/./urandom " + %OPTIONAL_SERVERPOD_RESOURCES% + %LOG_HOME_ON_PV_PREFIX%volumes: + %LOG_HOME_ON_PV_PREFIX% - name: 'weblogic-domain-storage-volume' + %LOG_HOME_ON_PV_PREFIX% persistentVolumeClaim: + %LOG_HOME_ON_PV_PREFIX% claimName: '%DOMAIN_PVC_NAME%' + %LOG_HOME_ON_PV_PREFIX%volumeMounts: + %LOG_HOME_ON_PV_PREFIX% - name: 'weblogic-domain-storage-volume' + %LOG_HOME_ON_PV_PREFIX% mountPath: %DOMAIN_ROOT_DIR% + # adminServer is used to configure the desired behavior for starting the administration server. + adminServer: + %EXPOSE_ANY_CHANNEL_PREFIX%adminService: + %EXPOSE_ANY_CHANNEL_PREFIX% channels: + # The Admin Server's NodePort + %EXPOSE_ANY_CHANNEL_PREFIX% - channelName: default + %EXPOSE_ADMIN_PORT_PREFIX% nodePort: %ADMIN_NODE_PORT% + # Uncomment to export the T3Channel as a service + %EXPOSE_T3_CHANNEL_PREFIX% - channelName: T3Channel + + # References to Cluster resources that describe the lifecycle options for all + # the Managed Server members of a WebLogic cluster, including Java + # options, environment variables, additional Pod content, and the ability to + # explicitly start, stop, or restart cluster members. The Cluster resource + # must describe a cluster that already exists in the WebLogic domain + # configuration. + clusters: + - name: %DOMAIN_UID%-%CLUSTER_NAME% + + # clusters is used to configure the desired behavior for starting member servers of a cluster. + # If you use this entry, then the rules will be applied to ALL servers that are members of the named clusters. + clusters: + - metadata: + name: %DOMAIN_UID%-%CLUSTER_NAME% + namespace: "%NAMESPACE%" + spec: + clusterName: %CLUSTER_NAME% + replicas: %INITIAL_MANAGED_SERVER_REPLICAS% diff --git a/kubernetes/samples/scripts/create-weblogic-domain/domain-home-in-image/create-domain-inputs.yaml b/kubernetes/samples/scripts/create-weblogic-domain/domain-home-in-image/create-domain-inputs.yaml index d59122f19aa..f1421695b8b 100644 --- a/kubernetes/samples/scripts/create-weblogic-domain/domain-home-in-image/create-domain-inputs.yaml +++ b/kubernetes/samples/scripts/create-weblogic-domain/domain-home-in-image/create-domain-inputs.yaml @@ -27,8 +27,8 @@ domainUID: domain1 domainHome: /u01/oracle/user_projects/domains/domain1 # Determines which WebLogic Servers the operator will start up -# Legal values are "NEVER", "IF_NEEDED", or "ADMIN_ONLY" -serverStartPolicy: IF_NEEDED +# Legal values are "Never", "IfNeeded", or "AdminOnly" +serverStartPolicy: IfNeeded # Cluster name clusterName: cluster-1 diff --git a/kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/create-domain-inputs.yaml b/kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/create-domain-inputs.yaml index 2263f267bb0..7aed80d5eaf 100644 --- a/kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/create-domain-inputs.yaml +++ b/kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/create-domain-inputs.yaml @@ -18,9 +18,11 @@ domainUID: domain1 # If not specified, the value is derived from the domainUID as /shared/domains/ domainHome: /shared/domains/domain1 +domainHomeSourceType: + # Determines which WebLogic Servers the operator will start up -# Legal values are "NEVER", "IF_NEEDED", or "ADMIN_ONLY" -serverStartPolicy: IF_NEEDED +# Legal values are "Never", "IfNeeded", or "AdminOnly" +serverStartPolicy: IfNeeded # Cluster name clusterName: cluster-1 diff --git a/kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/update-domain.sh b/kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/update-domain.sh index 68c68c6122a..1ffb809bdb6 100755 --- a/kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/update-domain.sh +++ b/kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/update-domain.sh @@ -169,7 +169,7 @@ createDomainConfigmap() { # Now that we have the model file in the domainoutputdir/tmp, # we can add the kubernetes section to the model file. - updateModelFile + updateModelFile wdt_k8s_model_template_updated.yaml # create the configmap and label it properly local cmName=${domainUID}-update-weblogic-sample-domain-job-cm diff --git a/kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/wdt_k8s_model_template.yaml b/kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/wdt_k8s_model_template.yaml index 9945fd783d1..ea8a8858e59 100644 --- a/kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/wdt_k8s_model_template.yaml +++ b/kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/wdt_k8s_model_template.yaml @@ -6,89 +6,96 @@ # extractDomainResource script to generate a domain.yaml # kubernetes: - apiVersion: "weblogic.oracle/v8" - kind: Domain - metadata: - name: %DOMAIN_UID% - namespace: "%NAMESPACE%" - labels: - #weblogic.resourceVersion: "domain-v2" - weblogic.domainUID: %DOMAIN_UID% - spec: - # The WebLogic Domain Home - domainHome: %DOMAIN_HOME% + domain: + metadata: + name: %DOMAIN_UID% + namespace: "%NAMESPACE%" + spec: + # The WebLogic Domain Home + domainHome: %DOMAIN_HOME% - # The domain home source type - # Set to PersistentVolume for domain-in-pv, Image for domain-in-image, or FromModel for model-in-image - domainHomeSourceType: %DOMAIN_HOME_SOURCE_TYPE% + # The domain home source type + # Set to PersistentVolume for domain-in-pv, Image for domain-in-image, or FromModel for model-in-image + domainHomeSourceType: "%DOMAIN_HOME_SOURCE_TYPE%" - # The WebLogic Server Docker image that the Operator uses to start the domain - image: "%WEBLOGIC_IMAGE%" + # The WebLogic Server Docker image that the Operator uses to start the domain + image: "%WEBLOGIC_IMAGE%" - # imagePullPolicy defaults to "Always" if image version is :latest - imagePullPolicy: %WEBLOGIC_IMAGE_PULL_POLICY% + # imagePullPolicy defaults to "Always" if image version is :latest + imagePullPolicy: %WEBLOGIC_IMAGE_PULL_POLICY% - # Identify which Secret contains the credentials for pulling an image - %WEBLOGIC_IMAGE_PULL_SECRET_PREFIX%imagePullSecrets: - %WEBLOGIC_IMAGE_PULL_SECRET_PREFIX% - name: "%WEBLOGIC_IMAGE_PULL_SECRET_NAME%" - # Identify which Secret contains the WebLogic Admin credentials (note that there is an example of - # how to create that Secret at the end of this file) - webLogicCredentialsSecret: - name: '%WEBLOGIC_CREDENTIALS_SECRET_NAME%' + # Identify which Secret contains the credentials for pulling an image + %WEBLOGIC_IMAGE_PULL_SECRET_PREFIX%imagePullSecrets: + %WEBLOGIC_IMAGE_PULL_SECRET_PREFIX% - name: "%WEBLOGIC_IMAGE_PULL_SECRET_NAME%" + # Identify which Secret contains the WebLogic Admin credentials (note that there is an example of + # how to create that Secret at the end of this file) + webLogicCredentialsSecret: + name: '%WEBLOGIC_CREDENTIALS_SECRET_NAME%' - # Whether to include the server out file into the pod's stdout, default is true - includeServerOutInPodLog: %INCLUDE_SERVER_OUT_IN_POD_LOG% + # Whether to include the server out file into the pod's stdout, default is true + includeServerOutInPodLog: %INCLUDE_SERVER_OUT_IN_POD_LOG% - # Whether to enable log home - %LOG_HOME_ON_PV_PREFIX%logHomeEnabled: %LOG_HOME_ENABLED% + # Whether to enable log home + %LOG_HOME_ON_PV_PREFIX%logHomeEnabled: %LOG_HOME_ENABLED% - # Whether to write HTTP access log file to log home - #%LOG_HOME_ON_PV_PREFIX%httpAccessLogInLogHome: %HTTP_ACCESS_LOG_IN_LOG_HOME% + # Whether to write HTTP access log file to log home + #%LOG_HOME_ON_PV_PREFIX%httpAccessLogInLogHome: %HTTP_ACCESS_LOG_IN_LOG_HOME% - # The in-pod location for domain log, server logs, server out, and Node Manager log files - %LOG_HOME_ON_PV_PREFIX%logHome: %LOG_HOME% - # An (optional) in-pod location for data storage of default and custom file stores. - # If not specified or the value is either not set or empty (e.g. dataHome: "") then the - # data storage directories are determined from the WebLogic domain home configuration. - dataHome: "%DATA_HOME%" + # The in-pod location for domain log, server logs, server out, and Node Manager log files + %LOG_HOME_ON_PV_PREFIX%logHome: %LOG_HOME% + # An (optional) in-pod location for data storage of default and custom file stores. + # If not specified or the value is either not set or empty (e.g. dataHome: "") then the + # data storage directories are determined from the WebLogic domain home configuration. + dataHome: "%DATA_HOME%" - replicas: 2 - # serverStartPolicy legal values are "NEVER", "IF_NEEDED", or "ADMIN_ONLY" - # This determines which WebLogic Servers the Operator will start up when it discovers this Domain - # - "NEVER" will not start any server in the domain - # - "ADMIN_ONLY" will start up only the administration server (no managed servers will be started) - # - "IF_NEEDED" will start all non-clustered servers, including the administration server and clustered servers up to the replica count - serverStartPolicy: %SERVER_START_POLICY% + replicas: 2 + # serverStartPolicy legal values are "Never, "IfNeeded", or "AdminOnly" + # This determines which WebLogic Servers the Operator will start up when it discovers this Domain + # - "Never" will not start any server in the domain + # - "AdminOnly" will start up only the administration server (no managed servers will be started) + # - "IfNeeded" will start all non-clustered servers, including the administration server and clustered servers up to the replica count + serverStartPolicy: %SERVER_START_POLICY% - serverPod: - # an (optional) list of environment variable to be set on the servers - env: - - name: JAVA_OPTIONS - value: "%JAVA_OPTIONS%" - - name: USER_MEM_ARGS - value: "-Djava.security.egd=file:/dev/./urandom " - %OPTIONAL_SERVERPOD_RESOURCES% - %LOG_HOME_ON_PV_PREFIX%volumes: - %LOG_HOME_ON_PV_PREFIX% - name: 'weblogic-domain-storage-volume' - %LOG_HOME_ON_PV_PREFIX% persistentVolumeClaim: - %LOG_HOME_ON_PV_PREFIX% claimName: '%DOMAIN_PVC_NAME%' - %LOG_HOME_ON_PV_PREFIX%volumeMounts: - %LOG_HOME_ON_PV_PREFIX% - name: 'weblogic-domain-storage-volume' - %LOG_HOME_ON_PV_PREFIX% mountPath: %DOMAIN_ROOT_DIR% - - # adminServer is used to configure the desired behavior for starting the administration server. - adminServer: - %EXPOSE_ANY_CHANNEL_PREFIX%adminService: - %EXPOSE_ANY_CHANNEL_PREFIX% channels: - # The Admin Server's NodePort - %EXPOSE_ANY_CHANNEL_PREFIX% - channelName: default - %EXPOSE_ADMIN_PORT_PREFIX% nodePort: %ADMIN_NODE_PORT% - # Uncomment to export the T3Channel as a service - %EXPOSE_T3_CHANNEL_PREFIX% - channelName: T3Channel + serverPod: + # an (optional) list of environment variable to be set on the servers + env: + - name: JAVA_OPTIONS + value: "%JAVA_OPTIONS%" + - name: USER_MEM_ARGS + value: "-Djava.security.egd=file:/dev/./urandom " + %OPTIONAL_SERVERPOD_RESOURCES% + %LOG_HOME_ON_PV_PREFIX%volumes: + %LOG_HOME_ON_PV_PREFIX% - name: 'weblogic-domain-storage-volume' + %LOG_HOME_ON_PV_PREFIX% persistentVolumeClaim: + %LOG_HOME_ON_PV_PREFIX% claimName: '%DOMAIN_PVC_NAME%' + %LOG_HOME_ON_PV_PREFIX%volumeMounts: + %LOG_HOME_ON_PV_PREFIX% - name: 'weblogic-domain-storage-volume' + %LOG_HOME_ON_PV_PREFIX% mountPath: %DOMAIN_ROOT_DIR% - # clusters is used to configure the desired behavior for starting member servers of a cluster. - # If you use this entry, then the rules will be applied to ALL servers that are members of the named clusters. - clusters: - - clusterName: %CLUSTER_NAME% - replicas: %INITIAL_MANAGED_SERVER_REPLICAS% + # adminServer is used to configure the desired behavior for starting the administration server. + adminServer: + %EXPOSE_ANY_CHANNEL_PREFIX%adminService: + %EXPOSE_ANY_CHANNEL_PREFIX% channels: + # The Admin Server's NodePort + %EXPOSE_ANY_CHANNEL_PREFIX% - channelName: default + %EXPOSE_ADMIN_PORT_PREFIX% nodePort: %ADMIN_NODE_PORT% + # Uncomment to export the T3Channel as a service + %EXPOSE_T3_CHANNEL_PREFIX% - channelName: T3Channel + # References to Cluster resources that describe the lifecycle options for all + # the Managed Server members of a WebLogic cluster, including Java + # options, environment variables, additional Pod content, and the ability to + # explicitly start, stop, or restart cluster members. The Cluster resource + # must describe a cluster that already exists in the WebLogic domain + # configuration. + clusters: + - name: %DOMAIN_UID%-%CLUSTER_NAME% + + # Used by WDT's extractDomainResource script to generate a Cluster resource. + clusters: + - metadata: + name: %DOMAIN_UID%-%CLUSTER_NAME% + namespace: "%NAMESPACE%" + spec: + clusterName: %CLUSTER_NAME% + replicas: %INITIAL_MANAGED_SERVER_REPLICAS% diff --git a/kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/wdt_k8s_model_template_updated.yaml b/kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/wdt_k8s_model_template_updated.yaml new file mode 100644 index 00000000000..0523dbd2acf --- /dev/null +++ b/kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/wdt_k8s_model_template_updated.yaml @@ -0,0 +1,108 @@ +# Copyright (c) 2022, Oracle and/or its affiliates. + +# +# This is the template for kubernetes section for wdt_model file. This +# will be appended to the wdt_model.yaml file so that we can use wdt's +# extractDomainResource script to generate a domain.yaml +# +kubernetes: + domain: + metadata: + name: %DOMAIN_UID% + namespace: "%NAMESPACE%" + spec: + # The WebLogic Domain Home + domainHome: %DOMAIN_HOME% + + # The domain home source type + # Set to PersistentVolume for domain-in-pv, Image for domain-in-image, or FromModel for model-in-image + domainHomeSourceType: "%DOMAIN_HOME_SOURCE_TYPE%" + + # The WebLogic Server Docker image that the Operator uses to start the domain + image: "%WEBLOGIC_IMAGE%" + + # imagePullPolicy defaults to "Always" if image version is :latest + imagePullPolicy: %WEBLOGIC_IMAGE_PULL_POLICY% + + # Identify which Secret contains the credentials for pulling an image + %WEBLOGIC_IMAGE_PULL_SECRET_PREFIX%imagePullSecrets: + %WEBLOGIC_IMAGE_PULL_SECRET_PREFIX% - name: "%WEBLOGIC_IMAGE_PULL_SECRET_NAME%" + # Identify which Secret contains the WebLogic Admin credentials (note that there is an example of + # how to create that Secret at the end of this file) + webLogicCredentialsSecret: + name: '%WEBLOGIC_CREDENTIALS_SECRET_NAME%' + + # Whether to include the server out file into the pod's stdout, default is true + includeServerOutInPodLog: %INCLUDE_SERVER_OUT_IN_POD_LOG% + + # Whether to enable log home + %LOG_HOME_ON_PV_PREFIX%logHomeEnabled: %LOG_HOME_ENABLED% + + # Whether to write HTTP access log file to log home + #%LOG_HOME_ON_PV_PREFIX%httpAccessLogInLogHome: %HTTP_ACCESS_LOG_IN_LOG_HOME% + + # The in-pod location for domain log, server logs, server out, and Node Manager log files + %LOG_HOME_ON_PV_PREFIX%logHome: %LOG_HOME% + # An (optional) in-pod location for data storage of default and custom file stores. + # If not specified or the value is either not set or empty (e.g. dataHome: "") then the + # data storage directories are determined from the WebLogic domain home configuration. + dataHome: "%DATA_HOME%" + + replicas: 2 + # serverStartPolicy legal values are "Never, "IfNeeded", or "AdminOnly" + # This determines which WebLogic Servers the Operator will start up when it discovers this Domain + # - "Never" will not start any server in the domain + # - "AdminOnly" will start up only the administration server (no managed servers will be started) + # - "IfNeeded" will start all non-clustered servers, including the administration server and clustered servers up to the replica count + serverStartPolicy: %SERVER_START_POLICY% + + serverPod: + # an (optional) list of environment variable to be set on the servers + env: + - name: JAVA_OPTIONS + value: "%JAVA_OPTIONS%" + - name: USER_MEM_ARGS + value: "-Djava.security.egd=file:/dev/./urandom " + %OPTIONAL_SERVERPOD_RESOURCES% + %LOG_HOME_ON_PV_PREFIX%volumes: + %LOG_HOME_ON_PV_PREFIX% - name: 'weblogic-domain-storage-volume' + %LOG_HOME_ON_PV_PREFIX% persistentVolumeClaim: + %LOG_HOME_ON_PV_PREFIX% claimName: '%DOMAIN_PVC_NAME%' + %LOG_HOME_ON_PV_PREFIX%volumeMounts: + %LOG_HOME_ON_PV_PREFIX% - name: 'weblogic-domain-storage-volume' + %LOG_HOME_ON_PV_PREFIX% mountPath: %DOMAIN_ROOT_DIR% + + # adminServer is used to configure the desired behavior for starting the administration server. + adminServer: + %EXPOSE_ANY_CHANNEL_PREFIX%adminService: + %EXPOSE_ANY_CHANNEL_PREFIX% channels: + # The Admin Server's NodePort + %EXPOSE_ANY_CHANNEL_PREFIX% - channelName: default + %EXPOSE_ADMIN_PORT_PREFIX% nodePort: %ADMIN_NODE_PORT% + # Uncomment to export the T3Channel as a service + %EXPOSE_T3_CHANNEL_PREFIX% - channelName: T3Channel + + # References to Cluster resources that describe the lifecycle options for all + # the Managed Server members of a WebLogic cluster, including Java + # options, environment variables, additional Pod content, and the ability to + # explicitly start, stop, or restart cluster members. The Cluster resource + # must describe a cluster that already exists in the WebLogic domain + # configuration. + clusters: + - name: %DOMAIN_UID%-%CLUSTER_NAME% + - name: %DOMAIN_UID%-%CLUSTER_NAME2% + + # Used by WDT's extractDomainResource script to generate Cluster resources. + clusters: + - metadata: + name: %DOMAIN_UID%-%CLUSTER_NAME% + namespace: "%NAMESPACE%" + spec: + clusterName: %CLUSTER_NAME% + replicas: %INITIAL_MANAGED_SERVER_REPLICAS% + - metadata: + name: %DOMAIN_UID%-%CLUSTER_NAME2% + namespace: "%NAMESPACE%" + spec: + clusterName: %CLUSTER_NAME2% + replicas: %INITIAL_MANAGED_SERVER_REPLICAS% From fbfe3845b753c43b2e0a07cffd4262d91d26e095 Mon Sep 17 00:00:00 2001 From: Ryan Eberhard Date: Fri, 9 Dec 2022 19:18:04 -0500 Subject: [PATCH 9/9] Update generated CRD's --- kubernetes/crd/cluster-crd.yaml | 4 +--- kubernetes/crd/domain-crd.yaml | 8 +------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/kubernetes/crd/cluster-crd.yaml b/kubernetes/crd/cluster-crd.yaml index d646d7de566..bf0bb594dcd 100644 --- a/kubernetes/crd/cluster-crd.yaml +++ b/kubernetes/crd/cluster-crd.yaml @@ -5,7 +5,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - weblogic.sha256: 46ef88005b68d9fb13a122b63fece506c555770209221581cb056c15f1ac7e6a + weblogic.sha256: 9f051b9b7805fc9100cf6490873e80b91671c7165960bfbcd6e8007ae171937f name: clusters.weblogic.oracle spec: group: weblogic.oracle @@ -526,8 +526,6 @@ spec: type: string fieldsType: type: string - clusterName: - type: string creationTimestamp: format: date-time type: string diff --git a/kubernetes/crd/domain-crd.yaml b/kubernetes/crd/domain-crd.yaml index 61c5f8af0db..16c4448eb83 100644 --- a/kubernetes/crd/domain-crd.yaml +++ b/kubernetes/crd/domain-crd.yaml @@ -5,7 +5,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - weblogic.sha256: 3a81ece5d88c85957a5d5e4a1b6c068cdca4355afd80a5a6598cbfade313871f + weblogic.sha256: 50af6b0cfbe5da871bbeae4bb4fd91c6da38931a01817fa475801e63dbbbdcd5 name: domains.weblogic.oracle spec: group: weblogic.oracle @@ -1024,8 +1024,6 @@ spec: type: string fieldsType: type: string - clusterName: - type: string creationTimestamp: format: date-time type: string @@ -4014,8 +4012,6 @@ spec: type: string fieldsType: type: string - clusterName: - type: string creationTimestamp: format: date-time type: string @@ -6842,8 +6838,6 @@ spec: type: string fieldsType: type: string - clusterName: - type: string creationTimestamp: format: date-time type: string