diff --git a/OracleWebCenterPortal/kubernetes/charts/apache-samples/README.md b/OracleWebCenterPortal/kubernetes/charts/apache-samples/README.md
old mode 100644
new mode 100755
index dcaab57c7..096dfbccc
--- a/OracleWebCenterPortal/kubernetes/charts/apache-samples/README.md
+++ b/OracleWebCenterPortal/kubernetes/charts/apache-samples/README.md
@@ -1,8 +1,8 @@
-# Apache load balancer samples
-
-The sample package contains two samples that use the [Apache Helm chart](../apache-webtier/README.md). The samples use the Docker image for the Apache HTTP Server with the 12.2.1.3.0 and 12.2.1.4.0 Oracle WebLogic Server Proxy Plugin. See the details in [Apache HTTP Server with Oracle WebLogic Server Proxy Plugin on Docker](https://github.com/oracle/docker-images/tree/master/OracleWebLogic/samples/12213-webtier-apache).
-
-* [The default sample](default-sample/README.md) uses the built-in configuration in the Docker image.
-
-* [The custom sample](custom-sample/README.md) demonstrates how to customize the configuration of the Apache HTTP Server with the 12.2.1.3.0 and 12.2.1.4.0 Oracle WebLogic Server Proxy Plugins.
-
+# Apache load balancer samples
+
+The sample package contains two samples that use the [Apache Helm chart](../apache-webtier/README.md). The samples use the Docker image for the Apache HTTP Server with the 12.2.1.3.0 and 12.2.1.4.0 Oracle WebLogic Server Proxy Plugin. See the details in [Apache HTTP Server with Oracle WebLogic Server Proxy Plugin on Docker](https://github.com/oracle/docker-images/tree/master/OracleWebLogic/samples/12213-webtier-apache).
+
+* [The default sample](default-sample/README.md) uses the built-in configuration in the Docker image.
+
+* [The custom sample](custom-sample/README.md) demonstrates how to customize the configuration of the Apache HTTP Server with the 12.2.1.3.0 and 12.2.1.4.0 Oracle WebLogic Server Proxy Plugins.
+
diff --git a/OracleWebCenterPortal/kubernetes/charts/apache-samples/custom-sample/README.md b/OracleWebCenterPortal/kubernetes/charts/apache-samples/custom-sample/README.md
old mode 100644
new mode 100755
index c35d2d700..3e367c4e3
--- a/OracleWebCenterPortal/kubernetes/charts/apache-samples/custom-sample/README.md
+++ b/OracleWebCenterPortal/kubernetes/charts/apache-samples/custom-sample/README.md
@@ -1,149 +1,149 @@
-# Apache load balancer custom sample
-In this sample, we will configure the Apache webtier as a load balancer for multiple WebLogic domains using a custom configuration. We will demonstrate how to use the Apache webtier to handle traffic to multiple backend WebLogic domains.
-
-## 1. Create a namespace
-In this sample, both the Apache webtier and WebLogic domain instances are located in the namespace `apache-sample`.
-```shell
-$ kubectl create namespace apache-sample
-```
-
-## 2. Create WebLogic domains
-We need to prepare some backend domains for load balancing by the Apache webtier. Refer to the [sample](/kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/README.md), to create two WebLogic domains under the namespace `apache-sample`.
-
-The first domain uses the following custom configuration parameters:
-- namespace: `apache-sample`
-- domainUID: `domain1`
-- clusterName: `cluster-1`
-- adminServerName: `admin-server`
-- adminPort: `7001`
-- adminNodePort: `30701`
-- managedServerPort: `8001`
-
-The second domain uses the following custom configuration parameters:
-- namespace: `apache-sample`
-- domainUID: `domain2`
-- clusterName: `cluster-1`
-- adminServerName: `admin-server`
-- adminPort: `7011`
-- adminNodePort: `30702`
-- managedServerPort: `8021`
-
-After the domains are successfully created, deploy the sample web application, `testwebapp.war`, on each domain cluster using the WLS Administration Console. The sample web application is located in the `kubernetes/samples/charts/application` directory.
-
-## 3. Build the Apache webtier Docker image
-Refer to the [sample](https://github.com/oracle/docker-images/tree/master/OracleWebLogic/samples/12213-webtier-apache), to build the Apache webtier Docker image.
-
-## 4. Provide the custom Apache plugin configuration
-In this sample, we will provide a custom Apache plugin configuration to fine tune the behavior of Apache.
-
-* Create a custom Apache plugin configuration file named `custom_mod_wl_apache.conf`. The file content is similar to below.
-
-```
-# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-
-
-WebLogicHost ${WEBLOGIC_HOST}
-WebLogicPort ${WEBLOGIC_PORT}
-
-
-# Directive for weblogic admin Console deployed on Weblogic Admin Server
-
-SetHandler weblogic-handler
-WebLogicHost domain1-admin-server
-WebLogicPort ${WEBLOGIC_PORT}
-
-
-# Directive for all application deployed on weblogic cluster with a prepath defined by LOCATION variable
-# For example, if the LOCAITON is set to '/weblogic', all applications deployed on the cluster can be accessed via
-# http://myhost:myport/weblogic/application_end_url
-# where 'myhost' is the IP of the machine that runs the Apache web tier, and
-# 'myport' is the port that the Apache web tier is publicly exposed to.
-# Note that LOCATION cannot be set to '/' unless this is the only Location module configured.
-
-WLSRequest On
-WebLogicCluster domain1-cluster-cluster-1:8001
-PathTrim /weblogic1
-
-
-# Directive for all application deployed on weblogic cluster with a prepath defined by LOCATION2 variable
-# For example, if the LOCAITON2 is set to '/weblogic2', all applications deployed on the cluster can be accessed via
-# http://myhost:myport/weblogic2/application_end_url
-# where 'myhost' is the IP of the machine that runs the Apache web tier, and
-# 'myport' is the port that the Apache webt ier is publicly exposed to.
-
-WLSRequest On
-WebLogicCluster domain2-cluster-cluster-1:8021
-PathTrim /weblogic2
-
-```
-
-* Create a PV / PVC (pv-claim-name) that can be used to store the `custom_mod_wl_apache.conf`. Refer to the [Sample for creating a PV or PVC](/kubernetes/samples/scripts/create-weblogic-domain-pv-pvc/README.md).
-
-## 5. Prepare your own certificate and private key
-In production, Oracle strongly recommends that you provide your own certificates. Run the following commands to generate your own certificate and private key using `openssl`.
-
-```shell
-$ cd kubernetes/samples/charts/apache-samples/custom-sample
-$ export VIRTUAL_HOST_NAME=apache-sample-host
-$ export SSL_CERT_FILE=apache-sample.crt
-$ export SSL_CERT_KEY_FILE=apache-sample.key
-$ sh certgen.sh
-```
-
-## 6. Prepare the input values for the Apache webtier Helm chart
-Run the following commands to prepare the input value file for the Apache webtier Helm chart.
-
-```shell
-$ base64 -i ${SSL_CERT_FILE} | tr -d '\n'
-$ base64 -i ${SSL_CERT_KEY_FILE} | tr -d '\n'
-$ touch input.yaml
-```
-Edit the input parameters file, `input.yaml`. The file content is similar to below.
-
-```yaml
-# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-
-# Use this to provide your own Apache webtier configuration as needed; simply define this
-# Persistence Volume which contains your own custom_mod_wl_apache.conf file.
-persistentVolumeClaimName:
-
-# The VirtualHostName of the Apache HTTP server. It is used to enable custom SSL configuration.
-virtualHostName: apache-sample-host
-
-# The customer supplied certificate to use for Apache webtier SSL configuration.
-# The value must be a string containing a base64 encoded certificate. Run following command to get it.
-# base64 -i ${SSL_CERT_FILE} | tr -d '\n'
-customCert:
-
-# The customer supplied private key to use for Apache webtier SSL configuration.
-# The value must be a string containing a base64 encoded key. Run following command to get it.
-# base64 -i ${SSL_KEY_FILE} | tr -d '\n'
-customKey:
-```
-
-## 7. Install the Apache webtier Helm chart
-The Apache webtier Helm chart is located in the `kubernetes/samples/charts/apache-webtier` directory. Install the Apache webtier Helm chart to the `apache-sample` namespace with the specified input parameters:
-
-```shell
-$ cd kubernetes/samples/charts
-$ helm install my-release --values apache-samples/custom-sample/input.yaml --namespace apache-sample apache-webtier
-```
-
-## 8. Run the sample application
-Now you can send requests to different WebLogic domains with the unique entry point of Apache with different paths. Alternatively, you can access the URLs in a web browser.
-```shell
-$ curl --silent http://${HOSTNAME}:30305/weblogic1/testwebapp/
-$ curl --silent http://${HOSTNAME}:30305/weblogic2/testwebapp/
-```
-Also, you can use SSL URLs to send requests to different WebLogic domains. Access the SSL URL via the `curl` command or a web browser.
-```shell
-$ curl -k --silent https://${HOSTNAME}:30443/weblogic1/testwebapp/
-$ curl -k --silent https://${HOSTNAME}:30443/weblogic2/testwebapp/
-```
-
-## 9. Uninstall the Apache webtier
-```shell
-$ helm uninstall my-release --namespace apache-sample
-```
+# Apache load balancer custom sample
+In this sample, we will configure the Apache webtier as a load balancer for multiple WebLogic domains using a custom configuration. We will demonstrate how to use the Apache webtier to handle traffic to multiple backend WebLogic domains.
+
+## 1. Create a namespace
+In this sample, both the Apache webtier and WebLogic domain instances are located in the namespace `apache-sample`.
+```shell
+$ kubectl create namespace apache-sample
+```
+
+## 2. Create WebLogic domains
+We need to prepare some backend domains for load balancing by the Apache webtier. Refer to the [sample](/kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/README.md), to create two WebLogic domains under the namespace `apache-sample`.
+
+The first domain uses the following custom configuration parameters:
+- namespace: `apache-sample`
+- domainUID: `domain1`
+- clusterName: `cluster-1`
+- adminServerName: `admin-server`
+- adminPort: `7001`
+- adminNodePort: `30701`
+- managedServerPort: `8001`
+
+The second domain uses the following custom configuration parameters:
+- namespace: `apache-sample`
+- domainUID: `domain2`
+- clusterName: `cluster-1`
+- adminServerName: `admin-server`
+- adminPort: `7011`
+- adminNodePort: `30702`
+- managedServerPort: `8021`
+
+After the domains are successfully created, deploy the sample web application, `testwebapp.war`, on each domain cluster using the WLS Administration Console. The sample web application is located in the `kubernetes/samples/charts/application` directory.
+
+## 3. Build the Apache webtier Docker image
+Refer to the [sample](https://github.com/oracle/docker-images/tree/master/OracleWebLogic/samples/12213-webtier-apache), to build the Apache webtier Docker image.
+
+## 4. Provide the custom Apache plugin configuration
+In this sample, we will provide a custom Apache plugin configuration to fine tune the behavior of Apache.
+
+* Create a custom Apache plugin configuration file named `custom_mod_wl_apache.conf`. The file content is similar to below.
+
+```
+# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+
+
+WebLogicHost ${WEBLOGIC_HOST}
+WebLogicPort ${WEBLOGIC_PORT}
+
+
+# Directive for weblogic admin Console deployed on Weblogic Admin Server
+
+SetHandler weblogic-handler
+WebLogicHost domain1-admin-server
+WebLogicPort ${WEBLOGIC_PORT}
+
+
+# Directive for all application deployed on weblogic cluster with a prepath defined by LOCATION variable
+# For example, if the LOCAITON is set to '/weblogic', all applications deployed on the cluster can be accessed via
+# http://myhost:myport/weblogic/application_end_url
+# where 'myhost' is the IP of the machine that runs the Apache web tier, and
+# 'myport' is the port that the Apache web tier is publicly exposed to.
+# Note that LOCATION cannot be set to '/' unless this is the only Location module configured.
+
+WLSRequest On
+WebLogicCluster domain1-cluster-cluster-1:8001
+PathTrim /weblogic1
+
+
+# Directive for all application deployed on weblogic cluster with a prepath defined by LOCATION2 variable
+# For example, if the LOCAITON2 is set to '/weblogic2', all applications deployed on the cluster can be accessed via
+# http://myhost:myport/weblogic2/application_end_url
+# where 'myhost' is the IP of the machine that runs the Apache web tier, and
+# 'myport' is the port that the Apache webt ier is publicly exposed to.
+
+WLSRequest On
+WebLogicCluster domain2-cluster-cluster-1:8021
+PathTrim /weblogic2
+
+```
+
+* Create a PV / PVC (pv-claim-name) that can be used to store the `custom_mod_wl_apache.conf`. Refer to the [Sample for creating a PV or PVC](/kubernetes/samples/scripts/create-weblogic-domain-pv-pvc/README.md).
+
+## 5. Prepare your own certificate and private key
+In production, Oracle strongly recommends that you provide your own certificates. Run the following commands to generate your own certificate and private key using `openssl`.
+
+```shell
+$ cd kubernetes/samples/charts/apache-samples/custom-sample
+$ export VIRTUAL_HOST_NAME=apache-sample-host
+$ export SSL_CERT_FILE=apache-sample.crt
+$ export SSL_CERT_KEY_FILE=apache-sample.key
+$ sh certgen.sh
+```
+
+## 6. Prepare the input values for the Apache webtier Helm chart
+Run the following commands to prepare the input value file for the Apache webtier Helm chart.
+
+```shell
+$ base64 -i ${SSL_CERT_FILE} | tr -d '\n'
+$ base64 -i ${SSL_CERT_KEY_FILE} | tr -d '\n'
+$ touch input.yaml
+```
+Edit the input parameters file, `input.yaml`. The file content is similar to below.
+
+```yaml
+# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+
+# Use this to provide your own Apache webtier configuration as needed; simply define this
+# Persistence Volume which contains your own custom_mod_wl_apache.conf file.
+persistentVolumeClaimName:
+
+# The VirtualHostName of the Apache HTTP server. It is used to enable custom SSL configuration.
+virtualHostName: apache-sample-host
+
+# The customer supplied certificate to use for Apache webtier SSL configuration.
+# The value must be a string containing a base64 encoded certificate. Run following command to get it.
+# base64 -i ${SSL_CERT_FILE} | tr -d '\n'
+customCert:
+
+# The customer supplied private key to use for Apache webtier SSL configuration.
+# The value must be a string containing a base64 encoded key. Run following command to get it.
+# base64 -i ${SSL_KEY_FILE} | tr -d '\n'
+customKey:
+```
+
+## 7. Install the Apache webtier Helm chart
+The Apache webtier Helm chart is located in the `kubernetes/samples/charts/apache-webtier` directory. Install the Apache webtier Helm chart to the `apache-sample` namespace with the specified input parameters:
+
+```shell
+$ cd kubernetes/samples/charts
+$ helm install my-release --values apache-samples/custom-sample/input.yaml --namespace apache-sample apache-webtier
+```
+
+## 8. Run the sample application
+Now you can send requests to different WebLogic domains with the unique entry point of Apache with different paths. Alternatively, you can access the URLs in a web browser.
+```shell
+$ curl --silent http://${HOSTNAME}:30305/weblogic1/testwebapp/
+$ curl --silent http://${HOSTNAME}:30305/weblogic2/testwebapp/
+```
+Also, you can use SSL URLs to send requests to different WebLogic domains. Access the SSL URL via the `curl` command or a web browser.
+```shell
+$ curl -k --silent https://${HOSTNAME}:30443/weblogic1/testwebapp/
+$ curl -k --silent https://${HOSTNAME}:30443/weblogic2/testwebapp/
+```
+
+## 9. Uninstall the Apache webtier
+```shell
+$ helm uninstall my-release --namespace apache-sample
+```
diff --git a/OracleWebCenterPortal/kubernetes/charts/apache-samples/custom-sample/certgen.sh b/OracleWebCenterPortal/kubernetes/charts/apache-samples/custom-sample/certgen.sh
old mode 100644
new mode 100755
index 20dd9fa51..74b359ddb
--- a/OracleWebCenterPortal/kubernetes/charts/apache-samples/custom-sample/certgen.sh
+++ b/OracleWebCenterPortal/kubernetes/charts/apache-samples/custom-sample/certgen.sh
@@ -1,51 +1,51 @@
-#!/bin/sh
-# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-#
-# Since: June, 2018
-# Author: dongbo.xiao@oracle.com
-# Description: script to start Apache HTTP Server
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
-
-# Generated configuration file
-CONFIG_FILE="config.txt"
-
-cat > $CONFIG_FILE <<-EOF
-[req]
-default_bits = 2048
-prompt = no
-default_md = sha256
-req_extensions=v3_req
-extensions=v3_req
-distinguished_name = dn
-
-[dn]
-C = US
-ST = CA
-L = Redwood Shores
-O = Oracle Corporation
-OU = Apache HTTP Server With Plugin
-CN = $VIRTUAL_HOST_NAME
-
-[v3_req]
-subjectAltName = @alt_names
-[alt_names]
-DNS.1 = $VIRTUAL_HOST_NAME
-DNS.2 = $VIRTUAL_HOST_NAME.cloud.oracle.com
-DNS.3 = *.$VIRTUAL_HOST_NAME
-DNS.4 = localhost
-EOF
-
-echo "Generating certs for $VIRTUAL_HOST_NAME"
-
-# Generate our Private Key, CSR and Certificate
-# Use SHA-2 as SHA-1 is unsupported from Jan 1, 2017
-
-openssl req -x509 -newkey rsa:2048 -sha256 -nodes -keyout "$SSL_CERT_KEY_FILE" -days 3650 -out "$SSL_CERT_FILE" -config "$CONFIG_FILE"
-
-# OPTIONAL - write an info to see the details of the generated crt
-openssl x509 -noout -fingerprint -text < "$SSL_CERT_FILE" > "$SSL_CERT_FILE.info"
-# Protect the key
-chmod 400 "$SSL_CERT_KEY_FILE"
-chmod 400 "$SSL_CERT_FILE.info"
+#!/bin/sh
+# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+#
+# Since: June, 2018
+# Author: dongbo.xiao@oracle.com
+# Description: script to start Apache HTTP Server
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+# Generated configuration file
+CONFIG_FILE="config.txt"
+
+cat > $CONFIG_FILE <<-EOF
+[req]
+default_bits = 2048
+prompt = no
+default_md = sha256
+req_extensions=v3_req
+extensions=v3_req
+distinguished_name = dn
+
+[dn]
+C = US
+ST = CA
+L = Redwood Shores
+O = Oracle Corporation
+OU = Apache HTTP Server With Plugin
+CN = $VIRTUAL_HOST_NAME
+
+[v3_req]
+subjectAltName = @alt_names
+[alt_names]
+DNS.1 = $VIRTUAL_HOST_NAME
+DNS.2 = $VIRTUAL_HOST_NAME.cloud.oracle.com
+DNS.3 = *.$VIRTUAL_HOST_NAME
+DNS.4 = localhost
+EOF
+
+echo "Generating certs for $VIRTUAL_HOST_NAME"
+
+# Generate our Private Key, CSR and Certificate
+# Use SHA-2 as SHA-1 is unsupported from Jan 1, 2017
+
+openssl req -x509 -newkey rsa:2048 -sha256 -nodes -keyout "$SSL_CERT_KEY_FILE" -days 3650 -out "$SSL_CERT_FILE" -config "$CONFIG_FILE"
+
+# OPTIONAL - write an info to see the details of the generated crt
+openssl x509 -noout -fingerprint -text < "$SSL_CERT_FILE" > "$SSL_CERT_FILE.info"
+# Protect the key
+chmod 400 "$SSL_CERT_KEY_FILE"
+chmod 400 "$SSL_CERT_FILE.info"
diff --git a/OracleWebCenterPortal/kubernetes/charts/apache-samples/custom-sample/custom_mod_wl_apache.conf b/OracleWebCenterPortal/kubernetes/charts/apache-samples/custom-sample/custom_mod_wl_apache.conf
old mode 100644
new mode 100755
index 8a2d05f0d..878cd9ee2
--- a/OracleWebCenterPortal/kubernetes/charts/apache-samples/custom-sample/custom_mod_wl_apache.conf
+++ b/OracleWebCenterPortal/kubernetes/charts/apache-samples/custom-sample/custom_mod_wl_apache.conf
@@ -1,37 +1,37 @@
-# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-
-
-WebLogicHost ${WEBLOGIC_HOST}
-WebLogicPort ${WEBLOGIC_PORT}
-
-
-# Directive for weblogic admin Console deployed on Weblogic Admin Server
-
-SetHandler weblogic-handler
-WebLogicHost domain1-admin-server
-WebLogicPort ${WEBLOGIC_PORT}
-
-
-# Directive for all application deployed on weblogic cluster with a prepath defined by LOCATION variable
-# For example, if the LOCAITON is set to '/weblogic', all applications deployed on the cluster can be accessed via
-# http://myhost:myport/weblogic/application_end_url
-# where 'myhost' is the IP of the machine that runs the Apache web tier, and
-# 'myport' is the port that the Apache web tier is publicly exposed to.
-# Note that LOCATION cannot be set to '/' unless this is the only Location module configured.
-
-WLSRequest On
-WebLogicCluster domain1-cluster-cluster-1:8001
-PathTrim /weblogic1
-
-
-# Directive for all application deployed on weblogic cluster with a prepath defined by LOCATION2 variable
-# For example, if the LOCAITON2 is set to '/weblogic2', all applications deployed on the cluster can be accessed via
-# http://myhost:myport/weblogic2/application_end_url
-# where 'myhost' is the IP of the machine that runs the Apache web tier, and
-# 'myport' is the port that the Apache webt ier is publicly exposed to.
-
-WLSRequest On
-WebLogicCluster domain2-cluster-cluster-1:8021
-PathTrim /weblogic2
-
+# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+
+
+WebLogicHost ${WEBLOGIC_HOST}
+WebLogicPort ${WEBLOGIC_PORT}
+
+
+# Directive for weblogic admin Console deployed on Weblogic Admin Server
+
+SetHandler weblogic-handler
+WebLogicHost domain1-admin-server
+WebLogicPort ${WEBLOGIC_PORT}
+
+
+# Directive for all application deployed on weblogic cluster with a prepath defined by LOCATION variable
+# For example, if the LOCAITON is set to '/weblogic', all applications deployed on the cluster can be accessed via
+# http://myhost:myport/weblogic/application_end_url
+# where 'myhost' is the IP of the machine that runs the Apache web tier, and
+# 'myport' is the port that the Apache web tier is publicly exposed to.
+# Note that LOCATION cannot be set to '/' unless this is the only Location module configured.
+
+WLSRequest On
+WebLogicCluster domain1-cluster-cluster-1:8001
+PathTrim /weblogic1
+
+
+# Directive for all application deployed on weblogic cluster with a prepath defined by LOCATION2 variable
+# For example, if the LOCAITON2 is set to '/weblogic2', all applications deployed on the cluster can be accessed via
+# http://myhost:myport/weblogic2/application_end_url
+# where 'myhost' is the IP of the machine that runs the Apache web tier, and
+# 'myport' is the port that the Apache webt ier is publicly exposed to.
+
+WLSRequest On
+WebLogicCluster domain2-cluster-cluster-1:8021
+PathTrim /weblogic2
+
diff --git a/OracleWebCenterPortal/kubernetes/charts/apache-samples/custom-sample/input.yaml b/OracleWebCenterPortal/kubernetes/charts/apache-samples/custom-sample/input.yaml
old mode 100644
new mode 100755
index 95eaec6e9..3a502a3d3
--- a/OracleWebCenterPortal/kubernetes/charts/apache-samples/custom-sample/input.yaml
+++ b/OracleWebCenterPortal/kubernetes/charts/apache-samples/custom-sample/input.yaml
@@ -1,28 +1,28 @@
-# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-
-# Use this to provide your own Apache webtier configuration as needed; simply define the
-# Persistence Volume which contains your own custom_mod_wl_apache.conf file and provide the Persistence Volume Claim Name
-persistentVolumeClaimName:
-
-# imagePullSecrets contains an optional list of Kubernetes secrets, that are needed
-# to access the registry containing the apache webtier image.
-# If no secrets are required, then omit this property.
-#
-# Example : a secret is needed, and has been stored in 'my-apache-webtier-secret'
-#
-# imagePullSecrets:
-# - name: my-apache-webtier-secret
-
-# The VirtualHostName of the Apache HTTP server. It is used to enable custom SSL configuration.
-virtualHostName: apache-sample-host
-
-# The customer supplied certificate to use for Apache webtier SSL configuration.
-# The value must be a string containing a base64 encoded certificate. Run following command to get it.
-# base64 -i ${SSL_CERT_FILE} | tr -d '\n'
-customCert: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURxakNDQXBJQ0NRQ0w2Q2JwRWZ6QnB6QU5CZ2txaGtpRzl3MEJBUXNGQURDQmxqRUxNQWtHQTFVRUJoTUMKVlZNeEN6QUpCZ05WQkFnTUFrTkJNUmN3RlFZRFZRUUhEQTVTWldSM2IyOWtJRk5vYjNKbGN6RWJNQmtHQTFVRQpDZ3dTVDNKaFkyeGxJRU52Y25CdmNtRjBhVzl1TVNjd0pRWURWUVFMREI1QmNHRmphR1VnU0ZSVVVDQlRaWEoyClpYSWdWMmwwYUNCUWJIVm5hVzR4R3pBWkJnTlZCQU1NRW1Gd1lXTm9aUzF6WVcxd2JHVXRhRzl6ZERBZUZ3MHgKT0RFeE1UUXhOVEF3TURGYUZ3MHlPREV4TVRFeE5UQXdNREZhTUlHV01Rc3dDUVlEVlFRR0V3SlZVekVMTUFrRwpBMVVFQ0F3Q1EwRXhGekFWQmdOVkJBY01EbEpsWkhkdmIyUWdVMmh2Y21Wek1Sc3dHUVlEVlFRS0RCSlBjbUZqCmJHVWdRMjl5Y0c5eVlYUnBiMjR4SnpBbEJnTlZCQXNNSGtGd1lXTm9aU0JJVkZSUUlGTmxjblpsY2lCWGFYUm8KSUZCc2RXZHBiakViTUJrR0ExVUVBd3dTWVhCaFkyaGxMWE5oYlhCc1pTMW9iM04wTUlJQklqQU5CZ2txaGtpRwo5dzBCQVFFRkFBT0NBUThBTUlJQkNnS0NBUUVBeXBVWjEzV3ltcUVnSUZOVTZDa2E0SkFqMXFNemZ4T2FjTklNClVKRE9zZUtqdjNOYmpJb0szQTArcE9lRDNPOXBNcUVxM3F5ZWlCTUtnVEQwREhZNS9HQldjeEUvdUJyWk0rQzgKcnl3RVk5QTl5Y1drZ3h4NUFqSFM1ZnRLMFhpQU9OZWdnUnV0RTBTTnRmbmY3T0FwaStzU0k1RlBzT2V2ZWZGVgoybjJHUDg0bHNDTTZ3Y3FLcXRKeStwOC94VEJKdW1MY2RoL1daYktGTDd5YzFGSzdUNXdPVTB3eS9nZ1lVOUVvCk9tT3M3MENQWmloSkNrc1hrd1d0Q0JISEEwWGJPMXpYM1VZdnRpeGMwb2U3aFltd29zZnlQWU1raC9hL2pWYzEKWkhac25wQXZiWTZrVEoyY1dBa1hyS0srVmc5ZGJrWGVPY0FFTnNHazIvcXFxVGNOV1FJREFRQUJNQTBHQ1NxRwpTSWIzRFFFQkN3VUFBNElCQVFDQXZZNzBHVzBTM1V4d01mUHJGYTZvOFJxS3FNSDlCRE9lZ29zZGc5Nm9QakZnClgzRGJjblU5U0QxTzAyZUhNb0RTRldiNFlsK3dwZk9zUDFKekdQTERQcXV0RWRuVjRsbUJlbG15Q09xb0F4R0gKRW1vZGNUSWVxQXBnVDNEaHR1NW90UW4zZTdGaGNRRHhDelN6SldkUTRJTFh4SExsTVBkeHpRN1NwTzVySERGeAo0eEd6dkNHRkMwSlhBZ2w4dFhvR3dUYkpDR1hxYWV2cUIrNXVLY1NpSUo2M2dhQk1USytjUmF5MkR4L1dwcEdBClZWTnJsTWs4TEVQT1VSN2RZMm0xT3RaU1hCckdib3QwQjNEUG9yRkNpeVF5Q20vd0FYMFk0Z0hiMlNmcitOeFoKQkppb2VXajZ6ZGFvU3dPZkwxd2taWlJjVGtlZlZyZXdVRjZRQ3BCcAotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==
-
-# The customer supplied private key to use for Apache webtier SSL configuration.
-# The value must be a string containing a base64 encoded key. Run following command to get it.
-# base64 -i ${SSL_KEY_FILE} | tr -d '\n'
-customKey: LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCk1JSUV2Z0lCQURBTkJna3Foa2lHOXcwQkFRRUZBQVNDQktnd2dnU2tBZ0VBQW9JQkFRREtsUm5YZGJLYW9TQWcKVTFUb0tScmdrQ1BXb3pOL0U1cHcwZ3hRa002eDRxTy9jMXVNaWdyY0RUNms1NFBjNzJreW9TcmVySjZJRXdxQgpNUFFNZGpuOFlGWnpFVCs0R3RrejRMeXZMQVJqMEQzSnhhU0RISGtDTWRMbCswclJlSUE0MTZDQkc2MFRSSTIxCitkL3M0Q21MNnhJamtVK3c1Njk1OFZYYWZZWS96aVd3SXpyQnlvcXEwbkw2bnovRk1FbTZZdHgySDlabHNvVXYKdkp6VVVydFBuQTVUVERMK0NCaFQwU2c2WTZ6dlFJOW1LRWtLU3hlVEJhMElFY2NEUmRzN1hOZmRSaSsyTEZ6UwpoN3VGaWJDaXgvSTlneVNIOXIrTlZ6VmtkbXlla0M5dGpxUk1uWnhZQ1Jlc29yNVdEMTF1UmQ0NXdBUTJ3YVRiCitxcXBOdzFaQWdNQkFBRUNnZ0VCQUtPKzR4VnFHRVN1aWxZMnBVSEd2K2ZWK25IcWxweFh6eFQwWTJuWHNvck0KZzhralNGT1AzUGxEWjJoSmppZE9DUDBZa3B0TWNoUFJPRU4ydXowN2J1RlZTV3RXL09jbUpIeXZZalJCWXdiKwo4b0tlVTd4NmprRTgzcGh3aDJoTGUzRDJzZERKK3hyQTViNjZ5OG9lNHRZcTJ3Mk96aGhUSFY1MnVRdVRQS2xpCjJpSHNYQzIwT1dMSmRuMGU1a0IycTJhV3JJaUJBVzI1Y0JyRDQ5MWFyTDh0emJQOWM4eUUyWUdNM1FKaUFtbkYKNUxZUElzZFdVczJYNEhscWtUM0d6ZEVxNUtzV0pzdjN5QUkxOVJ4eXAwZXd1ditTN3hsRjdIZGlhbnR6ZUp4WAp3MnRWbHpjb1BVQVhoVHIxS0N1UDNCT3BQVXNvMG9oaDNzRFVXamVVWUNVQ2dZRUE3L25QYTE5ckpKUExJOFZiCllhQ2pEKzhTR0FvVWZwSDdRTVFyT2RzR0RkcWRKa2VlNEJ0RDBITUEzL1lLVGFUK0JvRVZmQ2czSWpZVWpmeGcKSkp0VWlJVlcya0RsMU5NY0xXaldINExPaFErQlRGbWcvbFlkc2puMW9FbUJ1Rk1NYWF0ejNGdmZscFRCekg4cwpwMHFyL0hJYTFTbllBckVTUXZUVk9MMVhtcThDZ1lFQTJCd1V6NmpQdVVGR3ZKS3RxWTZVbE9yYm05WXFyYVdDCjlhQ3ZBTDFHZ0Q1U1FEcGRVZnl3MVlWdm9hUU9DWHBOL0Z5UHZCdFF2TzYrbHp0MjVTcmMwZk0weHI3d3ZHRmEKSW5FcmlSOXAvMXdXU01yaWFXZitKaE81NENneFZ0alBXZm1pOVNhc0pqOE1jZVk0cUNCNUVJLzM1cjVaa3lFRQozeEhzcEUxVnVuY0NnWUJLYXBveXZzVTM4NGprRDloMW50M1NIQjN0VEhyc2dSSjhGQmtmZU5jWXhybEMzS1RjCjlEZUVWWlZvM2lCMTBYdGd3dmpKcHFMcVBnRUR3c2FCczVWMFBIMGhjMHlTUWVFVUI5V1dzZmFlOXA3dThVQm0KZm9mNDg5WkNuV2pYb3hGUFYzYTNWOW92RlBSQUdSUGMwT0FpaWJQZWRIcGk0MHc1YlRrTnZsR0RTd0tCZ1FESApubWk2eUR2WDZ5dmowN2tGL2VYUkNIK0NHdm1oSEZremVoRXNwYWtSbkg5dFJId2UxMEtnZUhqODNnVDVURGZzCis3THBGbklsa29JS1A2czdVN1JWV2tsTnErSENvRW9adGw5NGNjUC9WSmhnOU1iZWhtaUQwNFRHUVZvUjFvTHgKb1YyZEJQUFBBRDRHbDVtTjh6RGcwNXN4VUhKOUxPckxBa3VNR01NdlVRS0JnQ2RUUGgwVHRwODNUUVZFZnR3bwpuSGVuSEQzMkhrZkR0MTV4Wk84NVZGcTlONVg2MjB2amZKNkNyVnloS1RISllUREs1N2owQ3Z2STBFTksxNytpCi9yaXgwVlFNMTBIMFFuTkZlb0pmS0VITHhXb2czSHVBSVZxTEg4NmJwcytmb25nOCtuMGgvbk5NZUZNYjdSNUMKdmFHNEVkc0VHV0hZS2FiL2lzRlowUVU0Ci0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0K
+# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+
+# Use this to provide your own Apache webtier configuration as needed; simply define the
+# Persistence Volume which contains your own custom_mod_wl_apache.conf file and provide the Persistence Volume Claim Name
+persistentVolumeClaimName:
+
+# imagePullSecrets contains an optional list of Kubernetes secrets, that are needed
+# to access the registry containing the apache webtier image.
+# If no secrets are required, then omit this property.
+#
+# Example : a secret is needed, and has been stored in 'my-apache-webtier-secret'
+#
+# imagePullSecrets:
+# - name: my-apache-webtier-secret
+
+# The VirtualHostName of the Apache HTTP server. It is used to enable custom SSL configuration.
+virtualHostName: apache-sample-host
+
+# The customer supplied certificate to use for Apache webtier SSL configuration.
+# The value must be a string containing a base64 encoded certificate. Run following command to get it.
+# base64 -i ${SSL_CERT_FILE} | tr -d '\n'
+customCert: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURxakNDQXBJQ0NRQ0w2Q2JwRWZ6QnB6QU5CZ2txaGtpRzl3MEJBUXNGQURDQmxqRUxNQWtHQTFVRUJoTUMKVlZNeEN6QUpCZ05WQkFnTUFrTkJNUmN3RlFZRFZRUUhEQTVTWldSM2IyOWtJRk5vYjNKbGN6RWJNQmtHQTFVRQpDZ3dTVDNKaFkyeGxJRU52Y25CdmNtRjBhVzl1TVNjd0pRWURWUVFMREI1QmNHRmphR1VnU0ZSVVVDQlRaWEoyClpYSWdWMmwwYUNCUWJIVm5hVzR4R3pBWkJnTlZCQU1NRW1Gd1lXTm9aUzF6WVcxd2JHVXRhRzl6ZERBZUZ3MHgKT0RFeE1UUXhOVEF3TURGYUZ3MHlPREV4TVRFeE5UQXdNREZhTUlHV01Rc3dDUVlEVlFRR0V3SlZVekVMTUFrRwpBMVVFQ0F3Q1EwRXhGekFWQmdOVkJBY01EbEpsWkhkdmIyUWdVMmh2Y21Wek1Sc3dHUVlEVlFRS0RCSlBjbUZqCmJHVWdRMjl5Y0c5eVlYUnBiMjR4SnpBbEJnTlZCQXNNSGtGd1lXTm9aU0JJVkZSUUlGTmxjblpsY2lCWGFYUm8KSUZCc2RXZHBiakViTUJrR0ExVUVBd3dTWVhCaFkyaGxMWE5oYlhCc1pTMW9iM04wTUlJQklqQU5CZ2txaGtpRwo5dzBCQVFFRkFBT0NBUThBTUlJQkNnS0NBUUVBeXBVWjEzV3ltcUVnSUZOVTZDa2E0SkFqMXFNemZ4T2FjTklNClVKRE9zZUtqdjNOYmpJb0szQTArcE9lRDNPOXBNcUVxM3F5ZWlCTUtnVEQwREhZNS9HQldjeEUvdUJyWk0rQzgKcnl3RVk5QTl5Y1drZ3h4NUFqSFM1ZnRLMFhpQU9OZWdnUnV0RTBTTnRmbmY3T0FwaStzU0k1RlBzT2V2ZWZGVgoybjJHUDg0bHNDTTZ3Y3FLcXRKeStwOC94VEJKdW1MY2RoL1daYktGTDd5YzFGSzdUNXdPVTB3eS9nZ1lVOUVvCk9tT3M3MENQWmloSkNrc1hrd1d0Q0JISEEwWGJPMXpYM1VZdnRpeGMwb2U3aFltd29zZnlQWU1raC9hL2pWYzEKWkhac25wQXZiWTZrVEoyY1dBa1hyS0srVmc5ZGJrWGVPY0FFTnNHazIvcXFxVGNOV1FJREFRQUJNQTBHQ1NxRwpTSWIzRFFFQkN3VUFBNElCQVFDQXZZNzBHVzBTM1V4d01mUHJGYTZvOFJxS3FNSDlCRE9lZ29zZGc5Nm9QakZnClgzRGJjblU5U0QxTzAyZUhNb0RTRldiNFlsK3dwZk9zUDFKekdQTERQcXV0RWRuVjRsbUJlbG15Q09xb0F4R0gKRW1vZGNUSWVxQXBnVDNEaHR1NW90UW4zZTdGaGNRRHhDelN6SldkUTRJTFh4SExsTVBkeHpRN1NwTzVySERGeAo0eEd6dkNHRkMwSlhBZ2w4dFhvR3dUYkpDR1hxYWV2cUIrNXVLY1NpSUo2M2dhQk1USytjUmF5MkR4L1dwcEdBClZWTnJsTWs4TEVQT1VSN2RZMm0xT3RaU1hCckdib3QwQjNEUG9yRkNpeVF5Q20vd0FYMFk0Z0hiMlNmcitOeFoKQkppb2VXajZ6ZGFvU3dPZkwxd2taWlJjVGtlZlZyZXdVRjZRQ3BCcAotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==
+
+# The customer supplied private key to use for Apache webtier SSL configuration.
+# The value must be a string containing a base64 encoded key. Run following command to get it.
+# base64 -i ${SSL_KEY_FILE} | tr -d '\n'
+customKey: LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCk1JSUV2Z0lCQURBTkJna3Foa2lHOXcwQkFRRUZBQVNDQktnd2dnU2tBZ0VBQW9JQkFRREtsUm5YZGJLYW9TQWcKVTFUb0tScmdrQ1BXb3pOL0U1cHcwZ3hRa002eDRxTy9jMXVNaWdyY0RUNms1NFBjNzJreW9TcmVySjZJRXdxQgpNUFFNZGpuOFlGWnpFVCs0R3RrejRMeXZMQVJqMEQzSnhhU0RISGtDTWRMbCswclJlSUE0MTZDQkc2MFRSSTIxCitkL3M0Q21MNnhJamtVK3c1Njk1OFZYYWZZWS96aVd3SXpyQnlvcXEwbkw2bnovRk1FbTZZdHgySDlabHNvVXYKdkp6VVVydFBuQTVUVERMK0NCaFQwU2c2WTZ6dlFJOW1LRWtLU3hlVEJhMElFY2NEUmRzN1hOZmRSaSsyTEZ6UwpoN3VGaWJDaXgvSTlneVNIOXIrTlZ6VmtkbXlla0M5dGpxUk1uWnhZQ1Jlc29yNVdEMTF1UmQ0NXdBUTJ3YVRiCitxcXBOdzFaQWdNQkFBRUNnZ0VCQUtPKzR4VnFHRVN1aWxZMnBVSEd2K2ZWK25IcWxweFh6eFQwWTJuWHNvck0KZzhralNGT1AzUGxEWjJoSmppZE9DUDBZa3B0TWNoUFJPRU4ydXowN2J1RlZTV3RXL09jbUpIeXZZalJCWXdiKwo4b0tlVTd4NmprRTgzcGh3aDJoTGUzRDJzZERKK3hyQTViNjZ5OG9lNHRZcTJ3Mk96aGhUSFY1MnVRdVRQS2xpCjJpSHNYQzIwT1dMSmRuMGU1a0IycTJhV3JJaUJBVzI1Y0JyRDQ5MWFyTDh0emJQOWM4eUUyWUdNM1FKaUFtbkYKNUxZUElzZFdVczJYNEhscWtUM0d6ZEVxNUtzV0pzdjN5QUkxOVJ4eXAwZXd1ditTN3hsRjdIZGlhbnR6ZUp4WAp3MnRWbHpjb1BVQVhoVHIxS0N1UDNCT3BQVXNvMG9oaDNzRFVXamVVWUNVQ2dZRUE3L25QYTE5ckpKUExJOFZiCllhQ2pEKzhTR0FvVWZwSDdRTVFyT2RzR0RkcWRKa2VlNEJ0RDBITUEzL1lLVGFUK0JvRVZmQ2czSWpZVWpmeGcKSkp0VWlJVlcya0RsMU5NY0xXaldINExPaFErQlRGbWcvbFlkc2puMW9FbUJ1Rk1NYWF0ejNGdmZscFRCekg4cwpwMHFyL0hJYTFTbllBckVTUXZUVk9MMVhtcThDZ1lFQTJCd1V6NmpQdVVGR3ZKS3RxWTZVbE9yYm05WXFyYVdDCjlhQ3ZBTDFHZ0Q1U1FEcGRVZnl3MVlWdm9hUU9DWHBOL0Z5UHZCdFF2TzYrbHp0MjVTcmMwZk0weHI3d3ZHRmEKSW5FcmlSOXAvMXdXU01yaWFXZitKaE81NENneFZ0alBXZm1pOVNhc0pqOE1jZVk0cUNCNUVJLzM1cjVaa3lFRQozeEhzcEUxVnVuY0NnWUJLYXBveXZzVTM4NGprRDloMW50M1NIQjN0VEhyc2dSSjhGQmtmZU5jWXhybEMzS1RjCjlEZUVWWlZvM2lCMTBYdGd3dmpKcHFMcVBnRUR3c2FCczVWMFBIMGhjMHlTUWVFVUI5V1dzZmFlOXA3dThVQm0KZm9mNDg5WkNuV2pYb3hGUFYzYTNWOW92RlBSQUdSUGMwT0FpaWJQZWRIcGk0MHc1YlRrTnZsR0RTd0tCZ1FESApubWk2eUR2WDZ5dmowN2tGL2VYUkNIK0NHdm1oSEZremVoRXNwYWtSbkg5dFJId2UxMEtnZUhqODNnVDVURGZzCis3THBGbklsa29JS1A2czdVN1JWV2tsTnErSENvRW9adGw5NGNjUC9WSmhnOU1iZWhtaUQwNFRHUVZvUjFvTHgKb1YyZEJQUFBBRDRHbDVtTjh6RGcwNXN4VUhKOUxPckxBa3VNR01NdlVRS0JnQ2RUUGgwVHRwODNUUVZFZnR3bwpuSGVuSEQzMkhrZkR0MTV4Wk84NVZGcTlONVg2MjB2amZKNkNyVnloS1RISllUREs1N2owQ3Z2STBFTksxNytpCi9yaXgwVlFNMTBIMFFuTkZlb0pmS0VITHhXb2czSHVBSVZxTEg4NmJwcytmb25nOCtuMGgvbk5NZUZNYjdSNUMKdmFHNEVkc0VHV0hZS2FiL2lzRlowUVU0Ci0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0K
diff --git a/OracleWebCenterPortal/kubernetes/charts/apache-samples/default-sample/README.md b/OracleWebCenterPortal/kubernetes/charts/apache-samples/default-sample/README.md
old mode 100644
new mode 100755
index 806bab5c9..afda2898b
--- a/OracleWebCenterPortal/kubernetes/charts/apache-samples/default-sample/README.md
+++ b/OracleWebCenterPortal/kubernetes/charts/apache-samples/default-sample/README.md
@@ -1,39 +1,39 @@
-# Apache load balancer default sample
-In this sample, we will configure the Apache webtier as a load balancer for a WebLogic domain using the default configuration. We will demonstrate how to use the Apache webtier to handle traffic to a backend WebLogic domain.
-
-## 1. Create a WebLogic domain
-We need to prepare a backend domain for load balancing by the Apache webtier. Refer to the [sample](/kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/README.md), to create a WebLogic domain. Keep the default values for the following configuration parameters:
-- namespace: `default`
-- domainUID: `domain1`
-- clusterName: `cluster-1`
-- adminServerName: `admin-server`
-- adminPort: `7001`
-- managedServerPort: `8001`
-
-After the domain is successfully created, deploy the sample web application, `testwebapp.war`, on the domain cluster using the WLS Administration Console. The sample web application is located in the `kubernetes/samples/charts/application` directory.
-
-## 2. Build the Apache webtier Docker image
-Refer to the [sample](https://github.com/oracle/docker-images/tree/master/OracleWebLogic/samples/12213-webtier-apache), to build the Apache webtier Docker image.
-
-## 3. Install the Apache webtier with a Helm chart
-The Apache webtier Helm chart [is located here](../../apache-webtier/README.md).
-Install the Apache webtier Helm chart into the default namespace with the default settings:
-```shell
-$ cd kubernetes/samples/charts
-$ helm install my-release apache-webtier
-```
-
-## 4. Run the sample application
-Now you can send request to the WebLogic domain with the unique entry point of Apache. Alternatively, you can access the URL in a web browser.
-```shell
-$ curl --silent http://${HOSTNAME}:30305/weblogic/testwebapp/
-```
-You can also use an SSL URL to send requests to the WebLogic domain. Access the SSL URL via the `curl` command or a web browser.
-```shell
-$ curl -k --silent https://${HOSTNAME}:30443/weblogic/testwebapp/
-```
-
-## 5. Uninstall the Apache webtier
-```shell
-$ helm uninstall my-release
-```
+# Apache load balancer default sample
+In this sample, we will configure the Apache webtier as a load balancer for a WebLogic domain using the default configuration. We will demonstrate how to use the Apache webtier to handle traffic to a backend WebLogic domain.
+
+## 1. Create a WebLogic domain
+We need to prepare a backend domain for load balancing by the Apache webtier. Refer to the [sample](/kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/README.md), to create a WebLogic domain. Keep the default values for the following configuration parameters:
+- namespace: `default`
+- domainUID: `domain1`
+- clusterName: `cluster-1`
+- adminServerName: `admin-server`
+- adminPort: `7001`
+- managedServerPort: `8001`
+
+After the domain is successfully created, deploy the sample web application, `testwebapp.war`, on the domain cluster using the WLS Administration Console. The sample web application is located in the `kubernetes/samples/charts/application` directory.
+
+## 2. Build the Apache webtier Docker image
+Refer to the [sample](https://github.com/oracle/docker-images/tree/master/OracleWebLogic/samples/12213-webtier-apache), to build the Apache webtier Docker image.
+
+## 3. Install the Apache webtier with a Helm chart
+The Apache webtier Helm chart [is located here](../../apache-webtier/README.md).
+Install the Apache webtier Helm chart into the default namespace with the default settings:
+```shell
+$ cd kubernetes/samples/charts
+$ helm install my-release apache-webtier
+```
+
+## 4. Run the sample application
+Now you can send request to the WebLogic domain with the unique entry point of Apache. Alternatively, you can access the URL in a web browser.
+```shell
+$ curl --silent http://${HOSTNAME}:30305/weblogic/testwebapp/
+```
+You can also use an SSL URL to send requests to the WebLogic domain. Access the SSL URL via the `curl` command or a web browser.
+```shell
+$ curl -k --silent https://${HOSTNAME}:30443/weblogic/testwebapp/
+```
+
+## 5. Uninstall the Apache webtier
+```shell
+$ helm uninstall my-release
+```
diff --git a/OracleWebCenterPortal/kubernetes/charts/apache-webtier/Chart.yaml b/OracleWebCenterPortal/kubernetes/charts/apache-webtier/Chart.yaml
old mode 100644
new mode 100755
index 413b8ba2d..18ffecf90
--- a/OracleWebCenterPortal/kubernetes/charts/apache-webtier/Chart.yaml
+++ b/OracleWebCenterPortal/kubernetes/charts/apache-webtier/Chart.yaml
@@ -1,20 +1,20 @@
-# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-
-apiVersion: v1
-name: apache-webtier
-version: 1.0.0
-appVersion: 12.2.1.3
-description: Chart for Apache HTTP Server
-keywords:
-- apache
-- http
-- https
-- load balance
-- proxy
-home: https://httpd.apache.org
-sources:
-- https://github.com/oracle/weblogic-kubernetes-operator/tree/master/kubernetes/samples/charts/apache-webtier
-maintainers:
-- name: Oracle
-engine: gotpl
+# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+
+apiVersion: v1
+name: apache-webtier
+version: 1.0.0
+appVersion: 12.2.1.3
+description: Chart for Apache HTTP Server
+keywords:
+- apache
+- http
+- https
+- load balance
+- proxy
+home: https://httpd.apache.org
+sources:
+- https://github.com/oracle/weblogic-kubernetes-operator/tree/master/kubernetes/samples/charts/apache-webtier
+maintainers:
+- name: Oracle
+engine: gotpl
diff --git a/OracleWebCenterPortal/kubernetes/charts/apache-webtier/README.md b/OracleWebCenterPortal/kubernetes/charts/apache-webtier/README.md
old mode 100644
new mode 100755
index 2be875dd3..405aaa3b3
--- a/OracleWebCenterPortal/kubernetes/charts/apache-webtier/README.md
+++ b/OracleWebCenterPortal/kubernetes/charts/apache-webtier/README.md
@@ -1,92 +1,92 @@
-# Apache webtier Helm chart
-
-This Helm chart bootstraps an Apache HTTP Server deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.
-
-The chart depends on the Docker image for the Apache HTTP Server with Oracle WebLogic Server Proxy Plugin (supported versions 12.2.1.3.0 and 12.2.1.4.0). See the details in [Apache HTTP Server with Oracle WebLogic Server Proxy Plugin on Docker](https://github.com/oracle/docker-images/tree/master/OracleWebLogic/samples/12213-webtier-apache).
-
-## Prerequisites
-
-You will need to build a Docker image with the Apache webtier in it using the sample provided [here](https://github.com/oracle/docker-images/tree/master/OracleWebLogic/samples/12213-webtier-apache)
-in order to use this load balancer.
-
-## Installing the Chart
-To install the chart with the release name `my-release`:
-```shell
-$ helm install my-release apache-webtier
-```
-The command deploys the Apache HTTP Server on the Kubernetes cluster with the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation.
-
-> **Tip**: List all releases using `helm list`
-
-## Uninstalling the Chart
-
-To uninstall/delete `my-release`:
-
-```shell
-$ helm uninstall my-release
-```
-
-The command removes all the Kubernetes components associated with the chart and deletes the release.
-
-## Configuration
-
-The following table lists the configurable parameters of the Apache webtier chart and their default values.
-
-
-| Parameter | Description | Default |
-| -----------------------------------| ------------------------------------------------------------- | ----------------------|
-| `image` | Apache webtier Docker image | `oracle/apache:12.2.1.3` |
-| `imagePullPolicy` | Image pull policy for the Apache webtier Docker image | `IfNotPresent` |
-| `imagePullSecrets` | Image pull Secrets required to access the registry containing the Apache webtier Docker image| ``|
-| `persistentVolumeClaimName` | Persistence Volume Claim name Apache webtier | `` |
-| `createRBAC` | Boolean indicating if RBAC resources should be created | `true` |
-| `httpNodePort` | Node port to expose for HTTP access | `30305` |
-| `httpsNodePort` | Node port to expose for HTTPS access | `30443` |
-| `virtualHostName` | The `VirtualHostName` of the Apache HTTP Server | `` |
-| `customCert` | The customer supplied certificate | `` |
-| `customKey` | The customer supplied private key | `` |
-| `domainUID` | Unique ID identifying a domain | `domain1` |
-| `clusterName` | Cluster name | `cluster-1` |
-| `adminServerName` | Name of the Administration Server | `admin-server` |
-| `adminPort` | Port number for Administration Server | `7001` |
-| `managedServerPort` | Port number for each Managed Server | `8001` |
-| `location` | Prepath for all applications deployed on the WebLogic cluster | `/weblogic` |
-| `useNonPriviledgedPorts` | Configuration of Apache webtier on NonPriviledgedPort | `false` |
-
-
-Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example:
-
-```shell
-$ helm install my-release --set persistentVolumeClaimName=webtier-apache-pvc apache-webtier
-```
-
-Alternatively, a YAML file that specifies the values for the parameters can be provided while
-installing the chart. For example:
-
-```shell
-$ helm install my-release --values values.yaml apache-webtier
-```
-## useNonPriviledgedPorts
-By default, the chart will install the Apache webtier on PriviledgedPort (port 80). Set the flag `useNonPriviledgedPorts=true` to enable the Apache webtier to listen on port `8080`
-
-
-## RBAC
-By default, the chart will install the recommended RBAC roles and role bindings.
-
-Set the flag `--authorization-mode=RBAC` on the API server. See the following document for how to enable [RBAC](https://kubernetes.io/docs/reference/access-authn-authz/rbac/).
-
-To determine if your cluster supports RBAC, run the following command:
-
-```shell
-$ kubectl api-versions | grep rbac
-```
-
-If the output contains "beta", you may install the chart with RBAC enabled.
-
-### Disable RBAC role/rolebinding creation
-
-To disable the creation of RBAC resources (on clusters with RBAC). Do the following:
-
-```shell
-$ helm install my-release apache-webtier --set createRBAC=false
-```
+# Apache webtier Helm chart
+
+This Helm chart bootstraps an Apache HTTP Server deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.
+
+The chart depends on the Docker image for the Apache HTTP Server with Oracle WebLogic Server Proxy Plugin (supported versions 12.2.1.3.0 and 12.2.1.4.0). See the details in [Apache HTTP Server with Oracle WebLogic Server Proxy Plugin on Docker](https://github.com/oracle/docker-images/tree/master/OracleWebLogic/samples/12213-webtier-apache).
+
+## Prerequisites
+
+You will need to build a Docker image with the Apache webtier in it using the sample provided [here](https://github.com/oracle/docker-images/tree/master/OracleWebLogic/samples/12213-webtier-apache)
+in order to use this load balancer.
+
+## Installing the Chart
+To install the chart with the release name `my-release`:
+```shell
+$ helm install my-release apache-webtier
+```
+The command deploys the Apache HTTP Server on the Kubernetes cluster with the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation.
+
+> **Tip**: List all releases using `helm list`
+
+## Uninstalling the Chart
+
+To uninstall/delete `my-release`:
+
+```shell
+$ helm uninstall my-release
+```
+
+The command removes all the Kubernetes components associated with the chart and deletes the release.
+
+## Configuration
+
+The following table lists the configurable parameters of the Apache webtier chart and their default values.
+
+
+| Parameter | Description | Default |
+| -----------------------------------| ------------------------------------------------------------- | ----------------------|
+| `image` | Apache webtier Docker image | `oracle/apache:12.2.1.3` |
+| `imagePullPolicy` | Image pull policy for the Apache webtier Docker image | `IfNotPresent` |
+| `imagePullSecrets` | Image pull Secrets required to access the registry containing the Apache webtier Docker image| ``|
+| `persistentVolumeClaimName` | Persistence Volume Claim name Apache webtier | `` |
+| `createRBAC` | Boolean indicating if RBAC resources should be created | `true` |
+| `httpNodePort` | Node port to expose for HTTP access | `30305` |
+| `httpsNodePort` | Node port to expose for HTTPS access | `30443` |
+| `virtualHostName` | The `VirtualHostName` of the Apache HTTP Server | `` |
+| `customCert` | The customer supplied certificate | `` |
+| `customKey` | The customer supplied private key | `` |
+| `domainUID` | Unique ID identifying a domain | `domain1` |
+| `clusterName` | Cluster name | `cluster-1` |
+| `adminServerName` | Name of the Administration Server | `admin-server` |
+| `adminPort` | Port number for Administration Server | `7001` |
+| `managedServerPort` | Port number for each Managed Server | `8001` |
+| `location` | Prepath for all applications deployed on the WebLogic cluster | `/weblogic` |
+| `useNonPriviledgedPorts` | Configuration of Apache webtier on NonPriviledgedPort | `false` |
+
+
+Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example:
+
+```shell
+$ helm install my-release --set persistentVolumeClaimName=webtier-apache-pvc apache-webtier
+```
+
+Alternatively, a YAML file that specifies the values for the parameters can be provided while
+installing the chart. For example:
+
+```shell
+$ helm install my-release --values values.yaml apache-webtier
+```
+## useNonPriviledgedPorts
+By default, the chart will install the Apache webtier on PriviledgedPort (port 80). Set the flag `useNonPriviledgedPorts=true` to enable the Apache webtier to listen on port `8080`
+
+
+## RBAC
+By default, the chart will install the recommended RBAC roles and role bindings.
+
+Set the flag `--authorization-mode=RBAC` on the API server. See the following document for how to enable [RBAC](https://kubernetes.io/docs/reference/access-authn-authz/rbac/).
+
+To determine if your cluster supports RBAC, run the following command:
+
+```shell
+$ kubectl api-versions | grep rbac
+```
+
+If the output contains "beta", you may install the chart with RBAC enabled.
+
+### Disable RBAC role/rolebinding creation
+
+To disable the creation of RBAC resources (on clusters with RBAC). Do the following:
+
+```shell
+$ helm install my-release apache-webtier --set createRBAC=false
+```
diff --git a/OracleWebCenterPortal/kubernetes/charts/apache-webtier/templates/_helpers.tpl b/OracleWebCenterPortal/kubernetes/charts/apache-webtier/templates/_helpers.tpl
old mode 100644
new mode 100755
index c7999d287..bb6887aca
--- a/OracleWebCenterPortal/kubernetes/charts/apache-webtier/templates/_helpers.tpl
+++ b/OracleWebCenterPortal/kubernetes/charts/apache-webtier/templates/_helpers.tpl
@@ -1,25 +1,25 @@
-# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-
-{/* vim: set filetype=mustache: */}}
-{{/*
-Expand the name of the chart.
-*/}}
-{{- define "apache.name" -}}
-{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
-{{- end -}}
-
-{{/*
-Create a default fully qualified app name.
-*/}}
-{{- define "apache.fullname" -}}
-{{- $name := default .Chart.Name .Values.nameOverride -}}
-{{- printf "%s-%s" .Release.Name $name | trunc 63 -}}
-{{- end -}}
-
-{{/*
-Create the name of the service account to use
-*/}}
-{{- define "apache.serviceAccountName" -}}
-{{- printf "%s-%s" .Release.Name .Chart.Name | trunc 63 -}}
-{{- end -}}
+# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+
+{/* vim: set filetype=mustache: */}}
+{{/*
+Expand the name of the chart.
+*/}}
+{{- define "apache.name" -}}
+{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+
+{{/*
+Create a default fully qualified app name.
+*/}}
+{{- define "apache.fullname" -}}
+{{- $name := default .Chart.Name .Values.nameOverride -}}
+{{- printf "%s-%s" .Release.Name $name | trunc 63 -}}
+{{- end -}}
+
+{{/*
+Create the name of the service account to use
+*/}}
+{{- define "apache.serviceAccountName" -}}
+{{- printf "%s-%s" .Release.Name .Chart.Name | trunc 63 -}}
+{{- end -}}
diff --git a/OracleWebCenterPortal/kubernetes/charts/apache-webtier/templates/cluster-role-binding.yaml b/OracleWebCenterPortal/kubernetes/charts/apache-webtier/templates/cluster-role-binding.yaml
old mode 100644
new mode 100755
index 188e54d1a..798a0c8d3
--- a/OracleWebCenterPortal/kubernetes/charts/apache-webtier/templates/cluster-role-binding.yaml
+++ b/OracleWebCenterPortal/kubernetes/charts/apache-webtier/templates/cluster-role-binding.yaml
@@ -1,17 +1,17 @@
-# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-
-{{ if .Values.createRBAC }}
-kind: ClusterRoleBinding
-apiVersion: rbac.authorization.k8s.io/v1
-metadata:
- name: {{ template "apache.fullname" . }}
-roleRef:
- apiGroup: rbac.authorization.k8s.io
- kind: ClusterRole
- name: {{ template "apache.fullname" . }}
-subjects:
-- kind: ServiceAccount
- name: {{ template "apache.serviceAccountName" . }}
- namespace: {{ .Release.Namespace | quote }}
-{{ end }}
+# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+
+{{ if .Values.createRBAC }}
+kind: ClusterRoleBinding
+apiVersion: rbac.authorization.k8s.io/v1
+metadata:
+ name: {{ template "apache.fullname" . }}
+roleRef:
+ apiGroup: rbac.authorization.k8s.io
+ kind: ClusterRole
+ name: {{ template "apache.fullname" . }}
+subjects:
+- kind: ServiceAccount
+ name: {{ template "apache.serviceAccountName" . }}
+ namespace: {{ .Release.Namespace | quote }}
+{{ end }}
diff --git a/OracleWebCenterPortal/kubernetes/charts/apache-webtier/templates/cluster-role.yaml b/OracleWebCenterPortal/kubernetes/charts/apache-webtier/templates/cluster-role.yaml
old mode 100644
new mode 100755
index 449a87664..aa36887cc
--- a/OracleWebCenterPortal/kubernetes/charts/apache-webtier/templates/cluster-role.yaml
+++ b/OracleWebCenterPortal/kubernetes/charts/apache-webtier/templates/cluster-role.yaml
@@ -1,29 +1,29 @@
-# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-
-{{ if .Values.createRBAC }}
-kind: ClusterRole
-apiVersion: rbac.authorization.k8s.io/v1
-metadata:
- name: {{ template "apache.fullname" . }}
-rules:
- - apiGroups:
- - ""
- resources:
- - pods
- - services
- - endpoints
- - secrets
- verbs:
- - get
- - list
- - watch
- - apiGroups:
- - extensions
- resources:
- - ingresses
- verbs:
- - get
- - list
- - watch
-{{ end }}
+# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+
+{{ if .Values.createRBAC }}
+kind: ClusterRole
+apiVersion: rbac.authorization.k8s.io/v1
+metadata:
+ name: {{ template "apache.fullname" . }}
+rules:
+ - apiGroups:
+ - ""
+ resources:
+ - pods
+ - services
+ - endpoints
+ - secrets
+ verbs:
+ - get
+ - list
+ - watch
+ - apiGroups:
+ - extensions
+ resources:
+ - ingresses
+ verbs:
+ - get
+ - list
+ - watch
+{{ end }}
diff --git a/OracleWebCenterPortal/kubernetes/charts/apache-webtier/templates/deployment.yaml b/OracleWebCenterPortal/kubernetes/charts/apache-webtier/templates/deployment.yaml
old mode 100644
new mode 100755
index cd7b07ad3..5b06e4c1e
--- a/OracleWebCenterPortal/kubernetes/charts/apache-webtier/templates/deployment.yaml
+++ b/OracleWebCenterPortal/kubernetes/charts/apache-webtier/templates/deployment.yaml
@@ -1,106 +1,106 @@
-# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-
-kind: Deployment
-apiVersion: apps/v1
-metadata:
- name: {{ template "apache.fullname" . }}
- namespace: {{ .Release.Namespace }}
- labels:
- app: {{ template "apache.fullname" . }}
-spec:
- replicas: 1
- selector:
- matchLabels:
- app: {{ template "apache.fullname" . }}
- template:
- metadata:
- labels:
- app: {{ template "apache.fullname" . }}
- spec:
- serviceAccountName: {{ template "apache.serviceAccountName" . }}
- terminationGracePeriodSeconds: 60
-{{- if or (and (.Values.virtualHostName) (.Values.customCert)) (.Values.persistentVolumeClaimName) }}
- volumes:
-{{- end }}
-{{- if and (.Values.virtualHostName) (.Values.customCert) }}
- - name: serving-cert
- secret:
- defaultMode: 420
- secretName: {{ template "apache.fullname" . }}-cert
-{{- end }}
-{{- if .Values.persistentVolumeClaimName }}
- - name: {{ template "apache.fullname" . }}
- persistentVolumeClaim:
- claimName: {{ .Values.persistentVolumeClaimName | quote }}
-{{- end }}
- {{- if .Values.imagePullSecrets }}
- imagePullSecrets:
- {{ .Values.imagePullSecrets | toYaml }}
- {{- end }}
- containers:
- - name: {{ template "apache.fullname" . }}
- image: {{ .Values.image | quote }}
- imagePullPolicy: {{ .Values.imagePullPolicy | quote }}
-{{- if or (and (.Values.virtualHostName) (.Values.customCert)) (.Values.persistentVolumeClaimName) }}
- volumeMounts:
-{{- end }}
-{{- if and (.Values.virtualHostName) (.Values.customCert) }}
- - name: serving-cert
- mountPath: "/var/serving-cert"
-{{- end }}
-{{- if .Values.persistentVolumeClaimName }}
- - name: {{ template "apache.fullname" . }}
- mountPath: "/config"
-{{- end }}
-{{- if or (not (.Values.persistentVolumeClaimName)) (.Values.virtualHostName) }}
- env:
-{{- end }}
-{{- if .Values.useNonPriviledgedPorts }}
- - name: NonPriviledgedPorts
- value: "true"
-{{- end }}
-{{- if not (.Values.persistentVolumeClaimName) }}
- - name: WEBLOGIC_CLUSTER
- value: "{{ .Values.domainUID | replace "_" "-" | lower }}-cluster-{{ .Values.clusterName | replace "_" "-" | lower }}:{{ .Values.managedServerPort }}"
- - name: LOCATION
- value: {{ .Values.location | quote }}
- - name: WEBLOGIC_HOST
- value: "{{ .Values.domainUID | replace "_" "-" | lower }}-{{ .Values.adminServerName | replace "_" "-" | lower }}"
- - name: WEBLOGIC_PORT
- value: {{ .Values.adminPort | quote }}
-{{- end }}
-{{- if .Values.virtualHostName }}
- - name: VIRTUAL_HOST_NAME
- value: {{ .Values.virtualHostName | quote }}
-{{- if .Values.customCert }}
- - name: SSL_CERT_FILE
- value: "/var/serving-cert/tls.crt"
- - name: SSL_CERT_KEY_FILE
- value: "/var/serving-cert/tls.key"
-{{- end }}
-{{- end }}
- readinessProbe:
- tcpSocket:
-{{- if .Values.useNonPriviledgedPorts }}
- port: 8080
-{{- else }}
- port: 80
-{{- end }}
- failureThreshold: 1
- initialDelaySeconds: 10
- periodSeconds: 10
- successThreshold: 1
- timeoutSeconds: 2
- livenessProbe:
- tcpSocket:
-{{- if .Values.useNonPriviledgedPorts }}
- port: 8080
-{{- else }}
- port: 80
-{{- end }}
- failureThreshold: 3
- initialDelaySeconds: 10
- periodSeconds: 10
- successThreshold: 1
- timeoutSeconds: 2
+# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+
+kind: Deployment
+apiVersion: apps/v1
+metadata:
+ name: {{ template "apache.fullname" . }}
+ namespace: {{ .Release.Namespace }}
+ labels:
+ app: {{ template "apache.fullname" . }}
+spec:
+ replicas: 1
+ selector:
+ matchLabels:
+ app: {{ template "apache.fullname" . }}
+ template:
+ metadata:
+ labels:
+ app: {{ template "apache.fullname" . }}
+ spec:
+ serviceAccountName: {{ template "apache.serviceAccountName" . }}
+ terminationGracePeriodSeconds: 60
+{{- if or (and (.Values.virtualHostName) (.Values.customCert)) (.Values.persistentVolumeClaimName) }}
+ volumes:
+{{- end }}
+{{- if and (.Values.virtualHostName) (.Values.customCert) }}
+ - name: serving-cert
+ secret:
+ defaultMode: 420
+ secretName: {{ template "apache.fullname" . }}-cert
+{{- end }}
+{{- if .Values.persistentVolumeClaimName }}
+ - name: {{ template "apache.fullname" . }}
+ persistentVolumeClaim:
+ claimName: {{ .Values.persistentVolumeClaimName | quote }}
+{{- end }}
+ {{- if .Values.imagePullSecrets }}
+ imagePullSecrets:
+ {{ .Values.imagePullSecrets | toYaml }}
+ {{- end }}
+ containers:
+ - name: {{ template "apache.fullname" . }}
+ image: {{ .Values.image | quote }}
+ imagePullPolicy: {{ .Values.imagePullPolicy | quote }}
+{{- if or (and (.Values.virtualHostName) (.Values.customCert)) (.Values.persistentVolumeClaimName) }}
+ volumeMounts:
+{{- end }}
+{{- if and (.Values.virtualHostName) (.Values.customCert) }}
+ - name: serving-cert
+ mountPath: "/var/serving-cert"
+{{- end }}
+{{- if .Values.persistentVolumeClaimName }}
+ - name: {{ template "apache.fullname" . }}
+ mountPath: "/config"
+{{- end }}
+{{- if or (not (.Values.persistentVolumeClaimName)) (.Values.virtualHostName) }}
+ env:
+{{- end }}
+{{- if .Values.useNonPriviledgedPorts }}
+ - name: NonPriviledgedPorts
+ value: "true"
+{{- end }}
+{{- if not (.Values.persistentVolumeClaimName) }}
+ - name: WEBLOGIC_CLUSTER
+ value: "{{ .Values.domainUID | replace "_" "-" | lower }}-cluster-{{ .Values.clusterName | replace "_" "-" | lower }}:{{ .Values.managedServerPort }}"
+ - name: LOCATION
+ value: {{ .Values.location | quote }}
+ - name: WEBLOGIC_HOST
+ value: "{{ .Values.domainUID | replace "_" "-" | lower }}-{{ .Values.adminServerName | replace "_" "-" | lower }}"
+ - name: WEBLOGIC_PORT
+ value: {{ .Values.adminPort | quote }}
+{{- end }}
+{{- if .Values.virtualHostName }}
+ - name: VIRTUAL_HOST_NAME
+ value: {{ .Values.virtualHostName | quote }}
+{{- if .Values.customCert }}
+ - name: SSL_CERT_FILE
+ value: "/var/serving-cert/tls.crt"
+ - name: SSL_CERT_KEY_FILE
+ value: "/var/serving-cert/tls.key"
+{{- end }}
+{{- end }}
+ readinessProbe:
+ tcpSocket:
+{{- if .Values.useNonPriviledgedPorts }}
+ port: 8080
+{{- else }}
+ port: 80
+{{- end }}
+ failureThreshold: 1
+ initialDelaySeconds: 10
+ periodSeconds: 10
+ successThreshold: 1
+ timeoutSeconds: 2
+ livenessProbe:
+ tcpSocket:
+{{- if .Values.useNonPriviledgedPorts }}
+ port: 8080
+{{- else }}
+ port: 80
+{{- end }}
+ failureThreshold: 3
+ initialDelaySeconds: 10
+ periodSeconds: 10
+ successThreshold: 1
+ timeoutSeconds: 2
diff --git a/OracleWebCenterPortal/kubernetes/charts/apache-webtier/templates/secret.yaml b/OracleWebCenterPortal/kubernetes/charts/apache-webtier/templates/secret.yaml
old mode 100644
new mode 100755
index bb716f50b..a24fe801b
--- a/OracleWebCenterPortal/kubernetes/charts/apache-webtier/templates/secret.yaml
+++ b/OracleWebCenterPortal/kubernetes/charts/apache-webtier/templates/secret.yaml
@@ -1,14 +1,14 @@
-# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-
-{{ if .Values.customCert }}
-apiVersion: v1
-kind: Secret
-metadata:
- name: {{ template "apache.fullname" . }}-cert
- namespace: {{ .Release.Namespace | quote }}
-type: Opaque
-data:
- tls.crt: {{ .Values.customCert | quote }}
- tls.key: {{ .Values.customKey | quote }}
-{{ end }}
+# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+
+{{ if .Values.customCert }}
+apiVersion: v1
+kind: Secret
+metadata:
+ name: {{ template "apache.fullname" . }}-cert
+ namespace: {{ .Release.Namespace | quote }}
+type: Opaque
+data:
+ tls.crt: {{ .Values.customCert | quote }}
+ tls.key: {{ .Values.customKey | quote }}
+{{ end }}
diff --git a/OracleWebCenterPortal/kubernetes/charts/apache-webtier/templates/service-account.yaml b/OracleWebCenterPortal/kubernetes/charts/apache-webtier/templates/service-account.yaml
old mode 100644
new mode 100755
index f76d46aec..effad16b7
--- a/OracleWebCenterPortal/kubernetes/charts/apache-webtier/templates/service-account.yaml
+++ b/OracleWebCenterPortal/kubernetes/charts/apache-webtier/templates/service-account.yaml
@@ -1,8 +1,8 @@
-# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-
-apiVersion: v1
-kind: ServiceAccount
-metadata:
- name: {{ template "apache.serviceAccountName" . }}
- namespace: {{ .Release.Namespace | quote }}
+# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+
+apiVersion: v1
+kind: ServiceAccount
+metadata:
+ name: {{ template "apache.serviceAccountName" . }}
+ namespace: {{ .Release.Namespace | quote }}
diff --git a/OracleWebCenterPortal/kubernetes/charts/apache-webtier/templates/service.yaml b/OracleWebCenterPortal/kubernetes/charts/apache-webtier/templates/service.yaml
old mode 100644
new mode 100755
index c8b8089eb..b26443fc2
--- a/OracleWebCenterPortal/kubernetes/charts/apache-webtier/templates/service.yaml
+++ b/OracleWebCenterPortal/kubernetes/charts/apache-webtier/templates/service.yaml
@@ -1,28 +1,28 @@
-# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-
-apiVersion: v1
-kind: Service
-metadata:
- name: {{ template "apache.fullname" . }}
- namespace: {{ .Release.Namespace | quote }}
-spec:
- type: NodePort
- selector:
- app: {{ template "apache.fullname" . }}
- ports:
-{{- if .Values.useNonPriviledgedPorts }}
- - port: 8080
-{{- else}}
- - port: 80
-{{- end }}
- nodePort: {{ .Values.httpNodePort }}
- name: http
-{{- if .Values.virtualHostName }}
- - port: 4433
-{{- else }}
- - port: 443
-{{- end }}
- nodePort: {{ .Values.httpsNodePort }}
- name: https
-
+# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+
+apiVersion: v1
+kind: Service
+metadata:
+ name: {{ template "apache.fullname" . }}
+ namespace: {{ .Release.Namespace | quote }}
+spec:
+ type: NodePort
+ selector:
+ app: {{ template "apache.fullname" . }}
+ ports:
+{{- if .Values.useNonPriviledgedPorts }}
+ - port: 8080
+{{- else}}
+ - port: 80
+{{- end }}
+ nodePort: {{ .Values.httpNodePort }}
+ name: http
+{{- if .Values.virtualHostName }}
+ - port: 4433
+{{- else }}
+ - port: 443
+{{- end }}
+ nodePort: {{ .Values.httpsNodePort }}
+ name: https
+
diff --git a/OracleWebCenterPortal/kubernetes/charts/apache-webtier/values.yaml b/OracleWebCenterPortal/kubernetes/charts/apache-webtier/values.yaml
old mode 100644
new mode 100755
index ee0a8a815..3e891a94b
--- a/OracleWebCenterPortal/kubernetes/charts/apache-webtier/values.yaml
+++ b/OracleWebCenterPortal/kubernetes/charts/apache-webtier/values.yaml
@@ -1,79 +1,79 @@
-# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-
-# Apache webtier docker image
-image: "oracle/apache:12.2.1.3"
-
-# imagePullPolicy specifies the image pull policy for the apache webiter docker image
-imagePullPolicy: "IfNotPresent"
-
-# imagePullSecrets contains an optional list of Kubernetes secrets, that are needed
-# to access the registry containing the apache webtier image.
-# If no secrets are required, then omit this property.
-#
-# Example : a secret is needed, and has been stored in 'my-apache-webtier-secret'
-#
-# imagePullSecrets:
-# - name: my-apache-webtier-secret
-#
-# imagePullSecrets:
-# - name:
-
-# Volume path for Apache webtier. By default, it is empty, which causes the volume
-# mount be disabled and, therefore, the built-in Apache plugin config be used.
-# Use this to provide your own Apache webtier configuration as needed; simply define this
-# path and put your own custom_mod_wl_apache.conf file under this path.
-persistentVolumeClaimName:
-
-# Boolean indicating if RBAC resources should be created
-createRBAC: true
-
-# NodePort to expose for http access
-httpNodePort: 30305
-
-# NodePort to expose for https access
-httpsNodePort: 30443
-
-# The VirtualHostName of the Apache HTTP server. It is used to enable custom SSL configuration.
-# If it is set, the Apache HTTP Server is configured to listen to port 4433 for SSL traffic.
-virtualHostName:
-
-# The customer supplied certificate to use for Apache webtier SSL configuration.
-# The value must be a string containing a base64 encoded certificate.
-# If 'virtualHostName' is set, the custom certificate and private key are not provided,
-# the default built-in auto-generated sample certificate and private key in the apache image will be used.
-# This parameter is ignored if 'virtualHostName' is not set.
-customCert:
-
-# The customer supplied private key to use for Apache webtier SSL configuration.
-# The value must be a string containing a base64 encoded key.
-# If 'virtualHostName' is set, the custom certificate and private key are not provided,
-# the default built-in auto-generated sample certificate and private key in the apache image will be used.
-# This parameter is ignored if 'virtualHostName' is not set.
-customKey:
-
-# Unique ID identifying a domain.
-# This ID must not contain an underscore ("_"), and must be lowercase and unique across all domains in a Kubernetes cluster.
-domainUID: "domain1"
-
-# Cluster name
-clusterName: "cluster-1"
-
-# Name of the admin server
-adminServerName: "admin-server"
-
-# Port number for admin server
-adminPort: 7001
-
-# Port number for each managed server
-managedServerPort: 8001
-
-# Prepath for all application deployed on WebLogic cluster.
-# For example, if it is set to '/weblogic', all applications deployed on the cluster can be accessed via
-# http://myhost:myport/weblogic/application_end_url
-# where 'myhost' is the IP of the machine that runs the Apache web tier, and
-# 'myport' is the port that the Apache web tier is publicly exposed to.
-location: "/weblogic"
-
-# Use non privileged port 8080 to listen. If set to false, default privileged port 80 will be used.
-useNonPriviledgedPorts: false
+# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+
+# Apache webtier docker image
+image: "oracle/apache:12.2.1.3"
+
+# imagePullPolicy specifies the image pull policy for the apache webiter docker image
+imagePullPolicy: "IfNotPresent"
+
+# imagePullSecrets contains an optional list of Kubernetes secrets, that are needed
+# to access the registry containing the apache webtier image.
+# If no secrets are required, then omit this property.
+#
+# Example : a secret is needed, and has been stored in 'my-apache-webtier-secret'
+#
+# imagePullSecrets:
+# - name: my-apache-webtier-secret
+#
+# imagePullSecrets:
+# - name:
+
+# Volume path for Apache webtier. By default, it is empty, which causes the volume
+# mount be disabled and, therefore, the built-in Apache plugin config be used.
+# Use this to provide your own Apache webtier configuration as needed; simply define this
+# path and put your own custom_mod_wl_apache.conf file under this path.
+persistentVolumeClaimName:
+
+# Boolean indicating if RBAC resources should be created
+createRBAC: true
+
+# NodePort to expose for http access
+httpNodePort: 30305
+
+# NodePort to expose for https access
+httpsNodePort: 30443
+
+# The VirtualHostName of the Apache HTTP server. It is used to enable custom SSL configuration.
+# If it is set, the Apache HTTP Server is configured to listen to port 4433 for SSL traffic.
+virtualHostName:
+
+# The customer supplied certificate to use for Apache webtier SSL configuration.
+# The value must be a string containing a base64 encoded certificate.
+# If 'virtualHostName' is set, the custom certificate and private key are not provided,
+# the default built-in auto-generated sample certificate and private key in the apache image will be used.
+# This parameter is ignored if 'virtualHostName' is not set.
+customCert:
+
+# The customer supplied private key to use for Apache webtier SSL configuration.
+# The value must be a string containing a base64 encoded key.
+# If 'virtualHostName' is set, the custom certificate and private key are not provided,
+# the default built-in auto-generated sample certificate and private key in the apache image will be used.
+# This parameter is ignored if 'virtualHostName' is not set.
+customKey:
+
+# Unique ID identifying a domain.
+# This ID must not contain an underscore ("_"), and must be lowercase and unique across all domains in a Kubernetes cluster.
+domainUID: "domain1"
+
+# Cluster name
+clusterName: "cluster-1"
+
+# Name of the admin server
+adminServerName: "admin-server"
+
+# Port number for admin server
+adminPort: 7001
+
+# Port number for each managed server
+managedServerPort: 8001
+
+# Prepath for all application deployed on WebLogic cluster.
+# For example, if it is set to '/weblogic', all applications deployed on the cluster can be accessed via
+# http://myhost:myport/weblogic/application_end_url
+# where 'myhost' is the IP of the machine that runs the Apache web tier, and
+# 'myport' is the port that the Apache web tier is publicly exposed to.
+location: "/weblogic"
+
+# Use non privileged port 8080 to listen. If set to false, default privileged port 80 will be used.
+useNonPriviledgedPorts: false
diff --git a/OracleWebCenterPortal/kubernetes/charts/ingress-per-domain/Chart.yaml b/OracleWebCenterPortal/kubernetes/charts/ingress-per-domain/Chart.yaml
old mode 100644
new mode 100755
diff --git a/OracleWebCenterPortal/kubernetes/charts/ingress-per-domain/templates/nginx-ingress-k8s1.19.yaml b/OracleWebCenterPortal/kubernetes/charts/ingress-per-domain/templates/nginx-ingress-k8s1.19.yaml
old mode 100644
new mode 100755
index ea79521df..f27636f31
--- a/OracleWebCenterPortal/kubernetes/charts/ingress-per-domain/templates/nginx-ingress-k8s1.19.yaml
+++ b/OracleWebCenterPortal/kubernetes/charts/ingress-per-domain/templates/nginx-ingress-k8s1.19.yaml
@@ -1,101 +1,101 @@
-# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-#
-{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
-{{- if eq .Values.type "NGINX" }}
-{{- if or (eq .Values.sslType "NONSSL") (eq .Values.sslType "SSL") }}
----
-apiVersion: networking.k8s.io/v1
-kind: Ingress
-metadata:
- name: {{ .Values.wlsDomain.domainUID }}-nginx
- namespace: {{ .Release.Namespace }}
- annotations:
- kubernetes.io/ingress.class: 'nginx'
- nginx.ingress.kubernetes.io/proxy-connect-timeout: '{{ .Values.nginx.connectTimeout }}'
- nginx.ingress.kubernetes.io/proxy-read-timeout: '{{ .Values.nginx.readTimeout }}'
- nginx.ingress.kubernetes.io/proxy-send-timeout: '{{ .Values.nginx.sendTimeout }}'
- nginx.ingress.kubernetes.io/affinity: 'cookie'
- nginx.ingress.kubernetes.io/session-cookie-name: 'stickyid'
- nginx.ingress.kubernetes.io/session-cookie-expires: '{{ .Values.nginx.cookieExpires }}'
- nginx.ingress.kubernetes.io/session-cookie-max-age: '{{ .Values.nginx.cookieMaxAge }}'
- nginx.ingress.kubernetes.io/ssl-redirect: 'false'
- nginx.ingress.kubernetes.io/affinity-mode: 'persistent'
-{{- if eq .Values.sslType "SSL" }}
- nginx.ingress.kubernetes.io/configuration-snippet: |
- more_set_input_headers "X-Forwarded-Proto: https";
- more_set_input_headers "WL-Proxy-SSL: true";
- nginx.ingress.kubernetes.io/ingress.allow-http: 'false'
-{{- end }}
-spec:
- rules:
- - host: '{{ .Values.nginx.hostname }}'
- http:
- paths:
- - path: /webcenter
- pathType: ImplementationSpecific
- backend:
- service:
- name: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpClusterName | lower | replace "_" "-" }}'
- port:
- number: {{ .Values.wlsDomain.wcpManagedServerPort }}
- - path: /console
- pathType: ImplementationSpecific
- backend:
- service:
- name: '{{ .Values.wlsDomain.domainUID }}-{{ .Values.wlsDomain.adminServerName | lower | replace "_" "-" }}'
- port:
- number: {{ .Values.wlsDomain.adminServerPort }}
- - path: /rsscrawl
- pathType: ImplementationSpecific
- backend:
- service:
- name: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpClusterName | lower | replace "_" "-" }}'
- port:
- number: {{ .Values.wlsDomain.wcpManagedServerPort }}
- - path: /webcenterhelp
- pathType: ImplementationSpecific
- backend:
- service:
- name: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpClusterName | lower | replace "_" "-" }}'
- port:
- number: {{ .Values.wlsDomain.wcpManagedServerPort }}
- - path: /rest
- pathType: ImplementationSpecific
- backend:
- service:
- name: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpClusterName | lower | replace "_" "-" }}'
- port:
- number: {{ .Values.wlsDomain.wcpManagedServerPort }}
- - path: /em
- pathType: ImplementationSpecific
- backend:
- service:
- name: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpClusterName | lower | replace "_" "-" }}'
- port:
- number: {{ .Values.wlsDomain.wcpManagedServerPort }}
- - path: /wsrp-tools
- pathType: ImplementationSpecific
- backend:
- service:
- name: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpPortletClusterName | lower | replace "_" "-" }}'
- port:
- number: {{ .Values.wlsDomain.wcpPortletManagedServerPort }}
- - path: /portalTools
- pathType: ImplementationSpecific
- backend:
- service:
- name: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpPortletClusterName | lower | replace "_" "-" }}'
- port:
- number: {{ .Values.wlsDomain.wcpPortletManagedServerPort }}
-{{- if eq .Values.sslType "SSL" }}
- tls:
- - hosts:
- - '{{ .Values.nginx.hostname }}'
- secretName: {{ .Values.wlsDomain.domainUID }}-tls-cert
-{{- end }}
-
-{{- end }}
-{{- end }}
-{{- end }}
-
+# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+#
+{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
+{{- if eq .Values.type "NGINX" }}
+{{- if or (eq .Values.sslType "NONSSL") (eq .Values.sslType "SSL") }}
+---
+apiVersion: networking.k8s.io/v1
+kind: Ingress
+metadata:
+ name: {{ .Values.wlsDomain.domainUID }}-nginx
+ namespace: {{ .Release.Namespace }}
+ annotations:
+ kubernetes.io/ingress.class: 'nginx'
+ nginx.ingress.kubernetes.io/proxy-connect-timeout: '{{ .Values.nginx.connectTimeout }}'
+ nginx.ingress.kubernetes.io/proxy-read-timeout: '{{ .Values.nginx.readTimeout }}'
+ nginx.ingress.kubernetes.io/proxy-send-timeout: '{{ .Values.nginx.sendTimeout }}'
+ nginx.ingress.kubernetes.io/affinity: 'cookie'
+ nginx.ingress.kubernetes.io/session-cookie-name: 'stickyid'
+ nginx.ingress.kubernetes.io/session-cookie-expires: '{{ .Values.nginx.cookieExpires }}'
+ nginx.ingress.kubernetes.io/session-cookie-max-age: '{{ .Values.nginx.cookieMaxAge }}'
+ nginx.ingress.kubernetes.io/ssl-redirect: 'false'
+ nginx.ingress.kubernetes.io/affinity-mode: 'persistent'
+{{- if eq .Values.sslType "SSL" }}
+ nginx.ingress.kubernetes.io/configuration-snippet: |
+ more_set_input_headers "X-Forwarded-Proto: https";
+ more_set_input_headers "WL-Proxy-SSL: true";
+ nginx.ingress.kubernetes.io/ingress.allow-http: 'false'
+{{- end }}
+spec:
+ rules:
+ - host: '{{ .Values.nginx.hostname }}'
+ http:
+ paths:
+ - path: /webcenter
+ pathType: ImplementationSpecific
+ backend:
+ service:
+ name: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpClusterName | lower | replace "_" "-" }}'
+ port:
+ number: {{ .Values.wlsDomain.wcpManagedServerPort }}
+ - path: /console
+ pathType: ImplementationSpecific
+ backend:
+ service:
+ name: '{{ .Values.wlsDomain.domainUID }}-{{ .Values.wlsDomain.adminServerName | lower | replace "_" "-" }}'
+ port:
+ number: {{ .Values.wlsDomain.adminServerPort }}
+ - path: /rsscrawl
+ pathType: ImplementationSpecific
+ backend:
+ service:
+ name: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpClusterName | lower | replace "_" "-" }}'
+ port:
+ number: {{ .Values.wlsDomain.wcpManagedServerPort }}
+ - path: /webcenterhelp
+ pathType: ImplementationSpecific
+ backend:
+ service:
+ name: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpClusterName | lower | replace "_" "-" }}'
+ port:
+ number: {{ .Values.wlsDomain.wcpManagedServerPort }}
+ - path: /rest
+ pathType: ImplementationSpecific
+ backend:
+ service:
+ name: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpClusterName | lower | replace "_" "-" }}'
+ port:
+ number: {{ .Values.wlsDomain.wcpManagedServerPort }}
+ - path: /em
+ pathType: ImplementationSpecific
+ backend:
+ service:
+ name: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpClusterName | lower | replace "_" "-" }}'
+ port:
+ number: {{ .Values.wlsDomain.wcpManagedServerPort }}
+ - path: /wsrp-tools
+ pathType: ImplementationSpecific
+ backend:
+ service:
+ name: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpPortletClusterName | lower | replace "_" "-" }}'
+ port:
+ number: {{ .Values.wlsDomain.wcpPortletManagedServerPort }}
+ - path: /portalTools
+ pathType: ImplementationSpecific
+ backend:
+ service:
+ name: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpPortletClusterName | lower | replace "_" "-" }}'
+ port:
+ number: {{ .Values.wlsDomain.wcpPortletManagedServerPort }}
+{{- if eq .Values.sslType "SSL" }}
+ tls:
+ - hosts:
+ - '{{ .Values.nginx.hostname }}'
+ secretName: {{ .Values.wlsDomain.domainUID }}-tls-cert
+{{- end }}
+
+{{- end }}
+{{- end }}
+{{- end }}
+
diff --git a/OracleWebCenterPortal/kubernetes/charts/ingress-per-domain/templates/nginx-ingress.yaml b/OracleWebCenterPortal/kubernetes/charts/ingress-per-domain/templates/nginx-ingress.yaml
old mode 100644
new mode 100755
index 41917e342..b4f3dca1f
--- a/OracleWebCenterPortal/kubernetes/charts/ingress-per-domain/templates/nginx-ingress.yaml
+++ b/OracleWebCenterPortal/kubernetes/charts/ingress-per-domain/templates/nginx-ingress.yaml
@@ -1,77 +1,77 @@
-# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-#
-{{- if semverCompare "<1.19-0" .Capabilities.KubeVersion.GitVersion -}}
-{{- if eq .Values.type "NGINX" }}
-{{- if or (eq .Values.sslType "NONSSL") (eq .Values.sslType "SSL") }}
----
-apiVersion: extensions/v1beta1
-kind: Ingress
-metadata:
- name: {{ .Values.wlsDomain.domainUID }}-nginx
- namespace: {{ .Release.Namespace }}
- annotations:
- kubernetes.io/ingress.class: 'nginx'
- nginx.ingress.kubernetes.io/proxy-connect-timeout: '{{ .Values.nginx.connectTimeout }}'
- nginx.ingress.kubernetes.io/proxy-read-timeout: '{{ .Values.nginx.readTimeout }}'
- nginx.ingress.kubernetes.io/proxy-send-timeout: '{{ .Values.nginx.sendTimeout }}'
- nginx.ingress.kubernetes.io/affinity: 'cookie'
- nginx.ingress.kubernetes.io/session-cookie-name: 'stickyid'
- nginx.ingress.kubernetes.io/session-cookie-expires: '{{ .Values.nginx.cookieExpires }}'
- nginx.ingress.kubernetes.io/session-cookie-max-age: '{{ .Values.nginx.cookieMaxAge }}'
- nginx.ingress.kubernetes.io/ssl-redirect: 'false'
- nginx.ingress.kubernetes.io/affinity-mode: 'persistent'
-{{- if eq .Values.sslType "SSL" }}
- nginx.ingress.kubernetes.io/configuration-snippet: |
- more_set_input_headers "X-Forwarded-Proto: https";
- more_set_input_headers "WL-Proxy-SSL: true";
- nginx.ingress.kubernetes.io/ingress.allow-http: 'false'
-{{- end }}
-spec:
- rules:
- - host: '{{ .Values.nginx.hostname }}'
- http:
- paths:
- - path: /webcenter
- backend:
- serviceName: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpClusterName | lower | replace "_" "-" }}'
- servicePort: {{ .Values.wlsDomain.wcpManagedServerPort }}
- - path: /console
- backend:
- serviceName: '{{ .Values.wlsDomain.domainUID }}-{{ .Values.wlsDomain.adminServerName | lower | replace "_" "-" }}'
- servicePort: {{ .Values.wlsDomain.adminServerPort }}
- - path: /rsscrawl
- backend:
- serviceName: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpClusterName | lower | replace "_" "-" }}'
- servicePort: {{ .Values.wlsDomain.wcpManagedServerPort }}
- - path: /webcenterhelp
- backend:
- serviceName: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpClusterName | lower | replace "_" "-" }}'
- servicePort: {{ .Values.wlsDomain.wcpManagedServerPort }}
- - path: /rest
- backend:
- serviceName: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpClusterName | lower | replace "_" "-" }}'
- servicePort: {{ .Values.wlsDomain.wcpManagedServerPort }}
- - path: /em
- backend:
- serviceName: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpClusterName | lower | replace "_" "-" }}'
- servicePort: {{ .Values.wlsDomain.wcpManagedServerPort }}
- - path: /wsrp-tools
- backend:
- serviceName: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpPortletClusterName | lower | replace "_" "-" }}'
- servicePort: {{ .Values.wlsDomain.wcpPortletManagedServerPort }}
- - path: /portalTools
- backend:
- serviceName: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpPortletClusterName | lower | replace "_" "-" }}'
- servicePort: {{ .Values.wlsDomain.wcpPortletManagedServerPort }}
-{{- if eq .Values.sslType "SSL" }}
- tls:
- - hosts:
- - '{{ .Values.nginx.hostname }}'
- secretName: {{ .Values.wlsDomain.domainUID }}-tls-cert
-{{- end }}
-
-{{- end }}
-{{- end }}
-{{- end }}
-
+# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+#
+{{- if semverCompare "<1.19-0" .Capabilities.KubeVersion.GitVersion -}}
+{{- if eq .Values.type "NGINX" }}
+{{- if or (eq .Values.sslType "NONSSL") (eq .Values.sslType "SSL") }}
+---
+apiVersion: extensions/v1beta1
+kind: Ingress
+metadata:
+ name: {{ .Values.wlsDomain.domainUID }}-nginx
+ namespace: {{ .Release.Namespace }}
+ annotations:
+ kubernetes.io/ingress.class: 'nginx'
+ nginx.ingress.kubernetes.io/proxy-connect-timeout: '{{ .Values.nginx.connectTimeout }}'
+ nginx.ingress.kubernetes.io/proxy-read-timeout: '{{ .Values.nginx.readTimeout }}'
+ nginx.ingress.kubernetes.io/proxy-send-timeout: '{{ .Values.nginx.sendTimeout }}'
+ nginx.ingress.kubernetes.io/affinity: 'cookie'
+ nginx.ingress.kubernetes.io/session-cookie-name: 'stickyid'
+ nginx.ingress.kubernetes.io/session-cookie-expires: '{{ .Values.nginx.cookieExpires }}'
+ nginx.ingress.kubernetes.io/session-cookie-max-age: '{{ .Values.nginx.cookieMaxAge }}'
+ nginx.ingress.kubernetes.io/ssl-redirect: 'false'
+ nginx.ingress.kubernetes.io/affinity-mode: 'persistent'
+{{- if eq .Values.sslType "SSL" }}
+ nginx.ingress.kubernetes.io/configuration-snippet: |
+ more_set_input_headers "X-Forwarded-Proto: https";
+ more_set_input_headers "WL-Proxy-SSL: true";
+ nginx.ingress.kubernetes.io/ingress.allow-http: 'false'
+{{- end }}
+spec:
+ rules:
+ - host: '{{ .Values.nginx.hostname }}'
+ http:
+ paths:
+ - path: /webcenter
+ backend:
+ serviceName: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpClusterName | lower | replace "_" "-" }}'
+ servicePort: {{ .Values.wlsDomain.wcpManagedServerPort }}
+ - path: /console
+ backend:
+ serviceName: '{{ .Values.wlsDomain.domainUID }}-{{ .Values.wlsDomain.adminServerName | lower | replace "_" "-" }}'
+ servicePort: {{ .Values.wlsDomain.adminServerPort }}
+ - path: /rsscrawl
+ backend:
+ serviceName: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpClusterName | lower | replace "_" "-" }}'
+ servicePort: {{ .Values.wlsDomain.wcpManagedServerPort }}
+ - path: /webcenterhelp
+ backend:
+ serviceName: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpClusterName | lower | replace "_" "-" }}'
+ servicePort: {{ .Values.wlsDomain.wcpManagedServerPort }}
+ - path: /rest
+ backend:
+ serviceName: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpClusterName | lower | replace "_" "-" }}'
+ servicePort: {{ .Values.wlsDomain.wcpManagedServerPort }}
+ - path: /em
+ backend:
+ serviceName: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpClusterName | lower | replace "_" "-" }}'
+ servicePort: {{ .Values.wlsDomain.wcpManagedServerPort }}
+ - path: /wsrp-tools
+ backend:
+ serviceName: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpPortletClusterName | lower | replace "_" "-" }}'
+ servicePort: {{ .Values.wlsDomain.wcpPortletManagedServerPort }}
+ - path: /portalTools
+ backend:
+ serviceName: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpPortletClusterName | lower | replace "_" "-" }}'
+ servicePort: {{ .Values.wlsDomain.wcpPortletManagedServerPort }}
+{{- if eq .Values.sslType "SSL" }}
+ tls:
+ - hosts:
+ - '{{ .Values.nginx.hostname }}'
+ secretName: {{ .Values.wlsDomain.domainUID }}-tls-cert
+{{- end }}
+
+{{- end }}
+{{- end }}
+{{- end }}
+
diff --git a/OracleWebCenterPortal/kubernetes/charts/ingress-per-domain/templates/traefik-ingress-k8s1.19.yaml b/OracleWebCenterPortal/kubernetes/charts/ingress-per-domain/templates/traefik-ingress-k8s1.19.yaml
old mode 100644
new mode 100755
index 1965ccd59..e44fb4168
--- a/OracleWebCenterPortal/kubernetes/charts/ingress-per-domain/templates/traefik-ingress-k8s1.19.yaml
+++ b/OracleWebCenterPortal/kubernetes/charts/ingress-per-domain/templates/traefik-ingress-k8s1.19.yaml
@@ -1,110 +1,110 @@
-# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-#
-{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
-{{- if eq .Values.type "TRAEFIK" }}
-{{- if or (eq .Values.sslType "NONSSL") (eq .Values.sslType "SSL") }}
----
-apiVersion: networking.k8s.io/v1
-kind: Ingress
-metadata:
- name: {{ .Values.wlsDomain.domainUID }}-traefik
- namespace: {{ .Release.Namespace }}
- labels:
- weblogic.resourceVersion: domain-v2
- annotations:
- kubernetes.io/ingress.class: 'traefik'
-{{- if eq .Values.sslType "SSL" }}
- traefik.ingress.kubernetes.io/router.entrypoints: 'websecure'
- traefik.ingress.kubernetes.io/router.tls: 'true'
- traefik.ingress.kubernetes.io/router.middlewares: '{{ .Release.Namespace}}-wls-proxy-ssl@kubernetescrd'
-{{- end }}
-spec:
- rules:
- - host: '{{ .Values.traefik.hostname }}'
- http:
- paths:
- - path: /webcenter
- pathType: ImplementationSpecific
- backend:
- service:
- name: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpClusterName | lower | replace "_" "-" }}'
- port:
- number: {{ .Values.wlsDomain.wcpManagedServerPort }}
- - path: /console
- pathType: ImplementationSpecific
- backend:
- service:
- name: '{{ .Values.wlsDomain.domainUID }}-{{ .Values.wlsDomain.adminServerName | lower | replace "_" "-" }}'
- port:
- number: {{ .Values.wlsDomain.adminServerPort }}
- - path: /rsscrawl
- pathType: ImplementationSpecific
- backend:
- service:
- name: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpClusterName | lower | replace "_" "-" }}'
- port:
- number: {{ .Values.wlsDomain.wcpManagedServerPort }}
- - path: /webcenterhelp
- pathType: ImplementationSpecific
- backend:
- service:
- name: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpClusterName | lower | replace "_" "-" }}'
- port:
- number: {{ .Values.wlsDomain.wcpManagedServerPort }}
- - path: /rest
- pathType: ImplementationSpecific
- backend:
- service:
- name: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpClusterName | lower | replace "_" "-" }}'
- port:
- number: {{ .Values.wlsDomain.wcpManagedServerPort }}
- - path: /em
- pathType: ImplementationSpecific
- backend:
- service:
- name: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpClusterName | lower | replace "_" "-" }}'
- port:
- number: {{ .Values.wlsDomain.wcpManagedServerPort }}
- - path: /wsrp-tools
- pathType: ImplementationSpecific
- backend:
- service:
- name: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpPortletClusterName | lower | replace "_" "-" }}'
- port:
- number: {{ .Values.wlsDomain.wcpPortletManagedServerPort }}
- - path: /portalTools
- pathType: ImplementationSpecific
- backend:
- service:
- name: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpPortletClusterName | lower | replace "_" "-" }}'
- port:
- number: {{ .Values.wlsDomain.wcpPortletManagedServerPort }}
-{{- if eq .Values.sslType "SSL" }}
- tls:
- - hosts:
- - '{{ .Values.traefik.hostname }}'
- secretName: {{ .Values.wlsDomain.domainUID }}-tls-cert
-{{- end }}
----
-#Create Traefik Middleware custom resource for SSL Termination
-{{- if eq .Values.sslType "SSL" }}
-apiVersion: traefik.containo.us/v1alpha1
-kind: Middleware
-metadata:
- name: wls-proxy-ssl
- namespace: {{ .Release.Namespace }}
-spec:
- headers:
- customRequestHeaders:
- X-Custom-Request-Header: ""
- X-Forwarded-For: ""
- WL-Proxy-Client-IP: ""
- WL-Proxy-SSL: ""
- WL-Proxy-SSL: "true"
- sslRedirect: true
-{{- end }}
-
-{{- end }}
-{{- end }}
-{{- end }}
+# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+#
+{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
+{{- if eq .Values.type "TRAEFIK" }}
+{{- if or (eq .Values.sslType "NONSSL") (eq .Values.sslType "SSL") }}
+---
+apiVersion: networking.k8s.io/v1
+kind: Ingress
+metadata:
+ name: {{ .Values.wlsDomain.domainUID }}-traefik
+ namespace: {{ .Release.Namespace }}
+ labels:
+ weblogic.resourceVersion: domain-v2
+ annotations:
+ kubernetes.io/ingress.class: 'traefik'
+{{- if eq .Values.sslType "SSL" }}
+ traefik.ingress.kubernetes.io/router.entrypoints: 'websecure'
+ traefik.ingress.kubernetes.io/router.tls: 'true'
+ traefik.ingress.kubernetes.io/router.middlewares: '{{ .Release.Namespace}}-wls-proxy-ssl@kubernetescrd'
+{{- end }}
+spec:
+ rules:
+ - host: '{{ .Values.traefik.hostname }}'
+ http:
+ paths:
+ - path: /webcenter
+ pathType: ImplementationSpecific
+ backend:
+ service:
+ name: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpClusterName | lower | replace "_" "-" }}'
+ port:
+ number: {{ .Values.wlsDomain.wcpManagedServerPort }}
+ - path: /console
+ pathType: ImplementationSpecific
+ backend:
+ service:
+ name: '{{ .Values.wlsDomain.domainUID }}-{{ .Values.wlsDomain.adminServerName | lower | replace "_" "-" }}'
+ port:
+ number: {{ .Values.wlsDomain.adminServerPort }}
+ - path: /rsscrawl
+ pathType: ImplementationSpecific
+ backend:
+ service:
+ name: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpClusterName | lower | replace "_" "-" }}'
+ port:
+ number: {{ .Values.wlsDomain.wcpManagedServerPort }}
+ - path: /webcenterhelp
+ pathType: ImplementationSpecific
+ backend:
+ service:
+ name: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpClusterName | lower | replace "_" "-" }}'
+ port:
+ number: {{ .Values.wlsDomain.wcpManagedServerPort }}
+ - path: /rest
+ pathType: ImplementationSpecific
+ backend:
+ service:
+ name: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpClusterName | lower | replace "_" "-" }}'
+ port:
+ number: {{ .Values.wlsDomain.wcpManagedServerPort }}
+ - path: /em
+ pathType: ImplementationSpecific
+ backend:
+ service:
+ name: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpClusterName | lower | replace "_" "-" }}'
+ port:
+ number: {{ .Values.wlsDomain.wcpManagedServerPort }}
+ - path: /wsrp-tools
+ pathType: ImplementationSpecific
+ backend:
+ service:
+ name: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpPortletClusterName | lower | replace "_" "-" }}'
+ port:
+ number: {{ .Values.wlsDomain.wcpPortletManagedServerPort }}
+ - path: /portalTools
+ pathType: ImplementationSpecific
+ backend:
+ service:
+ name: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpPortletClusterName | lower | replace "_" "-" }}'
+ port:
+ number: {{ .Values.wlsDomain.wcpPortletManagedServerPort }}
+{{- if eq .Values.sslType "SSL" }}
+ tls:
+ - hosts:
+ - '{{ .Values.traefik.hostname }}'
+ secretName: {{ .Values.wlsDomain.domainUID }}-tls-cert
+{{- end }}
+---
+#Create Traefik Middleware custom resource for SSL Termination
+{{- if eq .Values.sslType "SSL" }}
+apiVersion: traefik.containo.us/v1alpha1
+kind: Middleware
+metadata:
+ name: wls-proxy-ssl
+ namespace: {{ .Release.Namespace }}
+spec:
+ headers:
+ customRequestHeaders:
+ X-Custom-Request-Header: ""
+ X-Forwarded-For: ""
+ WL-Proxy-Client-IP: ""
+ WL-Proxy-SSL: ""
+ WL-Proxy-SSL: "true"
+ sslRedirect: true
+{{- end }}
+
+{{- end }}
+{{- end }}
+{{- end }}
diff --git a/OracleWebCenterPortal/kubernetes/charts/ingress-per-domain/templates/traefik-ingress.yaml b/OracleWebCenterPortal/kubernetes/charts/ingress-per-domain/templates/traefik-ingress.yaml
old mode 100644
new mode 100755
index 3a4df423c..385acc5fb
--- a/OracleWebCenterPortal/kubernetes/charts/ingress-per-domain/templates/traefik-ingress.yaml
+++ b/OracleWebCenterPortal/kubernetes/charts/ingress-per-domain/templates/traefik-ingress.yaml
@@ -1,87 +1,87 @@
-# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-#
-{{- if semverCompare "<1.19-0" .Capabilities.KubeVersion.GitVersion -}}
-{{- if eq .Values.type "TRAEFIK" }}
-{{- if or (eq .Values.sslType "NONSSL") (eq .Values.sslType "SSL") }}
----
-apiVersion: extensions/v1beta1
-kind: Ingress
-metadata:
- name: {{ .Values.wlsDomain.domainUID }}-traefik
- namespace: {{ .Release.Namespace }}
- labels:
- weblogic.resourceVersion: domain-v2
- annotations:
- kubernetes.io/ingress.class: 'traefik'
-{{- if eq .Values.sslType "SSL" }}
- traefik.ingress.kubernetes.io/router.entrypoints: 'websecure'
- traefik.ingress.kubernetes.io/router.tls: 'true'
- traefik.ingress.kubernetes.io/router.middlewares: '{{ .Release.Namespace}}-wls-proxy-ssl@kubernetescrd'
-{{- end }}
-spec:
- rules:
- - host: '{{ .Values.traefik.hostname }}'
- http:
- paths:
- - path: /webcenter
- backend:
- serviceName: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpClusterName | lower | replace "_" "-" }}'
- servicePort: {{ .Values.wlsDomain.wcpManagedServerPort }}
- - path: /console
- backend:
- serviceName: '{{ .Values.wlsDomain.domainUID }}-{{ .Values.wlsDomain.adminServerName | lower | replace "_" "-" }}'
- servicePort: {{ .Values.wlsDomain.adminServerPort }}
- - path: /rsscrawl
- backend:
- serviceName: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpClusterName | lower | replace "_" "-" }}'
- servicePort: {{ .Values.wlsDomain.wcpManagedServerPort }}
- - path: /webcenterhelp
- backend:
- serviceName: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpClusterName | lower | replace "_" "-" }}'
- servicePort: {{ .Values.wlsDomain.wcpManagedServerPort }}
- - path: /rest
- backend:
- serviceName: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpClusterName | lower | replace "_" "-" }}'
- servicePort: {{ .Values.wlsDomain.wcpManagedServerPort }}
- - path: /em
- backend:
- serviceName: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpClusterName | lower | replace "_" "-" }}'
- servicePort: {{ .Values.wlsDomain.wcpManagedServerPort }}
- - path: /wsrp-tools
- backend:
- serviceName: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpPortletClusterName | lower | replace "_" "-" }}'
- servicePort: {{ .Values.wlsDomain.wcpPortletManagedServerPort }}
- - path: /portalTools
- backend:
- serviceName: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpPortletClusterName | lower | replace "_" "-" }}'
- servicePort: {{ .Values.wlsDomain.wcpPortletManagedServerPort }}
-{{- if eq .Values.sslType "SSL" }}
- tls:
- - hosts:
- - '{{ .Values.traefik.hostname }}'
- secretName: {{ .Values.wlsDomain.domainUID }}-tls-cert
-{{- end }}
----
-#Create Traefik Middleware custom resource for SSL Termination
-{{- if eq .Values.sslType "SSL" }}
-apiVersion: traefik.containo.us/v1alpha1
-kind: Middleware
-metadata:
- name: wls-proxy-ssl
- namespace: {{ .Release.Namespace }}
-spec:
- headers:
- customRequestHeaders:
- X-Custom-Request-Header: ""
- X-Forwarded-For: ""
- WL-Proxy-Client-IP: ""
- WL-Proxy-SSL: ""
- WL-Proxy-SSL: "true"
- sslRedirect: true
-{{- end }}
-
-{{- end }}
-{{- end }}
-{{- end }}
-
+# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+#
+{{- if semverCompare "<1.19-0" .Capabilities.KubeVersion.GitVersion -}}
+{{- if eq .Values.type "TRAEFIK" }}
+{{- if or (eq .Values.sslType "NONSSL") (eq .Values.sslType "SSL") }}
+---
+apiVersion: extensions/v1beta1
+kind: Ingress
+metadata:
+ name: {{ .Values.wlsDomain.domainUID }}-traefik
+ namespace: {{ .Release.Namespace }}
+ labels:
+ weblogic.resourceVersion: domain-v2
+ annotations:
+ kubernetes.io/ingress.class: 'traefik'
+{{- if eq .Values.sslType "SSL" }}
+ traefik.ingress.kubernetes.io/router.entrypoints: 'websecure'
+ traefik.ingress.kubernetes.io/router.tls: 'true'
+ traefik.ingress.kubernetes.io/router.middlewares: '{{ .Release.Namespace}}-wls-proxy-ssl@kubernetescrd'
+{{- end }}
+spec:
+ rules:
+ - host: '{{ .Values.traefik.hostname }}'
+ http:
+ paths:
+ - path: /webcenter
+ backend:
+ serviceName: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpClusterName | lower | replace "_" "-" }}'
+ servicePort: {{ .Values.wlsDomain.wcpManagedServerPort }}
+ - path: /console
+ backend:
+ serviceName: '{{ .Values.wlsDomain.domainUID }}-{{ .Values.wlsDomain.adminServerName | lower | replace "_" "-" }}'
+ servicePort: {{ .Values.wlsDomain.adminServerPort }}
+ - path: /rsscrawl
+ backend:
+ serviceName: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpClusterName | lower | replace "_" "-" }}'
+ servicePort: {{ .Values.wlsDomain.wcpManagedServerPort }}
+ - path: /webcenterhelp
+ backend:
+ serviceName: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpClusterName | lower | replace "_" "-" }}'
+ servicePort: {{ .Values.wlsDomain.wcpManagedServerPort }}
+ - path: /rest
+ backend:
+ serviceName: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpClusterName | lower | replace "_" "-" }}'
+ servicePort: {{ .Values.wlsDomain.wcpManagedServerPort }}
+ - path: /em
+ backend:
+ serviceName: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpClusterName | lower | replace "_" "-" }}'
+ servicePort: {{ .Values.wlsDomain.wcpManagedServerPort }}
+ - path: /wsrp-tools
+ backend:
+ serviceName: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpPortletClusterName | lower | replace "_" "-" }}'
+ servicePort: {{ .Values.wlsDomain.wcpPortletManagedServerPort }}
+ - path: /portalTools
+ backend:
+ serviceName: '{{ .Values.wlsDomain.domainUID }}-cluster-{{ .Values.wlsDomain.wcpPortletClusterName | lower | replace "_" "-" }}'
+ servicePort: {{ .Values.wlsDomain.wcpPortletManagedServerPort }}
+{{- if eq .Values.sslType "SSL" }}
+ tls:
+ - hosts:
+ - '{{ .Values.traefik.hostname }}'
+ secretName: {{ .Values.wlsDomain.domainUID }}-tls-cert
+{{- end }}
+---
+#Create Traefik Middleware custom resource for SSL Termination
+{{- if eq .Values.sslType "SSL" }}
+apiVersion: traefik.containo.us/v1alpha1
+kind: Middleware
+metadata:
+ name: wls-proxy-ssl
+ namespace: {{ .Release.Namespace }}
+spec:
+ headers:
+ customRequestHeaders:
+ X-Custom-Request-Header: ""
+ X-Forwarded-For: ""
+ WL-Proxy-Client-IP: ""
+ WL-Proxy-SSL: ""
+ WL-Proxy-SSL: "true"
+ sslRedirect: true
+{{- end }}
+
+{{- end }}
+{{- end }}
+{{- end }}
+
diff --git a/OracleWebCenterPortal/kubernetes/charts/ingress-per-domain/tls/nginx-tls.yaml b/OracleWebCenterPortal/kubernetes/charts/ingress-per-domain/tls/nginx-tls.yaml
old mode 100644
new mode 100755
diff --git a/OracleWebCenterPortal/kubernetes/charts/ingress-per-domain/tls/traefik-tls.yaml b/OracleWebCenterPortal/kubernetes/charts/ingress-per-domain/tls/traefik-tls.yaml
old mode 100644
new mode 100755
diff --git a/OracleWebCenterPortal/kubernetes/charts/ingress-per-domain/values.yaml b/OracleWebCenterPortal/kubernetes/charts/ingress-per-domain/values.yaml
old mode 100644
new mode 100755
index 9678cc41d..e752ff03e
--- a/OracleWebCenterPortal/kubernetes/charts/ingress-per-domain/values.yaml
+++ b/OracleWebCenterPortal/kubernetes/charts/ingress-per-domain/values.yaml
@@ -1,43 +1,43 @@
-# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-#
-#
-# Default values for ingress-per-domain.
-# This is a YAML-formatted file.
-# Declare variables to be passed into your templates.
-#
-# Load balancer type. Supported values are: TRAEFIK, NGINX
-type: TRAEFIK
-
-# Type of Configuration Supported Values are : NONSSL, SSL
-sslType: NONSSL
-
-# domainType Supported values are soa,osb and soaosb.
-domainType: wcp
-
-#WLS domain as backend to the load balancer
-wlsDomain:
- domainUID: wcp-domain
- adminServerName: adminserver
- adminServerPort: 7001
- adminServerSSLPort:
- wcpClusterName: wcp-cluster
- wcpManagedServerPort: 8888
- wcpManagedServerSSLPort:
- wcpPortletClusterName: wcportlet-cluster
- wcpPortletManagedServerPort: 8889
- wcpPortletManagedServerSSLPort:
-
-# Host specific values
-traefik:
- hostname: domain1.org
-
-# Ngnix specific values
-nginx:
- connectTimeout: 1800
- readTimeout: 1800
- sendTimeout: 1800
- cookieExpires: 172800
- cookieMaxAge: 172800
-
-
+# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+#
+#
+# Default values for ingress-per-domain.
+# This is a YAML-formatted file.
+# Declare variables to be passed into your templates.
+#
+# Load balancer type. Supported values are: TRAEFIK, NGINX
+type: TRAEFIK
+
+# Type of Configuration Supported Values are : NONSSL, SSL
+sslType: NONSSL
+
+# domainType Supported values are soa,osb and soaosb.
+domainType: wcp
+
+#WLS domain as backend to the load balancer
+wlsDomain:
+ domainUID: wcp-domain
+ adminServerName: adminserver
+ adminServerPort: 7001
+ adminServerSSLPort:
+ wcpClusterName: wcp-cluster
+ wcpManagedServerPort: 8888
+ wcpManagedServerSSLPort:
+ wcpPortletClusterName: wcportlet-cluster
+ wcpPortletManagedServerPort: 8889
+ wcpPortletManagedServerSSLPort:
+
+# Host specific values
+traefik:
+ hostname: domain1.org
+
+# Ngnix specific values
+nginx:
+ connectTimeout: 1800
+ readTimeout: 1800
+ sendTimeout: 1800
+ cookieExpires: 172800
+ cookieMaxAge: 172800
+
+
diff --git a/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/.helmignore b/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/.helmignore
old mode 100644
new mode 100755
index 1397cc19f..676bb2363
--- a/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/.helmignore
+++ b/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/.helmignore
@@ -1,12 +1,12 @@
-# Patterns to ignore when building packages.
-# This supports shell glob matching, relative path matching, and
-# negation (prefixed with !). Only one pattern per line.
-.DS_Store
-.git/
-.gitignore
-*.bak
-*.tmp
-*.orig
-*~
-.project
-.idea/
+# Patterns to ignore when building packages.
+# This supports shell glob matching, relative path matching, and
+# negation (prefixed with !). Only one pattern per line.
+.DS_Store
+.git/
+.gitignore
+*.bak
+*.tmp
+*.orig
+*~
+.project
+.idea/
diff --git a/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/Chart.yaml b/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/Chart.yaml
old mode 100644
new mode 100755
index b5cac770e..506ee2ddc
--- a/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/Chart.yaml
+++ b/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/Chart.yaml
@@ -1,10 +1,10 @@
-# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-
-apiVersion: v1
-name: weblogic-operator
-description: Helm chart for configuring the WebLogic operator.
-
-type: application
-version: 3.3.0
-appVersion: 3.3.0
+# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+
+apiVersion: v1
+name: weblogic-operator
+description: Helm chart for configuring the WebLogic operator.
+
+type: application
+version: 3.3.0
+appVersion: 3.3.0
diff --git a/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_domain-namespaces.tpl b/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_domain-namespaces.tpl
old mode 100644
new mode 100755
index 08988c28d..9fa1c26b0
--- a/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_domain-namespaces.tpl
+++ b/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_domain-namespaces.tpl
@@ -1,134 +1,134 @@
-# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-
-{{- define "operator.domainNamespaces" }}
-{{- if (or (eq (default "List" .domainNamespaceSelectionStrategy) "Dedicated") (and .dedicated (eq (default "List" .domainNamespaceSelectionStrategy) "List"))) }}
-{{- $args := include "utils.cloneDictionary" . | fromYaml -}}
-{{- $key := .Release.Namespace -}}
-{{- $ignore := set $args "domainNamespace" $key -}}
-{{- include "operator.operatorRoleBindingNamespace" $args -}}
-{{- else if eq (default "List" .domainNamespaceSelectionStrategy) "List" }}
-{{- $args := include "utils.cloneDictionary" . | fromYaml -}}
-{{- range $key := $args.domainNamespaces -}}
-{{- $ignore := set $args "domainNamespace" $key -}}
-{{- include "operator.operatorRoleBindingNamespace" $args -}}
-{{- end }}
-{{- else if eq .domainNamespaceSelectionStrategy "LabelSelector" }}
-{{- $args := include "utils.cloneDictionary" . | fromYaml -}}
-{{- /*
- Split terms on commas not contained in parentheses. Unfortunately, the regular expression
- support included with Helm templates does not include lookarounds.
-*/ -}}
-{{- $working := dict "rejected" (list) "terms" (list $args.domainNamespaceLabelSelector) }}
-{{- if contains "," $args.domainNamespaceLabelSelector }}
-{{- $cs := regexSplit "," $args.domainNamespaceLabelSelector -1 }}
-{{- $ignore := set $working "st" (list) }}
-{{- $ignore := set $working "item" "" }}
-{{- range $c := $cs }}
-{{- if and (contains "(" $c) (not (contains ")" $c)) }}
-{{- $ignore := set $working "item" (print $working.item $c) }}
-{{- else if not (eq $working.item "") }}
-{{- $ignore := set $working "st" (append $working.st (print $working.item "," $c)) }}
-{{- if contains ")" $c }}
-{{- $ignore := set $working "item" "" }}
-{{- end }}
-{{- else }}
-{{- $ignore := set $working "st" (append $working.st $c) }}
-{{- end }}
-{{- end }}
-{{- $ignore := set $working "terms" $working.st }}
-{{- end }}
-{{- $namespaces := (lookup "v1" "Namespace" "" "").items }}
-{{- range $t := $working.terms }}
-{{- $term := trim $t }}
-{{- range $index, $namespace := $namespaces }}
-{{- /*
- Label selector patterns
- Equality-based: =, ==, !=
- Set-based: x in (a, b), x notin (a, b)
- Existence: x, !x
-*/ -}}
-{{- if not $namespace.metadata.labels }}
-{{- $ignore := set $namespace.metadata "labels" (dict) }}
-{{- end }}
-{{- if hasPrefix "!" $term }}
-{{- if hasKey $namespace.metadata.labels (trimPrefix "!" $term) }}
-{{- $ignore := set $working "rejected" (append $working.rejected $namespace.metadata.name) }}
-{{- end }}
-{{- else if contains "!=" $term }}
-{{- $split := regexSplit "!=" $term 2 }}
-{{- $key := nospace (first $split) }}
-{{- if hasKey $namespace.metadata.labels $key }}
-{{- if eq (last $split | nospace) (get $namespace.metadata.labels $key) }}
-{{- $ignore := set $working "rejected" (append $working.rejected $namespace.metadata.name) }}
-{{- end }}
-{{- end }}
-{{- else if contains "==" $term }}
-{{- $split := regexSplit "==" $term 2 }}
-{{- $key := nospace (first $split) }}
-{{- if or (not (hasKey $namespace.metadata.labels $key)) (not (eq (last $split | nospace) (get $namespace.metadata.labels $key))) }}
-{{- $ignore := set $working "rejected" (append $working.rejected $namespace.metadata.name) }}
-{{- end }}
-{{- else if contains "=" $term }}
-{{- $split := regexSplit "=" $term 2 }}
-{{- $key := nospace (first $split) }}
-{{- if or (not (hasKey $namespace.metadata.labels $key)) (not (eq (last $split | nospace) (get $namespace.metadata.labels $key))) }}
-{{- $ignore := set $working "rejected" (append $working.rejected $namespace.metadata.name) }}
-{{- end }}
-{{- else if contains " notin " $term }}
-{{- $split := regexSplit " notin " $term 2 }}
-{{- $key := nospace (first $split) }}
-{{- if hasKey $namespace.metadata.labels $key }}
-{{- $second := nospace (last $split) }}
-{{- $parenContents := substr 1 (int (sub (len $second) 1)) $second }}
-{{- $values := regexSplit "," $parenContents -1 }}
-{{- range $value := $values }}
-{{- if eq ($value | nospace) (get $namespace.metadata.labels $key) }}
-{{- $ignore := set $working "rejected" (append $working.rejected $namespace.metadata.name) }}
-{{- end }}
-{{- end }}
-{{- end }}
-{{- else if contains " in " $term }}
-{{- $split := regexSplit " in " $term 2 }}
-{{- $key := nospace (first $split) }}
-{{- if not (hasKey $namespace.metadata.labels $key) }}
-{{- $ignore := set $working "rejected" (append $working.rejected $namespace.metadata.name) }}
-{{- else }}
-{{- $second := nospace (last $split) }}
-{{- $parenContents := substr 1 (int (sub (len $second) 1)) $second }}
-{{- $values := regexSplit "," $parenContents -1 }}
-{{- $ignore := set $working "found" false }}
-{{- range $value := $values }}
-{{- if eq ($value | nospace) (get $namespace.metadata.labels $key) }}
-{{- $ignore := set $working "found" true }}
-{{- end }}
-{{- end }}
-{{- if not $working.found }}
-{{- $ignore := set $working "rejected" (append $working.rejected $namespace.metadata.name) }}
-{{- end }}
-{{- end }}
-{{- else }}
-{{- if not (hasKey $namespace.metadata.labels $term) }}
-{{- $ignore := set $working "rejected" (append $working.rejected $namespace.metadata.name) }}
-{{- end }}
-{{- end }}
-{{- end }}
-{{- end }}
-{{- range $index, $namespace := $namespaces }}
-{{- $key := $namespace.metadata.name -}}
-{{- if not (has $key $working.rejected) }}
-{{- $ignore := set $args "domainNamespace" $key -}}
-{{- include "operator.operatorRoleBindingNamespace" $args -}}
-{{- end }}
-{{- end }}
-{{- else if eq .domainNamespaceSelectionStrategy "RegExp" }}
-{{- $args := include "utils.cloneDictionary" . | fromYaml -}}
-{{- range $index, $namespace := (lookup "v1" "Namespace" "" "").items }}
-{{- if regexMatch $args.domainNamespaceRegExp $namespace.metadata.name }}
-{{- $key := $namespace.metadata.name -}}
-{{- $ignore := set $args "domainNamespace" $key -}}
-{{- include "operator.operatorRoleBindingNamespace" $args -}}
-{{- end }}
-{{- end }}
-{{- end }}
-{{- end }}
+# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+
+{{- define "operator.domainNamespaces" }}
+{{- if (or (eq (default "List" .domainNamespaceSelectionStrategy) "Dedicated") (and .dedicated (eq (default "List" .domainNamespaceSelectionStrategy) "List"))) }}
+{{- $args := include "utils.cloneDictionary" . | fromYaml -}}
+{{- $key := .Release.Namespace -}}
+{{- $ignore := set $args "domainNamespace" $key -}}
+{{- include "operator.operatorRoleBindingNamespace" $args -}}
+{{- else if eq (default "List" .domainNamespaceSelectionStrategy) "List" }}
+{{- $args := include "utils.cloneDictionary" . | fromYaml -}}
+{{- range $key := $args.domainNamespaces -}}
+{{- $ignore := set $args "domainNamespace" $key -}}
+{{- include "operator.operatorRoleBindingNamespace" $args -}}
+{{- end }}
+{{- else if eq .domainNamespaceSelectionStrategy "LabelSelector" }}
+{{- $args := include "utils.cloneDictionary" . | fromYaml -}}
+{{- /*
+ Split terms on commas not contained in parentheses. Unfortunately, the regular expression
+ support included with Helm templates does not include lookarounds.
+*/ -}}
+{{- $working := dict "rejected" (list) "terms" (list $args.domainNamespaceLabelSelector) }}
+{{- if contains "," $args.domainNamespaceLabelSelector }}
+{{- $cs := regexSplit "," $args.domainNamespaceLabelSelector -1 }}
+{{- $ignore := set $working "st" (list) }}
+{{- $ignore := set $working "item" "" }}
+{{- range $c := $cs }}
+{{- if and (contains "(" $c) (not (contains ")" $c)) }}
+{{- $ignore := set $working "item" (print $working.item $c) }}
+{{- else if not (eq $working.item "") }}
+{{- $ignore := set $working "st" (append $working.st (print $working.item "," $c)) }}
+{{- if contains ")" $c }}
+{{- $ignore := set $working "item" "" }}
+{{- end }}
+{{- else }}
+{{- $ignore := set $working "st" (append $working.st $c) }}
+{{- end }}
+{{- end }}
+{{- $ignore := set $working "terms" $working.st }}
+{{- end }}
+{{- $namespaces := (lookup "v1" "Namespace" "" "").items }}
+{{- range $t := $working.terms }}
+{{- $term := trim $t }}
+{{- range $index, $namespace := $namespaces }}
+{{- /*
+ Label selector patterns
+ Equality-based: =, ==, !=
+ Set-based: x in (a, b), x notin (a, b)
+ Existence: x, !x
+*/ -}}
+{{- if not $namespace.metadata.labels }}
+{{- $ignore := set $namespace.metadata "labels" (dict) }}
+{{- end }}
+{{- if hasPrefix "!" $term }}
+{{- if hasKey $namespace.metadata.labels (trimPrefix "!" $term) }}
+{{- $ignore := set $working "rejected" (append $working.rejected $namespace.metadata.name) }}
+{{- end }}
+{{- else if contains "!=" $term }}
+{{- $split := regexSplit "!=" $term 2 }}
+{{- $key := nospace (first $split) }}
+{{- if hasKey $namespace.metadata.labels $key }}
+{{- if eq (last $split | nospace) (get $namespace.metadata.labels $key) }}
+{{- $ignore := set $working "rejected" (append $working.rejected $namespace.metadata.name) }}
+{{- end }}
+{{- end }}
+{{- else if contains "==" $term }}
+{{- $split := regexSplit "==" $term 2 }}
+{{- $key := nospace (first $split) }}
+{{- if or (not (hasKey $namespace.metadata.labels $key)) (not (eq (last $split | nospace) (get $namespace.metadata.labels $key))) }}
+{{- $ignore := set $working "rejected" (append $working.rejected $namespace.metadata.name) }}
+{{- end }}
+{{- else if contains "=" $term }}
+{{- $split := regexSplit "=" $term 2 }}
+{{- $key := nospace (first $split) }}
+{{- if or (not (hasKey $namespace.metadata.labels $key)) (not (eq (last $split | nospace) (get $namespace.metadata.labels $key))) }}
+{{- $ignore := set $working "rejected" (append $working.rejected $namespace.metadata.name) }}
+{{- end }}
+{{- else if contains " notin " $term }}
+{{- $split := regexSplit " notin " $term 2 }}
+{{- $key := nospace (first $split) }}
+{{- if hasKey $namespace.metadata.labels $key }}
+{{- $second := nospace (last $split) }}
+{{- $parenContents := substr 1 (int (sub (len $second) 1)) $second }}
+{{- $values := regexSplit "," $parenContents -1 }}
+{{- range $value := $values }}
+{{- if eq ($value | nospace) (get $namespace.metadata.labels $key) }}
+{{- $ignore := set $working "rejected" (append $working.rejected $namespace.metadata.name) }}
+{{- end }}
+{{- end }}
+{{- end }}
+{{- else if contains " in " $term }}
+{{- $split := regexSplit " in " $term 2 }}
+{{- $key := nospace (first $split) }}
+{{- if not (hasKey $namespace.metadata.labels $key) }}
+{{- $ignore := set $working "rejected" (append $working.rejected $namespace.metadata.name) }}
+{{- else }}
+{{- $second := nospace (last $split) }}
+{{- $parenContents := substr 1 (int (sub (len $second) 1)) $second }}
+{{- $values := regexSplit "," $parenContents -1 }}
+{{- $ignore := set $working "found" false }}
+{{- range $value := $values }}
+{{- if eq ($value | nospace) (get $namespace.metadata.labels $key) }}
+{{- $ignore := set $working "found" true }}
+{{- end }}
+{{- end }}
+{{- if not $working.found }}
+{{- $ignore := set $working "rejected" (append $working.rejected $namespace.metadata.name) }}
+{{- end }}
+{{- end }}
+{{- else }}
+{{- if not (hasKey $namespace.metadata.labels $term) }}
+{{- $ignore := set $working "rejected" (append $working.rejected $namespace.metadata.name) }}
+{{- end }}
+{{- end }}
+{{- end }}
+{{- end }}
+{{- range $index, $namespace := $namespaces }}
+{{- $key := $namespace.metadata.name -}}
+{{- if not (has $key $working.rejected) }}
+{{- $ignore := set $args "domainNamespace" $key -}}
+{{- include "operator.operatorRoleBindingNamespace" $args -}}
+{{- end }}
+{{- end }}
+{{- else if eq .domainNamespaceSelectionStrategy "RegExp" }}
+{{- $args := include "utils.cloneDictionary" . | fromYaml -}}
+{{- range $index, $namespace := (lookup "v1" "Namespace" "" "").items }}
+{{- if regexMatch $args.domainNamespaceRegExp $namespace.metadata.name }}
+{{- $key := $namespace.metadata.name -}}
+{{- $ignore := set $args "domainNamespace" $key -}}
+{{- include "operator.operatorRoleBindingNamespace" $args -}}
+{{- end }}
+{{- end }}
+{{- end }}
+{{- end }}
diff --git a/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-clusterrole-domain-admin.tpl b/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-clusterrole-domain-admin.tpl
old mode 100644
new mode 100755
index 94cab9df7..3bcf74669
--- a/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-clusterrole-domain-admin.tpl
+++ b/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-clusterrole-domain-admin.tpl
@@ -1,40 +1,40 @@
-# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-
-{{- define "operator.operatorClusterRoleDomainAdmin" }}
----
-{{- if (or (eq (default "List" .domainNamespaceSelectionStrategy) "Dedicated") (and .dedicated (eq (default "List" .domainNamespaceSelectionStrategy) "List"))) }}
-kind: "Role"
-{{- else }}
-kind: "ClusterRole"
-{{- end }}
-apiVersion: "rbac.authorization.k8s.io/v1"
-metadata:
- {{- if (or (eq (default "List" .domainNamespaceSelectionStrategy) "Dedicated") (and .dedicated (eq (default "List" .domainNamespaceSelectionStrategy) "List"))) }}
- name: "weblogic-operator-role-domain-admin"
- namespace: {{ .Release.Namespace | quote }}
- {{- else }}
- name: {{ list .Release.Namespace "weblogic-operator-clusterrole-domain-admin" | join "-" | quote }}
- {{- end }}
- labels:
- weblogic.operatorName: {{ .Release.Namespace | quote }}
-rules:
-- apiGroups: [""]
- resources: ["configmaps"]
- verbs: ["get", "list", "watch", "create", "update", "patch", "delete", "deletecollection"]
-- apiGroups: [""]
- resources: ["secrets", "pods", "events"]
- verbs: ["get", "list", "watch"]
-- apiGroups: [""]
- resources: ["pods/log"]
- verbs: ["get", "list"]
-- apiGroups: [""]
- resources: ["pods/exec"]
- verbs: ["get", "create"]
-- apiGroups: ["weblogic.oracle"]
- resources: ["domains"]
- verbs: ["get", "list", "watch", "create", "update", "patch", "delete", "deletecollection"]
-- apiGroups: ["weblogic.oracle"]
- resources: ["domains/status"]
- verbs: ["get", "watch"]
-{{- end }}
+# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+
+{{- define "operator.operatorClusterRoleDomainAdmin" }}
+---
+{{- if (or (eq (default "List" .domainNamespaceSelectionStrategy) "Dedicated") (and .dedicated (eq (default "List" .domainNamespaceSelectionStrategy) "List"))) }}
+kind: "Role"
+{{- else }}
+kind: "ClusterRole"
+{{- end }}
+apiVersion: "rbac.authorization.k8s.io/v1"
+metadata:
+ {{- if (or (eq (default "List" .domainNamespaceSelectionStrategy) "Dedicated") (and .dedicated (eq (default "List" .domainNamespaceSelectionStrategy) "List"))) }}
+ name: "weblogic-operator-role-domain-admin"
+ namespace: {{ .Release.Namespace | quote }}
+ {{- else }}
+ name: {{ list .Release.Namespace "weblogic-operator-clusterrole-domain-admin" | join "-" | quote }}
+ {{- end }}
+ labels:
+ weblogic.operatorName: {{ .Release.Namespace | quote }}
+rules:
+- apiGroups: [""]
+ resources: ["configmaps"]
+ verbs: ["get", "list", "watch", "create", "update", "patch", "delete", "deletecollection"]
+- apiGroups: [""]
+ resources: ["secrets", "pods", "events"]
+ verbs: ["get", "list", "watch"]
+- apiGroups: [""]
+ resources: ["pods/log"]
+ verbs: ["get", "list"]
+- apiGroups: [""]
+ resources: ["pods/exec"]
+ verbs: ["get", "create"]
+- apiGroups: ["weblogic.oracle"]
+ resources: ["domains"]
+ verbs: ["get", "list", "watch", "create", "update", "patch", "delete", "deletecollection"]
+- apiGroups: ["weblogic.oracle"]
+ resources: ["domains/status"]
+ verbs: ["get", "watch"]
+{{- end }}
diff --git a/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-clusterrole-general.tpl b/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-clusterrole-general.tpl
old mode 100644
new mode 100755
index 2eba13b95..2a920ecfd
--- a/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-clusterrole-general.tpl
+++ b/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-clusterrole-general.tpl
@@ -1,39 +1,39 @@
-# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-
-{{- define "operator.operatorClusterRoleGeneral" }}
----
-{{- if (or (eq (default "List" .domainNamespaceSelectionStrategy) "Dedicated") (and .dedicated (eq (default "List" .domainNamespaceSelectionStrategy) "List"))) }}
-kind: "Role"
-{{- else }}
-kind: "ClusterRole"
-{{- end }}
-apiVersion: "rbac.authorization.k8s.io/v1"
-metadata:
- {{- if (or (eq (default "List" .domainNamespaceSelectionStrategy) "Dedicated") (and .dedicated (eq (default "List" .domainNamespaceSelectionStrategy) "List"))) }}
- name: "weblogic-operator-role-general"
- namespace: {{ .Release.Namespace | quote }}
- {{- else }}
- name: {{ list .Release.Namespace "weblogic-operator-clusterrole-general" | join "-" | quote }}
- {{- end }}
- labels:
- weblogic.operatorName: {{ .Release.Namespace | quote }}
-rules:
-{{- if not (or (eq (default "List" .domainNamespaceSelectionStrategy) "Dedicated") (and .dedicated (eq (default "List" .domainNamespaceSelectionStrategy) "List"))) }}
-- apiGroups: [""]
- resources: ["namespaces"]
- verbs: ["get", "list", "watch"]
-- apiGroups: ["apiextensions.k8s.io"]
- resources: ["customresourcedefinitions"]
- verbs: ["get", "list", "watch", "create", "update", "patch"]
-{{- end }}
-- apiGroups: ["weblogic.oracle"]
- resources: ["domains", "domains/status"]
- verbs: ["get", "list", "watch", "update", "patch"]
-- apiGroups: ["authentication.k8s.io"]
- resources: ["tokenreviews"]
- verbs: ["create"]
-- apiGroups: ["authorization.k8s.io"]
- resources: ["selfsubjectrulesreviews"]
- verbs: ["create"]
-{{- end }}
+# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+
+{{- define "operator.operatorClusterRoleGeneral" }}
+---
+{{- if (or (eq (default "List" .domainNamespaceSelectionStrategy) "Dedicated") (and .dedicated (eq (default "List" .domainNamespaceSelectionStrategy) "List"))) }}
+kind: "Role"
+{{- else }}
+kind: "ClusterRole"
+{{- end }}
+apiVersion: "rbac.authorization.k8s.io/v1"
+metadata:
+ {{- if (or (eq (default "List" .domainNamespaceSelectionStrategy) "Dedicated") (and .dedicated (eq (default "List" .domainNamespaceSelectionStrategy) "List"))) }}
+ name: "weblogic-operator-role-general"
+ namespace: {{ .Release.Namespace | quote }}
+ {{- else }}
+ name: {{ list .Release.Namespace "weblogic-operator-clusterrole-general" | join "-" | quote }}
+ {{- end }}
+ labels:
+ weblogic.operatorName: {{ .Release.Namespace | quote }}
+rules:
+{{- if not (or (eq (default "List" .domainNamespaceSelectionStrategy) "Dedicated") (and .dedicated (eq (default "List" .domainNamespaceSelectionStrategy) "List"))) }}
+- apiGroups: [""]
+ resources: ["namespaces"]
+ verbs: ["get", "list", "watch"]
+- apiGroups: ["apiextensions.k8s.io"]
+ resources: ["customresourcedefinitions"]
+ verbs: ["get", "list", "watch", "create", "update", "patch"]
+{{- end }}
+- apiGroups: ["weblogic.oracle"]
+ resources: ["domains", "domains/status"]
+ verbs: ["get", "list", "watch", "update", "patch"]
+- apiGroups: ["authentication.k8s.io"]
+ resources: ["tokenreviews"]
+ verbs: ["create"]
+- apiGroups: ["authorization.k8s.io"]
+ resources: ["selfsubjectrulesreviews"]
+ verbs: ["create"]
+{{- end }}
diff --git a/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-clusterrole-namespace.tpl b/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-clusterrole-namespace.tpl
old mode 100644
new mode 100755
index 6310779bb..2cbd47da2
--- a/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-clusterrole-namespace.tpl
+++ b/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-clusterrole-namespace.tpl
@@ -1,40 +1,40 @@
-# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-
-{{- define "operator.operatorClusterRoleNamespace" }}
----
-{{- if (or (eq (default "List" .domainNamespaceSelectionStrategy) "Dedicated") (and .dedicated (eq (default "List" .domainNamespaceSelectionStrategy) "List"))) }}
-kind: "Role"
-{{- else }}
-kind: "ClusterRole"
-{{- end }}
-apiVersion: "rbac.authorization.k8s.io/v1"
-metadata:
- {{- if (or (eq (default "List" .domainNamespaceSelectionStrategy) "Dedicated") (and .dedicated (eq (default "List" .domainNamespaceSelectionStrategy) "List"))) }}
- name: "weblogic-operator-role-namespace"
- namespace: {{ .Release.Namespace | quote }}
- {{- else }}
- name: {{ list .Release.Namespace "weblogic-operator-clusterrole-namespace" | join "-" | quote }}
- {{- end }}
- labels:
- weblogic.operatorName: {{ .Release.Namespace | quote }}
-rules:
-- apiGroups: [""]
- resources: ["services", "configmaps", "pods", "events"]
- verbs: ["get", "list", "watch", "create", "update", "patch", "delete", "deletecollection"]
-- apiGroups: [""]
- resources: ["secrets"]
- verbs: ["get", "list", "watch"]
-- apiGroups: [""]
- resources: ["pods/log"]
- verbs: ["get", "list"]
-- apiGroups: [""]
- resources: ["pods/exec"]
- verbs: ["get", "create"]
-- apiGroups: ["batch"]
- resources: ["jobs"]
- verbs: ["get", "list", "watch", "create", "update", "patch", "delete", "deletecollection"]
-- apiGroups: ["policy"]
- resources: ["poddisruptionbudgets"]
- verbs: ["get", "list", "watch", "create", "update", "patch", "delete", "deletecollection"]
-{{- end }}
+# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+
+{{- define "operator.operatorClusterRoleNamespace" }}
+---
+{{- if (or (eq (default "List" .domainNamespaceSelectionStrategy) "Dedicated") (and .dedicated (eq (default "List" .domainNamespaceSelectionStrategy) "List"))) }}
+kind: "Role"
+{{- else }}
+kind: "ClusterRole"
+{{- end }}
+apiVersion: "rbac.authorization.k8s.io/v1"
+metadata:
+ {{- if (or (eq (default "List" .domainNamespaceSelectionStrategy) "Dedicated") (and .dedicated (eq (default "List" .domainNamespaceSelectionStrategy) "List"))) }}
+ name: "weblogic-operator-role-namespace"
+ namespace: {{ .Release.Namespace | quote }}
+ {{- else }}
+ name: {{ list .Release.Namespace "weblogic-operator-clusterrole-namespace" | join "-" | quote }}
+ {{- end }}
+ labels:
+ weblogic.operatorName: {{ .Release.Namespace | quote }}
+rules:
+- apiGroups: [""]
+ resources: ["services", "configmaps", "pods", "events"]
+ verbs: ["get", "list", "watch", "create", "update", "patch", "delete", "deletecollection"]
+- apiGroups: [""]
+ resources: ["secrets"]
+ verbs: ["get", "list", "watch"]
+- apiGroups: [""]
+ resources: ["pods/log"]
+ verbs: ["get", "list"]
+- apiGroups: [""]
+ resources: ["pods/exec"]
+ verbs: ["get", "create"]
+- apiGroups: ["batch"]
+ resources: ["jobs"]
+ verbs: ["get", "list", "watch", "create", "update", "patch", "delete", "deletecollection"]
+- apiGroups: ["policy"]
+ resources: ["poddisruptionbudgets"]
+ verbs: ["get", "list", "watch", "create", "update", "patch", "delete", "deletecollection"]
+{{- end }}
diff --git a/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-clusterrole-nonresource.tpl b/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-clusterrole-nonresource.tpl
old mode 100644
new mode 100755
index e3b6a2785..65a207cd8
--- a/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-clusterrole-nonresource.tpl
+++ b/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-clusterrole-nonresource.tpl
@@ -1,15 +1,15 @@
-# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-
-{{- define "operator.operatorClusterRoleNonResource" }}
----
-kind: "ClusterRole"
-apiVersion: "rbac.authorization.k8s.io/v1"
-metadata:
- name: {{ list .Release.Namespace "weblogic-operator-clusterrole-nonresource" | join "-" | quote }}
- labels:
- weblogic.operatorName: {{ .Release.Namespace | quote }}
-rules:
-- nonResourceURLs: ["/version/*"]
- verbs: ["get"]
-{{- end }}
+# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+
+{{- define "operator.operatorClusterRoleNonResource" }}
+---
+kind: "ClusterRole"
+apiVersion: "rbac.authorization.k8s.io/v1"
+metadata:
+ name: {{ list .Release.Namespace "weblogic-operator-clusterrole-nonresource" | join "-" | quote }}
+ labels:
+ weblogic.operatorName: {{ .Release.Namespace | quote }}
+rules:
+- nonResourceURLs: ["/version/*"]
+ verbs: ["get"]
+{{- end }}
diff --git a/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-clusterrole-operator-admin.tpl b/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-clusterrole-operator-admin.tpl
old mode 100644
new mode 100755
index 46faed184..84ba3c33d
--- a/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-clusterrole-operator-admin.tpl
+++ b/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-clusterrole-operator-admin.tpl
@@ -1,34 +1,34 @@
-# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-
-{{- define "operator.operatorClusterRoleOperatorAdmin" }}
----
-{{- if (or (eq (default "List" .domainNamespaceSelectionStrategy) "Dedicated") (and .dedicated (eq (default "List" .domainNamespaceSelectionStrategy) "List"))) }}
-kind: "Role"
-{{- else }}
-kind: "ClusterRole"
-{{- end }}
-apiVersion: "rbac.authorization.k8s.io/v1"
-metadata:
- {{- if (or (eq (default "List" .domainNamespaceSelectionStrategy) "Dedicated") (and .dedicated (eq (default "List" .domainNamespaceSelectionStrategy) "List"))) }}
- name: "weblogic-operator-role-operator-admin"
- namespace: {{ .Release.Namespace | quote }}
- {{- else }}
- name: {{ list .Release.Namespace "weblogic-operator-clusterrole-operator-admin" | join "-" | quote }}
- {{- end }}
- labels:
- weblogic.operatorName: {{ .Release.Namespace | quote }}
-rules:
-- apiGroups: [""]
- resources: ["configmaps", "secrets"]
- verbs: ["get", "list", "watch", "create", "update", "patch", "delete", "deletecollection"]
-- apiGroups: [""]
- resources: ["pods", "events"]
- verbs: ["get", "list", "watch"]
-- apiGroups: [""]
- resources: ["pods/log"]
- verbs: ["get", "list"]
-- apiGroups: [""]
- resources: ["pods/exec"]
- verbs: ["get", "create"]
-{{- end }}
+# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+
+{{- define "operator.operatorClusterRoleOperatorAdmin" }}
+---
+{{- if (or (eq (default "List" .domainNamespaceSelectionStrategy) "Dedicated") (and .dedicated (eq (default "List" .domainNamespaceSelectionStrategy) "List"))) }}
+kind: "Role"
+{{- else }}
+kind: "ClusterRole"
+{{- end }}
+apiVersion: "rbac.authorization.k8s.io/v1"
+metadata:
+ {{- if (or (eq (default "List" .domainNamespaceSelectionStrategy) "Dedicated") (and .dedicated (eq (default "List" .domainNamespaceSelectionStrategy) "List"))) }}
+ name: "weblogic-operator-role-operator-admin"
+ namespace: {{ .Release.Namespace | quote }}
+ {{- else }}
+ name: {{ list .Release.Namespace "weblogic-operator-clusterrole-operator-admin" | join "-" | quote }}
+ {{- end }}
+ labels:
+ weblogic.operatorName: {{ .Release.Namespace | quote }}
+rules:
+- apiGroups: [""]
+ resources: ["configmaps", "secrets"]
+ verbs: ["get", "list", "watch", "create", "update", "patch", "delete", "deletecollection"]
+- apiGroups: [""]
+ resources: ["pods", "events"]
+ verbs: ["get", "list", "watch"]
+- apiGroups: [""]
+ resources: ["pods/log"]
+ verbs: ["get", "list"]
+- apiGroups: [""]
+ resources: ["pods/exec"]
+ verbs: ["get", "create"]
+{{- end }}
diff --git a/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-clusterrolebinding-auth-delegator.tpl b/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-clusterrolebinding-auth-delegator.tpl
old mode 100644
new mode 100755
index 783f970e7..4339ef0e9
--- a/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-clusterrolebinding-auth-delegator.tpl
+++ b/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-clusterrolebinding-auth-delegator.tpl
@@ -1,30 +1,30 @@
-# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-
-{{- define "operator.clusterRoleBindingAuthDelegator" }}
----
-apiVersion: "rbac.authorization.k8s.io/v1"
-{{- if (or (eq (default "List" .domainNamespaceSelectionStrategy) "Dedicated") (and .dedicated (eq (default "List" .domainNamespaceSelectionStrategy) "List"))) }}
-kind: "RoleBinding"
-{{- else }}
-kind: "ClusterRoleBinding"
-{{- end }}
-metadata:
- labels:
- weblogic.operatorName: {{ .Release.Namespace | quote}}
- {{- if (or (eq (default "List" .domainNamespaceSelectionStrategy) "Dedicated") (and .dedicated (eq (default "List" .domainNamespaceSelectionStrategy) "List"))) }}
- name: "weblogic-operator-rolebinding-auth-delegator"
- namespace: {{ .Release.Namespace | quote }}
- {{- else }}
- name: {{ list .Release.Namespace "weblogic-operator-clusterrolebinding-auth-delegator" | join "-" | quote }}
- {{- end }}
-roleRef:
- apiGroup: "rbac.authorization.k8s.io"
- kind: "ClusterRole"
- name: "system:auth-delegator"
-subjects:
-- kind: "ServiceAccount"
- apiGroup: ""
- name: {{ .serviceAccount | quote }}
- namespace: {{ .Release.Namespace | quote }}
-{{- end }}
+# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+
+{{- define "operator.clusterRoleBindingAuthDelegator" }}
+---
+apiVersion: "rbac.authorization.k8s.io/v1"
+{{- if (or (eq (default "List" .domainNamespaceSelectionStrategy) "Dedicated") (and .dedicated (eq (default "List" .domainNamespaceSelectionStrategy) "List"))) }}
+kind: "RoleBinding"
+{{- else }}
+kind: "ClusterRoleBinding"
+{{- end }}
+metadata:
+ labels:
+ weblogic.operatorName: {{ .Release.Namespace | quote}}
+ {{- if (or (eq (default "List" .domainNamespaceSelectionStrategy) "Dedicated") (and .dedicated (eq (default "List" .domainNamespaceSelectionStrategy) "List"))) }}
+ name: "weblogic-operator-rolebinding-auth-delegator"
+ namespace: {{ .Release.Namespace | quote }}
+ {{- else }}
+ name: {{ list .Release.Namespace "weblogic-operator-clusterrolebinding-auth-delegator" | join "-" | quote }}
+ {{- end }}
+roleRef:
+ apiGroup: "rbac.authorization.k8s.io"
+ kind: "ClusterRole"
+ name: "system:auth-delegator"
+subjects:
+- kind: "ServiceAccount"
+ apiGroup: ""
+ name: {{ .serviceAccount | quote }}
+ namespace: {{ .Release.Namespace | quote }}
+{{- end }}
diff --git a/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-clusterrolebinding-discovery.tpl b/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-clusterrolebinding-discovery.tpl
old mode 100644
new mode 100755
index 48c505fa5..706fb367c
--- a/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-clusterrolebinding-discovery.tpl
+++ b/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-clusterrolebinding-discovery.tpl
@@ -1,30 +1,30 @@
-# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-
-{{- define "operator.clusterRoleBindingDiscovery" }}
----
-apiVersion: "rbac.authorization.k8s.io/v1"
-{{- if (or (eq (default "List" .domainNamespaceSelectionStrategy) "Dedicated") (and .dedicated (eq (default "List" .domainNamespaceSelectionStrategy) "List"))) }}
-kind: "RoleBinding"
-{{- else }}
-kind: "ClusterRoleBinding"
-{{- end }}
-metadata:
- labels:
- weblogic.operatorName: {{ .Release.Namespace | quote }}
- {{- if (or (eq (default "List" .domainNamespaceSelectionStrategy) "Dedicated") (and .dedicated (eq (default "List" .domainNamespaceSelectionStrategy) "List"))) }}
- name: "weblogic-operator-rolebinding-discovery"
- namespace: {{ .Release.Namespace | quote }}
- {{- else }}
- name: {{ list .Release.Namespace "weblogic-operator-clusterrolebinding-discovery" | join "-" | quote }}
- {{- end }}
-roleRef:
- apiGroup: "rbac.authorization.k8s.io"
- kind: "ClusterRole"
- name: "system:discovery"
-subjects:
-- kind: "ServiceAccount"
- apiGroup: ""
- name: {{ .serviceAccount | quote }}
- namespace: {{ .Release.Namespace | quote }}
-{{- end }}
+# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+
+{{- define "operator.clusterRoleBindingDiscovery" }}
+---
+apiVersion: "rbac.authorization.k8s.io/v1"
+{{- if (or (eq (default "List" .domainNamespaceSelectionStrategy) "Dedicated") (and .dedicated (eq (default "List" .domainNamespaceSelectionStrategy) "List"))) }}
+kind: "RoleBinding"
+{{- else }}
+kind: "ClusterRoleBinding"
+{{- end }}
+metadata:
+ labels:
+ weblogic.operatorName: {{ .Release.Namespace | quote }}
+ {{- if (or (eq (default "List" .domainNamespaceSelectionStrategy) "Dedicated") (and .dedicated (eq (default "List" .domainNamespaceSelectionStrategy) "List"))) }}
+ name: "weblogic-operator-rolebinding-discovery"
+ namespace: {{ .Release.Namespace | quote }}
+ {{- else }}
+ name: {{ list .Release.Namespace "weblogic-operator-clusterrolebinding-discovery" | join "-" | quote }}
+ {{- end }}
+roleRef:
+ apiGroup: "rbac.authorization.k8s.io"
+ kind: "ClusterRole"
+ name: "system:discovery"
+subjects:
+- kind: "ServiceAccount"
+ apiGroup: ""
+ name: {{ .serviceAccount | quote }}
+ namespace: {{ .Release.Namespace | quote }}
+{{- end }}
diff --git a/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-clusterrolebinding-general.tpl b/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-clusterrolebinding-general.tpl
old mode 100644
new mode 100755
index f2994da33..8b2fc8fcf
--- a/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-clusterrolebinding-general.tpl
+++ b/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-clusterrolebinding-general.tpl
@@ -1,35 +1,35 @@
-# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-
-{{- define "operator.clusterRoleBindingGeneral" }}
----
-apiVersion: "rbac.authorization.k8s.io/v1"
-{{- if (or (eq (default "List" .domainNamespaceSelectionStrategy) "Dedicated") (and .dedicated (eq (default "List" .domainNamespaceSelectionStrategy) "List"))) }}
-kind: "RoleBinding"
-{{- else }}
-kind: "ClusterRoleBinding"
-{{- end }}
-metadata:
- labels:
- weblogic.operatorName: {{ .Release.Namespace | quote }}
- {{- if (or (eq (default "List" .domainNamespaceSelectionStrategy) "Dedicated") (and .dedicated (eq (default "List" .domainNamespaceSelectionStrategy) "List"))) }}
- name: "weblogic-operator-rolebinding-general"
- namespace: {{ .Release.Namespace | quote }}
- {{- else }}
- name: {{ list .Release.Namespace "weblogic-operator-clusterrolebinding-general" | join "-" | quote }}
- {{- end }}
-roleRef:
- apiGroup: "rbac.authorization.k8s.io"
- {{- if (or (eq (default "List" .domainNamespaceSelectionStrategy) "Dedicated") (and .dedicated (eq (default "List" .domainNamespaceSelectionStrategy) "List"))) }}
- kind: "Role"
- name: "weblogic-operator-role-general"
- {{- else }}
- kind: "ClusterRole"
- name: {{ list .Release.Namespace "weblogic-operator-clusterrole-general" | join "-" | quote }}
- {{- end }}
-subjects:
-- kind: "ServiceAccount"
- apiGroup: ""
- name: {{ .serviceAccount | quote }}
- namespace: {{ .Release.Namespace | quote }}
-{{- end }}
+# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+
+{{- define "operator.clusterRoleBindingGeneral" }}
+---
+apiVersion: "rbac.authorization.k8s.io/v1"
+{{- if (or (eq (default "List" .domainNamespaceSelectionStrategy) "Dedicated") (and .dedicated (eq (default "List" .domainNamespaceSelectionStrategy) "List"))) }}
+kind: "RoleBinding"
+{{- else }}
+kind: "ClusterRoleBinding"
+{{- end }}
+metadata:
+ labels:
+ weblogic.operatorName: {{ .Release.Namespace | quote }}
+ {{- if (or (eq (default "List" .domainNamespaceSelectionStrategy) "Dedicated") (and .dedicated (eq (default "List" .domainNamespaceSelectionStrategy) "List"))) }}
+ name: "weblogic-operator-rolebinding-general"
+ namespace: {{ .Release.Namespace | quote }}
+ {{- else }}
+ name: {{ list .Release.Namespace "weblogic-operator-clusterrolebinding-general" | join "-" | quote }}
+ {{- end }}
+roleRef:
+ apiGroup: "rbac.authorization.k8s.io"
+ {{- if (or (eq (default "List" .domainNamespaceSelectionStrategy) "Dedicated") (and .dedicated (eq (default "List" .domainNamespaceSelectionStrategy) "List"))) }}
+ kind: "Role"
+ name: "weblogic-operator-role-general"
+ {{- else }}
+ kind: "ClusterRole"
+ name: {{ list .Release.Namespace "weblogic-operator-clusterrole-general" | join "-" | quote }}
+ {{- end }}
+subjects:
+- kind: "ServiceAccount"
+ apiGroup: ""
+ name: {{ .serviceAccount | quote }}
+ namespace: {{ .Release.Namespace | quote }}
+{{- end }}
diff --git a/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-clusterrolebinding-nonresource.tpl b/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-clusterrolebinding-nonresource.tpl
old mode 100644
new mode 100755
index d998ab0e9..0f0fd0a63
--- a/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-clusterrolebinding-nonresource.tpl
+++ b/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-clusterrolebinding-nonresource.tpl
@@ -1,21 +1,21 @@
-# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-
-{{- define "operator.clusterRoleBindingNonResource" }}
----
-apiVersion: "rbac.authorization.k8s.io/v1"
-kind: "ClusterRoleBinding"
-metadata:
- labels:
- weblogic.operatorName: {{ .Release.Namespace | quote }}
- name: {{ list .Release.Namespace "weblogic-operator-clusterrolebinding-nonresource" | join "-" | quote }}
-roleRef:
- apiGroup: "rbac.authorization.k8s.io"
- kind: "ClusterRole"
- name: {{ list .Release.Namespace "weblogic-operator-clusterrole-nonresource" | join "-" | quote }}
-subjects:
-- kind: "ServiceAccount"
- apiGroup: ""
- name: {{ .serviceAccount | quote }}
- namespace: {{ .Release.Namespace | quote }}
-{{- end }}
+# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+
+{{- define "operator.clusterRoleBindingNonResource" }}
+---
+apiVersion: "rbac.authorization.k8s.io/v1"
+kind: "ClusterRoleBinding"
+metadata:
+ labels:
+ weblogic.operatorName: {{ .Release.Namespace | quote }}
+ name: {{ list .Release.Namespace "weblogic-operator-clusterrolebinding-nonresource" | join "-" | quote }}
+roleRef:
+ apiGroup: "rbac.authorization.k8s.io"
+ kind: "ClusterRole"
+ name: {{ list .Release.Namespace "weblogic-operator-clusterrole-nonresource" | join "-" | quote }}
+subjects:
+- kind: "ServiceAccount"
+ apiGroup: ""
+ name: {{ .serviceAccount | quote }}
+ namespace: {{ .Release.Namespace | quote }}
+{{- end }}
diff --git a/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-cm.tpl b/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-cm.tpl
old mode 100644
new mode 100755
index dd6594de2..c94f25313
--- a/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-cm.tpl
+++ b/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-cm.tpl
@@ -1,58 +1,58 @@
-# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-
-{{- define "operator.operatorConfigMap" }}
----
-apiVersion: "v1"
-data:
- {{- if .externalRestEnabled }}
- {{- if (hasKey . "externalRestIdentitySecret") }}
- externalRestIdentitySecret: {{ .externalRestIdentitySecret | quote }}
- {{- else }}
- externalOperatorCert: {{ .externalOperatorCert | quote }}
- {{- end }}
- {{- end }}
- {{- $configmap := (lookup "v1" "ConfigMap" .Release.Namespace "weblogic-operator-cm") }}
- {{- if (and $configmap $configmap.data) }}
- {{- $internalOperatorCert := index $configmap.data "internalOperatorCert" }}
- {{- if $internalOperatorCert }}
- internalOperatorCert: {{ $internalOperatorCert }}
- {{- end }}
- {{- end }}
- serviceaccount: {{ .serviceAccount | quote }}
- domainNamespaceSelectionStrategy: {{ (default "List" .domainNamespaceSelectionStrategy) | quote }}
- domainNamespaces: {{ .domainNamespaces | uniq | sortAlpha | join "," | quote }}
- {{- if .dedicated }}
- dedicated: {{ .dedicated | quote }}
- {{- end }}
- {{- if .domainNamespaceLabelSelector }}
- domainNamespaceLabelSelector: {{ .domainNamespaceLabelSelector | quote }}
- {{- end }}
- {{- if .domainNamespaceRegExp }}
- domainNamespaceRegExp: {{ .domainNamespaceRegExp | quote }}
- {{- end }}
- {{- if .dns1123Fields }}
- dns1123Fields: {{ .dns1123Fields | quote }}
- {{- end }}
- {{- if .featureGates }}
- featureGates: {{ .featureGates | quote }}
- {{- end }}
- {{- if .introspectorJobNameSuffix }}
- introspectorJobNameSuffix: {{ .introspectorJobNameSuffix | quote }}
- {{- end }}
- {{- if .externalServiceNameSuffix }}
- externalServiceNameSuffix: {{ .externalServiceNameSuffix | quote }}
- {{- end }}
- {{- if .clusterSizePaddingValidationEnabled }}
- clusterSizePaddingValidationEnabled: {{ .clusterSizePaddingValidationEnabled | quote }}
- {{- end }}
- {{- if .tokenReviewAuthentication }}
- tokenReviewAuthentication: {{ .tokenReviewAuthentication | quote }}
- {{- end }}
-kind: "ConfigMap"
-metadata:
- labels:
- weblogic.operatorName: {{ .Release.Namespace | quote }}
- name: "weblogic-operator-cm"
- namespace: {{ .Release.Namespace | quote }}
-{{- end }}
+# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+
+{{- define "operator.operatorConfigMap" }}
+---
+apiVersion: "v1"
+data:
+ {{- if .externalRestEnabled }}
+ {{- if (hasKey . "externalRestIdentitySecret") }}
+ externalRestIdentitySecret: {{ .externalRestIdentitySecret | quote }}
+ {{- else }}
+ externalOperatorCert: {{ .externalOperatorCert | quote }}
+ {{- end }}
+ {{- end }}
+ {{- $configmap := (lookup "v1" "ConfigMap" .Release.Namespace "weblogic-operator-cm") }}
+ {{- if (and $configmap $configmap.data) }}
+ {{- $internalOperatorCert := index $configmap.data "internalOperatorCert" }}
+ {{- if $internalOperatorCert }}
+ internalOperatorCert: {{ $internalOperatorCert }}
+ {{- end }}
+ {{- end }}
+ serviceaccount: {{ .serviceAccount | quote }}
+ domainNamespaceSelectionStrategy: {{ (default "List" .domainNamespaceSelectionStrategy) | quote }}
+ domainNamespaces: {{ .domainNamespaces | uniq | sortAlpha | join "," | quote }}
+ {{- if .dedicated }}
+ dedicated: {{ .dedicated | quote }}
+ {{- end }}
+ {{- if .domainNamespaceLabelSelector }}
+ domainNamespaceLabelSelector: {{ .domainNamespaceLabelSelector | quote }}
+ {{- end }}
+ {{- if .domainNamespaceRegExp }}
+ domainNamespaceRegExp: {{ .domainNamespaceRegExp | quote }}
+ {{- end }}
+ {{- if .dns1123Fields }}
+ dns1123Fields: {{ .dns1123Fields | quote }}
+ {{- end }}
+ {{- if .featureGates }}
+ featureGates: {{ .featureGates | quote }}
+ {{- end }}
+ {{- if .introspectorJobNameSuffix }}
+ introspectorJobNameSuffix: {{ .introspectorJobNameSuffix | quote }}
+ {{- end }}
+ {{- if .externalServiceNameSuffix }}
+ externalServiceNameSuffix: {{ .externalServiceNameSuffix | quote }}
+ {{- end }}
+ {{- if .clusterSizePaddingValidationEnabled }}
+ clusterSizePaddingValidationEnabled: {{ .clusterSizePaddingValidationEnabled | quote }}
+ {{- end }}
+ {{- if .tokenReviewAuthentication }}
+ tokenReviewAuthentication: {{ .tokenReviewAuthentication | quote }}
+ {{- end }}
+kind: "ConfigMap"
+metadata:
+ labels:
+ weblogic.operatorName: {{ .Release.Namespace | quote }}
+ name: "weblogic-operator-cm"
+ namespace: {{ .Release.Namespace | quote }}
+{{- end }}
diff --git a/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-dep.tpl b/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-dep.tpl
old mode 100644
new mode 100755
index 3fadac7dc..bc05c2914
--- a/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-dep.tpl
+++ b/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-dep.tpl
@@ -1,158 +1,158 @@
-# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-
-{{- define "operator.operatorDeployment" }}
----
-apiVersion: "apps/v1"
-kind: "Deployment"
-metadata:
- name: "weblogic-operator"
- namespace: {{ .Release.Namespace | quote }}
- labels:
- weblogic.operatorName: {{ .Release.Namespace | quote }}
-spec:
- strategy:
- type: Recreate
- selector:
- matchLabels:
- weblogic.operatorName: {{ .Release.Namespace | quote }}
- replicas: 1
- template:
- metadata:
- {{- with .annotations }}
- annotations:
- {{- end }}
- {{- range $key, $value := .annotations }}
- {{ $key }}: {{ $value | quote }}
- {{- end }}
- labels:
- weblogic.operatorName: {{ .Release.Namespace | quote }}
- app: "weblogic-operator"
- {{- range $key, $value := .labels }}
- {{ $key }}: {{ $value | quote }}
- {{- end }}
- spec:
- serviceAccountName: {{ .serviceAccount | quote }}
- {{- with .nodeSelector }}
- nodeSelector:
- {{- toYaml . | nindent 8 }}
- {{- end }}
- {{- with .affinity }}
- affinity:
- {{- toYaml . | nindent 8 }}
- {{- end }}
- containers:
- - name: "weblogic-operator"
- image: {{ .image | quote }}
- imagePullPolicy: {{ .imagePullPolicy | quote }}
- command: ["bash"]
- args: ["/operator/operator.sh"]
- env:
- - name: "OPERATOR_NAMESPACE"
- valueFrom:
- fieldRef:
- fieldPath: "metadata.namespace"
- - name: "OPERATOR_POD_NAME"
- valueFrom:
- fieldRef:
- fieldPath: "metadata.name"
- - name: "OPERATOR_POD_UID"
- valueFrom:
- fieldRef:
- fieldPath: "metadata.uid"
- - name: "OPERATOR_VERBOSE"
- value: "false"
- - name: "JAVA_LOGGING_LEVEL"
- value: {{ .javaLoggingLevel | quote }}
- - name: "JAVA_LOGGING_MAXSIZE"
- value: {{ .javaLoggingFileSizeLimit | default 20000000 | quote }}
- - name: "JAVA_LOGGING_COUNT"
- value: {{ .javaLoggingFileCount | default 10 | quote }}
- {{- if .remoteDebugNodePortEnabled }}
- - name: "REMOTE_DEBUG_PORT"
- value: {{ .internalDebugHttpPort | quote }}
- - name: "DEBUG_SUSPEND"
- {{- if .suspendOnDebugStartup }}
- value: "y"
- {{- else }}
- value: "n"
- {{- end }}
- {{- end }}
- {{- if .mockWLS }}
- - name: "MOCK_WLS"
- value: "true"
- {{- end }}
- resources:
- requests:
- cpu: {{ .cpuRequests | default "250m" }}
- memory: {{ .memoryRequests | default "512Mi" }}
- limits:
- {{- if .cpuLimits}}
- cpu: {{ .cpuLimits }}
- {{- end }}
- {{- if .memoryLimits}}
- memory: {{ .memoryLimits }}
- {{- end }}
- volumeMounts:
- - name: "weblogic-operator-cm-volume"
- mountPath: "/operator/config"
- - name: "weblogic-operator-debug-cm-volume"
- mountPath: "/operator/debug-config"
- - name: "weblogic-operator-secrets-volume"
- mountPath: "/operator/secrets"
- readOnly: true
- {{- if .elkIntegrationEnabled }}
- - mountPath: "/logs"
- name: "log-dir"
- readOnly: false
- {{- end }}
- {{- if not .remoteDebugNodePortEnabled }}
- livenessProbe:
- exec:
- command:
- - "bash"
- - "/operator/livenessProbe.sh"
- initialDelaySeconds: 20
- periodSeconds: 5
- readinessProbe:
- exec:
- command:
- - "bash"
- - "/operator/readinessProbe.sh"
- initialDelaySeconds: 2
- periodSeconds: 10
- {{- end }}
- {{- if .elkIntegrationEnabled }}
- - name: "logstash"
- image: {{ .logStashImage | quote }}
- args: [ "-f", "/logs/logstash.conf" ]
- volumeMounts:
- - name: "log-dir"
- mountPath: "/logs"
- env:
- - name: "ELASTICSEARCH_HOST"
- value: {{ .elasticSearchHost | quote }}
- - name: "ELASTICSEARCH_PORT"
- value: {{ .elasticSearchPort | quote }}
- {{- end }}
- {{- if .imagePullSecrets }}
- imagePullSecrets:
- {{ .imagePullSecrets | toYaml }}
- {{- end }}
- volumes:
- - name: "weblogic-operator-cm-volume"
- configMap:
- name: "weblogic-operator-cm"
- - name: "weblogic-operator-debug-cm-volume"
- configMap:
- name: "weblogic-operator-debug-cm"
- optional: true
- - name: "weblogic-operator-secrets-volume"
- secret:
- secretName: "weblogic-operator-secrets"
- {{- if .elkIntegrationEnabled }}
- - name: "log-dir"
- emptyDir:
- medium: "Memory"
- {{- end }}
-{{- end }}
+# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+
+{{- define "operator.operatorDeployment" }}
+---
+apiVersion: "apps/v1"
+kind: "Deployment"
+metadata:
+ name: "weblogic-operator"
+ namespace: {{ .Release.Namespace | quote }}
+ labels:
+ weblogic.operatorName: {{ .Release.Namespace | quote }}
+spec:
+ strategy:
+ type: Recreate
+ selector:
+ matchLabels:
+ weblogic.operatorName: {{ .Release.Namespace | quote }}
+ replicas: 1
+ template:
+ metadata:
+ {{- with .annotations }}
+ annotations:
+ {{- end }}
+ {{- range $key, $value := .annotations }}
+ {{ $key }}: {{ $value | quote }}
+ {{- end }}
+ labels:
+ weblogic.operatorName: {{ .Release.Namespace | quote }}
+ app: "weblogic-operator"
+ {{- range $key, $value := .labels }}
+ {{ $key }}: {{ $value | quote }}
+ {{- end }}
+ spec:
+ serviceAccountName: {{ .serviceAccount | quote }}
+ {{- with .nodeSelector }}
+ nodeSelector:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{- with .affinity }}
+ affinity:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ containers:
+ - name: "weblogic-operator"
+ image: {{ .image | quote }}
+ imagePullPolicy: {{ .imagePullPolicy | quote }}
+ command: ["bash"]
+ args: ["/operator/operator.sh"]
+ env:
+ - name: "OPERATOR_NAMESPACE"
+ valueFrom:
+ fieldRef:
+ fieldPath: "metadata.namespace"
+ - name: "OPERATOR_POD_NAME"
+ valueFrom:
+ fieldRef:
+ fieldPath: "metadata.name"
+ - name: "OPERATOR_POD_UID"
+ valueFrom:
+ fieldRef:
+ fieldPath: "metadata.uid"
+ - name: "OPERATOR_VERBOSE"
+ value: "false"
+ - name: "JAVA_LOGGING_LEVEL"
+ value: {{ .javaLoggingLevel | quote }}
+ - name: "JAVA_LOGGING_MAXSIZE"
+ value: {{ .javaLoggingFileSizeLimit | default 20000000 | quote }}
+ - name: "JAVA_LOGGING_COUNT"
+ value: {{ .javaLoggingFileCount | default 10 | quote }}
+ {{- if .remoteDebugNodePortEnabled }}
+ - name: "REMOTE_DEBUG_PORT"
+ value: {{ .internalDebugHttpPort | quote }}
+ - name: "DEBUG_SUSPEND"
+ {{- if .suspendOnDebugStartup }}
+ value: "y"
+ {{- else }}
+ value: "n"
+ {{- end }}
+ {{- end }}
+ {{- if .mockWLS }}
+ - name: "MOCK_WLS"
+ value: "true"
+ {{- end }}
+ resources:
+ requests:
+ cpu: {{ .cpuRequests | default "250m" }}
+ memory: {{ .memoryRequests | default "512Mi" }}
+ limits:
+ {{- if .cpuLimits}}
+ cpu: {{ .cpuLimits }}
+ {{- end }}
+ {{- if .memoryLimits}}
+ memory: {{ .memoryLimits }}
+ {{- end }}
+ volumeMounts:
+ - name: "weblogic-operator-cm-volume"
+ mountPath: "/operator/config"
+ - name: "weblogic-operator-debug-cm-volume"
+ mountPath: "/operator/debug-config"
+ - name: "weblogic-operator-secrets-volume"
+ mountPath: "/operator/secrets"
+ readOnly: true
+ {{- if .elkIntegrationEnabled }}
+ - mountPath: "/logs"
+ name: "log-dir"
+ readOnly: false
+ {{- end }}
+ {{- if not .remoteDebugNodePortEnabled }}
+ livenessProbe:
+ exec:
+ command:
+ - "bash"
+ - "/operator/livenessProbe.sh"
+ initialDelaySeconds: 20
+ periodSeconds: 5
+ readinessProbe:
+ exec:
+ command:
+ - "bash"
+ - "/operator/readinessProbe.sh"
+ initialDelaySeconds: 2
+ periodSeconds: 10
+ {{- end }}
+ {{- if .elkIntegrationEnabled }}
+ - name: "logstash"
+ image: {{ .logStashImage | quote }}
+ args: [ "-f", "/logs/logstash.conf" ]
+ volumeMounts:
+ - name: "log-dir"
+ mountPath: "/logs"
+ env:
+ - name: "ELASTICSEARCH_HOST"
+ value: {{ .elasticSearchHost | quote }}
+ - name: "ELASTICSEARCH_PORT"
+ value: {{ .elasticSearchPort | quote }}
+ {{- end }}
+ {{- if .imagePullSecrets }}
+ imagePullSecrets:
+ {{ .imagePullSecrets | toYaml }}
+ {{- end }}
+ volumes:
+ - name: "weblogic-operator-cm-volume"
+ configMap:
+ name: "weblogic-operator-cm"
+ - name: "weblogic-operator-debug-cm-volume"
+ configMap:
+ name: "weblogic-operator-debug-cm"
+ optional: true
+ - name: "weblogic-operator-secrets-volume"
+ secret:
+ secretName: "weblogic-operator-secrets"
+ {{- if .elkIntegrationEnabled }}
+ - name: "log-dir"
+ emptyDir:
+ medium: "Memory"
+ {{- end }}
+{{- end }}
diff --git a/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-external-svc.tpl b/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-external-svc.tpl
old mode 100644
new mode 100755
index 44bfc1191..06e963f1a
--- a/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-external-svc.tpl
+++ b/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-external-svc.tpl
@@ -1,30 +1,30 @@
-# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-
-{{- define "operator.operatorExternalService" }}
-{{- if or .externalRestEnabled .remoteDebugNodePortEnabled }}
----
-apiVersion: "v1"
-kind: "Service"
-metadata:
- name: "external-weblogic-operator-svc"
- namespace: {{ .Release.Namespace | quote }}
- labels:
- weblogic.operatorName: {{ .Release.Namespace | quote }}
-spec:
- type: "NodePort"
- selector:
- app: "weblogic-operator"
- ports:
- {{- if .externalRestEnabled }}
- - name: "rest"
- port: 8081
- nodePort: {{ .externalRestHttpsPort }}
- {{- end }}
- {{- if .remoteDebugNodePortEnabled }}
- - name: "debug"
- port: {{ .internalDebugHttpPort }}
- nodePort: {{ .externalDebugHttpPort }}
- {{- end }}
-{{- end }}
-{{- end }}
+# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+
+{{- define "operator.operatorExternalService" }}
+{{- if or .externalRestEnabled .remoteDebugNodePortEnabled }}
+---
+apiVersion: "v1"
+kind: "Service"
+metadata:
+ name: "external-weblogic-operator-svc"
+ namespace: {{ .Release.Namespace | quote }}
+ labels:
+ weblogic.operatorName: {{ .Release.Namespace | quote }}
+spec:
+ type: "NodePort"
+ selector:
+ app: "weblogic-operator"
+ ports:
+ {{- if .externalRestEnabled }}
+ - name: "rest"
+ port: 8081
+ nodePort: {{ .externalRestHttpsPort }}
+ {{- end }}
+ {{- if .remoteDebugNodePortEnabled }}
+ - name: "debug"
+ port: {{ .internalDebugHttpPort }}
+ nodePort: {{ .externalDebugHttpPort }}
+ {{- end }}
+{{- end }}
+{{- end }}
diff --git a/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-internal-svc.tpl b/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-internal-svc.tpl
old mode 100644
new mode 100755
index 0108738de..b90c27d71
--- a/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-internal-svc.tpl
+++ b/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-internal-svc.tpl
@@ -1,20 +1,20 @@
-# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-
-{{- define "operator.operatorInternalService" }}
----
-apiVersion: "v1"
-kind: "Service"
-metadata:
- name: "internal-weblogic-operator-svc"
- namespace: {{ .Release.Namespace | quote }}
- labels:
- weblogic.operatorName: {{ .Release.Namespace | quote }}
-spec:
- type: "ClusterIP"
- selector:
- app: "weblogic-operator"
- ports:
- - port: 8082
- name: "rest"
-{{- end }}
+# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+
+{{- define "operator.operatorInternalService" }}
+---
+apiVersion: "v1"
+kind: "Service"
+metadata:
+ name: "internal-weblogic-operator-svc"
+ namespace: {{ .Release.Namespace | quote }}
+ labels:
+ weblogic.operatorName: {{ .Release.Namespace | quote }}
+spec:
+ type: "ClusterIP"
+ selector:
+ app: "weblogic-operator"
+ ports:
+ - port: 8082
+ name: "rest"
+{{- end }}
diff --git a/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-role.tpl b/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-role.tpl
old mode 100644
new mode 100755
index e0c386b98..a521a5d75
--- a/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-role.tpl
+++ b/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-role.tpl
@@ -1,17 +1,17 @@
-# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-
-{{- define "operator.operatorRole" }}
----
-kind: "Role"
-apiVersion: "rbac.authorization.k8s.io/v1"
-metadata:
- name: "weblogic-operator-role"
- namespace: {{ .Release.Namespace | quote }}
- labels:
- weblogic.operatorName: {{ .Release.Namespace | quote }}
-rules:
-- apiGroups: [""]
- resources: ["events", "secrets", "configmaps"]
- verbs: ["get", "list", "watch", "create", "update", "patch", "delete", "deletecollection"]
-{{- end }}
+# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+
+{{- define "operator.operatorRole" }}
+---
+kind: "Role"
+apiVersion: "rbac.authorization.k8s.io/v1"
+metadata:
+ name: "weblogic-operator-role"
+ namespace: {{ .Release.Namespace | quote }}
+ labels:
+ weblogic.operatorName: {{ .Release.Namespace | quote }}
+rules:
+- apiGroups: [""]
+ resources: ["events", "secrets", "configmaps"]
+ verbs: ["get", "list", "watch", "create", "update", "patch", "delete", "deletecollection"]
+{{- end }}
diff --git a/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-rolebinding-namespace.tpl b/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-rolebinding-namespace.tpl
old mode 100644
new mode 100755
index d55ed3f47..6075b630b
--- a/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-rolebinding-namespace.tpl
+++ b/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-rolebinding-namespace.tpl
@@ -1,35 +1,35 @@
-# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-
-{{- define "operator.operatorRoleBindingNamespace" }}
----
-{{- if .enableClusterRoleBinding }}
-kind: "ClusterRoleBinding"
-{{- else }}
-kind: "RoleBinding"
-{{- end }}
-apiVersion: "rbac.authorization.k8s.io/v1"
-metadata:
- {{- if .enableClusterRoleBinding }}
- name: {{ list .Release.Namespace "weblogic-operator-clusterrolebinding-namespace" | join "-" | quote }}
- {{- else }}
- name: "weblogic-operator-rolebinding-namespace"
- namespace: {{ .domainNamespace | quote }}
- {{- end }}
- labels:
- weblogic.operatorName: {{ .Release.Namespace | quote }}
-subjects:
-- kind: "ServiceAccount"
- name: {{ .serviceAccount | quote }}
- namespace: {{ .Release.Namespace | quote }}
- apiGroup: ""
-roleRef:
- {{- if (or (eq (default "List" .domainNamespaceSelectionStrategy) "Dedicated") (and .dedicated (eq (default "List" .domainNamespaceSelectionStrategy) "List"))) }}
- kind: "Role"
- name: "weblogic-operator-role-namespace"
- {{- else }}
- kind: "ClusterRole"
- name: {{ list .Release.Namespace "weblogic-operator-clusterrole-namespace" | join "-" | quote }}
- {{- end }}
- apiGroup: "rbac.authorization.k8s.io"
-{{- end }}
+# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+
+{{- define "operator.operatorRoleBindingNamespace" }}
+---
+{{- if .enableClusterRoleBinding }}
+kind: "ClusterRoleBinding"
+{{- else }}
+kind: "RoleBinding"
+{{- end }}
+apiVersion: "rbac.authorization.k8s.io/v1"
+metadata:
+ {{- if .enableClusterRoleBinding }}
+ name: {{ list .Release.Namespace "weblogic-operator-clusterrolebinding-namespace" | join "-" | quote }}
+ {{- else }}
+ name: "weblogic-operator-rolebinding-namespace"
+ namespace: {{ .domainNamespace | quote }}
+ {{- end }}
+ labels:
+ weblogic.operatorName: {{ .Release.Namespace | quote }}
+subjects:
+- kind: "ServiceAccount"
+ name: {{ .serviceAccount | quote }}
+ namespace: {{ .Release.Namespace | quote }}
+ apiGroup: ""
+roleRef:
+ {{- if (or (eq (default "List" .domainNamespaceSelectionStrategy) "Dedicated") (and .dedicated (eq (default "List" .domainNamespaceSelectionStrategy) "List"))) }}
+ kind: "Role"
+ name: "weblogic-operator-role-namespace"
+ {{- else }}
+ kind: "ClusterRole"
+ name: {{ list .Release.Namespace "weblogic-operator-clusterrole-namespace" | join "-" | quote }}
+ {{- end }}
+ apiGroup: "rbac.authorization.k8s.io"
+{{- end }}
diff --git a/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-rolebinding.tpl b/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-rolebinding.tpl
old mode 100644
new mode 100755
index 98a09424e..b87f56336
--- a/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-rolebinding.tpl
+++ b/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-rolebinding.tpl
@@ -1,22 +1,22 @@
-# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-
-{{- define "operator.operatorRoleBinding" }}
----
-kind: "RoleBinding"
-apiVersion: "rbac.authorization.k8s.io/v1"
-metadata:
- name: "weblogic-operator-rolebinding"
- namespace: {{ .Release.Namespace | quote }}
- labels:
- weblogic.operatorName: {{ .Release.Namespace | quote }}
-subjects:
-- kind: "ServiceAccount"
- name: {{ .serviceAccount | quote }}
- namespace: {{ .Release.Namespace | quote }}
- apiGroup: ""
-roleRef:
- kind: "Role"
- name: "weblogic-operator-role"
- apiGroup: "rbac.authorization.k8s.io"
-{{- end }}
+# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+
+{{- define "operator.operatorRoleBinding" }}
+---
+kind: "RoleBinding"
+apiVersion: "rbac.authorization.k8s.io/v1"
+metadata:
+ name: "weblogic-operator-rolebinding"
+ namespace: {{ .Release.Namespace | quote }}
+ labels:
+ weblogic.operatorName: {{ .Release.Namespace | quote }}
+subjects:
+- kind: "ServiceAccount"
+ name: {{ .serviceAccount | quote }}
+ namespace: {{ .Release.Namespace | quote }}
+ apiGroup: ""
+roleRef:
+ kind: "Role"
+ name: "weblogic-operator-role"
+ apiGroup: "rbac.authorization.k8s.io"
+{{- end }}
diff --git a/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-secret.tpl b/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-secret.tpl
old mode 100644
new mode 100755
index 6a7442718..f67917cd7
--- a/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-secret.tpl
+++ b/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator-secret.tpl
@@ -1,25 +1,25 @@
-# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-
-{{- define "operator.operatorSecrets" }}
----
-apiVersion: "v1"
-kind: "Secret"
-data:
- {{- if (and .externalRestEnabled (hasKey . "externalOperatorKey")) }}
- externalOperatorKey: {{ .externalOperatorKey | quote }}
- {{- end }}
- {{- $secret := (lookup "v1" "Secret" .Release.Namespace "weblogic-operator-secrets") }}
- {{- if (and $secret $secret.data) }}
- {{- $internalOperatorKey := index $secret.data "internalOperatorKey" }}
- {{- if $internalOperatorKey }}
- internalOperatorKey: {{ $internalOperatorKey }}
- {{- end }}
- {{- end }}
-metadata:
- labels:
- weblogic.operatorName: {{ .Release.Namespace | quote }}
- name: "weblogic-operator-secrets"
- namespace: {{ .Release.Namespace | quote }}
-type: "Opaque"
-{{- end }}
+# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+
+{{- define "operator.operatorSecrets" }}
+---
+apiVersion: "v1"
+kind: "Secret"
+data:
+ {{- if (and .externalRestEnabled (hasKey . "externalOperatorKey")) }}
+ externalOperatorKey: {{ .externalOperatorKey | quote }}
+ {{- end }}
+ {{- $secret := (lookup "v1" "Secret" .Release.Namespace "weblogic-operator-secrets") }}
+ {{- if (and $secret $secret.data) }}
+ {{- $internalOperatorKey := index $secret.data "internalOperatorKey" }}
+ {{- if $internalOperatorKey }}
+ internalOperatorKey: {{ $internalOperatorKey }}
+ {{- end }}
+ {{- end }}
+metadata:
+ labels:
+ weblogic.operatorName: {{ .Release.Namespace | quote }}
+ name: "weblogic-operator-secrets"
+ namespace: {{ .Release.Namespace | quote }}
+type: "Opaque"
+{{- end }}
diff --git a/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator.tpl b/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator.tpl
old mode 100644
new mode 100755
index c24d7eebf..94eb85366
--- a/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator.tpl
+++ b/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_operator.tpl
@@ -1,30 +1,30 @@
-# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-
-{{- define "operator.operator" -}}
-{{- include "operator.operatorClusterRoleGeneral" . }}
-{{- include "operator.operatorClusterRoleNamespace" . }}
-{{- if not (or (eq (default "List" .domainNamespaceSelectionStrategy) "Dedicated") (and .dedicated (eq (default "List" .domainNamespaceSelectionStrategy) "List"))) }}
-{{- include "operator.operatorClusterRoleNonResource" . }}
-{{- end }}
-{{- include "operator.operatorClusterRoleOperatorAdmin" . }}
-{{- include "operator.operatorClusterRoleDomainAdmin" . }}
-{{- include "operator.clusterRoleBindingGeneral" . }}
-{{- include "operator.clusterRoleBindingAuthDelegator" . }}
-{{- include "operator.clusterRoleBindingDiscovery" . }}
-{{- if not (or (eq (default "List" .domainNamespaceSelectionStrategy) "Dedicated") (and .dedicated (eq (default "List" .domainNamespaceSelectionStrategy) "List"))) }}
-{{- include "operator.clusterRoleBindingNonResource" . }}
-{{- end }}
-{{- include "operator.operatorRole" . }}
-{{- include "operator.operatorRoleBinding" . }}
-{{- include "operator.operatorConfigMap" . }}
-{{- include "operator.operatorSecrets" . }}
-{{- include "operator.operatorDeployment" . }}
-{{- include "operator.operatorInternalService" . }}
-{{- include "operator.operatorExternalService" . }}
-{{- if .enableClusterRoleBinding }}
-{{- include "operator.operatorRoleBindingNamespace" . }}
-{{- else }}
-{{- include "operator.domainNamespaces" . }}
-{{- end }}
-{{- end }}
+# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+
+{{- define "operator.operator" -}}
+{{- include "operator.operatorClusterRoleGeneral" . }}
+{{- include "operator.operatorClusterRoleNamespace" . }}
+{{- if not (or (eq (default "List" .domainNamespaceSelectionStrategy) "Dedicated") (and .dedicated (eq (default "List" .domainNamespaceSelectionStrategy) "List"))) }}
+{{- include "operator.operatorClusterRoleNonResource" . }}
+{{- end }}
+{{- include "operator.operatorClusterRoleOperatorAdmin" . }}
+{{- include "operator.operatorClusterRoleDomainAdmin" . }}
+{{- include "operator.clusterRoleBindingGeneral" . }}
+{{- include "operator.clusterRoleBindingAuthDelegator" . }}
+{{- include "operator.clusterRoleBindingDiscovery" . }}
+{{- if not (or (eq (default "List" .domainNamespaceSelectionStrategy) "Dedicated") (and .dedicated (eq (default "List" .domainNamespaceSelectionStrategy) "List"))) }}
+{{- include "operator.clusterRoleBindingNonResource" . }}
+{{- end }}
+{{- include "operator.operatorRole" . }}
+{{- include "operator.operatorRoleBinding" . }}
+{{- include "operator.operatorConfigMap" . }}
+{{- include "operator.operatorSecrets" . }}
+{{- include "operator.operatorDeployment" . }}
+{{- include "operator.operatorInternalService" . }}
+{{- include "operator.operatorExternalService" . }}
+{{- if .enableClusterRoleBinding }}
+{{- include "operator.operatorRoleBindingNamespace" . }}
+{{- else }}
+{{- include "operator.domainNamespaces" . }}
+{{- end }}
+{{- end }}
diff --git a/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_utils.tpl b/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_utils.tpl
old mode 100644
new mode 100755
index 9f2ed825c..24619ca64
--- a/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_utils.tpl
+++ b/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_utils.tpl
@@ -1,493 +1,493 @@
-# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-
-{{/*
-Start validation
-*/}}
-{{- define "utils.startValidation" -}}
-{{- $scope := . -}}
-{{- $context := dict "scope" $scope "path" list -}}
-{{- $stack := list $context -}}
-{{- $ignore := set $scope "validationContextStack" $stack -}}
-{{- $ignore := include "utils.setCurrentValidationContext" $scope -}}
-{{- end -}}
-
-{{/*
-End validation
-If there were any validation errors, report them and kill the helm chart installation.
-*/}}
-{{- define "utils.endValidation" -}}
-{{- $scope := . -}}
-{{- if hasKey $scope "validationErrors" -}}
-{{- fail $scope.validationErrors -}}
-{{- end -}}
-{{- end -}}
-
-{{/*
-Push a new validation context
-*/}}
-{{- define "utils.pushValidationContext" -}}
-{{- $scope := index . 0 }}
-{{- $scopeName := index . 1 }}
-{{- $newScope := index $scope.validationScope $scopeName -}}
-{{- $newPath := append $scope.validationPath $scopeName -}}
-{{- $newContext := dict "scope" $newScope "path" $newPath -}}
-{{- $newStack := append $scope.validationContextStack $newContext -}}
-{{- $ignore := set $scope "validationContextStack" $newStack -}}
-{{- $ignore := include "utils.setCurrentValidationContext" $scope -}}
-{{- end -}}
-
-{{/*
-Pop the validation context
-*/}}
-{{- define "utils.popValidationContext" -}}
-{{- $scope := . }}
-{{- $stack := $scope.validationContextStack -}}
-{{- $ignore := set $scope "validationContextStack" (initial $stack) -}}
-{{- $ignore := include "utils.setCurrentValidationContext" $scope -}}
-{{- end -}}
-
-{{/*
-Set the current validation context from the stack
-*/}}
-{{- define "utils.setCurrentValidationContext" -}}
-{{- $scope := . }}
-{{- $context := $scope.validationContextStack | last -}}
-{{- $ignore := set $scope "validationScope" (index $context "scope") -}}
-{{- $ignore := set $scope "validationPath" (index $context "path") -}}
-{{- end -}}
-
-{{/*
-Record a validation error (it will get reported later by utils.reportValidationErrors)
-*/}}
-{{- define "utils.recordValidationError" -}}
-{{- $scope := index . 0 -}}
-{{- $errorMsg := index . 1 -}}
-{{- $path := $scope.validationPath -}}
-{{- $pathStr := $path | join "." | trim -}}
-{{- $scopedErrorMsg := (list "\n" $pathStr $errorMsg) | compact | join " " -}}
-{{- if hasKey $scope "validationErrors" -}}
-{{- $newValidationErrors := cat $scope.validationErrors $scopedErrorMsg -}}
-{{- $ignore := set $scope "validationErrors" $newValidationErrors -}}
-{{- else -}}
-{{- $newValidationErrors := $scopedErrorMsg -}}
-{{- $ignore := set $scope "validationErrors" $newValidationErrors -}}
-{{- end -}}
-{{- end -}}
-
-{{/*
-Returns whether any errors have been reported
-*/}}
-{{- define "utils.haveValidationErrors" -}}
-{{- if hasKey . "validationErrors" -}}
- true
-{{- end -}}
-{{- end -}}
-
-{{/*
-Determine whether a dictionary has a non-null value for a key
-*/}}
-{{- define "utils.dictionaryHasNonNullValue" -}}
-{{- $dict := index . 0 -}}
-{{- $name := index . 1 -}}
-{{- if and (hasKey $dict $name) (not ( eq (typeOf (index $dict $name)) "" )) -}}
- true
-{{- end -}}
-{{- end -}}
-
-{{/*
-Verify that a value of a specific kind has been specified.
-*/}}
-{{- define "utils.verifyValue" -}}
-{{- $requiredKind := index . 0 -}}
-{{- $scope := index . 1 -}}
-{{- $name := index . 2 -}}
-{{- $isRequired := index . 3 -}}
-{{- if $scope.trace -}}
-{{- $errorMsg := cat "TRACE" $name $requiredKind $isRequired -}}
-{{- $ignore := include "utils.recordValidationError" (list $scope $errorMsg) -}}
-{{- end -}}
-{{- $parent := $scope.validationScope -}}
-{{- if include "utils.dictionaryHasNonNullValue" (list $parent $name) -}}
-{{- $value := index $parent $name -}}
-{{- $actualKind := kindOf $value -}}
-{{- if eq $requiredKind $actualKind -}}
- true
-{{- else -}}
-{{- $errorMsg := cat $name "must be a" $requiredKind ":" $actualKind -}}
-{{- include "utils.recordValidationError" (list $scope $errorMsg) -}}
-{{- end -}}
-{{- else -}}
-{{- if $isRequired -}}
-{{- $errorMsg := cat $requiredKind $name "must be specified" -}}
-{{- include "utils.recordValidationError" (list $scope $errorMsg) -}}
-{{- else -}}
- true
-{{- end -}}
-{{- end -}}
-{{- end -}}
-
-{{/*
-Verify that a list value has been specified
-*/}}
-{{- define "utils.verifyListValue" -}}
-{{- $requiredKind := index . 0 -}}
-{{- $scope := index . 1 -}}
-{{- $name := index . 2 -}}
-{{- $isRequired := index . 3 -}}
-{{- $parent := $scope.validationScope -}}
-{{- $args := . -}}
-{{- if include "utils.verifyValue" (list "slice" $scope $name $isRequired) -}}
-{{- $status := dict -}}
-{{- if hasKey $parent $name -}}
-{{- $list := index $parent $name -}}
-{{- range $value := $list -}}
-{{- $actualKind := kindOf $value -}}
-{{- if not (eq $requiredKind $actualKind) -}}
-{{- $errorMsg := cat $name "must only contain" $requiredKind "elements:" $actualKind -}}
-{{- include "utils.recordValidationError" (list $scope $errorMsg) -}}
-{{- $ignore := set $status "error" true -}}
-{{- end -}}
-{{- end -}}
-{{- end -}}
-{{- if not (hasKey $status "error") -}}
- true
-{{- end -}}
-{{- end -}}
-{{- end -}}
-
-{{/*
-Verify a string value
-*/}}
-{{- define "utils.baseVerifyString" -}}
-{{- include "utils.verifyValue" (prepend . "string") -}}
-{{- end -}}
-
-{{/*
-Verify a required string value
-*/}}
-{{- define "utils.verifyString" -}}
-{{- include "utils.baseVerifyString" (append . true) -}}
-{{- end -}}
-
-{{/*
-Verify an optional string value
-*/}}
-{{- define "utils.verifyOptionalString" -}}
-{{- include "utils.baseVerifyString" (append . false) -}}
-{{- end -}}
-
-{{/*
-Verify a boolean value
-*/}}
-{{- define "utils.baseVerifyBoolean" -}}
-{{- include "utils.verifyValue" (prepend . "bool") -}}
-{{- end -}}
-
-{{/*
-Verify a required boolean value
-*/}}
-{{- define "utils.verifyBoolean" -}}
-{{- include "utils.baseVerifyBoolean" (append . true) -}}
-{{- end -}}
-
-{{/*
-Verify an optional boolean value
-*/}}
-{{- define "utils.verifyOptionalBoolean" -}}
-{{- include "utils.baseVerifyBoolean" (append . false) -}}
-{{- end -}}
-
-{{/*
-Verify an integer value
-*/}}
-{{- define "utils.baseVerifyInteger" -}}
-{{- include "utils.verifyValue" (prepend . "float64") -}}
-{{- end -}}
-
-{{/*
-Verify a required integer value
-*/}}
-{{- define "utils.verifyInteger" -}}
-{{- include "utils.baseVerifyInteger" (append . true) -}}
-{{- end -}}
-
-{{/*
-Verify an optional required integer value
-*/}}
-{{- define "utils.verifyOptionalInteger" -}}
-{{- include "utils.baseVerifyInteger" (append . false) -}}
-{{- end -}}
-
-{{/*
-Verify a dictionary value
-*/}}
-{{- define "utils.baseVerifyDictionary" -}}
-{{- include "utils.verifyValue" (prepend . "map") -}}
-{{- end -}}
-
-{{/*
-Verify a required dictionary value
-*/}}
-{{- define "utils.verifyDictionary" -}}
-{{- include "utils.baseVerifyDictionary" (append . true) -}}
-{{- end -}}
-
-{{/*
-Verify an optional dictionary value
-*/}}
-{{- define "utils.verifyOptionalDictionary" -}}
-{{- include "utils.baseVerifyDictionary" (append . false) -}}
-{{- end -}}
-
-{{/*
-Verify a enum string value
-*/}}
-{{- define "utils.baseVerifyEnum" -}}
-{{- $scope := index . 0 -}}
-{{- $name := index . 1 -}}
-{{- $legalValues := index . 2 -}}
-{{- $isRequired := index . 3 -}}
-{{- if include "utils.baseVerifyString" (list $scope $name $isRequired) -}}
-{{- $parent := $scope.validationScope -}}
-{{- if include "utils.dictionaryHasNonNullValue" (list $parent $name) -}}
-{{- $value := index $parent $name -}}
-{{- if has $value $legalValues -}}
- true
-{{- else -}}
-{{ $errorMsg := cat $name "must be one of the following values" $legalValues ":" $value -}}
-{{- include "utils.recordValidationError" (list $scope $errorMsg) -}}
-{{- end -}}
-{{- end -}}
-{{- end -}}
-{{- end -}}
-
-{{/*
-Verify a required enum string value
-*/}}
-{{- define "utils.verifyEnum" -}}
-{{- include "utils.baseVerifyEnum" (append . true) -}}
-{{- end -}}
-
-{{/*
-Verify an optional enum string value
-*/}}
-{{- define "utils.verifyOptionalEnum" -}}
-{{- include "utils.baseVerifyEnum" (append . false) -}}
-{{- end -}}
-
-{{/*
-Verify a kubernetes resource name string value
-*/}}
-{{- define "utils.baseVerifyResourceName" -}}
-{{/* https://kubernetes.io/docs/concepts/overview/working-with-objects/names */}}
-{{/* names: only lower case, numbers, dot, dash, max 253 */}}
-{{/* https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#syntax-and-character-set */}}
-{{/* labels/selectors - upper & lower case, numbers, dot, dash, underscore, max 63 */}}
-{{- $scope := index . 0 -}}
-{{- $name := index . 1 -}}
-{{- $max := index . 2 -}}
-{{- $isRequired := index . 3 -}}
-{{- if include "utils.baseVerifyString" (list $scope $name $isRequired) -}}
-{{- $parent := $scope.validationScope -}}
-{{- if include "utils.dictionaryHasNonNullValue" (list $parent $name) -}}
-{{- $value := index $parent $name -}}
-{{- $len := len $value -}}
-{{- if and (le $len $max) (regexMatch "^[a-z0-9.-]+$" $value) -}}
- true
-{{- else -}}
-{{- $errorMsg := cat $name "must only contain lower case letters, numbers, dashes and dots, and must not contain more than" $max "characters: " $value -}}
-{{- include "utils.recordValidationError" (list $scope $errorMsg) -}}
-{{- end -}}
-{{- end -}}
-{{- else -}}
-{{- end -}}
-{{- end -}}
-
-{{/*
-Verify a required kubernetes resource name string value
-*/}}
-{{- define "utils.verifyResourceName" -}}
-{{- include "utils.baseVerifyResourceName" (append . true) -}}
-{{- end -}}
-
-{{/*
-Verify an optional kubernetes resource name string value
-*/}}
-{{- define "utils.verifyOptionalResourceName" -}}
-{{- include "utils.baseVerifyResourceName" (append . false) -}}
-{{- end -}}
-
-{{/*
-Verify external service name suffix string value
-*/}}
-{{- define "utils.verifyExternalServiceNameSuffix" -}}
-{{- include "utils.baseVerifyResourceName" (append . false) -}}
-{{- end -}}
-
-{{/*
-Verify introspector job name suffix string value
-*/}}
-{{- define "utils.verifyIntrospectorJobNameSuffix" -}}
-{{- include "utils.baseVerifyResourceName" (append . false) -}}
-{{- end -}}
-
-{{/*
-Verify a list of strings value
-*/}}
-{{- define "utils.baseVerifyStringList" -}}
-{{- include "utils.verifyListValue" (prepend . "string") -}}
-{{- end -}}
-
-{{/*
-Verify a required list of strings value
-*/}}
-{{- define "utils.verifyStringList" -}}
-{{- include "utils.baseVerifyStringList" (append . true) -}}
-{{- end -}}
-
-{{/*
-Verify an optional list of strings value
-*/}}
-{{- define "utils.verifyOptionalStringList" -}}
-{{- include "utils.baseVerifyStringList" (append . false) -}}
-{{- end -}}
-
-{{/*
-Verify a list of dictionaries value
-*/}}
-{{- define "utils.baseVerifyDictionaryList" -}}
-{{- include "utils.verifyListValue" (prepend . "map") -}}
-{{- end -}}
-
-{{/*
-Verify a required list of dictionaries value
-*/}}
-{{- define "utils.verifyDictionaryList" -}}
-{{- include "utils.baseVerifyDictionaryList" (append . true) -}}
-{{- end -}}
-
-{{/*
-Verify an optional list of dictionaries value
-*/}}
-{{- define "utils.verifyOptionalDictionaryList" -}}
-{{- include "utils.baseVerifyDictionaryList" (append . false) -}}
-{{- end -}}
-
-{{/*
-Merge a set of dictionaries into a single dictionary.
-
-The scope must be a list of dictionaries, starting with the least specific
-and ending with the most specific.
-
-First it makes an empty destinaction dictionary, then iterates over the dictionaries,
-overlaying their values on the destination dictionary.
-
-If a value is null, then it removes that key from the destination dictionary.
-
-If the value is already present in the destination dictionary, and the old and
-new values are both dictionaries, it merges them into the destination.
-*/}}
-{{- define "utils.mergeDictionaries" -}}
-{{- $dest := dict -}}
-{{- range $src := . -}}
-{{- if not (empty $src) -}}
-{{- range $key, $value := $src -}}
-{{- $ignore := include "utils.mergeDictionaryValue" (list $dest $key $value) -}}
-{{- end -}}
-{{- end -}}
-{{- end -}}
-{{- toYaml $dest -}}
-{{- end -}}
-
-{{/*
-Merge a value into a dictionary.
-This is like helm's 'merge' function, except that it handles null entries too.
-*/}}
-{{- define "utils.mergeDictionaryValue" -}}
-{{- $dest := index . 0 -}}
-{{- $key := index . 1 -}}
-{{- $newValue := index . 2 -}}
-{{- $newType := typeOf $newValue -}}
-{{- if hasKey $dest $key -}}
-{{- if eq $newType "" -}}
-{{/* # if the value already existed, and the new value is null, remove the old value */}}
-{{- $ignore := unset $dest $key -}}
-{{- else -}}
-{{- $oldValue := index $dest $key -}}
-{{- $oldKind := kindOf $oldValue -}}
-{{- $newKind := kindOf $newValue -}}
-{{- if (and (eq $oldKind "map") (eq $newKind "map")) -}}
-{{/* # if both values are maps, merge them */}}
-{{- $merged := include "utils.mergeDictionaries" (list $oldValue $newValue) | fromYaml -}}
-{{- $ignore := set $dest $key $merged -}}
-{{- else -}}
-{{/* # replace the old value with the new one */}}
-{{- $ignore := set $dest $key $newValue -}}
-{{- end -}}
-{{- end -}}
-{{- else -}}
-{{- if not (eq $newType "") -}}
-{{/* #if there was no old value, and the new value isn't null, use the new value */}}
-{{- $ignore := set $dest $key $newValue -}}
-{{- end -}}
-{{- end -}}
-{{- end -}}
-
-{{/*
-Make a writable copy of a dictionary.
-TBD - does helm provide a clone method we can use instead?
-*/}}
-{{- define "utils.cloneDictionary" -}}
-{{- include "utils.mergeDictionaries" (list .) -}}
-{{- end -}}
-
-{{/*
-Verify that a list of values (exclude) can not be defined if another value (key) is already defined
-*/}}
-{{- define "utils.mutexValue" -}}
-{{- $scope := index . 0 -}}
-{{- $key := index . 1 -}}
-{{- $exclude := index . 2 -}}
-{{- $type := index . 3 -}}
-{{- $parent := $scope.validationScope -}}
-{{- $args := . -}}
-{{- $status := dict -}}
-{{- if hasKey $parent $key -}}
-{{- range $value := $exclude -}}
-{{- if hasKey $parent $value -}}
-{{- $errorMsg := cat $value "can not be present when" $key "is defined" " " -}}
-{{- include "utils.recordValidationError" (list $scope $errorMsg) -}}
-{{- $ignore := set $status "error" true -}}
-{{- end -}}
-{{- end -}}
-{{- end -}}
-{{- if not (hasKey $status "error") -}}
- true
-{{- end -}}
-{{- end -}}
-
-{{/*
-Verify that a list of strings can not be defined if another string is already defined
-*/}}
-{{- define "utils.mutexString" -}}
-{{- include "utils.mutexValue" (append . "string") -}}
-{{- end -}}
-
-{{/*
-Verify that a Kubernetes resource exists in a given namespace
-*/}}
-{{- define "utils.verifyK8SResource" -}}
-{{- $scope := index . 0 -}}
-{{- $name := index . 1 -}}
-{{- $type := index . 2 -}}
-{{- $namespace := index . 3 -}}
-{{- $foundNS := (lookup "v1" "Namespace" "" $namespace) }}
-{{- if $foundNS }}
-{{- $foundResource := (lookup "v1" $type $namespace $name) }}
-{{- if not $foundResource }}
-{{- $errorMsg := cat $type $name " not found in namespace " $namespace -}}
-{{- include "utils.recordValidationError" (list $scope $errorMsg) -}}
-{{- end -}}
-{{- end -}}
-{{- end -}}
+# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+
+{{/*
+Start validation
+*/}}
+{{- define "utils.startValidation" -}}
+{{- $scope := . -}}
+{{- $context := dict "scope" $scope "path" list -}}
+{{- $stack := list $context -}}
+{{- $ignore := set $scope "validationContextStack" $stack -}}
+{{- $ignore := include "utils.setCurrentValidationContext" $scope -}}
+{{- end -}}
+
+{{/*
+End validation
+If there were any validation errors, report them and kill the helm chart installation.
+*/}}
+{{- define "utils.endValidation" -}}
+{{- $scope := . -}}
+{{- if hasKey $scope "validationErrors" -}}
+{{- fail $scope.validationErrors -}}
+{{- end -}}
+{{- end -}}
+
+{{/*
+Push a new validation context
+*/}}
+{{- define "utils.pushValidationContext" -}}
+{{- $scope := index . 0 }}
+{{- $scopeName := index . 1 }}
+{{- $newScope := index $scope.validationScope $scopeName -}}
+{{- $newPath := append $scope.validationPath $scopeName -}}
+{{- $newContext := dict "scope" $newScope "path" $newPath -}}
+{{- $newStack := append $scope.validationContextStack $newContext -}}
+{{- $ignore := set $scope "validationContextStack" $newStack -}}
+{{- $ignore := include "utils.setCurrentValidationContext" $scope -}}
+{{- end -}}
+
+{{/*
+Pop the validation context
+*/}}
+{{- define "utils.popValidationContext" -}}
+{{- $scope := . }}
+{{- $stack := $scope.validationContextStack -}}
+{{- $ignore := set $scope "validationContextStack" (initial $stack) -}}
+{{- $ignore := include "utils.setCurrentValidationContext" $scope -}}
+{{- end -}}
+
+{{/*
+Set the current validation context from the stack
+*/}}
+{{- define "utils.setCurrentValidationContext" -}}
+{{- $scope := . }}
+{{- $context := $scope.validationContextStack | last -}}
+{{- $ignore := set $scope "validationScope" (index $context "scope") -}}
+{{- $ignore := set $scope "validationPath" (index $context "path") -}}
+{{- end -}}
+
+{{/*
+Record a validation error (it will get reported later by utils.reportValidationErrors)
+*/}}
+{{- define "utils.recordValidationError" -}}
+{{- $scope := index . 0 -}}
+{{- $errorMsg := index . 1 -}}
+{{- $path := $scope.validationPath -}}
+{{- $pathStr := $path | join "." | trim -}}
+{{- $scopedErrorMsg := (list "\n" $pathStr $errorMsg) | compact | join " " -}}
+{{- if hasKey $scope "validationErrors" -}}
+{{- $newValidationErrors := cat $scope.validationErrors $scopedErrorMsg -}}
+{{- $ignore := set $scope "validationErrors" $newValidationErrors -}}
+{{- else -}}
+{{- $newValidationErrors := $scopedErrorMsg -}}
+{{- $ignore := set $scope "validationErrors" $newValidationErrors -}}
+{{- end -}}
+{{- end -}}
+
+{{/*
+Returns whether any errors have been reported
+*/}}
+{{- define "utils.haveValidationErrors" -}}
+{{- if hasKey . "validationErrors" -}}
+ true
+{{- end -}}
+{{- end -}}
+
+{{/*
+Determine whether a dictionary has a non-null value for a key
+*/}}
+{{- define "utils.dictionaryHasNonNullValue" -}}
+{{- $dict := index . 0 -}}
+{{- $name := index . 1 -}}
+{{- if and (hasKey $dict $name) (not ( eq (typeOf (index $dict $name)) "" )) -}}
+ true
+{{- end -}}
+{{- end -}}
+
+{{/*
+Verify that a value of a specific kind has been specified.
+*/}}
+{{- define "utils.verifyValue" -}}
+{{- $requiredKind := index . 0 -}}
+{{- $scope := index . 1 -}}
+{{- $name := index . 2 -}}
+{{- $isRequired := index . 3 -}}
+{{- if $scope.trace -}}
+{{- $errorMsg := cat "TRACE" $name $requiredKind $isRequired -}}
+{{- $ignore := include "utils.recordValidationError" (list $scope $errorMsg) -}}
+{{- end -}}
+{{- $parent := $scope.validationScope -}}
+{{- if include "utils.dictionaryHasNonNullValue" (list $parent $name) -}}
+{{- $value := index $parent $name -}}
+{{- $actualKind := kindOf $value -}}
+{{- if eq $requiredKind $actualKind -}}
+ true
+{{- else -}}
+{{- $errorMsg := cat $name "must be a" $requiredKind ":" $actualKind -}}
+{{- include "utils.recordValidationError" (list $scope $errorMsg) -}}
+{{- end -}}
+{{- else -}}
+{{- if $isRequired -}}
+{{- $errorMsg := cat $requiredKind $name "must be specified" -}}
+{{- include "utils.recordValidationError" (list $scope $errorMsg) -}}
+{{- else -}}
+ true
+{{- end -}}
+{{- end -}}
+{{- end -}}
+
+{{/*
+Verify that a list value has been specified
+*/}}
+{{- define "utils.verifyListValue" -}}
+{{- $requiredKind := index . 0 -}}
+{{- $scope := index . 1 -}}
+{{- $name := index . 2 -}}
+{{- $isRequired := index . 3 -}}
+{{- $parent := $scope.validationScope -}}
+{{- $args := . -}}
+{{- if include "utils.verifyValue" (list "slice" $scope $name $isRequired) -}}
+{{- $status := dict -}}
+{{- if hasKey $parent $name -}}
+{{- $list := index $parent $name -}}
+{{- range $value := $list -}}
+{{- $actualKind := kindOf $value -}}
+{{- if not (eq $requiredKind $actualKind) -}}
+{{- $errorMsg := cat $name "must only contain" $requiredKind "elements:" $actualKind -}}
+{{- include "utils.recordValidationError" (list $scope $errorMsg) -}}
+{{- $ignore := set $status "error" true -}}
+{{- end -}}
+{{- end -}}
+{{- end -}}
+{{- if not (hasKey $status "error") -}}
+ true
+{{- end -}}
+{{- end -}}
+{{- end -}}
+
+{{/*
+Verify a string value
+*/}}
+{{- define "utils.baseVerifyString" -}}
+{{- include "utils.verifyValue" (prepend . "string") -}}
+{{- end -}}
+
+{{/*
+Verify a required string value
+*/}}
+{{- define "utils.verifyString" -}}
+{{- include "utils.baseVerifyString" (append . true) -}}
+{{- end -}}
+
+{{/*
+Verify an optional string value
+*/}}
+{{- define "utils.verifyOptionalString" -}}
+{{- include "utils.baseVerifyString" (append . false) -}}
+{{- end -}}
+
+{{/*
+Verify a boolean value
+*/}}
+{{- define "utils.baseVerifyBoolean" -}}
+{{- include "utils.verifyValue" (prepend . "bool") -}}
+{{- end -}}
+
+{{/*
+Verify a required boolean value
+*/}}
+{{- define "utils.verifyBoolean" -}}
+{{- include "utils.baseVerifyBoolean" (append . true) -}}
+{{- end -}}
+
+{{/*
+Verify an optional boolean value
+*/}}
+{{- define "utils.verifyOptionalBoolean" -}}
+{{- include "utils.baseVerifyBoolean" (append . false) -}}
+{{- end -}}
+
+{{/*
+Verify an integer value
+*/}}
+{{- define "utils.baseVerifyInteger" -}}
+{{- include "utils.verifyValue" (prepend . "float64") -}}
+{{- end -}}
+
+{{/*
+Verify a required integer value
+*/}}
+{{- define "utils.verifyInteger" -}}
+{{- include "utils.baseVerifyInteger" (append . true) -}}
+{{- end -}}
+
+{{/*
+Verify an optional required integer value
+*/}}
+{{- define "utils.verifyOptionalInteger" -}}
+{{- include "utils.baseVerifyInteger" (append . false) -}}
+{{- end -}}
+
+{{/*
+Verify a dictionary value
+*/}}
+{{- define "utils.baseVerifyDictionary" -}}
+{{- include "utils.verifyValue" (prepend . "map") -}}
+{{- end -}}
+
+{{/*
+Verify a required dictionary value
+*/}}
+{{- define "utils.verifyDictionary" -}}
+{{- include "utils.baseVerifyDictionary" (append . true) -}}
+{{- end -}}
+
+{{/*
+Verify an optional dictionary value
+*/}}
+{{- define "utils.verifyOptionalDictionary" -}}
+{{- include "utils.baseVerifyDictionary" (append . false) -}}
+{{- end -}}
+
+{{/*
+Verify a enum string value
+*/}}
+{{- define "utils.baseVerifyEnum" -}}
+{{- $scope := index . 0 -}}
+{{- $name := index . 1 -}}
+{{- $legalValues := index . 2 -}}
+{{- $isRequired := index . 3 -}}
+{{- if include "utils.baseVerifyString" (list $scope $name $isRequired) -}}
+{{- $parent := $scope.validationScope -}}
+{{- if include "utils.dictionaryHasNonNullValue" (list $parent $name) -}}
+{{- $value := index $parent $name -}}
+{{- if has $value $legalValues -}}
+ true
+{{- else -}}
+{{ $errorMsg := cat $name "must be one of the following values" $legalValues ":" $value -}}
+{{- include "utils.recordValidationError" (list $scope $errorMsg) -}}
+{{- end -}}
+{{- end -}}
+{{- end -}}
+{{- end -}}
+
+{{/*
+Verify a required enum string value
+*/}}
+{{- define "utils.verifyEnum" -}}
+{{- include "utils.baseVerifyEnum" (append . true) -}}
+{{- end -}}
+
+{{/*
+Verify an optional enum string value
+*/}}
+{{- define "utils.verifyOptionalEnum" -}}
+{{- include "utils.baseVerifyEnum" (append . false) -}}
+{{- end -}}
+
+{{/*
+Verify a kubernetes resource name string value
+*/}}
+{{- define "utils.baseVerifyResourceName" -}}
+{{/* https://kubernetes.io/docs/concepts/overview/working-with-objects/names */}}
+{{/* names: only lower case, numbers, dot, dash, max 253 */}}
+{{/* https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#syntax-and-character-set */}}
+{{/* labels/selectors - upper & lower case, numbers, dot, dash, underscore, max 63 */}}
+{{- $scope := index . 0 -}}
+{{- $name := index . 1 -}}
+{{- $max := index . 2 -}}
+{{- $isRequired := index . 3 -}}
+{{- if include "utils.baseVerifyString" (list $scope $name $isRequired) -}}
+{{- $parent := $scope.validationScope -}}
+{{- if include "utils.dictionaryHasNonNullValue" (list $parent $name) -}}
+{{- $value := index $parent $name -}}
+{{- $len := len $value -}}
+{{- if and (le $len $max) (regexMatch "^[a-z0-9.-]+$" $value) -}}
+ true
+{{- else -}}
+{{- $errorMsg := cat $name "must only contain lower case letters, numbers, dashes and dots, and must not contain more than" $max "characters: " $value -}}
+{{- include "utils.recordValidationError" (list $scope $errorMsg) -}}
+{{- end -}}
+{{- end -}}
+{{- else -}}
+{{- end -}}
+{{- end -}}
+
+{{/*
+Verify a required kubernetes resource name string value
+*/}}
+{{- define "utils.verifyResourceName" -}}
+{{- include "utils.baseVerifyResourceName" (append . true) -}}
+{{- end -}}
+
+{{/*
+Verify an optional kubernetes resource name string value
+*/}}
+{{- define "utils.verifyOptionalResourceName" -}}
+{{- include "utils.baseVerifyResourceName" (append . false) -}}
+{{- end -}}
+
+{{/*
+Verify external service name suffix string value
+*/}}
+{{- define "utils.verifyExternalServiceNameSuffix" -}}
+{{- include "utils.baseVerifyResourceName" (append . false) -}}
+{{- end -}}
+
+{{/*
+Verify introspector job name suffix string value
+*/}}
+{{- define "utils.verifyIntrospectorJobNameSuffix" -}}
+{{- include "utils.baseVerifyResourceName" (append . false) -}}
+{{- end -}}
+
+{{/*
+Verify a list of strings value
+*/}}
+{{- define "utils.baseVerifyStringList" -}}
+{{- include "utils.verifyListValue" (prepend . "string") -}}
+{{- end -}}
+
+{{/*
+Verify a required list of strings value
+*/}}
+{{- define "utils.verifyStringList" -}}
+{{- include "utils.baseVerifyStringList" (append . true) -}}
+{{- end -}}
+
+{{/*
+Verify an optional list of strings value
+*/}}
+{{- define "utils.verifyOptionalStringList" -}}
+{{- include "utils.baseVerifyStringList" (append . false) -}}
+{{- end -}}
+
+{{/*
+Verify a list of dictionaries value
+*/}}
+{{- define "utils.baseVerifyDictionaryList" -}}
+{{- include "utils.verifyListValue" (prepend . "map") -}}
+{{- end -}}
+
+{{/*
+Verify a required list of dictionaries value
+*/}}
+{{- define "utils.verifyDictionaryList" -}}
+{{- include "utils.baseVerifyDictionaryList" (append . true) -}}
+{{- end -}}
+
+{{/*
+Verify an optional list of dictionaries value
+*/}}
+{{- define "utils.verifyOptionalDictionaryList" -}}
+{{- include "utils.baseVerifyDictionaryList" (append . false) -}}
+{{- end -}}
+
+{{/*
+Merge a set of dictionaries into a single dictionary.
+
+The scope must be a list of dictionaries, starting with the least specific
+and ending with the most specific.
+
+First it makes an empty destinaction dictionary, then iterates over the dictionaries,
+overlaying their values on the destination dictionary.
+
+If a value is null, then it removes that key from the destination dictionary.
+
+If the value is already present in the destination dictionary, and the old and
+new values are both dictionaries, it merges them into the destination.
+*/}}
+{{- define "utils.mergeDictionaries" -}}
+{{- $dest := dict -}}
+{{- range $src := . -}}
+{{- if not (empty $src) -}}
+{{- range $key, $value := $src -}}
+{{- $ignore := include "utils.mergeDictionaryValue" (list $dest $key $value) -}}
+{{- end -}}
+{{- end -}}
+{{- end -}}
+{{- toYaml $dest -}}
+{{- end -}}
+
+{{/*
+Merge a value into a dictionary.
+This is like helm's 'merge' function, except that it handles null entries too.
+*/}}
+{{- define "utils.mergeDictionaryValue" -}}
+{{- $dest := index . 0 -}}
+{{- $key := index . 1 -}}
+{{- $newValue := index . 2 -}}
+{{- $newType := typeOf $newValue -}}
+{{- if hasKey $dest $key -}}
+{{- if eq $newType "" -}}
+{{/* # if the value already existed, and the new value is null, remove the old value */}}
+{{- $ignore := unset $dest $key -}}
+{{- else -}}
+{{- $oldValue := index $dest $key -}}
+{{- $oldKind := kindOf $oldValue -}}
+{{- $newKind := kindOf $newValue -}}
+{{- if (and (eq $oldKind "map") (eq $newKind "map")) -}}
+{{/* # if both values are maps, merge them */}}
+{{- $merged := include "utils.mergeDictionaries" (list $oldValue $newValue) | fromYaml -}}
+{{- $ignore := set $dest $key $merged -}}
+{{- else -}}
+{{/* # replace the old value with the new one */}}
+{{- $ignore := set $dest $key $newValue -}}
+{{- end -}}
+{{- end -}}
+{{- else -}}
+{{- if not (eq $newType "") -}}
+{{/* #if there was no old value, and the new value isn't null, use the new value */}}
+{{- $ignore := set $dest $key $newValue -}}
+{{- end -}}
+{{- end -}}
+{{- end -}}
+
+{{/*
+Make a writable copy of a dictionary.
+TBD - does helm provide a clone method we can use instead?
+*/}}
+{{- define "utils.cloneDictionary" -}}
+{{- include "utils.mergeDictionaries" (list .) -}}
+{{- end -}}
+
+{{/*
+Verify that a list of values (exclude) can not be defined if another value (key) is already defined
+*/}}
+{{- define "utils.mutexValue" -}}
+{{- $scope := index . 0 -}}
+{{- $key := index . 1 -}}
+{{- $exclude := index . 2 -}}
+{{- $type := index . 3 -}}
+{{- $parent := $scope.validationScope -}}
+{{- $args := . -}}
+{{- $status := dict -}}
+{{- if hasKey $parent $key -}}
+{{- range $value := $exclude -}}
+{{- if hasKey $parent $value -}}
+{{- $errorMsg := cat $value "can not be present when" $key "is defined" " " -}}
+{{- include "utils.recordValidationError" (list $scope $errorMsg) -}}
+{{- $ignore := set $status "error" true -}}
+{{- end -}}
+{{- end -}}
+{{- end -}}
+{{- if not (hasKey $status "error") -}}
+ true
+{{- end -}}
+{{- end -}}
+
+{{/*
+Verify that a list of strings can not be defined if another string is already defined
+*/}}
+{{- define "utils.mutexString" -}}
+{{- include "utils.mutexValue" (append . "string") -}}
+{{- end -}}
+
+{{/*
+Verify that a Kubernetes resource exists in a given namespace
+*/}}
+{{- define "utils.verifyK8SResource" -}}
+{{- $scope := index . 0 -}}
+{{- $name := index . 1 -}}
+{{- $type := index . 2 -}}
+{{- $namespace := index . 3 -}}
+{{- $foundNS := (lookup "v1" "Namespace" "" $namespace) }}
+{{- if $foundNS }}
+{{- $foundResource := (lookup "v1" $type $namespace $name) }}
+{{- if not $foundResource }}
+{{- $errorMsg := cat $type $name " not found in namespace " $namespace -}}
+{{- include "utils.recordValidationError" (list $scope $errorMsg) -}}
+{{- end -}}
+{{- end -}}
+{{- end -}}
diff --git a/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_validate-inputs.tpl b/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_validate-inputs.tpl
old mode 100644
new mode 100755
index a6ee7dd02..cfb13a0a8
--- a/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_validate-inputs.tpl
+++ b/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/_validate-inputs.tpl
@@ -1,63 +1,63 @@
-# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-
-{{- define "operator.validateInputs" -}}
-{{- $scope := include "utils.cloneDictionary" . | fromYaml -}}
-{{- $ignore:= include "utils.startValidation" $scope -}}
-{{- $ignore := include "utils.pushValidationContext" (list $scope "Release") -}}
-{{- $ignore := include "utils.verifyResourceName" (list $scope "Namespace" 63) -}}
-{{- $ignore := include "utils.popValidationContext" $scope -}}
-{{- $ignore := include "utils.verifyString" (list $scope "serviceAccount") -}}
-{{- $ignore := include "utils.verifyK8SResource" (list $scope .serviceAccount "ServiceAccount" .Release.Namespace) -}}
-{{- $ignore := include "utils.verifyString" (list $scope "image") -}}
-{{- $ignore := include "utils.verifyEnum" (list $scope "imagePullPolicy" (list "Always" "IfNotPresent" "Never")) -}}
-{{- $ignore := include "utils.verifyOptionalDictionaryList" (list $scope "imagePullSecrets") -}}
-{{- $ignore := include "utils.verifyEnum" (list $scope "javaLoggingLevel" (list "SEVERE" "WARNING" "INFO" "CONFIG" "FINE" "FINER" "FINEST")) -}}
-{{- if include "utils.verifyBoolean" (list $scope "externalRestEnabled") -}}
-{{- if $scope.externalRestEnabled -}}
-{{- $ignore := include "utils.verifyInteger" (list $scope "externalRestHttpsPort") -}}
-{{- $ignore := include "utils.mutexString" (list $scope "externalRestIdentitySecret" (list "externalOperatorKey" "externalOperatorCert")) -}}
-{{- if (or (hasKey $scope "externalOperatorCert") (hasKey $scope "externalOperatorKey")) -}}
-{{- $ignore := include "utils.verifyString" (list $scope "externalOperatorCert") -}}
-{{- $ignore := include "utils.verifyString" (list $scope "externalOperatorKey") -}}
-{{- else }}
-{{- $ignore := include "utils.verifyString" (list $scope "externalRestIdentitySecret") -}}
-{{- end -}}
-{{- end -}}
-{{- end -}}
-{{- if include "utils.verifyBoolean" (list $scope "remoteDebugNodePortEnabled") -}}
-{{- if $scope.remoteDebugNodePortEnabled -}}
-{{- $ignore := include "utils.verifyBoolean" (list $scope "suspendOnDebugStartup") -}}
-{{- $ignore := include "utils.verifyInteger" (list $scope "internalDebugHttpPort") -}}
-{{- $ignore := include "utils.verifyInteger" (list $scope "externalDebugHttpPort") -}}
-{{- end -}}
-{{- end -}}
-{{- $ignore := include "utils.verifyOptionalBoolean" (list $scope "enableClusterRoleBinding") -}}
-{{- if and .enableClusterRoleBinding (or (eq (default "List" .domainNamespaceSelectionStrategy) "Dedicated") (and .dedicated (eq (default "List" .domainNamespaceSelectionStrategy) "List"))) }}
-{{- $errorMsg := "The enableClusterRoleBinding value may not be true when either dedicated is true or domainNamespaceSelectionStrategy is Dedicated" -}}
-{{- include "utils.recordValidationError" (list $scope $errorMsg) -}}
-{{- end -}}
-{{- if eq (default "List" $scope.domainNamespaceSelectionStrategy) "List" -}}
-{{- $ignore := include "utils.verifyStringList" (list $scope "domainNamespaces") -}}
-{{- end -}}
-{{- if include "utils.verifyBoolean" (list $scope "elkIntegrationEnabled") -}}
-{{- if $scope.elkIntegrationEnabled -}}
-{{- $ignore := include "utils.verifyString" (list $scope "logStashImage") -}}
-{{- $ignore := include "utils.verifyString" (list $scope "elasticSearchHost") -}}
-{{- $ignore := include "utils.verifyInteger" (list $scope "elasticSearchPort") -}}
-{{- end -}}
-{{- end -}}
-{{- $ignore := include "utils.verifyOptionalBoolean" (list $scope "dedicated") -}}
-{{- $ignore := include "utils.verifyOptionalEnum" (list $scope "domainNamespaceSelectionStrategy" (list "List" "LabelSelector" "RegExp" "Dedicated")) -}}
-{{- if eq (default "List" $scope.domainNamespaceSelectionStrategy) "LabelSelector" -}}
-{{- $ignore := include "utils.verifyString" (list $scope "domainNamespaceLabelSelector") -}}
-{{- end -}}
-{{- if eq (default "List" $scope.domainNamespaceSelectionStrategy) "RegExp" -}}
-{{- $ignore := include "utils.verifyString" (list $scope "domainNamespaceRegExp") -}}
-{{- end -}}
-{{- $ignore := include "utils.verifyOptionalBoolean" (list $scope "mockWLS") -}}
-{{- $ignore := include "utils.verifyIntrospectorJobNameSuffix" (list $scope "introspectorJobNameSuffix" 25) -}}
-{{- $ignore := include "utils.verifyExternalServiceNameSuffix" (list $scope "externalServiceNameSuffix" 10) -}}
-{{- $ignore := include "utils.verifyOptionalBoolean" (list $scope "clusterSizePaddingValidationEnabled") -}}
-{{- $ignore := include "utils.endValidation" $scope -}}
-{{- end -}}
+# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+
+{{- define "operator.validateInputs" -}}
+{{- $scope := include "utils.cloneDictionary" . | fromYaml -}}
+{{- $ignore:= include "utils.startValidation" $scope -}}
+{{- $ignore := include "utils.pushValidationContext" (list $scope "Release") -}}
+{{- $ignore := include "utils.verifyResourceName" (list $scope "Namespace" 63) -}}
+{{- $ignore := include "utils.popValidationContext" $scope -}}
+{{- $ignore := include "utils.verifyString" (list $scope "serviceAccount") -}}
+{{- $ignore := include "utils.verifyK8SResource" (list $scope .serviceAccount "ServiceAccount" .Release.Namespace) -}}
+{{- $ignore := include "utils.verifyString" (list $scope "image") -}}
+{{- $ignore := include "utils.verifyEnum" (list $scope "imagePullPolicy" (list "Always" "IfNotPresent" "Never")) -}}
+{{- $ignore := include "utils.verifyOptionalDictionaryList" (list $scope "imagePullSecrets") -}}
+{{- $ignore := include "utils.verifyEnum" (list $scope "javaLoggingLevel" (list "SEVERE" "WARNING" "INFO" "CONFIG" "FINE" "FINER" "FINEST")) -}}
+{{- if include "utils.verifyBoolean" (list $scope "externalRestEnabled") -}}
+{{- if $scope.externalRestEnabled -}}
+{{- $ignore := include "utils.verifyInteger" (list $scope "externalRestHttpsPort") -}}
+{{- $ignore := include "utils.mutexString" (list $scope "externalRestIdentitySecret" (list "externalOperatorKey" "externalOperatorCert")) -}}
+{{- if (or (hasKey $scope "externalOperatorCert") (hasKey $scope "externalOperatorKey")) -}}
+{{- $ignore := include "utils.verifyString" (list $scope "externalOperatorCert") -}}
+{{- $ignore := include "utils.verifyString" (list $scope "externalOperatorKey") -}}
+{{- else }}
+{{- $ignore := include "utils.verifyString" (list $scope "externalRestIdentitySecret") -}}
+{{- end -}}
+{{- end -}}
+{{- end -}}
+{{- if include "utils.verifyBoolean" (list $scope "remoteDebugNodePortEnabled") -}}
+{{- if $scope.remoteDebugNodePortEnabled -}}
+{{- $ignore := include "utils.verifyBoolean" (list $scope "suspendOnDebugStartup") -}}
+{{- $ignore := include "utils.verifyInteger" (list $scope "internalDebugHttpPort") -}}
+{{- $ignore := include "utils.verifyInteger" (list $scope "externalDebugHttpPort") -}}
+{{- end -}}
+{{- end -}}
+{{- $ignore := include "utils.verifyOptionalBoolean" (list $scope "enableClusterRoleBinding") -}}
+{{- if and .enableClusterRoleBinding (or (eq (default "List" .domainNamespaceSelectionStrategy) "Dedicated") (and .dedicated (eq (default "List" .domainNamespaceSelectionStrategy) "List"))) }}
+{{- $errorMsg := "The enableClusterRoleBinding value may not be true when either dedicated is true or domainNamespaceSelectionStrategy is Dedicated" -}}
+{{- include "utils.recordValidationError" (list $scope $errorMsg) -}}
+{{- end -}}
+{{- if eq (default "List" $scope.domainNamespaceSelectionStrategy) "List" -}}
+{{- $ignore := include "utils.verifyStringList" (list $scope "domainNamespaces") -}}
+{{- end -}}
+{{- if include "utils.verifyBoolean" (list $scope "elkIntegrationEnabled") -}}
+{{- if $scope.elkIntegrationEnabled -}}
+{{- $ignore := include "utils.verifyString" (list $scope "logStashImage") -}}
+{{- $ignore := include "utils.verifyString" (list $scope "elasticSearchHost") -}}
+{{- $ignore := include "utils.verifyInteger" (list $scope "elasticSearchPort") -}}
+{{- end -}}
+{{- end -}}
+{{- $ignore := include "utils.verifyOptionalBoolean" (list $scope "dedicated") -}}
+{{- $ignore := include "utils.verifyOptionalEnum" (list $scope "domainNamespaceSelectionStrategy" (list "List" "LabelSelector" "RegExp" "Dedicated")) -}}
+{{- if eq (default "List" $scope.domainNamespaceSelectionStrategy) "LabelSelector" -}}
+{{- $ignore := include "utils.verifyString" (list $scope "domainNamespaceLabelSelector") -}}
+{{- end -}}
+{{- if eq (default "List" $scope.domainNamespaceSelectionStrategy) "RegExp" -}}
+{{- $ignore := include "utils.verifyString" (list $scope "domainNamespaceRegExp") -}}
+{{- end -}}
+{{- $ignore := include "utils.verifyOptionalBoolean" (list $scope "mockWLS") -}}
+{{- $ignore := include "utils.verifyIntrospectorJobNameSuffix" (list $scope "introspectorJobNameSuffix" 25) -}}
+{{- $ignore := include "utils.verifyExternalServiceNameSuffix" (list $scope "externalServiceNameSuffix" 10) -}}
+{{- $ignore := include "utils.verifyOptionalBoolean" (list $scope "clusterSizePaddingValidationEnabled") -}}
+{{- $ignore := include "utils.endValidation" $scope -}}
+{{- end -}}
diff --git a/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/main.yaml b/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/main.yaml
old mode 100644
new mode 100755
index fb7e731f9..787afb0b0
--- a/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/main.yaml
+++ b/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/templates/main.yaml
@@ -1,11 +1,11 @@
-# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-
-{{- $scope := include "utils.cloneDictionary" .Values | fromYaml -}}
-{{- $ignore := set $scope "Files" .Files -}}
-{{- $ignore := set $scope "Chart" .Chart -}}
-{{- $ignore := set $scope "Release" .Release -}}
-{{- $ignore := set $scope "APIVersions" .Capabilities.APIVersions -}}
-
-{{ include "operator.validateInputs" $scope }}
-{{- include "operator.operator" $scope }}
+# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+
+{{- $scope := include "utils.cloneDictionary" .Values | fromYaml -}}
+{{- $ignore := set $scope "Files" .Files -}}
+{{- $ignore := set $scope "Chart" .Chart -}}
+{{- $ignore := set $scope "Release" .Release -}}
+{{- $ignore := set $scope "APIVersions" .Capabilities.APIVersions -}}
+
+{{ include "operator.validateInputs" $scope }}
+{{- include "operator.operator" $scope }}
diff --git a/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/values.yaml b/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/values.yaml
old mode 100644
new mode 100755
index dac9a5382..de797b21c
--- a/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/values.yaml
+++ b/OracleWebCenterPortal/kubernetes/charts/weblogic-operator/values.yaml
@@ -1,224 +1,224 @@
-# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-
-# serviceAccount specifies the name of the ServiceAccount in the operator's namespace that the
-# operator will use to make requests to the Kubernetes API server.
-# The customer is responsible for creating the ServiceAccount in the same namespace as this Helm release.
-# If not specified, the the operator will use the Helm release namespace's 'default' ServiceAccount.
-serviceAccount: "default"
-
-# domainNamespaceSelectionStrategy specifies how the operator will select the set of namespaces
-# that it will manage. Legal values are: List, LabelSelector, RegExp, and Dedicated. If set to 'List',
-# then the operator will manage the set of namespaces listed by the 'domainNamespaces' value.
-# If set to 'LabelSelector', then the operator will manage the set of namespaces discovered by a list
-# of namespaces using the value specified by 'domainNamespaceLabelSelector' as a label selector.
-# If set to 'RegExp', then the operator will manage the set of namespaces discovered by a list
-# of namespaces using the value specified by 'domainNamespaceRegExp' as a regular expression matched
-# against the namespace names.
-# If set to 'Dedicated', then operator will manage WebLogic Domains only in the same namespace
-# where the operator itself is deployed, which is the namespace of the Helm release.
-domainNamespaceSelectionStrategy: List
-
-# This value is deprecated. Please use 'domainNamespaceSelectionStrategy: Dedicated'.
-# dedicated specifies if this operator will manage WebLogic Domains only in the same namespace in
-# which the operator itself is deployed. If set to 'true', then the 'domainNamespaces' value below
-# is ignored. This value is ignored if 'domainNamespaceSelectionStrategy' is set to a value other
-# than 'List'.
-# dedicated: false
-
-# domainNamespaces specifies list of WebLogic Domain namespaces that this operator manages. This value
-# is ignored if 'domainNamespaceSelectionStrategy' is not 'List'. The customer is responsible for creating these
-# namespaces. If not specified, then the operator will manage WebLogic Domains in the Kubernetes 'default' namespace.
-#
-# Example: In the configuration below, the operator will manage namespace1 and namespace2.
-#
-# domainNamespaces:
-# - "namespace1"
-# - "namespace2"
-domainNamespaces:
-- "default"
-
-# domainNamespaceLabelSelector specifies the label selector value that the operator will use when listing
-# namespaces in search of the namespaces that contain WebLogic Domains that this operator will manage. Ignored
-# if 'domainNamespaceSelectionStrategy' is not 'LabelSelector'.
-#
-# Example: manage any namespace with a label named "weblogic-operator".
-#
-# domainNamespaceLabelSelector: "weblogic-operator"
-#
-# domainNamespaceLabelSelector:
-
-# domainNamespaceRegExp specifies a regular expression that will be matched against namespace names when listing
-# namespaces in search of the namespaces that contain WebLogic Domains that this operator will manage. Ignored
-# if 'domainNamespaceSelectionStrategy' is not 'RegExp'.
-#
-# Example: manage any namespace where the namespace name starts with "prod".
-#
-# domainNamespaceRegExp: "^prod"
-#
-# domainNamespaceRegExp:
-
-# enableClusterRoleBinding specifies whether the roles necessary for the operator to manage domains
-# will be granted using a ClusterRoleBinding rather than using RoleBindings in each managed namespace.
-enableClusterRoleBinding: false
-
-# image specifies the container image containing the operator.
-image: "ghcr.io/oracle/weblogic-kubernetes-operator:3.3.0"
-
-# imagePullPolicy specifies the image pull policy for the operator's container image.
-imagePullPolicy: IfNotPresent
-
-# imagePullSecrets contains an optional list of Kubernetes Secrets, in the operator's namespace,
-# that are needed to access the registry containing the operator's container image.
-# The customer is responsible for creating the Secret.
-# If no Secrets are required, then omit this property.
-#
-# Example: a Secret is needed, and has been stored in 'my-operator-secret'
-#
-# imagePullSecrets:
-# - name: "my-operator-secret"
-
-# externalRestEnabled specifies whether the the operator's REST interface is exposed
-# outside of the Kubernetes cluster on the port specified by the 'externalRestHttpsPort'
-# property.
-#
-# If set to true, then the customer must provide the SSL certificate and private key for
-# the operator's external REST interface by specifying the 'externalOperatorCert' and
-# 'externalOperatorKey' properties.
-externalRestEnabled: false
-
-# externalRestHttpsPort specifies the node port that should be allocated for the external operator REST HTTPS interface.
-# This parameter is required if 'externalRestEnabled' is true.
-# Otherwise, it is ignored.
-externalRestHttpsPort: 31001
-
-# The name of the Secret used to store the certificate and private key to use for the external operator REST HTTPS interface.
-# The Secret has to be created in the same namespace of the WebLogic operator.
-# This parameter is required if 'externalRestEnabled' is true. Otherwise, it is ignored.
-# As example, an external REST identity can be created using the following sample script
-# kubernetes/samples/scripts/rest/generate-external-rest-identity.sh
-# externalRestIdentitySecret:
-
-# elkIntegrationEnabled specifies whether or not ELK integration is enabled.
-elkIntegrationEnabled: false
-
-# logStashImage specifies the container image containing logstash.
-# This parameter is ignored if 'elkIntegrationEnabled' is false.
-logStashImage: "logstash:6.6.0"
-
-# elasticSearchHost specifies the hostname of where elasticsearch is running.
-# This parameter is ignored if 'elkIntegrationEnabled' is false.
-elasticSearchHost: "elasticsearch.default.svc.cluster.local"
-
-# elasticSearchPort specifies the port number of where elasticsearch is running.
-# This parameter is ignored if 'elkIntegrationEnabled' is false.
-elasticSearchPort: 9200
-
-# featureGates specifies a set of key=value pairs separated by commas that describe whether a given
-# operator feature is enabled. You enable a feature by including a key=value pair where the key is the
-# feature name and the value is "true". This will allow the operator team to release features that
-# are not yet ready to be enabled by default, but that are ready for testing by customers. Once a feature is
-# stable then it will be enabled by default and can not be disabled using this configuration.
-# featureGates: "...,AuxiliaryImage=true"
-
-# javaLoggingLevel specifies the Java logging level for the operator. This affects the operator pod's
-# log output and the contents of log files in the container's /logs/ directory.
-# Valid values are: "SEVERE", "WARNING", "INFO", "CONFIG", "FINE", "FINER", and "FINEST".
-javaLoggingLevel: "INFO"
-
-# javaLoggingFileSizeLimit specifies the maximum size in bytes for an individual Java logging file in the operator container's
-# /logs/ directory.
-javaLoggingFileSizeLimit: 20000000
-
-# javaLoggingFileCount specifies the number of Java logging files to preserve in the operator container's /logs/
-# directory as the files are rotated.
-javaLoggingFileCount: 10
-
-# labels specifies a set of key-value labels that will be added to each pod running the operator.
-# See https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
-#labels:
-
-# annotations specifies a set of key-value annotations that will be added to each pod running the operator.
-# See https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
-#annotations:
-
-# nodeSelector specifies a matching rule that the Kubernetes scheduler will use when selecting the node
-# where the operator will run. If the nodeSelector value is specified, then this content will be added to
-# the operator's deployment. See https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector
-# for more information on node selectors.
-#nodeSelector:
-
-# affinity specifies a set of matching rules related to the presence of other workloads that the Kubernetes scheduler
-# will use when selecting the node where the operator will run. If the affinity value is specified, then this content
-# will be added to the operator's deployment. See https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity
-# for more information on affinity and anti-affinity.
-#affinity:
-
-# Values related to debugging the operator.
-# Customers should not need to use the following properties
-
-# remoteDebugNodePortEnabled specifies whether or not the operator will provide a Java remote debug interface on the
-# provided port. If the 'suspendOnDebugStartup' property is specified, the operator will suspend execution
-# until a remote debugger has attached.
-# The 'internalDebugHttpPort' property controls the port number inside the Kubernetes
-# cluster and the 'externalDebugHttpPort' property controls the port number outside
-# the Kubernetes cluster.
-remoteDebugNodePortEnabled: false
-
-#suspendOnDebugStartup specifies whether the operator will suspend on startup when a Java remote debugging is enabled.
-suspendOnDebugStartup: false
-
-# internalDebugHttpPort specifies the port number inside the Kubernetes cluster for the operator's Java
-# remote debug interface.
-# This parameter is required if 'remoteDebugNodePortEnabled' is true.
-# Otherwise, it is ignored.
-internalDebugHttpPort: 30999
-
-# externalDebugHttpPort specifies the node port that should be allocated for the operator's
-# Java remote debug interface.
-# This parameter is required if 'remoteDebugNodePortEnabled' is true.
-# Otherwise, it is ignored.
-externalDebugHttpPort: 30999
-
-# dns1123Fields overrides the default list of field names that the operator
-# converts to DNS-1123 legal values when replacing variable references in the
-# Domain resource. The default list can be found inside the class LegalNames
-# in the oracle.kubernetes.operator.helpers package.
-# Supply a comma separated list of field names to customize the list of fields
-# such as "name, claimName, volumeName", or leave it commented out to use
-# the default list of field names.
-# dns1123Fields: ""
-
-# introspectorJobNameSuffix overrides the default suffix that the operator uses
-# to append to the domainUID to form the name of the domain introspector job name.
-# Note that the resultant job name should not be more than 58 characters due to
-# the Kubernetes limit to the name of a job and Kubernetes appends five additional
-# characters to the name of the pod that is created by the job controller.
-# The default suffix is '-introspector'.
-# The default suffix in pre-3.1.0 is "-introspect-domain-job"
-introspectorJobNameSuffix: "-introspector"
-
-# externalServiceNameSuffix overrides the default suffix that the operator uses
-# to append to the domainUID and the WebLogic admin server name, to form the name
-# of the domain's admin server external service.
-# Note that the resultant name should not be more than 63 characters due to
-# the Kubernetes limit to the name of a service.
-# The default suffix is '-ext'.
-# The default suffix in pre-3.1.0 is "-external".
-externalServiceNameSuffix: "-ext"
-
-# clusterSizePaddingValidationEnabled specifies if additional one or two characters
-# need to be reserved to account for longer managed server names because of an increased
-# cluster size.
-# The default value is true.
-clusterSizePaddingValidationEnabled: true
-
-# tokenReviewAuthentication, if set to true, specifies whether the the operator's REST API should use
-# 1. Kubernetes token review API for authenticating users, and
-# 2. Kubernetes subject access review API for authorizing a user's operation (get, list,
-# patch, etc) on a resource.
-# 3. Update the Domain resource using the operator's privileges.
-# This parameter, if set to false, will use the caller's bearer token for any update
-# to the Domain resource so that it is done using the caller's privileges.
-# The default value is false.
-#tokenReviewAuthentication: false
+# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+
+# serviceAccount specifies the name of the ServiceAccount in the operator's namespace that the
+# operator will use to make requests to the Kubernetes API server.
+# The customer is responsible for creating the ServiceAccount in the same namespace as this Helm release.
+# If not specified, the the operator will use the Helm release namespace's 'default' ServiceAccount.
+serviceAccount: "default"
+
+# domainNamespaceSelectionStrategy specifies how the operator will select the set of namespaces
+# that it will manage. Legal values are: List, LabelSelector, RegExp, and Dedicated. If set to 'List',
+# then the operator will manage the set of namespaces listed by the 'domainNamespaces' value.
+# If set to 'LabelSelector', then the operator will manage the set of namespaces discovered by a list
+# of namespaces using the value specified by 'domainNamespaceLabelSelector' as a label selector.
+# If set to 'RegExp', then the operator will manage the set of namespaces discovered by a list
+# of namespaces using the value specified by 'domainNamespaceRegExp' as a regular expression matched
+# against the namespace names.
+# If set to 'Dedicated', then operator will manage WebLogic Domains only in the same namespace
+# where the operator itself is deployed, which is the namespace of the Helm release.
+domainNamespaceSelectionStrategy: List
+
+# This value is deprecated. Please use 'domainNamespaceSelectionStrategy: Dedicated'.
+# dedicated specifies if this operator will manage WebLogic Domains only in the same namespace in
+# which the operator itself is deployed. If set to 'true', then the 'domainNamespaces' value below
+# is ignored. This value is ignored if 'domainNamespaceSelectionStrategy' is set to a value other
+# than 'List'.
+# dedicated: false
+
+# domainNamespaces specifies list of WebLogic Domain namespaces that this operator manages. This value
+# is ignored if 'domainNamespaceSelectionStrategy' is not 'List'. The customer is responsible for creating these
+# namespaces. If not specified, then the operator will manage WebLogic Domains in the Kubernetes 'default' namespace.
+#
+# Example: In the configuration below, the operator will manage namespace1 and namespace2.
+#
+# domainNamespaces:
+# - "namespace1"
+# - "namespace2"
+domainNamespaces:
+- "default"
+
+# domainNamespaceLabelSelector specifies the label selector value that the operator will use when listing
+# namespaces in search of the namespaces that contain WebLogic Domains that this operator will manage. Ignored
+# if 'domainNamespaceSelectionStrategy' is not 'LabelSelector'.
+#
+# Example: manage any namespace with a label named "weblogic-operator".
+#
+# domainNamespaceLabelSelector: "weblogic-operator"
+#
+# domainNamespaceLabelSelector:
+
+# domainNamespaceRegExp specifies a regular expression that will be matched against namespace names when listing
+# namespaces in search of the namespaces that contain WebLogic Domains that this operator will manage. Ignored
+# if 'domainNamespaceSelectionStrategy' is not 'RegExp'.
+#
+# Example: manage any namespace where the namespace name starts with "prod".
+#
+# domainNamespaceRegExp: "^prod"
+#
+# domainNamespaceRegExp:
+
+# enableClusterRoleBinding specifies whether the roles necessary for the operator to manage domains
+# will be granted using a ClusterRoleBinding rather than using RoleBindings in each managed namespace.
+enableClusterRoleBinding: false
+
+# image specifies the container image containing the operator.
+image: "ghcr.io/oracle/weblogic-kubernetes-operator:3.3.0"
+
+# imagePullPolicy specifies the image pull policy for the operator's container image.
+imagePullPolicy: IfNotPresent
+
+# imagePullSecrets contains an optional list of Kubernetes Secrets, in the operator's namespace,
+# that are needed to access the registry containing the operator's container image.
+# The customer is responsible for creating the Secret.
+# If no Secrets are required, then omit this property.
+#
+# Example: a Secret is needed, and has been stored in 'my-operator-secret'
+#
+# imagePullSecrets:
+# - name: "my-operator-secret"
+
+# externalRestEnabled specifies whether the the operator's REST interface is exposed
+# outside of the Kubernetes cluster on the port specified by the 'externalRestHttpsPort'
+# property.
+#
+# If set to true, then the customer must provide the SSL certificate and private key for
+# the operator's external REST interface by specifying the 'externalOperatorCert' and
+# 'externalOperatorKey' properties.
+externalRestEnabled: false
+
+# externalRestHttpsPort specifies the node port that should be allocated for the external operator REST HTTPS interface.
+# This parameter is required if 'externalRestEnabled' is true.
+# Otherwise, it is ignored.
+externalRestHttpsPort: 31001
+
+# The name of the Secret used to store the certificate and private key to use for the external operator REST HTTPS interface.
+# The Secret has to be created in the same namespace of the WebLogic operator.
+# This parameter is required if 'externalRestEnabled' is true. Otherwise, it is ignored.
+# As example, an external REST identity can be created using the following sample script
+# kubernetes/samples/scripts/rest/generate-external-rest-identity.sh
+# externalRestIdentitySecret:
+
+# elkIntegrationEnabled specifies whether or not ELK integration is enabled.
+elkIntegrationEnabled: false
+
+# logStashImage specifies the container image containing logstash.
+# This parameter is ignored if 'elkIntegrationEnabled' is false.
+logStashImage: "logstash:6.6.0"
+
+# elasticSearchHost specifies the hostname of where elasticsearch is running.
+# This parameter is ignored if 'elkIntegrationEnabled' is false.
+elasticSearchHost: "elasticsearch.default.svc.cluster.local"
+
+# elasticSearchPort specifies the port number of where elasticsearch is running.
+# This parameter is ignored if 'elkIntegrationEnabled' is false.
+elasticSearchPort: 9200
+
+# featureGates specifies a set of key=value pairs separated by commas that describe whether a given
+# operator feature is enabled. You enable a feature by including a key=value pair where the key is the
+# feature name and the value is "true". This will allow the operator team to release features that
+# are not yet ready to be enabled by default, but that are ready for testing by customers. Once a feature is
+# stable then it will be enabled by default and can not be disabled using this configuration.
+# featureGates: "...,AuxiliaryImage=true"
+
+# javaLoggingLevel specifies the Java logging level for the operator. This affects the operator pod's
+# log output and the contents of log files in the container's /logs/ directory.
+# Valid values are: "SEVERE", "WARNING", "INFO", "CONFIG", "FINE", "FINER", and "FINEST".
+javaLoggingLevel: "INFO"
+
+# javaLoggingFileSizeLimit specifies the maximum size in bytes for an individual Java logging file in the operator container's
+# /logs/ directory.
+javaLoggingFileSizeLimit: 20000000
+
+# javaLoggingFileCount specifies the number of Java logging files to preserve in the operator container's /logs/
+# directory as the files are rotated.
+javaLoggingFileCount: 10
+
+# labels specifies a set of key-value labels that will be added to each pod running the operator.
+# See https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
+#labels:
+
+# annotations specifies a set of key-value annotations that will be added to each pod running the operator.
+# See https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
+#annotations:
+
+# nodeSelector specifies a matching rule that the Kubernetes scheduler will use when selecting the node
+# where the operator will run. If the nodeSelector value is specified, then this content will be added to
+# the operator's deployment. See https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector
+# for more information on node selectors.
+#nodeSelector:
+
+# affinity specifies a set of matching rules related to the presence of other workloads that the Kubernetes scheduler
+# will use when selecting the node where the operator will run. If the affinity value is specified, then this content
+# will be added to the operator's deployment. See https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity
+# for more information on affinity and anti-affinity.
+#affinity:
+
+# Values related to debugging the operator.
+# Customers should not need to use the following properties
+
+# remoteDebugNodePortEnabled specifies whether or not the operator will provide a Java remote debug interface on the
+# provided port. If the 'suspendOnDebugStartup' property is specified, the operator will suspend execution
+# until a remote debugger has attached.
+# The 'internalDebugHttpPort' property controls the port number inside the Kubernetes
+# cluster and the 'externalDebugHttpPort' property controls the port number outside
+# the Kubernetes cluster.
+remoteDebugNodePortEnabled: false
+
+#suspendOnDebugStartup specifies whether the operator will suspend on startup when a Java remote debugging is enabled.
+suspendOnDebugStartup: false
+
+# internalDebugHttpPort specifies the port number inside the Kubernetes cluster for the operator's Java
+# remote debug interface.
+# This parameter is required if 'remoteDebugNodePortEnabled' is true.
+# Otherwise, it is ignored.
+internalDebugHttpPort: 30999
+
+# externalDebugHttpPort specifies the node port that should be allocated for the operator's
+# Java remote debug interface.
+# This parameter is required if 'remoteDebugNodePortEnabled' is true.
+# Otherwise, it is ignored.
+externalDebugHttpPort: 30999
+
+# dns1123Fields overrides the default list of field names that the operator
+# converts to DNS-1123 legal values when replacing variable references in the
+# Domain resource. The default list can be found inside the class LegalNames
+# in the oracle.kubernetes.operator.helpers package.
+# Supply a comma separated list of field names to customize the list of fields
+# such as "name, claimName, volumeName", or leave it commented out to use
+# the default list of field names.
+# dns1123Fields: ""
+
+# introspectorJobNameSuffix overrides the default suffix that the operator uses
+# to append to the domainUID to form the name of the domain introspector job name.
+# Note that the resultant job name should not be more than 58 characters due to
+# the Kubernetes limit to the name of a job and Kubernetes appends five additional
+# characters to the name of the pod that is created by the job controller.
+# The default suffix is '-introspector'.
+# The default suffix in pre-3.1.0 is "-introspect-domain-job"
+introspectorJobNameSuffix: "-introspector"
+
+# externalServiceNameSuffix overrides the default suffix that the operator uses
+# to append to the domainUID and the WebLogic admin server name, to form the name
+# of the domain's admin server external service.
+# Note that the resultant name should not be more than 63 characters due to
+# the Kubernetes limit to the name of a service.
+# The default suffix is '-ext'.
+# The default suffix in pre-3.1.0 is "-external".
+externalServiceNameSuffix: "-ext"
+
+# clusterSizePaddingValidationEnabled specifies if additional one or two characters
+# need to be reserved to account for longer managed server names because of an increased
+# cluster size.
+# The default value is true.
+clusterSizePaddingValidationEnabled: true
+
+# tokenReviewAuthentication, if set to true, specifies whether the the operator's REST API should use
+# 1. Kubernetes token review API for authenticating users, and
+# 2. Kubernetes subject access review API for authorizing a user's operation (get, list,
+# patch, etc) on a resource.
+# 3. Update the Domain resource using the operator's privileges.
+# This parameter, if set to false, will use the caller's bearer token for any update
+# to the Domain resource so that it is done using the caller's privileges.
+# The default value is false.
+#tokenReviewAuthentication: false
diff --git a/OracleWebCenterPortal/kubernetes/common/createFMWJRFDomain.py b/OracleWebCenterPortal/kubernetes/common/createFMWJRFDomain.py
old mode 100644
new mode 100755
index bde936ca5..9a1dc67a7
--- a/OracleWebCenterPortal/kubernetes/common/createFMWJRFDomain.py
+++ b/OracleWebCenterPortal/kubernetes/common/createFMWJRFDomain.py
@@ -1,332 +1,332 @@
-# Copyright (c) 2014, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-
-import os
-import sys
-
-import com.oracle.cie.domain.script.jython.WLSTException as WLSTException
-
-class Infra12213Provisioner:
-
- MACHINES = {
- 'machine1' : {
- 'NMType': 'SSL',
- 'ListenAddress': 'localhost',
- 'ListenPort': 5658
- }
- }
-
- JRF_12213_TEMPLATES = {
- 'baseTemplate' : '@@ORACLE_HOME@@/wlserver/common/templates/wls/wls.jar',
- 'extensionTemplates' : [
- '@@ORACLE_HOME@@/oracle_common/common/templates/wls/oracle.jrf_template.jar',
- '@@ORACLE_HOME@@/oracle_common/common/templates/wls/oracle.jrf.ws.async_template.jar',
- '@@ORACLE_HOME@@/oracle_common/common/templates/wls/oracle.wsmpm_template.jar',
- '@@ORACLE_HOME@@/oracle_common/common/templates/wls/oracle.ums_template.jar',
- '@@ORACLE_HOME@@/em/common/templates/wls/oracle.em_wls_template.jar'
- ],
- 'serverGroupsToTarget' : [ 'JRF-MAN-SVR', 'WSMPM-MAN-SVR' ]
- }
-
- def __init__(self, oracleHome, javaHome, domainParentDir, adminListenPort, adminName, managedNameBase, managedServerPort, prodMode, managedCount, clusterName):
- self.oracleHome = self.validateDirectory(oracleHome)
- self.javaHome = self.validateDirectory(javaHome)
- self.domainParentDir = self.validateDirectory(domainParentDir, create=True)
- return
-
- def createInfraDomain(self, domainName, user, password, db, dbPrefix, dbPassword, adminListenPort, adminName,
- managedNameBase, managedServerPort, prodMode, managedCount, clusterName,
- exposeAdminT3Channel=None, t3ChannelPublicAddress=None, t3ChannelPort=None):
- domainHome = self.createBaseDomain(domainName, user, password, adminListenPort, adminName, managedNameBase,
- managedServerPort, prodMode, managedCount, clusterName
- )
- self.extendDomain(domainHome, db, dbPrefix, dbPassword, exposeAdminT3Channel, t3ChannelPublicAddress,
- t3ChannelPort)
-
- def createBaseDomain(self, domainName, user, password, adminListenPort, adminName, managedNameBase, managedServerPort, prodMode, managedCount, clusterName):
- baseTemplate = self.replaceTokens(self.JRF_12213_TEMPLATES['baseTemplate'])
-
- readTemplate(baseTemplate)
- setOption('DomainName', domainName)
- setOption('JavaHome', self.javaHome)
- if (prodMode == 'true'):
- setOption('ServerStartMode', 'prod')
- else:
- setOption('ServerStartMode', 'dev')
- set('Name', domainName)
-
- admin_port = int(adminListenPort)
- ms_port = int(managedServerPort)
- ms_count = int(managedCount)
-
- # Create Admin Server
- # =======================
- print 'Creating Admin Server...'
- cd('/Servers/AdminServer')
- #set('ListenAddress', '%s-%s' % (domain_uid, admin_server_name_svc))
- set('ListenPort', admin_port)
- set('Name', adminName)
-
- # Define the user password for weblogic
- # =====================================
- cd('/Security/' + domainName + '/User/weblogic')
- set('Name', user)
- set('Password', password)
-
- # Create a cluster
- # ======================
- print 'Creating cluster...'
- cd('/')
- cl=create(clusterName, 'Cluster')
-
- # Create managed servers
- for index in range(0, ms_count):
- cd('/')
- msIndex = index+1
- cd('/')
- name = '%s%s' % (managedNameBase, msIndex)
- create(name, 'Server')
- cd('/Servers/%s/' % name )
- print('managed server name is %s' % name);
- set('ListenPort', ms_port)
- set('NumOfRetriesBeforeMSIMode', 0)
- set('RetryIntervalBeforeMSIMode', 1)
- set('Cluster', clusterName)
-
- # Create Node Manager
- # =======================
- print 'Creating Node Managers...'
- for machine in self.MACHINES:
- cd('/')
- create(machine, 'Machine')
- cd('Machine/' + machine)
- create(machine, 'NodeManager')
- cd('NodeManager/' + machine)
- for param in self.MACHINES[machine]:
- set(param, self.MACHINES[machine][param])
-
-
- setOption('OverwriteDomain', 'true')
- domainHome = self.domainParentDir + '/' + domainName
- print 'Will create Base domain at ' + domainHome
-
- print 'Writing base domain...'
- writeDomain(domainHome)
- closeTemplate()
- print 'Base domain created at ' + domainHome
- return domainHome
-
-
- def extendDomain(self, domainHome, db, dbPrefix, dbPassword, exposeAdminT3Channel, t3ChannelPublicAddress,
- t3ChannelPort):
- print 'Extending domain at ' + domainHome
- print 'Database ' + db
- readDomain(domainHome)
- setOption('AppDir', self.domainParentDir + '/applications')
-
- print 'ExposeAdminT3Channel %s with %s:%s ' % (exposeAdminT3Channel, t3ChannelPublicAddress, t3ChannelPort)
- if 'true' == exposeAdminT3Channel:
- self.enable_admin_channel(t3ChannelPublicAddress, t3ChannelPort)
-
- print 'Applying JRF templates...'
- for extensionTemplate in self.JRF_12213_TEMPLATES['extensionTemplates']:
- addTemplate(self.replaceTokens(extensionTemplate))
-
- print 'Extension Templates added'
-
- print 'Configuring the Service Table DataSource...'
- fmwDb = 'jdbc:oracle:thin:@' + db
- print 'fmwDatabase ' + fmwDb
- cd('/JDBCSystemResource/LocalSvcTblDataSource/JdbcResource/LocalSvcTblDataSource')
- cd('JDBCDriverParams/NO_NAME_0')
- set('DriverName', 'oracle.jdbc.OracleDriver')
- set('URL', fmwDb)
- set('PasswordEncrypted', dbPassword)
-
- stbUser = dbPrefix + '_STB'
- cd('Properties/NO_NAME_0/Property/user')
- set('Value', stbUser)
-
- print 'Getting Database Defaults...'
- getDatabaseDefaults()
-
- print 'Targeting Server Groups...'
- managedName= '%s%s' % (managedNameBase, 1)
- print "Set CoherenceClusterSystemResource to defaultCoherenceCluster for server:" + managedName
- serverGroupsToTarget = list(self.JRF_12213_TEMPLATES['serverGroupsToTarget'])
- cd('/')
- setServerGroups(managedName, serverGroupsToTarget)
- print "Set CoherenceClusterSystemResource to defaultCoherenceCluster for server:" + managedName
- cd('/Servers/' + managedName)
- set('CoherenceClusterSystemResource', 'defaultCoherenceCluster')
-
- print 'Targeting Cluster ...'
- cd('/')
- print "Set CoherenceClusterSystemResource to defaultCoherenceCluster for cluster:" + clusterName
- cd('/Cluster/' + clusterName)
- set('CoherenceClusterSystemResource', 'defaultCoherenceCluster')
- print "Set WLS clusters as target of defaultCoherenceCluster:" + clusterName
- cd('/CoherenceClusterSystemResource/defaultCoherenceCluster')
- set('Target', clusterName)
-
- print 'Preparing to update domain...'
- updateDomain()
- print 'Domain updated successfully'
- closeDomain()
- return
-
-
- ###########################################################################
- # Helper Methods #
- ###########################################################################
-
- def validateDirectory(self, dirName, create=False):
- directory = os.path.realpath(dirName)
- if not os.path.exists(directory):
- if create:
- os.makedirs(directory)
- else:
- message = 'Directory ' + directory + ' does not exist'
- raise WLSTException(message)
- elif not os.path.isdir(directory):
- message = 'Directory ' + directory + ' is not a directory'
- raise WLSTException(message)
- return self.fixupPath(directory)
-
-
- def fixupPath(self, path):
- result = path
- if path is not None:
- result = path.replace('\\', '/')
- return result
-
-
- def replaceTokens(self, path):
- result = path
- if path is not None:
- result = path.replace('@@ORACLE_HOME@@', oracleHome)
- return result
-
- def enable_admin_channel(self, admin_channel_address, admin_channel_port):
- if admin_channel_address == None or admin_channel_port == 'None':
- return
- cd('/')
- admin_server_name = get('AdminServerName')
- print('setting admin server t3channel for ' + admin_server_name)
- cd('/Servers/' + admin_server_name)
- create('T3Channel', 'NetworkAccessPoint')
- cd('/Servers/' + admin_server_name + '/NetworkAccessPoint/T3Channel')
- set('ListenPort', int(admin_channel_port))
- set('PublicPort', int(admin_channel_port))
- set('PublicAddress', admin_channel_address)
-
-#############################
-# Entry point to the script #
-#############################
-
-def usage():
- print sys.argv[0] + ' -oh -jh -parent -name ' + \
- '-user -password ' + \
- '-rcuDb -rcuPrefix -rcuSchemaPwd ' \
- '-adminListenPort -adminName ' \
- '-managedNameBase -managedServerPort -prodMode ' \
- '-managedServerCount -clusterName ' \
- '-exposeAdminT3Channel -t3ChannelPublicAddress ' \
- '-t3ChannelPort '
- sys.exit(0)
-
-# Uncomment for Debug only
-#print str(sys.argv[0]) + " called with the following sys.argv array:"
-#for index, arg in enumerate(sys.argv):
-# print "sys.argv[" + str(index) + "] = " + str(sys.argv[index])
-
-if len(sys.argv) < 16:
- usage()
-
-#oracleHome will be passed by command line parameter -oh.
-oracleHome = None
-#javaHome will be passed by command line parameter -jh.
-javaHome = None
-#domainParentDir will be passed by command line parameter -parent.
-domainParentDir = None
-#domainUser is hard-coded to weblogic. You can change to other name of your choice. Command line paramter -user.
-domainUser = 'weblogic'
-#domainPassword will be passed by Command line parameter -password.
-domainPassword = None
-#rcuDb will be passed by command line parameter -rcuDb.
-rcuDb = None
-#change rcuSchemaPrefix to your infra schema prefix. Command line parameter -rcuPrefix.
-rcuSchemaPrefix = 'DEV12'
-#change rcuSchemaPassword to your infra schema password. Command line parameter -rcuSchemaPwd.
-rcuSchemaPassword = None
-exposeAdminT3Channel = None
-t3ChannelPort = None
-t3ChannelPublicAddress = None
-i = 1
-while i < len(sys.argv):
- if sys.argv[i] == '-oh':
- oracleHome = sys.argv[i + 1]
- i += 2
- elif sys.argv[i] == '-jh':
- javaHome = sys.argv[i + 1]
- i += 2
- elif sys.argv[i] == '-parent':
- domainParentDir = sys.argv[i + 1]
- i += 2
- elif sys.argv[i] == '-name':
- domainName = sys.argv[i + 1]
- i += 2
- elif sys.argv[i] == '-user':
- domainUser = sys.argv[i + 1]
- i += 2
- elif sys.argv[i] == '-password':
- domainPassword = sys.argv[i + 1]
- i += 2
- elif sys.argv[i] == '-rcuDb':
- rcuDb = sys.argv[i + 1]
- i += 2
- elif sys.argv[i] == '-rcuPrefix':
- rcuSchemaPrefix = sys.argv[i + 1]
- i += 2
- elif sys.argv[i] == '-rcuSchemaPwd':
- rcuSchemaPassword = sys.argv[i + 1]
- i += 2
- elif sys.argv[i] == '-adminListenPort':
- adminListenPort = sys.argv[i + 1]
- i += 2
- elif sys.argv[i] == '-adminName':
- adminName = sys.argv[i + 1]
- i += 2
- elif sys.argv[i] == '-managedNameBase':
- managedNameBase = sys.argv[i + 1]
- i += 2
- elif sys.argv[i] == '-managedServerPort':
- managedServerPort = sys.argv[i + 1]
- i += 2
- elif sys.argv[i] == '-prodMode':
- prodMode = sys.argv[i + 1]
- i += 2
- elif sys.argv[i] == '-managedServerCount':
- managedCount = sys.argv[i + 1]
- i += 2
- elif sys.argv[i] == '-clusterName':
- clusterName = sys.argv[i + 1]
- i += 2
- elif sys.argv[i] == '-t3ChannelPublicAddress':
- t3ChannelPublicAddress = sys.argv[i + 1]
- i += 2
- elif sys.argv[i] == '-t3ChannelPort':
- t3ChannelPort = sys.argv[i + 1]
- i += 2
- elif sys.argv[i] == '-exposeAdminT3Channel':
- exposeAdminT3Channel = sys.argv[i + 1]
- i += 2
- else:
- print 'Unexpected argument switch at position ' + str(i) + ': ' + str(sys.argv[i])
- usage()
- sys.exit(1)
-
-provisioner = Infra12213Provisioner(oracleHome, javaHome, domainParentDir, adminListenPort, adminName, managedNameBase, managedServerPort, prodMode, managedCount, clusterName)
-provisioner.createInfraDomain(domainName, domainUser, domainPassword, rcuDb, rcuSchemaPrefix, rcuSchemaPassword,
- adminListenPort, adminName, managedNameBase, managedServerPort, prodMode, managedCount,
+# Copyright (c) 2014, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+
+import os
+import sys
+
+import com.oracle.cie.domain.script.jython.WLSTException as WLSTException
+
+class Infra12213Provisioner:
+
+ MACHINES = {
+ 'machine1' : {
+ 'NMType': 'SSL',
+ 'ListenAddress': 'localhost',
+ 'ListenPort': 5658
+ }
+ }
+
+ JRF_12213_TEMPLATES = {
+ 'baseTemplate' : '@@ORACLE_HOME@@/wlserver/common/templates/wls/wls.jar',
+ 'extensionTemplates' : [
+ '@@ORACLE_HOME@@/oracle_common/common/templates/wls/oracle.jrf_template.jar',
+ '@@ORACLE_HOME@@/oracle_common/common/templates/wls/oracle.jrf.ws.async_template.jar',
+ '@@ORACLE_HOME@@/oracle_common/common/templates/wls/oracle.wsmpm_template.jar',
+ '@@ORACLE_HOME@@/oracle_common/common/templates/wls/oracle.ums_template.jar',
+ '@@ORACLE_HOME@@/em/common/templates/wls/oracle.em_wls_template.jar'
+ ],
+ 'serverGroupsToTarget' : [ 'JRF-MAN-SVR', 'WSMPM-MAN-SVR' ]
+ }
+
+ def __init__(self, oracleHome, javaHome, domainParentDir, adminListenPort, adminName, managedNameBase, managedServerPort, prodMode, managedCount, clusterName):
+ self.oracleHome = self.validateDirectory(oracleHome)
+ self.javaHome = self.validateDirectory(javaHome)
+ self.domainParentDir = self.validateDirectory(domainParentDir, create=True)
+ return
+
+ def createInfraDomain(self, domainName, user, password, db, dbPrefix, dbPassword, adminListenPort, adminName,
+ managedNameBase, managedServerPort, prodMode, managedCount, clusterName,
+ exposeAdminT3Channel=None, t3ChannelPublicAddress=None, t3ChannelPort=None):
+ domainHome = self.createBaseDomain(domainName, user, password, adminListenPort, adminName, managedNameBase,
+ managedServerPort, prodMode, managedCount, clusterName
+ )
+ self.extendDomain(domainHome, db, dbPrefix, dbPassword, exposeAdminT3Channel, t3ChannelPublicAddress,
+ t3ChannelPort)
+
+ def createBaseDomain(self, domainName, user, password, adminListenPort, adminName, managedNameBase, managedServerPort, prodMode, managedCount, clusterName):
+ baseTemplate = self.replaceTokens(self.JRF_12213_TEMPLATES['baseTemplate'])
+
+ readTemplate(baseTemplate)
+ setOption('DomainName', domainName)
+ setOption('JavaHome', self.javaHome)
+ if (prodMode == 'true'):
+ setOption('ServerStartMode', 'prod')
+ else:
+ setOption('ServerStartMode', 'dev')
+ set('Name', domainName)
+
+ admin_port = int(adminListenPort)
+ ms_port = int(managedServerPort)
+ ms_count = int(managedCount)
+
+ # Create Admin Server
+ # =======================
+ print 'Creating Admin Server...'
+ cd('/Servers/AdminServer')
+ #set('ListenAddress', '%s-%s' % (domain_uid, admin_server_name_svc))
+ set('ListenPort', admin_port)
+ set('Name', adminName)
+
+ # Define the user password for weblogic
+ # =====================================
+ cd('/Security/' + domainName + '/User/weblogic')
+ set('Name', user)
+ set('Password', password)
+
+ # Create a cluster
+ # ======================
+ print 'Creating cluster...'
+ cd('/')
+ cl=create(clusterName, 'Cluster')
+
+ # Create managed servers
+ for index in range(0, ms_count):
+ cd('/')
+ msIndex = index+1
+ cd('/')
+ name = '%s%s' % (managedNameBase, msIndex)
+ create(name, 'Server')
+ cd('/Servers/%s/' % name )
+ print('managed server name is %s' % name);
+ set('ListenPort', ms_port)
+ set('NumOfRetriesBeforeMSIMode', 0)
+ set('RetryIntervalBeforeMSIMode', 1)
+ set('Cluster', clusterName)
+
+ # Create Node Manager
+ # =======================
+ print 'Creating Node Managers...'
+ for machine in self.MACHINES:
+ cd('/')
+ create(machine, 'Machine')
+ cd('Machine/' + machine)
+ create(machine, 'NodeManager')
+ cd('NodeManager/' + machine)
+ for param in self.MACHINES[machine]:
+ set(param, self.MACHINES[machine][param])
+
+
+ setOption('OverwriteDomain', 'true')
+ domainHome = self.domainParentDir + '/' + domainName
+ print 'Will create Base domain at ' + domainHome
+
+ print 'Writing base domain...'
+ writeDomain(domainHome)
+ closeTemplate()
+ print 'Base domain created at ' + domainHome
+ return domainHome
+
+
+ def extendDomain(self, domainHome, db, dbPrefix, dbPassword, exposeAdminT3Channel, t3ChannelPublicAddress,
+ t3ChannelPort):
+ print 'Extending domain at ' + domainHome
+ print 'Database ' + db
+ readDomain(domainHome)
+ setOption('AppDir', self.domainParentDir + '/applications')
+
+ print 'ExposeAdminT3Channel %s with %s:%s ' % (exposeAdminT3Channel, t3ChannelPublicAddress, t3ChannelPort)
+ if 'true' == exposeAdminT3Channel:
+ self.enable_admin_channel(t3ChannelPublicAddress, t3ChannelPort)
+
+ print 'Applying JRF templates...'
+ for extensionTemplate in self.JRF_12213_TEMPLATES['extensionTemplates']:
+ addTemplate(self.replaceTokens(extensionTemplate))
+
+ print 'Extension Templates added'
+
+ print 'Configuring the Service Table DataSource...'
+ fmwDb = 'jdbc:oracle:thin:@' + db
+ print 'fmwDatabase ' + fmwDb
+ cd('/JDBCSystemResource/LocalSvcTblDataSource/JdbcResource/LocalSvcTblDataSource')
+ cd('JDBCDriverParams/NO_NAME_0')
+ set('DriverName', 'oracle.jdbc.OracleDriver')
+ set('URL', fmwDb)
+ set('PasswordEncrypted', dbPassword)
+
+ stbUser = dbPrefix + '_STB'
+ cd('Properties/NO_NAME_0/Property/user')
+ set('Value', stbUser)
+
+ print 'Getting Database Defaults...'
+ getDatabaseDefaults()
+
+ print 'Targeting Server Groups...'
+ managedName= '%s%s' % (managedNameBase, 1)
+ print "Set CoherenceClusterSystemResource to defaultCoherenceCluster for server:" + managedName
+ serverGroupsToTarget = list(self.JRF_12213_TEMPLATES['serverGroupsToTarget'])
+ cd('/')
+ setServerGroups(managedName, serverGroupsToTarget)
+ print "Set CoherenceClusterSystemResource to defaultCoherenceCluster for server:" + managedName
+ cd('/Servers/' + managedName)
+ set('CoherenceClusterSystemResource', 'defaultCoherenceCluster')
+
+ print 'Targeting Cluster ...'
+ cd('/')
+ print "Set CoherenceClusterSystemResource to defaultCoherenceCluster for cluster:" + clusterName
+ cd('/Cluster/' + clusterName)
+ set('CoherenceClusterSystemResource', 'defaultCoherenceCluster')
+ print "Set WLS clusters as target of defaultCoherenceCluster:" + clusterName
+ cd('/CoherenceClusterSystemResource/defaultCoherenceCluster')
+ set('Target', clusterName)
+
+ print 'Preparing to update domain...'
+ updateDomain()
+ print 'Domain updated successfully'
+ closeDomain()
+ return
+
+
+ ###########################################################################
+ # Helper Methods #
+ ###########################################################################
+
+ def validateDirectory(self, dirName, create=False):
+ directory = os.path.realpath(dirName)
+ if not os.path.exists(directory):
+ if create:
+ os.makedirs(directory)
+ else:
+ message = 'Directory ' + directory + ' does not exist'
+ raise WLSTException(message)
+ elif not os.path.isdir(directory):
+ message = 'Directory ' + directory + ' is not a directory'
+ raise WLSTException(message)
+ return self.fixupPath(directory)
+
+
+ def fixupPath(self, path):
+ result = path
+ if path is not None:
+ result = path.replace('\\', '/')
+ return result
+
+
+ def replaceTokens(self, path):
+ result = path
+ if path is not None:
+ result = path.replace('@@ORACLE_HOME@@', oracleHome)
+ return result
+
+ def enable_admin_channel(self, admin_channel_address, admin_channel_port):
+ if admin_channel_address == None or admin_channel_port == 'None':
+ return
+ cd('/')
+ admin_server_name = get('AdminServerName')
+ print('setting admin server t3channel for ' + admin_server_name)
+ cd('/Servers/' + admin_server_name)
+ create('T3Channel', 'NetworkAccessPoint')
+ cd('/Servers/' + admin_server_name + '/NetworkAccessPoint/T3Channel')
+ set('ListenPort', int(admin_channel_port))
+ set('PublicPort', int(admin_channel_port))
+ set('PublicAddress', admin_channel_address)
+
+#############################
+# Entry point to the script #
+#############################
+
+def usage():
+ print sys.argv[0] + ' -oh -jh -parent -name ' + \
+ '-user -password ' + \
+ '-rcuDb -rcuPrefix -rcuSchemaPwd ' \
+ '-adminListenPort -adminName ' \
+ '-managedNameBase -managedServerPort -prodMode ' \
+ '-managedServerCount -clusterName ' \
+ '-exposeAdminT3Channel -t3ChannelPublicAddress ' \
+ '-t3ChannelPort '
+ sys.exit(0)
+
+# Uncomment for Debug only
+#print str(sys.argv[0]) + " called with the following sys.argv array:"
+#for index, arg in enumerate(sys.argv):
+# print "sys.argv[" + str(index) + "] = " + str(sys.argv[index])
+
+if len(sys.argv) < 16:
+ usage()
+
+#oracleHome will be passed by command line parameter -oh.
+oracleHome = None
+#javaHome will be passed by command line parameter -jh.
+javaHome = None
+#domainParentDir will be passed by command line parameter -parent.
+domainParentDir = None
+#domainUser is hard-coded to weblogic. You can change to other name of your choice. Command line paramter -user.
+domainUser = 'weblogic'
+#domainPassword will be passed by Command line parameter -password.
+domainPassword = None
+#rcuDb will be passed by command line parameter -rcuDb.
+rcuDb = None
+#change rcuSchemaPrefix to your infra schema prefix. Command line parameter -rcuPrefix.
+rcuSchemaPrefix = 'DEV12'
+#change rcuSchemaPassword to your infra schema password. Command line parameter -rcuSchemaPwd.
+rcuSchemaPassword = None
+exposeAdminT3Channel = None
+t3ChannelPort = None
+t3ChannelPublicAddress = None
+i = 1
+while i < len(sys.argv):
+ if sys.argv[i] == '-oh':
+ oracleHome = sys.argv[i + 1]
+ i += 2
+ elif sys.argv[i] == '-jh':
+ javaHome = sys.argv[i + 1]
+ i += 2
+ elif sys.argv[i] == '-parent':
+ domainParentDir = sys.argv[i + 1]
+ i += 2
+ elif sys.argv[i] == '-name':
+ domainName = sys.argv[i + 1]
+ i += 2
+ elif sys.argv[i] == '-user':
+ domainUser = sys.argv[i + 1]
+ i += 2
+ elif sys.argv[i] == '-password':
+ domainPassword = sys.argv[i + 1]
+ i += 2
+ elif sys.argv[i] == '-rcuDb':
+ rcuDb = sys.argv[i + 1]
+ i += 2
+ elif sys.argv[i] == '-rcuPrefix':
+ rcuSchemaPrefix = sys.argv[i + 1]
+ i += 2
+ elif sys.argv[i] == '-rcuSchemaPwd':
+ rcuSchemaPassword = sys.argv[i + 1]
+ i += 2
+ elif sys.argv[i] == '-adminListenPort':
+ adminListenPort = sys.argv[i + 1]
+ i += 2
+ elif sys.argv[i] == '-adminName':
+ adminName = sys.argv[i + 1]
+ i += 2
+ elif sys.argv[i] == '-managedNameBase':
+ managedNameBase = sys.argv[i + 1]
+ i += 2
+ elif sys.argv[i] == '-managedServerPort':
+ managedServerPort = sys.argv[i + 1]
+ i += 2
+ elif sys.argv[i] == '-prodMode':
+ prodMode = sys.argv[i + 1]
+ i += 2
+ elif sys.argv[i] == '-managedServerCount':
+ managedCount = sys.argv[i + 1]
+ i += 2
+ elif sys.argv[i] == '-clusterName':
+ clusterName = sys.argv[i + 1]
+ i += 2
+ elif sys.argv[i] == '-t3ChannelPublicAddress':
+ t3ChannelPublicAddress = sys.argv[i + 1]
+ i += 2
+ elif sys.argv[i] == '-t3ChannelPort':
+ t3ChannelPort = sys.argv[i + 1]
+ i += 2
+ elif sys.argv[i] == '-exposeAdminT3Channel':
+ exposeAdminT3Channel = sys.argv[i + 1]
+ i += 2
+ else:
+ print 'Unexpected argument switch at position ' + str(i) + ': ' + str(sys.argv[i])
+ usage()
+ sys.exit(1)
+
+provisioner = Infra12213Provisioner(oracleHome, javaHome, domainParentDir, adminListenPort, adminName, managedNameBase, managedServerPort, prodMode, managedCount, clusterName)
+provisioner.createInfraDomain(domainName, domainUser, domainPassword, rcuDb, rcuSchemaPrefix, rcuSchemaPassword,
+ adminListenPort, adminName, managedNameBase, managedServerPort, prodMode, managedCount,
clusterName, exposeAdminT3Channel, t3ChannelPublicAddress, t3ChannelPort)
\ No newline at end of file
diff --git a/OracleWebCenterPortal/kubernetes/common/createFMWRestrictedJRFDomain.py b/OracleWebCenterPortal/kubernetes/common/createFMWRestrictedJRFDomain.py
old mode 100644
new mode 100755
index acfe5da80..e1b746312
--- a/OracleWebCenterPortal/kubernetes/common/createFMWRestrictedJRFDomain.py
+++ b/OracleWebCenterPortal/kubernetes/common/createFMWRestrictedJRFDomain.py
@@ -1,291 +1,291 @@
-# Copyright (c) 2014, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-
-import os
-import sys
-
-import com.oracle.cie.domain.script.jython.WLSTException as WLSTException
-
-class Infra12213Provisioner:
-
- MACHINES = {
- 'machine1' : {
- 'NMType': 'SSL',
- 'ListenAddress': 'localhost',
- 'ListenPort': 5658
- }
- }
-
- JRF_12213_TEMPLATES = {
- 'baseTemplate' : '@@ORACLE_HOME@@/wlserver/common/templates/wls/wls.jar',
- 'extensionTemplates' : [
- '@@ORACLE_HOME@@/oracle_common/common/templates/wls/oracle.jrf_restricted_template.jar',
- '@@ORACLE_HOME@@/em/common/templates/wls/oracle.em_wls_restricted_template.jar'
- ],
- 'serverGroupsToTarget' : [ 'JRF-MAN-SVR', 'WSMPM-MAN-SVR' ]
- }
-
- def __init__(self, oracleHome, javaHome, domainParentDir, adminListenPort, adminName, managedNameBase, managedServerPort, prodMode, managedCount, clusterName):
- self.oracleHome = self.validateDirectory(oracleHome)
- self.javaHome = self.validateDirectory(javaHome)
- self.domainParentDir = self.validateDirectory(domainParentDir, create=True)
- return
-
- def createInfraDomain(self, domainName, user, password, adminListenPort, adminName,
- managedNameBase, managedServerPort, prodMode, managedCount, clusterName,
- exposeAdminT3Channel=None, t3ChannelPublicAddress=None, t3ChannelPort=None):
- domainHome = self.createBaseDomain(domainName, user, password, adminListenPort, adminName, managedNameBase,
- managedServerPort, prodMode, managedCount, clusterName
- )
- self.extendDomain(domainHome, exposeAdminT3Channel, t3ChannelPublicAddress, t3ChannelPort)
-
- def createBaseDomain(self, domainName, user, password, adminListenPort, adminName, managedNameBase, managedServerPort, prodMode, managedCount, clusterName):
- baseTemplate = self.replaceTokens(self.JRF_12213_TEMPLATES['baseTemplate'])
-
- readTemplate(baseTemplate)
- setOption('DomainName', domainName)
- setOption('JavaHome', self.javaHome)
- if (prodMode == 'true'):
- setOption('ServerStartMode', 'prod')
- else:
- setOption('ServerStartMode', 'dev')
- set('Name', domainName)
-
- admin_port = int(adminListenPort)
- ms_port = int(managedServerPort)
- ms_count = int(managedCount)
-
- # Create Admin Server
- # =======================
- print 'Creating Admin Server...'
- cd('/Servers/AdminServer')
- #set('ListenAddress', '%s-%s' % (domain_uid, admin_server_name_svc))
- set('ListenPort', admin_port)
- set('Name', adminName)
-
- # Define the user password for weblogic
- # =====================================
- cd('/Security/' + domainName + '/User/weblogic')
- set('Name', user)
- set('Password', password)
-
- # Create a cluster
- # ======================
- print 'Creating cluster...'
- cd('/')
- cl=create(clusterName, 'Cluster')
-
- # Create managed servers
- for index in range(0, ms_count):
- cd('/')
- msIndex = index+1
- cd('/')
- name = '%s%s' % (managedNameBase, msIndex)
- create(name, 'Server')
- cd('/Servers/%s/' % name )
- print('managed server name is %s' % name);
- set('ListenPort', ms_port)
- set('NumOfRetriesBeforeMSIMode', 0)
- set('RetryIntervalBeforeMSIMode', 1)
- set('Cluster', clusterName)
-
- # Create Node Manager
- # =======================
- print 'Creating Node Managers...'
- for machine in self.MACHINES:
- cd('/')
- create(machine, 'Machine')
- cd('Machine/' + machine)
- create(machine, 'NodeManager')
- cd('NodeManager/' + machine)
- for param in self.MACHINES[machine]:
- set(param, self.MACHINES[machine][param])
-
-
- setOption('OverwriteDomain', 'true')
- domainHome = self.domainParentDir + '/' + domainName
- print 'Will create Base domain at ' + domainHome
-
- print 'Writing base domain...'
- writeDomain(domainHome)
- closeTemplate()
- print 'Base domain created at ' + domainHome
- return domainHome
-
-
- def extendDomain(self, domainHome, exposeAdminT3Channel, t3ChannelPublicAddress,
- t3ChannelPort):
- print 'Extending domain at ' + domainHome
- readDomain(domainHome)
- setOption('AppDir', self.domainParentDir + '/applications')
-
- print 'ExposeAdminT3Channel %s with %s:%s ' % (exposeAdminT3Channel, t3ChannelPublicAddress, t3ChannelPort)
- if 'true' == exposeAdminT3Channel:
- self.enable_admin_channel(t3ChannelPublicAddress, t3ChannelPort)
-
- print 'Applying JRF templates...'
- for extensionTemplate in self.JRF_12213_TEMPLATES['extensionTemplates']:
- addTemplate(self.replaceTokens(extensionTemplate))
-
- print 'Extension Templates added'
-
- print 'Preparing to update domain...'
- updateDomain()
- print 'Domain updated successfully'
- closeDomain()
- return
-
-
- ###########################################################################
- # Helper Methods #
- ###########################################################################
-
- def validateDirectory(self, dirName, create=False):
- directory = os.path.realpath(dirName)
- if not os.path.exists(directory):
- if create:
- os.makedirs(directory)
- else:
- message = 'Directory ' + directory + ' does not exist'
- raise WLSTException(message)
- elif not os.path.isdir(directory):
- message = 'Directory ' + directory + ' is not a directory'
- raise WLSTException(message)
- return self.fixupPath(directory)
-
-
- def fixupPath(self, path):
- result = path
- if path is not None:
- result = path.replace('\\', '/')
- return result
-
-
- def replaceTokens(self, path):
- result = path
- if path is not None:
- result = path.replace('@@ORACLE_HOME@@', oracleHome)
- return result
-
- def enable_admin_channel(self, admin_channel_address, admin_channel_port):
- if admin_channel_address == None or admin_channel_port == 'None':
- return
- cd('/')
- admin_server_name = get('AdminServerName')
- print('setting admin server t3channel for ' + admin_server_name)
- cd('/Servers/' + admin_server_name)
- create('T3Channel', 'NetworkAccessPoint')
- cd('/Servers/' + admin_server_name + '/NetworkAccessPoint/T3Channel')
- set('ListenPort', int(admin_channel_port))
- set('PublicPort', int(admin_channel_port))
- set('PublicAddress', admin_channel_address)
-
-#############################
-# Entry point to the script #
-#############################
-
-def usage():
- print sys.argv[0] + ' -oh -jh -parent -name ' + \
- '-user -password ' + \
- '-rcuDb -rcuPrefix -rcuSchemaPwd ' \
- '-adminListenPort -adminName ' \
- '-managedNameBase -managedServerPort -prodMode ' \
- '-managedServerCount -clusterName ' \
- '-exposeAdminT3Channel -t3ChannelPublicAddress ' \
- '-t3ChannelPort '
- sys.exit(0)
-
-# Uncomment for Debug only
-#print str(sys.argv[0]) + " called with the following sys.argv array:"
-#for index, arg in enumerate(sys.argv):
-# print "sys.argv[" + str(index) + "] = " + str(sys.argv[index])
-
-if len(sys.argv) < 16:
- usage()
-
-#oracleHome will be passed by command line parameter -oh.
-oracleHome = None
-#javaHome will be passed by command line parameter -jh.
-javaHome = None
-#domainParentDir will be passed by command line parameter -parent.
-domainParentDir = None
-#domainUser is hard-coded to weblogic. You can change to other name of your choice. Command line paramter -user.
-domainUser = 'weblogic'
-#domainPassword will be passed by Command line parameter -password.
-domainPassword = None
-#rcuDb will be passed by command line parameter -rcuDb.
-rcuDb = None
-#change rcuSchemaPrefix to your infra schema prefix. Command line parameter -rcuPrefix.
-rcuSchemaPrefix = 'DEV12'
-#change rcuSchemaPassword to your infra schema password. Command line parameter -rcuSchemaPwd.
-rcuSchemaPassword = None
-exposeAdminT3Channel = None
-t3ChannelPort = None
-t3ChannelPublicAddress = None
-i = 1
-while i < len(sys.argv):
- if sys.argv[i] == '-oh':
- oracleHome = sys.argv[i + 1]
- i += 2
- elif sys.argv[i] == '-jh':
- javaHome = sys.argv[i + 1]
- i += 2
- elif sys.argv[i] == '-parent':
- domainParentDir = sys.argv[i + 1]
- i += 2
- elif sys.argv[i] == '-name':
- domainName = sys.argv[i + 1]
- i += 2
- elif sys.argv[i] == '-user':
- domainUser = sys.argv[i + 1]
- i += 2
- elif sys.argv[i] == '-password':
- domainPassword = sys.argv[i + 1]
- i += 2
- elif sys.argv[i] == '-rcuDb':
- rcuDb = sys.argv[i + 1]
- i += 2
- elif sys.argv[i] == '-rcuPrefix':
- rcuSchemaPrefix = sys.argv[i + 1]
- i += 2
- elif sys.argv[i] == '-rcuSchemaPwd':
- rcuSchemaPassword = sys.argv[i + 1]
- i += 2
- elif sys.argv[i] == '-adminListenPort':
- adminListenPort = sys.argv[i + 1]
- i += 2
- elif sys.argv[i] == '-adminName':
- adminName = sys.argv[i + 1]
- i += 2
- elif sys.argv[i] == '-managedNameBase':
- managedNameBase = sys.argv[i + 1]
- i += 2
- elif sys.argv[i] == '-managedServerPort':
- managedServerPort = sys.argv[i + 1]
- i += 2
- elif sys.argv[i] == '-prodMode':
- prodMode = sys.argv[i + 1]
- i += 2
- elif sys.argv[i] == '-managedServerCount':
- managedCount = sys.argv[i + 1]
- i += 2
- elif sys.argv[i] == '-clusterName':
- clusterName = sys.argv[i + 1]
- i += 2
- elif sys.argv[i] == '-t3ChannelPublicAddress':
- t3ChannelPublicAddress = sys.argv[i + 1]
- i += 2
- elif sys.argv[i] == '-t3ChannelPort':
- t3ChannelPort = sys.argv[i + 1]
- i += 2
- elif sys.argv[i] == '-exposeAdminT3Channel':
- exposeAdminT3Channel = sys.argv[i + 1]
- i += 2
- else:
- print 'Unexpected argument switch at position ' + str(i) + ': ' + str(sys.argv[i])
- usage()
- sys.exit(1)
-
-provisioner = Infra12213Provisioner(oracleHome, javaHome, domainParentDir, adminListenPort, adminName, managedNameBase, managedServerPort, prodMode, managedCount, clusterName)
-provisioner.createInfraDomain(domainName, domainUser, domainPassword, adminListenPort, adminName, managedNameBase, managedServerPort, prodMode, managedCount,
- clusterName, exposeAdminT3Channel, t3ChannelPublicAddress, t3ChannelPort)
+# Copyright (c) 2014, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+
+import os
+import sys
+
+import com.oracle.cie.domain.script.jython.WLSTException as WLSTException
+
+class Infra12213Provisioner:
+
+ MACHINES = {
+ 'machine1' : {
+ 'NMType': 'SSL',
+ 'ListenAddress': 'localhost',
+ 'ListenPort': 5658
+ }
+ }
+
+ JRF_12213_TEMPLATES = {
+ 'baseTemplate' : '@@ORACLE_HOME@@/wlserver/common/templates/wls/wls.jar',
+ 'extensionTemplates' : [
+ '@@ORACLE_HOME@@/oracle_common/common/templates/wls/oracle.jrf_restricted_template.jar',
+ '@@ORACLE_HOME@@/em/common/templates/wls/oracle.em_wls_restricted_template.jar'
+ ],
+ 'serverGroupsToTarget' : [ 'JRF-MAN-SVR', 'WSMPM-MAN-SVR' ]
+ }
+
+ def __init__(self, oracleHome, javaHome, domainParentDir, adminListenPort, adminName, managedNameBase, managedServerPort, prodMode, managedCount, clusterName):
+ self.oracleHome = self.validateDirectory(oracleHome)
+ self.javaHome = self.validateDirectory(javaHome)
+ self.domainParentDir = self.validateDirectory(domainParentDir, create=True)
+ return
+
+ def createInfraDomain(self, domainName, user, password, adminListenPort, adminName,
+ managedNameBase, managedServerPort, prodMode, managedCount, clusterName,
+ exposeAdminT3Channel=None, t3ChannelPublicAddress=None, t3ChannelPort=None):
+ domainHome = self.createBaseDomain(domainName, user, password, adminListenPort, adminName, managedNameBase,
+ managedServerPort, prodMode, managedCount, clusterName
+ )
+ self.extendDomain(domainHome, exposeAdminT3Channel, t3ChannelPublicAddress, t3ChannelPort)
+
+ def createBaseDomain(self, domainName, user, password, adminListenPort, adminName, managedNameBase, managedServerPort, prodMode, managedCount, clusterName):
+ baseTemplate = self.replaceTokens(self.JRF_12213_TEMPLATES['baseTemplate'])
+
+ readTemplate(baseTemplate)
+ setOption('DomainName', domainName)
+ setOption('JavaHome', self.javaHome)
+ if (prodMode == 'true'):
+ setOption('ServerStartMode', 'prod')
+ else:
+ setOption('ServerStartMode', 'dev')
+ set('Name', domainName)
+
+ admin_port = int(adminListenPort)
+ ms_port = int(managedServerPort)
+ ms_count = int(managedCount)
+
+ # Create Admin Server
+ # =======================
+ print 'Creating Admin Server...'
+ cd('/Servers/AdminServer')
+ #set('ListenAddress', '%s-%s' % (domain_uid, admin_server_name_svc))
+ set('ListenPort', admin_port)
+ set('Name', adminName)
+
+ # Define the user password for weblogic
+ # =====================================
+ cd('/Security/' + domainName + '/User/weblogic')
+ set('Name', user)
+ set('Password', password)
+
+ # Create a cluster
+ # ======================
+ print 'Creating cluster...'
+ cd('/')
+ cl=create(clusterName, 'Cluster')
+
+ # Create managed servers
+ for index in range(0, ms_count):
+ cd('/')
+ msIndex = index+1
+ cd('/')
+ name = '%s%s' % (managedNameBase, msIndex)
+ create(name, 'Server')
+ cd('/Servers/%s/' % name )
+ print('managed server name is %s' % name);
+ set('ListenPort', ms_port)
+ set('NumOfRetriesBeforeMSIMode', 0)
+ set('RetryIntervalBeforeMSIMode', 1)
+ set('Cluster', clusterName)
+
+ # Create Node Manager
+ # =======================
+ print 'Creating Node Managers...'
+ for machine in self.MACHINES:
+ cd('/')
+ create(machine, 'Machine')
+ cd('Machine/' + machine)
+ create(machine, 'NodeManager')
+ cd('NodeManager/' + machine)
+ for param in self.MACHINES[machine]:
+ set(param, self.MACHINES[machine][param])
+
+
+ setOption('OverwriteDomain', 'true')
+ domainHome = self.domainParentDir + '/' + domainName
+ print 'Will create Base domain at ' + domainHome
+
+ print 'Writing base domain...'
+ writeDomain(domainHome)
+ closeTemplate()
+ print 'Base domain created at ' + domainHome
+ return domainHome
+
+
+ def extendDomain(self, domainHome, exposeAdminT3Channel, t3ChannelPublicAddress,
+ t3ChannelPort):
+ print 'Extending domain at ' + domainHome
+ readDomain(domainHome)
+ setOption('AppDir', self.domainParentDir + '/applications')
+
+ print 'ExposeAdminT3Channel %s with %s:%s ' % (exposeAdminT3Channel, t3ChannelPublicAddress, t3ChannelPort)
+ if 'true' == exposeAdminT3Channel:
+ self.enable_admin_channel(t3ChannelPublicAddress, t3ChannelPort)
+
+ print 'Applying JRF templates...'
+ for extensionTemplate in self.JRF_12213_TEMPLATES['extensionTemplates']:
+ addTemplate(self.replaceTokens(extensionTemplate))
+
+ print 'Extension Templates added'
+
+ print 'Preparing to update domain...'
+ updateDomain()
+ print 'Domain updated successfully'
+ closeDomain()
+ return
+
+
+ ###########################################################################
+ # Helper Methods #
+ ###########################################################################
+
+ def validateDirectory(self, dirName, create=False):
+ directory = os.path.realpath(dirName)
+ if not os.path.exists(directory):
+ if create:
+ os.makedirs(directory)
+ else:
+ message = 'Directory ' + directory + ' does not exist'
+ raise WLSTException(message)
+ elif not os.path.isdir(directory):
+ message = 'Directory ' + directory + ' is not a directory'
+ raise WLSTException(message)
+ return self.fixupPath(directory)
+
+
+ def fixupPath(self, path):
+ result = path
+ if path is not None:
+ result = path.replace('\\', '/')
+ return result
+
+
+ def replaceTokens(self, path):
+ result = path
+ if path is not None:
+ result = path.replace('@@ORACLE_HOME@@', oracleHome)
+ return result
+
+ def enable_admin_channel(self, admin_channel_address, admin_channel_port):
+ if admin_channel_address == None or admin_channel_port == 'None':
+ return
+ cd('/')
+ admin_server_name = get('AdminServerName')
+ print('setting admin server t3channel for ' + admin_server_name)
+ cd('/Servers/' + admin_server_name)
+ create('T3Channel', 'NetworkAccessPoint')
+ cd('/Servers/' + admin_server_name + '/NetworkAccessPoint/T3Channel')
+ set('ListenPort', int(admin_channel_port))
+ set('PublicPort', int(admin_channel_port))
+ set('PublicAddress', admin_channel_address)
+
+#############################
+# Entry point to the script #
+#############################
+
+def usage():
+ print sys.argv[0] + ' -oh -jh -parent -name ' + \
+ '-user -password ' + \
+ '-rcuDb -rcuPrefix -rcuSchemaPwd ' \
+ '-adminListenPort -adminName ' \
+ '-managedNameBase -managedServerPort -prodMode ' \
+ '-managedServerCount -clusterName ' \
+ '-exposeAdminT3Channel -t3ChannelPublicAddress ' \
+ '-t3ChannelPort '
+ sys.exit(0)
+
+# Uncomment for Debug only
+#print str(sys.argv[0]) + " called with the following sys.argv array:"
+#for index, arg in enumerate(sys.argv):
+# print "sys.argv[" + str(index) + "] = " + str(sys.argv[index])
+
+if len(sys.argv) < 16:
+ usage()
+
+#oracleHome will be passed by command line parameter -oh.
+oracleHome = None
+#javaHome will be passed by command line parameter -jh.
+javaHome = None
+#domainParentDir will be passed by command line parameter -parent.
+domainParentDir = None
+#domainUser is hard-coded to weblogic. You can change to other name of your choice. Command line paramter -user.
+domainUser = 'weblogic'
+#domainPassword will be passed by Command line parameter -password.
+domainPassword = None
+#rcuDb will be passed by command line parameter -rcuDb.
+rcuDb = None
+#change rcuSchemaPrefix to your infra schema prefix. Command line parameter -rcuPrefix.
+rcuSchemaPrefix = 'DEV12'
+#change rcuSchemaPassword to your infra schema password. Command line parameter -rcuSchemaPwd.
+rcuSchemaPassword = None
+exposeAdminT3Channel = None
+t3ChannelPort = None
+t3ChannelPublicAddress = None
+i = 1
+while i < len(sys.argv):
+ if sys.argv[i] == '-oh':
+ oracleHome = sys.argv[i + 1]
+ i += 2
+ elif sys.argv[i] == '-jh':
+ javaHome = sys.argv[i + 1]
+ i += 2
+ elif sys.argv[i] == '-parent':
+ domainParentDir = sys.argv[i + 1]
+ i += 2
+ elif sys.argv[i] == '-name':
+ domainName = sys.argv[i + 1]
+ i += 2
+ elif sys.argv[i] == '-user':
+ domainUser = sys.argv[i + 1]
+ i += 2
+ elif sys.argv[i] == '-password':
+ domainPassword = sys.argv[i + 1]
+ i += 2
+ elif sys.argv[i] == '-rcuDb':
+ rcuDb = sys.argv[i + 1]
+ i += 2
+ elif sys.argv[i] == '-rcuPrefix':
+ rcuSchemaPrefix = sys.argv[i + 1]
+ i += 2
+ elif sys.argv[i] == '-rcuSchemaPwd':
+ rcuSchemaPassword = sys.argv[i + 1]
+ i += 2
+ elif sys.argv[i] == '-adminListenPort':
+ adminListenPort = sys.argv[i + 1]
+ i += 2
+ elif sys.argv[i] == '-adminName':
+ adminName = sys.argv[i + 1]
+ i += 2
+ elif sys.argv[i] == '-managedNameBase':
+ managedNameBase = sys.argv[i + 1]
+ i += 2
+ elif sys.argv[i] == '-managedServerPort':
+ managedServerPort = sys.argv[i + 1]
+ i += 2
+ elif sys.argv[i] == '-prodMode':
+ prodMode = sys.argv[i + 1]
+ i += 2
+ elif sys.argv[i] == '-managedServerCount':
+ managedCount = sys.argv[i + 1]
+ i += 2
+ elif sys.argv[i] == '-clusterName':
+ clusterName = sys.argv[i + 1]
+ i += 2
+ elif sys.argv[i] == '-t3ChannelPublicAddress':
+ t3ChannelPublicAddress = sys.argv[i + 1]
+ i += 2
+ elif sys.argv[i] == '-t3ChannelPort':
+ t3ChannelPort = sys.argv[i + 1]
+ i += 2
+ elif sys.argv[i] == '-exposeAdminT3Channel':
+ exposeAdminT3Channel = sys.argv[i + 1]
+ i += 2
+ else:
+ print 'Unexpected argument switch at position ' + str(i) + ': ' + str(sys.argv[i])
+ usage()
+ sys.exit(1)
+
+provisioner = Infra12213Provisioner(oracleHome, javaHome, domainParentDir, adminListenPort, adminName, managedNameBase, managedServerPort, prodMode, managedCount, clusterName)
+provisioner.createInfraDomain(domainName, domainUser, domainPassword, adminListenPort, adminName, managedNameBase, managedServerPort, prodMode, managedCount,
+ clusterName, exposeAdminT3Channel, t3ChannelPublicAddress, t3ChannelPort)
diff --git a/OracleWebCenterPortal/kubernetes/common/domain-template.yaml b/OracleWebCenterPortal/kubernetes/common/domain-template.yaml
old mode 100644
new mode 100755
index 2d081de7d..779370d63
--- a/OracleWebCenterPortal/kubernetes/common/domain-template.yaml
+++ b/OracleWebCenterPortal/kubernetes/common/domain-template.yaml
@@ -1,119 +1,119 @@
-# Copyright (c) 2017, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-#
-# This is an example of how to define a Domain resource.
-#
-apiVersion: "weblogic.oracle/v8"
-kind: Domain
-metadata:
- name: %DOMAIN_UID%
- namespace: %NAMESPACE%
- labels:
- weblogic.domainUID: %DOMAIN_UID%
-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 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, introspector 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%"
-
-
- # 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%"
-
- 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 -Xms256m -Xmx512m "
- %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%- mountPath: %DOMAIN_ROOT_DIR%
- %LOG_HOME_ON_PV_PREFIX% name: weblogic-domain-storage-volume
-
- # adminServer is used to configure the desired behavior for starting the administration server.
- adminServer:
- # serverStartState legal values are "RUNNING" or "ADMIN"
- # "RUNNING" means the listed server will be started up to "RUNNING" mode
- # "ADMIN" means the listed server will be start up to "ADMIN" mode
- serverStartState: "RUNNING"
- %EXPOSE_ANY_CHANNEL_PREFIX%adminService:
- %EXPOSE_ANY_CHANNEL_PREFIX% channels:
- # The Admin Server's NodePort
- %EXPOSE_ADMIN_PORT_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
-
- # 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%
- serverStartState: "RUNNING"
- serverPod:
- # Instructs Kubernetes scheduler to prefer nodes for new cluster members where there are not
- # already members of the same cluster.
- affinity:
- podAntiAffinity:
- preferredDuringSchedulingIgnoredDuringExecution:
- - weight: 100
- podAffinityTerm:
- labelSelector:
- matchExpressions:
- - key: "weblogic.clusterName"
- operator: In
- values:
- - $(CLUSTER_NAME)
- topologyKey: "kubernetes.io/hostname"
- replicas: %INITIAL_MANAGED_SERVER_REPLICAS%
- # The number of managed servers to start for unlisted clusters
- # replicas: 1
-
- # Istio
- %ISTIO_PREFIX%configuration:
- %ISTIO_PREFIX% istio:
- %ISTIO_PREFIX% enabled: %ISTIO_ENABLED%
- %ISTIO_PREFIX% readinessPort: %ISTIO_READINESS_PORT%
-
+# Copyright (c) 2017, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+#
+# This is an example of how to define a Domain resource.
+#
+apiVersion: "weblogic.oracle/v8"
+kind: Domain
+metadata:
+ name: %DOMAIN_UID%
+ namespace: %NAMESPACE%
+ labels:
+ weblogic.domainUID: %DOMAIN_UID%
+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 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, introspector 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%"
+
+
+ # 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%"
+
+ 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 -Xms256m -Xmx512m "
+ %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%- mountPath: %DOMAIN_ROOT_DIR%
+ %LOG_HOME_ON_PV_PREFIX% name: weblogic-domain-storage-volume
+
+ # adminServer is used to configure the desired behavior for starting the administration server.
+ adminServer:
+ # serverStartState legal values are "RUNNING" or "ADMIN"
+ # "RUNNING" means the listed server will be started up to "RUNNING" mode
+ # "ADMIN" means the listed server will be start up to "ADMIN" mode
+ serverStartState: "RUNNING"
+ %EXPOSE_ANY_CHANNEL_PREFIX%adminService:
+ %EXPOSE_ANY_CHANNEL_PREFIX% channels:
+ # The Admin Server's NodePort
+ %EXPOSE_ADMIN_PORT_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
+
+ # 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%
+ serverStartState: "RUNNING"
+ serverPod:
+ # Instructs Kubernetes scheduler to prefer nodes for new cluster members where there are not
+ # already members of the same cluster.
+ affinity:
+ podAntiAffinity:
+ preferredDuringSchedulingIgnoredDuringExecution:
+ - weight: 100
+ podAffinityTerm:
+ labelSelector:
+ matchExpressions:
+ - key: "weblogic.clusterName"
+ operator: In
+ values:
+ - $(CLUSTER_NAME)
+ topologyKey: "kubernetes.io/hostname"
+ replicas: %INITIAL_MANAGED_SERVER_REPLICAS%
+ # The number of managed servers to start for unlisted clusters
+ # replicas: 1
+
+ # Istio
+ %ISTIO_PREFIX%configuration:
+ %ISTIO_PREFIX% istio:
+ %ISTIO_PREFIX% enabled: %ISTIO_ENABLED%
+ %ISTIO_PREFIX% readinessPort: %ISTIO_READINESS_PORT%
+
diff --git a/OracleWebCenterPortal/kubernetes/common/jrf-domain-template.yaml b/OracleWebCenterPortal/kubernetes/common/jrf-domain-template.yaml
old mode 100644
new mode 100755
index ccd35b84f..57fa90ffd
--- a/OracleWebCenterPortal/kubernetes/common/jrf-domain-template.yaml
+++ b/OracleWebCenterPortal/kubernetes/common/jrf-domain-template.yaml
@@ -1,123 +1,123 @@
-# Copyright (c) 2017, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-#
-# This is an example of how to define a Domain resource.
-#
-apiVersion: "weblogic.oracle/v8"
-kind: Domain
-metadata:
- name: %DOMAIN_UID%
- namespace: %NAMESPACE%
- labels:
- weblogic.domainUID: %DOMAIN_UID%
-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 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, introspector 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%"
-
- # 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%"
-
- 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 -Xms256m -Xmx1024m "
- %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%- mountPath: %DOMAIN_ROOT_DIR%
- %LOG_HOME_ON_PV_PREFIX% name: weblogic-domain-storage-volume
-
- # adminServer is used to configure the desired behavior for starting the administration server.
- adminServer:
- # serverStartState legal values are "RUNNING" or "ADMIN"
- # "RUNNING" means the listed server will be started up to "RUNNING" mode
- # "ADMIN" means the listed server will be start up to "ADMIN" mode
- serverStartState: "RUNNING"
- %EXPOSE_ANY_CHANNEL_PREFIX%adminService:
- %EXPOSE_ANY_CHANNEL_PREFIX% channels:
- # The Admin Server's NodePort
- %EXPOSE_ADMIN_PORT_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 admin servers
- env:
- - 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.
- clusters:
- - clusterName: %CLUSTER_NAME%
- serverStartState: "RUNNING"
- serverPod:
- # Instructs Kubernetes scheduler to prefer nodes for new cluster members where there are not
- # already members of the same cluster.
- affinity:
- podAntiAffinity:
- preferredDuringSchedulingIgnoredDuringExecution:
- - weight: 100
- podAffinityTerm:
- labelSelector:
- matchExpressions:
- - key: "weblogic.clusterName"
- operator: In
- values:
- - $(CLUSTER_NAME)
- topologyKey: "kubernetes.io/hostname"
- replicas: %INITIAL_MANAGED_SERVER_REPLICAS%
- # The number of managed servers to start for unlisted clusters
- # replicas: 1
-
- # Istio
- %ISTIO_PREFIX%configuration:
- %ISTIO_PREFIX% istio:
- %ISTIO_PREFIX% enabled: %ISTIO_ENABLED%
- %ISTIO_PREFIX% readinessPort: %ISTIO_READINESS_PORT%
-
+# Copyright (c) 2017, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+#
+# This is an example of how to define a Domain resource.
+#
+apiVersion: "weblogic.oracle/v8"
+kind: Domain
+metadata:
+ name: %DOMAIN_UID%
+ namespace: %NAMESPACE%
+ labels:
+ weblogic.domainUID: %DOMAIN_UID%
+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 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, introspector 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%"
+
+ # 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%"
+
+ 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 -Xms256m -Xmx1024m "
+ %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%- mountPath: %DOMAIN_ROOT_DIR%
+ %LOG_HOME_ON_PV_PREFIX% name: weblogic-domain-storage-volume
+
+ # adminServer is used to configure the desired behavior for starting the administration server.
+ adminServer:
+ # serverStartState legal values are "RUNNING" or "ADMIN"
+ # "RUNNING" means the listed server will be started up to "RUNNING" mode
+ # "ADMIN" means the listed server will be start up to "ADMIN" mode
+ serverStartState: "RUNNING"
+ %EXPOSE_ANY_CHANNEL_PREFIX%adminService:
+ %EXPOSE_ANY_CHANNEL_PREFIX% channels:
+ # The Admin Server's NodePort
+ %EXPOSE_ADMIN_PORT_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 admin servers
+ env:
+ - 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.
+ clusters:
+ - clusterName: %CLUSTER_NAME%
+ serverStartState: "RUNNING"
+ serverPod:
+ # Instructs Kubernetes scheduler to prefer nodes for new cluster members where there are not
+ # already members of the same cluster.
+ affinity:
+ podAntiAffinity:
+ preferredDuringSchedulingIgnoredDuringExecution:
+ - weight: 100
+ podAffinityTerm:
+ labelSelector:
+ matchExpressions:
+ - key: "weblogic.clusterName"
+ operator: In
+ values:
+ - $(CLUSTER_NAME)
+ topologyKey: "kubernetes.io/hostname"
+ replicas: %INITIAL_MANAGED_SERVER_REPLICAS%
+ # The number of managed servers to start for unlisted clusters
+ # replicas: 1
+
+ # Istio
+ %ISTIO_PREFIX%configuration:
+ %ISTIO_PREFIX% istio:
+ %ISTIO_PREFIX% enabled: %ISTIO_ENABLED%
+ %ISTIO_PREFIX% readinessPort: %ISTIO_READINESS_PORT%
+
diff --git a/OracleWebCenterPortal/kubernetes/common/utility.sh b/OracleWebCenterPortal/kubernetes/common/utility.sh
old mode 100644
new mode 100755
index 979207be2..6c680c9da
--- a/OracleWebCenterPortal/kubernetes/common/utility.sh
+++ b/OracleWebCenterPortal/kubernetes/common/utility.sh
@@ -1,928 +1,928 @@
-#!/usr/bin/env bash
-# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-
-#
-# Utility functions that are shared by multiple scripts
-#
-
-#
-# Function to exit and print an error message
-# $1 - text of message
-function fail {
- printError $*
- exit 1
-}
-
-# Function to print an error message
-function printError {
- echo [ERROR] $*
-}
-
-# Function to see if there is more than 1 input file.
-# This could happen if the user has a properties file from
-# running wdt discover domain on a on-prem domain
-function checkInputFiles {
- if [[ "${valuesInputFile}" =~ [,] ]] ; then
- echo "Found a comma separated list of input files"
- IFS=','
- read -a temp <<< "${valuesInputFile}"
-
- # We want to keep valuesInputFile pointing to the yaml since
- # the validate function expects it.
- local extension=$(echo "${temp[0]}" | sed 's/^.*\.//')
- if [ ${extension} == 'yaml' ]; then
- valuesInputFile=${temp[0]}
- valuesInputFile1=${temp[1]}
- else
- valuesInputFile=${temp[1]}
- valuesInputFile1=${temp[0]}
- fi
- fi
-}
-
-#
-# Function to parse a yaml file and generate the bash exports
-# $1 - Input filename
-# $2 - Output filename
-function parseYaml {
- local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034')
- sed -ne "s|^\($s\):|\1|" \
- -e "s|^\($s\)\($w\)$s:$s[\"']\(.*\)[\"']$s\$|\1$fs\2$fs\3|p" \
- -e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 |
- awk -F$fs '{
- if (length($3) > 0) {
- # javaOptions may contain tokens that are not allowed in export command
- # we need to handle it differently.
- if ($2=="javaOptions") {
- printf("%s=%s\n", $2, $3);
- } else {
- printf("export %s=\"%s\"\n", $2, $3);
- }
- }
- }' > $2
-}
-
-#
-# Function to parse a properties file and generate the bash exports
-# $1 - Input filename
-# $2 - Output filename
-function parseProperties {
- while IFS='=' read -r key value
- do
- echo "export ${key}=\"${value}\"" >> $2
- done < $1
-}
-
-#
-# Function to remove a file if it exists
-#
-function removeFileIfExists {
- if [ -f $1 ]; then
- rm $1
- fi
-}
-
-#
-# Function to parse the common parameter inputs file
-#
-function parseCommonInputs {
- exportValuesFile=$(mktemp /tmp/export-values-XXXXXXXXX.sh)
- tmpFile=$(mktemp /tmp/javaoptions_tmp-XXXXXXXXX.dat)
- parseYaml ${valuesInputFile} ${exportValuesFile}
-
- if [ ! -z ${valuesInputFile1} ]; then
- parseProperties ${valuesInputFile1} ${exportValuesFile}
- fi
-
- if [ ! -f ${exportValuesFile} ]; then
- echo Unable to locate the parsed output of ${valuesInputFile}.
- fail 'The file ${exportValuesFile} could not be found.'
- fi
-
- # Define the environment variables that will be used to fill in template values
- echo Input parameters being used
- cat ${exportValuesFile}
- echo
-
- # If we have 2 input files, we need to create a combined inputs file
- # exportsValueFile contains all the properties already
- # We just need to remove the term export from the file
- if [ ! -z ${valuesInputFile1} ]; then
- propsFile="domain.properties"
- cat ${exportValuesFile} > ${propsFile}
- sed -i 's/export //g' ${propsFile}
- sed -i 's/"//g' ${propsFile}
- valuesInputFile=${propsFile}
- cat ${valuesInputFile}
- fi
-
- # javaOptions may contain tokens that are not allowed in export command
- # we need to handle it differently.
- # we set the javaOptions variable that can be used later
- tmpStr=`grep "javaOptions" ${exportValuesFile}`
- javaOptions=${tmpStr//"javaOptions="/}
-
- # We exclude javaOptions from the exportValuesFile
- grep -v "javaOptions" ${exportValuesFile} > ${tmpFile}
- source ${tmpFile}
-
- rm ${exportValuesFile} ${tmpFile}
-}
-
-#
-# Function to delete a kubernetes object
-# $1 object type
-# $2 object name
-# $3 yaml file
-function deleteK8sObj {
- # If the yaml file does not exist yet, unable to do the delete
- if [ ! -f $3 ]; then
- fail "Unable to delete object type $1 with name $2 because file $3 does not exist"
- fi
-
- echo Checking if object type $1 with name $2 exists
- K8SOBJ=`kubectl get $1 -n ${namespace} | grep $2 | wc | awk ' { print $1; }'`
- if [ "${K8SOBJ}" = "1" ]; then
- echo Deleting $2 using $3
- kubectl delete -f $3
- fi
-}
-
-#
-# Function to lowercase a value
-# $1 - value to convert to lowercase
-function toLower {
- local lc=`echo $1 | tr "[:upper:]" "[:lower:]"`
- echo "$lc"
-}
-
-#
-# Function to lowercase a value and make it a legal DNS1123 name
-# $1 - value to convert to lowercase
-function toDNS1123Legal {
- local val=`echo $1 | tr "[:upper:]" "[:lower:]"`
- val=${val//"_"/"-"}
- echo "$val"
-}
-
-#
-# Check the state of a persistent volume.
-# $1 - name of volume
-# $2 - expected state of volume
-function checkPvState {
-
- echo "Checking if the persistent volume ${1:?} is ${2:?}"
- local pv_state=`kubectl get pv $1 -o jsonpath='{.status.phase}'`
- attempts=0
- while [ ! "$pv_state" = "$2" ] && [ ! $attempts -eq 10 ]; do
- attempts=$((attempts + 1))
- sleep 1
- pv_state=`kubectl get pv $1 -o jsonpath='{.status.phase}'`
- done
- if [ "$pv_state" != "$2" ]; then
- fail "The persistent volume state should be $2 but is $pv_state"
- fi
-}
-
-#
-# Function to check if a persistent volume exists
-# $1 - name of volume
-function checkPvExists {
-
- echo "Checking if the persistent volume ${1} exists"
- PV_EXISTS=`kubectl get pv | grep ${1} | wc | awk ' { print $1; } '`
- if [ "${PV_EXISTS}" = "1" ]; then
- echo "The persistent volume ${1} already exists"
- PV_EXISTS="true"
- else
- echo "The persistent volume ${1} does not exist"
- PV_EXISTS="false"
- fi
-}
-
-#
-# Function to check if a persistent volume claim exists
-# $1 - name of persistent volume claim
-# $2 - NameSpace
-function checkPvcExists {
- echo "Checking if the persistent volume claim ${1} in NameSpace ${2} exists"
- PVC_EXISTS=`kubectl get pvc -n ${2} | grep ${1} | wc | awk ' { print $1; } '`
- if [ "${PVC_EXISTS}" = "1" ]; then
- echo "The persistent volume claim ${1} already exists in NameSpace ${2}"
- PVC_EXISTS="true"
- else
- echo "The persistent volume claim ${1} does not exist in NameSpace ${2}"
- PVC_EXISTS="false"
- fi
-}
-
-# Copy the inputs file from the command line into the output directory
-# for the domain/operator unless the output directory already has an
-# inputs file and the file is the same as the one from the commandline.
-# $1 the inputs file from the command line
-# $2 the file in the output directory that needs to be made the same as $1
-function copyInputsFileToOutputDirectory {
- local from=$1
- local to=$2
- local doCopy="true"
- if [ -f "${to}" ]; then
- local difference=`diff ${from} ${to}`
- if [ -z "${difference}" ]; then
- # the output file already exists and is the same as the inputs file.
- # don't make a copy.
- doCopy="false"
- fi
- fi
- if [ "${doCopy}" = "true" ]; then
- cp ${from} ${to}
- fi
-}
-
-#
-# Function to obtain the IP address of the kubernetes cluster. This information
-# is used to form the URL's for accessing services that were deployed.
-#
-function getKubernetesClusterIP {
-
- # Get name of the current context
- local CUR_CTX=`kubectl config current-context | awk ' { print $1; } '`
-
- # Get the name of the current cluster
- local CUR_CLUSTER_CMD="kubectl config view -o jsonpath='{.contexts[?(@.name == \"${CUR_CTX}\")].context.cluster}' | awk ' { print $1; } '"
- local CUR_CLUSTER=`eval ${CUR_CLUSTER_CMD}`
-
- # Get the server address for the current cluster
- local SVR_ADDR_CMD="kubectl config view -o jsonpath='{.clusters[?(@.name == \"${CUR_CLUSTER}\")].cluster.server}' | awk ' { print $1; } '"
- local SVR_ADDR=`eval ${SVR_ADDR_CMD}`
-
- # Server address is expected to be of the form http://address:port. Delimit
- # string on the colon to obtain the address.
- local array=(${SVR_ADDR//:/ })
- K8S_IP="${array[1]/\/\//}"
-
-}
-
-#
-# Function to set the serverPodResources variable for including into the generated
-# domain.yaml, base on the serverPod resource requests and limits input values,
-# if specified.
-# The serverPodResources variable remains unset if none of the input values are provided.
-#
-function buildServerPodResources {
-
- if [ -n "${serverPodMemoryRequest}" ]; then
- local memoryRequest=" memory\: \"${serverPodMemoryRequest}\"\n"
- fi
- if [ -n "${serverPodCpuRequest}" ]; then
- local cpuRequest=" cpu\: \"${serverPodCpuRequest}\"\n"
- fi
- if [ -n "${memoryRequest}" ] || [ -n "${cpuRequest}" ]; then
- local requests=" requests\: \n$memoryRequest $cpuRequest"
- fi
-
- if [ -n "${serverPodMemoryLimit}" ]; then
- local memoryLimit=" memory\: \"${serverPodMemoryLimit}\"\n"
- fi
- if [ -n "${serverPodCpuLimit}" ]; then
- local cpuLimit=" cpu\: \"${serverPodCpuLimit}\"\n"
- fi
- if [ -n "${memoryLimit}" ] || [ -n "${cpuLimit}" ]; then
- local limits=" limits\: \n$memoryLimit $cpuLimit"
- fi
-
- if [ -n "${requests}" ] || [ -n "${limits}" ]; then
- # build resources element and remove last '\n'
- serverPodResources=$(echo "resources\:\n${requests}${limits}" | sed -e 's/\\n$//')
- fi
-}
-
-#
-# Function to generate the properties and yaml files for creating a domain
-#
-function createFiles {
-
- update=false
- if [ "$#" == 1 ]; then
- echo Trying to update the domain
- update=true
- fi
-
- # Make sure the output directory has a copy of the inputs file.
- # The user can either pre-create the output directory, put the inputs
- # file there, and create the domain from it, or the user can put the
- # inputs file some place else and let this script create the output directory
- # (if needed) and copy the inputs file there.
- echo createFiles - valuesInputFile is ${valuesInputFile}
- copyInputsFileToOutputDirectory ${valuesInputFile} "${domainOutputDir}/create-domain-inputs.yaml"
-
- if [ "${domainHomeInImage}" == "true" ]; then
- if [ -z "${domainHomeImageBase}" ]; then
- fail "Please specify domainHomeImageBase in your input YAML"
- fi
- else
- if [ -z "${image}" ]; then
- fail "Please specify image in your input YAML"
- fi
- fi
-
- dcrOutput="${domainOutputDir}/domain.yaml"
-
- domainName=${domainUID}
-
- enabledPrefix="" # uncomment the feature
- disabledPrefix="# " # comment out the feature
-
- exposeAnyChannelPrefix="${disabledPrefix}"
- if [ "${exposeAdminT3Channel}" = true ]; then
- exposeAdminT3ChannelPrefix="${enabledPrefix}"
- exposeAnyChannelPrefix="${enabledPrefix}"
- # set t3PublicAddress if not set
- if [ -z "${t3PublicAddress}" ]; then
- getKubernetesClusterIP
- t3PublicAddress="${K8S_IP}"
- fi
- else
- exposeAdminT3ChannelPrefix="${disabledPrefix}"
- fi
-
- if [ "${exposeAdminNodePort}" = true ]; then
- exposeAdminNodePortPrefix="${enabledPrefix}"
- exposeAnyChannelPrefix="${enabledPrefix}"
- else
- exposeAdminNodePortPrefix="${disabledPrefix}"
- fi
-
- if [ "${istioEnabled}" == "true" ]; then
- istioPrefix="${enabledPrefix}"
- else
- istioPrefix="${disabledPrefix}"
- fi
-
- # The FromModel, MII (model-in-image), and WDT_DOMAIN_TYPE updates in this script
- # must remain even though they are not referenced by a sample. They're used by the
- # Operator integration test code. If you're interested in MII,
- # see './kubernetes/samples/scripts/create-weblogic-domain/model-in-image'.
-
- # MII settings are used for model-in-image integration testing
- if [ "${domainHomeSourceType}" == "FromModel" ]; then
- miiPrefix="${enabledPrefix}"
- else
- miiPrefix="${disabledPrefix}"
- fi
-
- # MII settings are used for model-in-image integration testing
- if [ -z "${miiConfigMap}" ]; then
- miiConfigMapPrefix="${disabledPrefix}"
- else
- miiConfigMapPrefix="${enabledPrefix}"
- fi
-
- # For some parameters, use the default value if not defined.
- if [ -z "${domainPVMountPath}" ]; then
- domainPVMountPath="/shared"
- fi
-
- if [ -z "${logHome}" ]; then
- logHome="${domainPVMountPath}/logs/${domainUID}"
- fi
-
- if [ -z "${httpAccessLogInLogHome}" ]; then
- httpAccessLogInLogHome="true"
- fi
-
- if [ -z "${dataHome}" ]; then
- dataHome=""
- fi
-
- if [ -z "${persistentVolumeClaimName}" ]; then
- persistentVolumeClaimName="${domainUID}-weblogic-sample-pvc"
- fi
-
- if [ -z "${weblogicCredentialsSecretName}" ]; then
- weblogicCredentialsSecretName="${domainUID}-weblogic-credentials"
- fi
-
- if [ "${domainHomeInImage}" == "true" ]; then
- domainPropertiesOutput="${domainOutputDir}/domain.properties"
- domainHome="${domainHome:-/u01/oracle/user_projects/domains/${domainName}}"
-
- # Generate the properties file that will be used when creating the weblogic domain
- echo Generating ${domainPropertiesOutput} from ${domainPropertiesInput}
-
- cp ${domainPropertiesInput} ${domainPropertiesOutput}
- sed -i -e "s:%DOMAIN_NAME%:${domainName}:g" ${domainPropertiesOutput}
- sed -i -e "s:%DOMAIN_HOME%:${domainHome}:g" ${domainPropertiesOutput}
- sed -i -e "s:%ADMIN_PORT%:${adminPort}:g" ${domainPropertiesOutput}
- sed -i -e "s:%ADMIN_SERVER_SSL_PORT%:${adminServerSSLPort}:g" ${domainPropertiesOutput}
- sed -i -e "s:%ADMIN_SERVER_NAME%:${adminServerName}:g" ${domainPropertiesOutput}
- sed -i -e "s:%MANAGED_SERVER_PORT%:${managedServerPort}:g" ${domainPropertiesOutput}
- sed -i -e "s:%MANAGED_SERVER_SSL_PORT%:${managedServerSSLPort}:g" ${domainPropertiesOutput}
- sed -i -e "s:%MANAGED_SERVER_NAME_BASE%:${managedServerNameBase}:g" ${domainPropertiesOutput}
- sed -i -e "s:%CONFIGURED_MANAGED_SERVER_COUNT%:${configuredManagedServerCount}:g" ${domainPropertiesOutput}
- sed -i -e "s:%CLUSTER_NAME%:${clusterName}:g" ${domainPropertiesOutput}
- sed -i -e "s:%SSL_ENABLED%:${sslEnabled}:g" ${domainPropertiesOutput}
- sed -i -e "s:%PRODUCTION_MODE_ENABLED%:${productionModeEnabled}:g" ${domainPropertiesOutput}
- sed -i -e "s:%CLUSTER_TYPE%:${clusterType}:g" ${domainPropertiesOutput}
- sed -i -e "s;%JAVA_OPTIONS%;${javaOptions};g" ${domainPropertiesOutput}
- sed -i -e "s:%T3_CHANNEL_PORT%:${t3ChannelPort}:g" ${domainPropertiesOutput}
- sed -i -e "s:%T3_PUBLIC_ADDRESS%:${t3PublicAddress}:g" ${domainPropertiesOutput}
- sed -i -e "s:%EXPOSE_T3_CHANNEL%:${exposeAdminT3Channel}:g" ${domainPropertiesOutput}
- sed -i -e "s:%FMW_DOMAIN_TYPE%:${fmwDomainType}:g" ${domainPropertiesOutput}
- sed -i -e "s:%WDT_DOMAIN_TYPE%:${wdtDomainType}:g" ${domainPropertiesOutput}
- sed -i -e "s:%ADMIN_USER_NAME%:${username}:g" ${domainPropertiesOutput}
- sed -i -e "s:%ADMIN_USER_PASS%:${password}:g" ${domainPropertiesOutput}
- sed -i -e "s:%RCU_SCHEMA_PREFIX%:${rcuSchemaPrefix}:g" ${domainPropertiesOutput}
- sed -i -e "s:%RCU_SCHEMA_PASSWORD%:${rcuSchemaPassword}:g" ${domainPropertiesOutput}
- sed -i -e "s|%RCU_DB_CONN_STRING%|${rcuDatabaseURL}|g" ${domainPropertiesOutput}
-
- if [ -z "${image}" ]; then
- # calculate the internal name to tag the generated image
- defaultImageName="domain-home-in-image"
- baseTag=${domainHomeImageBase#*:}
- defaultImageName=${defaultImageName}:${baseTag:-"latest"}
- sed -i -e "s|%IMAGE_NAME%|${defaultImageName}|g" ${domainPropertiesOutput}
- export BUILD_IMAGE_TAG=${defaultImageName}
- else
- sed -i -e "s|%IMAGE_NAME%|${image}|g" ${domainPropertiesOutput}
- export BUILD_IMAGE_TAG=${image}
- fi
- else
- # we're in the domain in PV case
-
- wdtVersion="${WDT_VERSION:-${wdtVersion}}"
- httpsProxy="${https_proxy}"
-
- createJobOutput="${domainOutputDir}/create-domain-job.yaml"
- deleteJobOutput="${domainOutputDir}/delete-domain-job.yaml"
-
- if [ -z "${domainHome}" ]; then
- domainHome="${domainPVMountPath}/domains/${domainUID}"
- fi
-
- # Use the default value if not defined.
- if [ -z "${createDomainScriptsMountPath}" ]; then
- createDomainScriptsMountPath="/u01/weblogic"
- fi
-
- if [ "${update}" == "true" ]; then
- createDomainScriptName="update-domain-job.sh"
- elif [ -z "${createDomainScriptName}" ]; then
- createDomainScriptName="create-domain-job.sh"
- fi
- echo createDomainScriptName is ${createDomainScriptName}
-
- # Must escape the ':' value in image for sed to properly parse and replace
- image=$(echo ${image} | sed -e "s/\:/\\\:/g")
-
- # Generate the yaml to create the kubernetes job that will create the weblogic domain
- echo Generating ${createJobOutput}
-
- cp ${createJobInput} ${createJobOutput}
- sed -i -e "s:%NAMESPACE%:$namespace:g" ${createJobOutput}
- sed -i -e "s:%WEBLOGIC_CREDENTIALS_SECRET_NAME%:${weblogicCredentialsSecretName}:g" ${createJobOutput}
- sed -i -e "s:%WEBLOGIC_IMAGE%:${image}:g" ${createJobOutput}
- sed -i -e "s:%WEBLOGIC_IMAGE_PULL_POLICY%:${imagePullPolicy}:g" ${createJobOutput}
- sed -i -e "s:%WEBLOGIC_IMAGE_PULL_SECRET_NAME%:${imagePullSecretName}:g" ${createJobOutput}
- sed -i -e "s:%WEBLOGIC_IMAGE_PULL_SECRET_PREFIX%:${imagePullSecretPrefix}:g" ${createJobOutput}
- sed -i -e "s:%DOMAIN_UID%:${domainUID}:g" ${createJobOutput}
- sed -i -e "s:%DOMAIN_NAME%:${domainName}:g" ${createJobOutput}
- sed -i -e "s:%DOMAIN_HOME%:${domainHome}:g" ${createJobOutput}
- sed -i -e "s:%SSL_ENABLED%:${sslEnabled}:g" ${createJobOutput}
- sed -i -e "s:%PRODUCTION_MODE_ENABLED%:${productionModeEnabled}:g" ${createJobOutput}
- sed -i -e "s:%ADMIN_SERVER_NAME%:${adminServerName}:g" ${createJobOutput}
- sed -i -e "s:%ADMIN_SERVER_NAME_SVC%:${adminServerNameSVC}:g" ${createJobOutput}
- sed -i -e "s:%ADMIN_PORT%:${adminPort}:g" ${createJobOutput}
- sed -i -e "s:%ADMIN_SERVER_SSL_PORT%:${adminServerSSLPort}:g" ${createJobOutput}
- sed -i -e "s:%CONFIGURED_MANAGED_SERVER_COUNT%:${configuredManagedServerCount}:g" ${createJobOutput}
- sed -i -e "s:%MANAGED_SERVER_NAME_BASE%:${managedServerNameBase}:g" ${createJobOutput}
- sed -i -e "s:%MANAGED_SERVER_NAME_BASE_SVC%:${managedServerNameBaseSVC}:g" ${createJobOutput}
- sed -i -e "s:%MANAGED_SERVER_PORT%:${managedServerPort}:g" ${createJobOutput}
- sed -i -e "s:%MANAGED_SERVER_SSL_PORT%:${managedServerSSLPort}:g" ${createJobOutput}
- sed -i -e "s:%T3_CHANNEL_PORT%:${t3ChannelPort}:g" ${createJobOutput}
- sed -i -e "s:%T3_PUBLIC_ADDRESS%:${t3PublicAddress}:g" ${createJobOutput}
- sed -i -e "s:%CLUSTER_NAME%:${clusterName}:g" ${createJobOutput}
- sed -i -e "s:%CLUSTER_TYPE%:${clusterType}:g" ${createJobOutput}
- sed -i -e "s:%DOMAIN_PVC_NAME%:${persistentVolumeClaimName}:g" ${createJobOutput}
- sed -i -e "s:%DOMAIN_ROOT_DIR%:${domainPVMountPath}:g" ${createJobOutput}
- sed -i -e "s:%CREATE_DOMAIN_SCRIPT_DIR%:${createDomainScriptsMountPath}:g" ${createJobOutput}
- sed -i -e "s:%CREATE_DOMAIN_SCRIPT%:${createDomainScriptName}:g" ${createJobOutput}
- # extra entries for FMW Infra domains
- sed -i -e "s:%RCU_CREDENTIALS_SECRET_NAME%:${rcuCredentialsSecret}:g" ${createJobOutput}
- sed -i -e "s:%CUSTOM_RCUPREFIX%:${rcuSchemaPrefix}:g" ${createJobOutput}
- sed -i -e "s|%CUSTOM_CONNECTION_STRING%|${rcuDatabaseURL}|g" ${createJobOutput}
- sed -i -e "s:%EXPOSE_T3_CHANNEL_PREFIX%:${exposeAdminT3Channel}:g" ${createJobOutput}
- sed -i -e "s:%FRONTEND_HOST%:${frontEndHost}:g" ${createJobOutput}
- sed -i -e "s:%FRONTEND_PORT%:${frontEndPort}:g" ${createJobOutput}
- # entries for Istio
- sed -i -e "s:%ISTIO_PREFIX%:${istioPrefix}:g" ${createJobOutput}
- sed -i -e "s:%ISTIO_ENABLED%:${istioEnabled}:g" ${createJobOutput}
- sed -i -e "s:%ISTIO_READINESS_PORT%:${istioReadinessPort}:g" ${createJobOutput}
- sed -i -e "s:%WDT_VERSION%:${wdtVersion}:g" ${createJobOutput}
- sed -i -e "s|%DOMAIN_TYPE%|${domain_type}|g" ${createJobOutput}
- sed -i -e "s|%PROXY_VAL%|${httpsProxy}|g" ${createJobOutput}
-
- # Generate the yaml to create the kubernetes job that will delete the weblogic domain_home folder
- echo Generating ${deleteJobOutput}
-
- cp ${deleteJobInput} ${deleteJobOutput}
- sed -i -e "s:%NAMESPACE%:$namespace:g" ${deleteJobOutput}
- sed -i -e "s:%WEBLOGIC_IMAGE%:${image}:g" ${deleteJobOutput}
- sed -i -e "s:%WEBLOGIC_IMAGE_PULL_POLICY%:${imagePullPolicy}:g" ${deleteJobOutput}
- sed -i -e "s:%WEBLOGIC_CREDENTIALS_SECRET_NAME%:${weblogicCredentialsSecretName}:g" ${deleteJobOutput}
- sed -i -e "s:%WEBLOGIC_IMAGE_PULL_SECRET_NAME%:${imagePullSecretName}:g" ${deleteJobOutput}
- sed -i -e "s:%WEBLOGIC_IMAGE_PULL_SECRET_PREFIX%:${imagePullSecretPrefix}:g" ${deleteJobOutput}
- sed -i -e "s:%DOMAIN_UID%:${domainUID}:g" ${deleteJobOutput}
- sed -i -e "s:%DOMAIN_NAME%:${domainName}:g" ${deleteJobOutput}
- sed -i -e "s:%DOMAIN_HOME%:${domainHome}:g" ${deleteJobOutput}
- sed -i -e "s:%DOMAIN_PVC_NAME%:${persistentVolumeClaimName}:g" ${deleteJobOutput}
- sed -i -e "s:%DOMAIN_ROOT_DIR%:${domainPVMountPath}:g" ${deleteJobOutput}
- fi
-
- if [ "${domainHomeSourceType}" == "FromModel" ]; then
- echo domainHomeSourceType is FromModel
- # leave domainHomeSourceType to FromModel
- if [ "${logHomeOnPV}" == "true" ]; then
- logHomeOnPVPrefix="${enabledPrefix}"
- else
- logHomeOnPVPrefix="${disabledPrefix}"
- fi
- elif [ "${domainHomeInImage}" == "true" ]; then
- domainHomeSourceType="Image"
- if [ "${logHomeOnPV}" == "true" ]; then
- logHomeOnPVPrefix="${enabledPrefix}"
- else
- logHomeOnPVPrefix="${disabledPrefix}"
- fi
- else
- domainHomeSourceType="PersistentVolume"
- logHomeOnPVPrefix="${enabledPrefix}"
- logHomeOnPV=true
- fi
-
- # Generate the yaml file for creating the domain resource
- # We want to use wdt's extractDomainResource.sh to get the domain resource
- # for domain on pv use case. For others, generate domain resource here
-
- if [ "${domainHomeSourceType}" != "PersistentVolume" ] || [ "${wdtDomainType}" != "WLS" ] ||
- [ "${useWdt}" != true ]; then
- echo Generating ${dcrOutput}
-
- cp ${dcrInput} ${dcrOutput}
- sed -i -e "s:%DOMAIN_UID%:${domainUID}:g" ${dcrOutput}
- sed -i -e "s:%NAMESPACE%:$namespace:g" ${dcrOutput}
- sed -i -e "s:%DOMAIN_HOME%:${domainHome}:g" ${dcrOutput}
- sed -i -e "s:%DOMAIN_HOME_SOURCE_TYPE%:${domainHomeSourceType}:g" ${dcrOutput}
- sed -i -e "s:%WEBLOGIC_IMAGE_PULL_POLICY%:${imagePullPolicy}:g" ${dcrOutput}
- sed -i -e "s:%WEBLOGIC_IMAGE_PULL_SECRET_PREFIX%:${imagePullSecretPrefix}:g" ${dcrOutput}
- sed -i -e "s:%WEBLOGIC_IMAGE_PULL_SECRET_NAME%:${imagePullSecretName}:g" ${dcrOutput}
- sed -i -e "s:%WEBLOGIC_CREDENTIALS_SECRET_NAME%:${weblogicCredentialsSecretName}:g" ${dcrOutput}
- sed -i -e "s:%INCLUDE_SERVER_OUT_IN_POD_LOG%:${includeServerOutInPodLog}:g" ${dcrOutput}
- sed -i -e "s:%LOG_HOME_ON_PV_PREFIX%:${logHomeOnPVPrefix}:g" ${dcrOutput}
- sed -i -e "s:%LOG_HOME_ENABLED%:${logHomeOnPV}:g" ${dcrOutput}
- sed -i -e "s:%LOG_HOME%:${logHome}:g" ${dcrOutput}
- sed -i -e "s:%HTTP_ACCESS_LOG_IN_LOG_HOME%:${httpAccessLogInLogHome}:g" ${dcrOutput}
- sed -i -e "s:%DATA_HOME%:${dataHome}:g" ${dcrOutput}
- sed -i -e "s:%SERVER_START_POLICY%:${serverStartPolicy}:g" ${dcrOutput}
- sed -i -e "s;%JAVA_OPTIONS%;${javaOptions};g" ${dcrOutput}
- sed -i -e "s:%DOMAIN_PVC_NAME%:${persistentVolumeClaimName}:g" ${dcrOutput}
- sed -i -e "s:%DOMAIN_ROOT_DIR%:${domainPVMountPath}:g" ${dcrOutput}
-
- if [ "${istioEnabled}" == "true" ]; then
- exposeAdminNodePortPrefix="${disabledPrefix}"
- fi
-
- sed -i -e "s:%EXPOSE_T3_CHANNEL_PREFIX%:${exposeAdminT3ChannelPrefix}:g" ${dcrOutput}
- sed -i -e "s:%EXPOSE_ANY_CHANNEL_PREFIX%:${exposeAnyChannelPrefix}:g" ${dcrOutput}
- sed -i -e "s:%EXPOSE_ADMIN_PORT_PREFIX%:${exposeAdminNodePortPrefix}:g" ${dcrOutput}
- sed -i -e "s:%ADMIN_NODE_PORT%:${adminNodePort}:g" ${dcrOutput}
- sed -i -e "s:%CLUSTER_NAME%:${clusterName}:g" ${dcrOutput}
- sed -i -e "s:%INITIAL_MANAGED_SERVER_REPLICAS%:${initialManagedServerReplicas}:g" ${dcrOutput}
- sed -i -e "s:%ISTIO_PREFIX%:${istioPrefix}:g" ${dcrOutput}
- sed -i -e "s:%ISTIO_ENABLED%:${istioEnabled}:g" ${dcrOutput}
- sed -i -e "s:%ISTIO_READINESS_PORT%:${istioReadinessPort}:g" ${dcrOutput}
- # MII settings are used for model-in-image integration testing
- sed -i -e "s:%MII_PREFIX%:${miiPrefix}:g" ${dcrOutput}
- sed -i -e "s:%MII_CONFIG_MAP_PREFIX%:${miiConfigMapPrefix}:g" ${dcrOutput}
- sed -i -e "s:%MII_CONFIG_MAP%:${miiConfigMap}:g" ${dcrOutput}
- sed -i -e "s:%WDT_DOMAIN_TYPE%:${wdtDomainType}:g" ${dcrOutput}
-
- buildServerPodResources
- if [ -z "${serverPodResources}" ]; then
- sed -i -e "/%OPTIONAL_SERVERPOD_RESOURCES%/d" ${dcrOutput}
- else
- if [[ $(uname) -eq "Darwin" ]]; then
- serverPodResources=$(echo "${serverPodResources}" | sed -e 's/\\n/%NEWLINE%/g')
- sed -i -e "s:%OPTIONAL_SERVERPOD_RESOURCES%:${serverPodResources}:g" ${dcrOutput}
- sed -i -e $'s|%NEWLINE%|\\\n|g' ${dcrOutput}
- else
- sed -i -e "s:%OPTIONAL_SERVERPOD_RESOURCES%:${serverPodResources}:g" ${dcrOutput}
- fi
- fi
-
- if [ "${domainHomeInImage}" == "true" ]; then
-
- # now we know which image to use, update the domain yaml file
- if [ -z $image ]; then
- sed -i -e "s|%WEBLOGIC_IMAGE%|${defaultImageName}|g" ${dcrOutput}
- else
- sed -i -e "s|%WEBLOGIC_IMAGE%|${image}|g" ${dcrOutput}
- fi
- else
- sed -i -e "s:%WEBLOGIC_IMAGE%:${image}:g" ${dcrOutput}
- fi
- fi
-
- # Remove any "...yaml-e" and "...properties-e" files left over from running sed
- rm -f ${domainOutputDir}/*.yaml-e
- rm -f ${domainOutputDir}/*.properties-e
-
-}
-
-
-#
-# Function to markup the wdt model file
-#
-function updateModelFile {
- # Update the wdt model file with kubernetes section
- modelFile="${domainOutputDir}/tmp/wdt_model.yaml"
- cat ${scriptDir}/wdt_k8s_model_template.yaml >> ${modelFile}
-
- sed -i -e "s:%DOMAIN_UID%:${domainUID}:g" ${modelFile}
- sed -i -e "s:%NAMESPACE%:$namespace:g" ${modelFile}
- sed -i -e "s:%DOMAIN_HOME%:${domainHome}:g" ${modelFile}
- sed -i -e "s:%DOMAIN_HOME_SOURCE_TYPE%:${domainHomeSourceType}:g" ${modelFile}
- sed -i -e "s:%WEBLOGIC_IMAGE_PULL_POLICY%:${imagePullPolicy}:g" ${modelFile}
- sed -i -e "s:%WEBLOGIC_IMAGE_PULL_SECRET_PREFIX%:${imagePullSecretPrefix}:g" ${modelFile}
- sed -i -e "s:%WEBLOGIC_IMAGE_PULL_SECRET_NAME%:${imagePullSecretName}:g" ${modelFile}
- sed -i -e "s:%WEBLOGIC_CREDENTIALS_SECRET_NAME%:${weblogicCredentialsSecretName}:g" ${modelFile}
- sed -i -e "s:%INCLUDE_SERVER_OUT_IN_POD_LOG%:${includeServerOutInPodLog}:g" ${modelFile}
- sed -i -e "s:%LOG_HOME_ON_PV_PREFIX%:${logHomeOnPVPrefix}:g" ${modelFile}
- sed -i -e "s:%LOG_HOME_ENABLED%:${logHomeOnPV}:g" ${modelFile}
- sed -i -e "s:%LOG_HOME%:${logHome}:g" ${modelFile}
- sed -i -e "s:%HTTP_ACCESS_LOG_IN_LOG_HOME%:${httpAccessLogInLogHome}:g" ${modelFile}
- sed -i -e "s:%DATA_HOME%:${dataHome}:g" ${modelFile}
- sed -i -e "s:%SERVER_START_POLICY%:${serverStartPolicy}:g" ${modelFile}
- sed -i -e "s;%JAVA_OPTIONS%;${javaOptions};g" ${modelFile}
- sed -i -e "s:%DOMAIN_PVC_NAME%:${persistentVolumeClaimName}:g" ${modelFile}
- sed -i -e "s:%DOMAIN_ROOT_DIR%:${domainPVMountPath}:g" ${modelFile}
-
- if [ "${istioEnabled}" == "true" ]; then
- exposeAdminNodePortPrefix="${disabledPrefix}"
- fi
-
- sed -i -e "s:%EXPOSE_T3_CHANNEL_PREFIX%:${exposeAdminT3ChannelPrefix}:g" ${modelFile}
- sed -i -e "s:%EXPOSE_ANY_CHANNEL_PREFIX%:${exposeAnyChannelPrefix}:g" ${modelFile}
- 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:%INITIAL_MANAGED_SERVER_REPLICAS%:${initialManagedServerReplicas}:g" ${modelFile}
- sed -i -e "s:%ISTIO_PREFIX%:${istioPrefix}:g" ${modelFile}
- sed -i -e "s:%ISTIO_ENABLED%:${istioEnabled}:g" ${modelFile}
- sed -i -e "s:%ISTIO_READINESS_PORT%:${istioReadinessPort}:g" ${modelFile}
- # MII settings are used for model-in-image integration testing
- sed -i -e "s:%MII_PREFIX%:${miiPrefix}:g" ${modelFile}
- sed -i -e "s:%MII_CONFIG_MAP_PREFIX%:${miiConfigMapPrefix}:g" ${modelFile}
- sed -i -e "s:%MII_CONFIG_MAP%:${miiConfigMap}:g" ${modelFile}
- sed -i -e "s:%WDT_DOMAIN_TYPE%:${wdtDomainType}:g" ${modelFile}
-
- buildServerPodResources
- if [ -z "${serverPodResources}" ]; then
- sed -i -e "/%OPTIONAL_SERVERPOD_RESOURCES%/d" ${modelFile}
- else
- if [[ $(uname) -eq "Darwin" ]]; then
- serverPodResources=$(echo "${serverPodResources}" | sed -e 's/\\n/%NEWLINE%/g')
- sed -i -e "s:%OPTIONAL_SERVERPOD_RESOURCES%:${serverPodResources}:g" ${modelFile}
- sed -i -e $'s|%NEWLINE%|\\\n|g' ${modelFile}
- else
- sed -i -e "s:%OPTIONAL_SERVERPOD_RESOURCES%:${serverPodResources}:g" ${modelFile}
- fi
- fi
-
- sed -i -e "s:%WEBLOGIC_IMAGE%:${image}:g" ${modelFile}
-}
-
-#
-# Function to create the domain recource
-#
-function createDomainResource {
- kubectl apply -f ${dcrOutput}
-
- attempts=0
- while [ "$DCR_AVAIL" != "1" ] && [ ! $attempts -eq 10 ]; do
- attempts=$((attempts + 1))
- sleep 1
- DCR_AVAIL=`kubectl get domain ${domainUID} -n ${namespace} | grep ${domainUID} | wc | awk ' { print $1; } '`
- done
- if [ "${DCR_AVAIL}" != "1" ]; then
- fail "The domain resource ${domainUID} was not found"
- fi
-}
-
-#
-# Function to create a domain
-# $1 - boolean value indicating the location of the domain home
-# true means domain home in image
-# false means domain home on PV
-#
-function createDomain {
- if [ "$#" != 1 ]; then
- fail "The function must be called with domainHomeInImage parameter."
- fi
-
- domainHomeInImage="${1}"
- if [ "true" != "${domainHomeInImage}" ] && [ "false" != "${domainHomeInImage}" ]; then
- fail "The value of domainHomeInImage must be true or false: ${domainHomeInImage}"
- fi
-
- # Setup the environment for running this script and perform initial validation checks
- initialize
-
- # Generate files for creating the domain
- createFiles
-
- # Check that the domain secret exists and contains the required elements
- validateDomainSecret
-
- # Validate the domain's persistent volume claim
- if [ "${doValidation}" == true ] && [ "${domainHomeInImage}" == false -o "${logHomeOnPV}" == true ]; then
- validateDomainPVC
- fi
-
- # Create the WebLogic domain home
- createDomainHome
-
- if [ "${executeIt}" = true ]; then
- createDomainResource
- fi
-
- # Print a summary
- printSummary
-}
-
-#
-# Function to update a domain
-# $1 - boolean value indicating the location of the domain home
-# true means domain home in image
-# false means domain home on PV
-#
-function updateDomain {
-
- domainHomeInImage="false"
-
- # Setup the environment for running this script and perform initial validation checks
- initialize
-
- # Generate files for creating the domain
- createFiles update
-
- # Check that the domain secret exists and contains the required elements
- validateDomainSecret
-
- # Validate the domain's persistent volume claim
- if [ "${doValidation}" == true ]; then
- validateDomainPVC
- fi
-
- # Create the WebLogic domain home
- updateDomainHome
-
- if [ "${executeIt}" = true ]; then
- createDomainResource
- fi
-
- # Print a summary
- printSummary
-}
-
-# checks if a given pod in a NameSpace has been deleted
-function checkPodDelete(){
-
- pod=$1
- ns=$2
- status="Terminating"
-
- if [ -z ${1} ]; then
- echo "No Pod name provided "
- exit -1
- fi
-
- if [ -z ${2} ]; then
- echo "No NameSpace provided "
- exit -2
- fi
-
- echo "Checking Status for Pod [$pod] in namespace [${ns}]"
- max=10
- count=1
- while [ $count -le $max ] ; do
- sleep 5
- pod=`kubectl get po/$1 -n ${ns} | grep -v NAME | awk '{print $1}'`
- if [ -z ${pod} ]; then
- status="Terminated"
- echo "Pod [$1] removed from nameSpace [${ns}]"
- break;
- fi
- count=`expr $count + 1`
- echo "Pod [$pod] Status [${status}]"
- done
-
- if [ $count -gt $max ] ; then
- echo "[ERROR] The Pod[$1] in NameSpace [$ns] could not be deleted in 50s";
- exit 1
- fi
-}
-
-# Checks if all container(s) in a pod are running state based on READY column
-#NAME READY STATUS RESTARTS AGE
-#domain1-adminserver 1/1 Running 0 4m
-
-function checkPodState(){
-
- status="NotReady"
- max=60
- count=1
-
- pod=$1
- ns=$2
- state=${3:-1/1}
-
- echo "Checking Pod READY column for State [$state]"
- pname=`kubectl get po -n ${ns} | grep -w ${pod} | awk '{print $1}'`
- if [ -z ${pname} ]; then
- echo "No such pod [$pod] exists in NameSpace [$ns] "
- exit -1
- fi
-
- rcode=`kubectl get po ${pname} -n ${ns} | grep -w ${pod} | awk '{print $2}'`
- [[ ${rcode} -eq "${state}" ]] && status="Ready"
-
- while [ ${status} != "Ready" -a $count -le $max ] ; do
- sleep 5
- rcode=`kubectl get po/$pod -n ${ns} | grep -v NAME | awk '{print $2}'`
- [[ ${rcode} -eq "1/1" ]] && status="Ready"
- echo "Pod [$1] Status is ${status} Iter [$count/$max]"
- count=`expr $count + 1`
- done
- if [ $count -gt $max ] ; then
- echo "[ERROR] Unable to start the Pod [$pod] after 300s ";
- exit 1
- fi
-
- pname=`kubectl get po -n ${ns} | grep -w ${pod} | awk '{print $1}'`
- kubectl -n ${ns} get po ${pname}
-}
-
-# Checks if a pod is available in a given namespace
-function checkPod(){
-
- max=20
- count=1
-
- pod=$1
- ns=$2
-
- pname=`kubectl get po -n ${ns} | grep -w ${pod} | awk '{print $1}'`
- if [ -z ${pname} ]; then
- echo "No such pod [$pod] exists in NameSpace [$ns]"
- sleep 10
- fi
-
- rcode=`kubectl get po -n ${ns} | grep -w ${pod} | awk '{print $1}'`
- if [ ! -z ${rcode} ]; then
- echo "[$pod] already initialized .. "
- return 0
- fi
-
- echo "The POD [${pod}] has not been initialized ..."
- while [ -z ${rcode} ]; do
- [[ $count -gt $max ]] && break
- echo "Pod[$pod] is being initialized ..."
- sleep 5
- rcode=`kubectl get po -n ${ns} | grep $pod | awk '{print $1}'`
- count=`expr $count + 1`
- done
-
- if [ $count -gt $max ] ; then
- echo "[ERROR] Could not find Pod [$pod] after 120s";
- exit 1
- fi
-}
-
-# Checks if a service is available in a given namespace
-function checkService(){
- svc=$1
- ns=$2
- startSecs=$SECONDS
- maxWaitSecs=20
- while [ -z "`kubectl get service -n ${ns} | grep -w ${svc}`" ]; do
- if [ $((SECONDS - startSecs)) -lt $maxWaitSecs ]; then
- echo "Service [$svc] not found after $((SECONDS - startSecs)) seconds, retrying ..."
- sleep 5
- else
- echo "[Error] Could not find Service [$svc] after $((SECONDS - startSecs)) seconds"
- exit 1
- fi
- done
- echo "Service [$svc] found"
-}
+#!/usr/bin/env bash
+# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+
+#
+# Utility functions that are shared by multiple scripts
+#
+
+#
+# Function to exit and print an error message
+# $1 - text of message
+function fail {
+ printError $*
+ exit 1
+}
+
+# Function to print an error message
+function printError {
+ echo [ERROR] $*
+}
+
+# Function to see if there is more than 1 input file.
+# This could happen if the user has a properties file from
+# running wdt discover domain on a on-prem domain
+function checkInputFiles {
+ if [[ "${valuesInputFile}" =~ [,] ]] ; then
+ echo "Found a comma separated list of input files"
+ IFS=','
+ read -a temp <<< "${valuesInputFile}"
+
+ # We want to keep valuesInputFile pointing to the yaml since
+ # the validate function expects it.
+ local extension=$(echo "${temp[0]}" | sed 's/^.*\.//')
+ if [ ${extension} == 'yaml' ]; then
+ valuesInputFile=${temp[0]}
+ valuesInputFile1=${temp[1]}
+ else
+ valuesInputFile=${temp[1]}
+ valuesInputFile1=${temp[0]}
+ fi
+ fi
+}
+
+#
+# Function to parse a yaml file and generate the bash exports
+# $1 - Input filename
+# $2 - Output filename
+function parseYaml {
+ local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034')
+ sed -ne "s|^\($s\):|\1|" \
+ -e "s|^\($s\)\($w\)$s:$s[\"']\(.*\)[\"']$s\$|\1$fs\2$fs\3|p" \
+ -e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 |
+ awk -F$fs '{
+ if (length($3) > 0) {
+ # javaOptions may contain tokens that are not allowed in export command
+ # we need to handle it differently.
+ if ($2=="javaOptions") {
+ printf("%s=%s\n", $2, $3);
+ } else {
+ printf("export %s=\"%s\"\n", $2, $3);
+ }
+ }
+ }' > $2
+}
+
+#
+# Function to parse a properties file and generate the bash exports
+# $1 - Input filename
+# $2 - Output filename
+function parseProperties {
+ while IFS='=' read -r key value
+ do
+ echo "export ${key}=\"${value}\"" >> $2
+ done < $1
+}
+
+#
+# Function to remove a file if it exists
+#
+function removeFileIfExists {
+ if [ -f $1 ]; then
+ rm $1
+ fi
+}
+
+#
+# Function to parse the common parameter inputs file
+#
+function parseCommonInputs {
+ exportValuesFile=$(mktemp /tmp/export-values-XXXXXXXXX.sh)
+ tmpFile=$(mktemp /tmp/javaoptions_tmp-XXXXXXXXX.dat)
+ parseYaml ${valuesInputFile} ${exportValuesFile}
+
+ if [ ! -z ${valuesInputFile1} ]; then
+ parseProperties ${valuesInputFile1} ${exportValuesFile}
+ fi
+
+ if [ ! -f ${exportValuesFile} ]; then
+ echo Unable to locate the parsed output of ${valuesInputFile}.
+ fail 'The file ${exportValuesFile} could not be found.'
+ fi
+
+ # Define the environment variables that will be used to fill in template values
+ echo Input parameters being used
+ cat ${exportValuesFile}
+ echo
+
+ # If we have 2 input files, we need to create a combined inputs file
+ # exportsValueFile contains all the properties already
+ # We just need to remove the term export from the file
+ if [ ! -z ${valuesInputFile1} ]; then
+ propsFile="domain.properties"
+ cat ${exportValuesFile} > ${propsFile}
+ sed -i 's/export //g' ${propsFile}
+ sed -i 's/"//g' ${propsFile}
+ valuesInputFile=${propsFile}
+ cat ${valuesInputFile}
+ fi
+
+ # javaOptions may contain tokens that are not allowed in export command
+ # we need to handle it differently.
+ # we set the javaOptions variable that can be used later
+ tmpStr=`grep "javaOptions" ${exportValuesFile}`
+ javaOptions=${tmpStr//"javaOptions="/}
+
+ # We exclude javaOptions from the exportValuesFile
+ grep -v "javaOptions" ${exportValuesFile} > ${tmpFile}
+ source ${tmpFile}
+
+ rm ${exportValuesFile} ${tmpFile}
+}
+
+#
+# Function to delete a kubernetes object
+# $1 object type
+# $2 object name
+# $3 yaml file
+function deleteK8sObj {
+ # If the yaml file does not exist yet, unable to do the delete
+ if [ ! -f $3 ]; then
+ fail "Unable to delete object type $1 with name $2 because file $3 does not exist"
+ fi
+
+ echo Checking if object type $1 with name $2 exists
+ K8SOBJ=`kubectl get $1 -n ${namespace} | grep $2 | wc | awk ' { print $1; }'`
+ if [ "${K8SOBJ}" = "1" ]; then
+ echo Deleting $2 using $3
+ kubectl delete -f $3
+ fi
+}
+
+#
+# Function to lowercase a value
+# $1 - value to convert to lowercase
+function toLower {
+ local lc=`echo $1 | tr "[:upper:]" "[:lower:]"`
+ echo "$lc"
+}
+
+#
+# Function to lowercase a value and make it a legal DNS1123 name
+# $1 - value to convert to lowercase
+function toDNS1123Legal {
+ local val=`echo $1 | tr "[:upper:]" "[:lower:]"`
+ val=${val//"_"/"-"}
+ echo "$val"
+}
+
+#
+# Check the state of a persistent volume.
+# $1 - name of volume
+# $2 - expected state of volume
+function checkPvState {
+
+ echo "Checking if the persistent volume ${1:?} is ${2:?}"
+ local pv_state=`kubectl get pv $1 -o jsonpath='{.status.phase}'`
+ attempts=0
+ while [ ! "$pv_state" = "$2" ] && [ ! $attempts -eq 10 ]; do
+ attempts=$((attempts + 1))
+ sleep 1
+ pv_state=`kubectl get pv $1 -o jsonpath='{.status.phase}'`
+ done
+ if [ "$pv_state" != "$2" ]; then
+ fail "The persistent volume state should be $2 but is $pv_state"
+ fi
+}
+
+#
+# Function to check if a persistent volume exists
+# $1 - name of volume
+function checkPvExists {
+
+ echo "Checking if the persistent volume ${1} exists"
+ PV_EXISTS=`kubectl get pv | grep ${1} | wc | awk ' { print $1; } '`
+ if [ "${PV_EXISTS}" = "1" ]; then
+ echo "The persistent volume ${1} already exists"
+ PV_EXISTS="true"
+ else
+ echo "The persistent volume ${1} does not exist"
+ PV_EXISTS="false"
+ fi
+}
+
+#
+# Function to check if a persistent volume claim exists
+# $1 - name of persistent volume claim
+# $2 - NameSpace
+function checkPvcExists {
+ echo "Checking if the persistent volume claim ${1} in NameSpace ${2} exists"
+ PVC_EXISTS=`kubectl get pvc -n ${2} | grep ${1} | wc | awk ' { print $1; } '`
+ if [ "${PVC_EXISTS}" = "1" ]; then
+ echo "The persistent volume claim ${1} already exists in NameSpace ${2}"
+ PVC_EXISTS="true"
+ else
+ echo "The persistent volume claim ${1} does not exist in NameSpace ${2}"
+ PVC_EXISTS="false"
+ fi
+}
+
+# Copy the inputs file from the command line into the output directory
+# for the domain/operator unless the output directory already has an
+# inputs file and the file is the same as the one from the commandline.
+# $1 the inputs file from the command line
+# $2 the file in the output directory that needs to be made the same as $1
+function copyInputsFileToOutputDirectory {
+ local from=$1
+ local to=$2
+ local doCopy="true"
+ if [ -f "${to}" ]; then
+ local difference=`diff ${from} ${to}`
+ if [ -z "${difference}" ]; then
+ # the output file already exists and is the same as the inputs file.
+ # don't make a copy.
+ doCopy="false"
+ fi
+ fi
+ if [ "${doCopy}" = "true" ]; then
+ cp ${from} ${to}
+ fi
+}
+
+#
+# Function to obtain the IP address of the kubernetes cluster. This information
+# is used to form the URL's for accessing services that were deployed.
+#
+function getKubernetesClusterIP {
+
+ # Get name of the current context
+ local CUR_CTX=`kubectl config current-context | awk ' { print $1; } '`
+
+ # Get the name of the current cluster
+ local CUR_CLUSTER_CMD="kubectl config view -o jsonpath='{.contexts[?(@.name == \"${CUR_CTX}\")].context.cluster}' | awk ' { print $1; } '"
+ local CUR_CLUSTER=`eval ${CUR_CLUSTER_CMD}`
+
+ # Get the server address for the current cluster
+ local SVR_ADDR_CMD="kubectl config view -o jsonpath='{.clusters[?(@.name == \"${CUR_CLUSTER}\")].cluster.server}' | awk ' { print $1; } '"
+ local SVR_ADDR=`eval ${SVR_ADDR_CMD}`
+
+ # Server address is expected to be of the form http://address:port. Delimit
+ # string on the colon to obtain the address.
+ local array=(${SVR_ADDR//:/ })
+ K8S_IP="${array[1]/\/\//}"
+
+}
+
+#
+# Function to set the serverPodResources variable for including into the generated
+# domain.yaml, base on the serverPod resource requests and limits input values,
+# if specified.
+# The serverPodResources variable remains unset if none of the input values are provided.
+#
+function buildServerPodResources {
+
+ if [ -n "${serverPodMemoryRequest}" ]; then
+ local memoryRequest=" memory\: \"${serverPodMemoryRequest}\"\n"
+ fi
+ if [ -n "${serverPodCpuRequest}" ]; then
+ local cpuRequest=" cpu\: \"${serverPodCpuRequest}\"\n"
+ fi
+ if [ -n "${memoryRequest}" ] || [ -n "${cpuRequest}" ]; then
+ local requests=" requests\: \n$memoryRequest $cpuRequest"
+ fi
+
+ if [ -n "${serverPodMemoryLimit}" ]; then
+ local memoryLimit=" memory\: \"${serverPodMemoryLimit}\"\n"
+ fi
+ if [ -n "${serverPodCpuLimit}" ]; then
+ local cpuLimit=" cpu\: \"${serverPodCpuLimit}\"\n"
+ fi
+ if [ -n "${memoryLimit}" ] || [ -n "${cpuLimit}" ]; then
+ local limits=" limits\: \n$memoryLimit $cpuLimit"
+ fi
+
+ if [ -n "${requests}" ] || [ -n "${limits}" ]; then
+ # build resources element and remove last '\n'
+ serverPodResources=$(echo "resources\:\n${requests}${limits}" | sed -e 's/\\n$//')
+ fi
+}
+
+#
+# Function to generate the properties and yaml files for creating a domain
+#
+function createFiles {
+
+ update=false
+ if [ "$#" == 1 ]; then
+ echo Trying to update the domain
+ update=true
+ fi
+
+ # Make sure the output directory has a copy of the inputs file.
+ # The user can either pre-create the output directory, put the inputs
+ # file there, and create the domain from it, or the user can put the
+ # inputs file some place else and let this script create the output directory
+ # (if needed) and copy the inputs file there.
+ echo createFiles - valuesInputFile is ${valuesInputFile}
+ copyInputsFileToOutputDirectory ${valuesInputFile} "${domainOutputDir}/create-domain-inputs.yaml"
+
+ if [ "${domainHomeInImage}" == "true" ]; then
+ if [ -z "${domainHomeImageBase}" ]; then
+ fail "Please specify domainHomeImageBase in your input YAML"
+ fi
+ else
+ if [ -z "${image}" ]; then
+ fail "Please specify image in your input YAML"
+ fi
+ fi
+
+ dcrOutput="${domainOutputDir}/domain.yaml"
+
+ domainName=${domainUID}
+
+ enabledPrefix="" # uncomment the feature
+ disabledPrefix="# " # comment out the feature
+
+ exposeAnyChannelPrefix="${disabledPrefix}"
+ if [ "${exposeAdminT3Channel}" = true ]; then
+ exposeAdminT3ChannelPrefix="${enabledPrefix}"
+ exposeAnyChannelPrefix="${enabledPrefix}"
+ # set t3PublicAddress if not set
+ if [ -z "${t3PublicAddress}" ]; then
+ getKubernetesClusterIP
+ t3PublicAddress="${K8S_IP}"
+ fi
+ else
+ exposeAdminT3ChannelPrefix="${disabledPrefix}"
+ fi
+
+ if [ "${exposeAdminNodePort}" = true ]; then
+ exposeAdminNodePortPrefix="${enabledPrefix}"
+ exposeAnyChannelPrefix="${enabledPrefix}"
+ else
+ exposeAdminNodePortPrefix="${disabledPrefix}"
+ fi
+
+ if [ "${istioEnabled}" == "true" ]; then
+ istioPrefix="${enabledPrefix}"
+ else
+ istioPrefix="${disabledPrefix}"
+ fi
+
+ # The FromModel, MII (model-in-image), and WDT_DOMAIN_TYPE updates in this script
+ # must remain even though they are not referenced by a sample. They're used by the
+ # Operator integration test code. If you're interested in MII,
+ # see './kubernetes/samples/scripts/create-weblogic-domain/model-in-image'.
+
+ # MII settings are used for model-in-image integration testing
+ if [ "${domainHomeSourceType}" == "FromModel" ]; then
+ miiPrefix="${enabledPrefix}"
+ else
+ miiPrefix="${disabledPrefix}"
+ fi
+
+ # MII settings are used for model-in-image integration testing
+ if [ -z "${miiConfigMap}" ]; then
+ miiConfigMapPrefix="${disabledPrefix}"
+ else
+ miiConfigMapPrefix="${enabledPrefix}"
+ fi
+
+ # For some parameters, use the default value if not defined.
+ if [ -z "${domainPVMountPath}" ]; then
+ domainPVMountPath="/shared"
+ fi
+
+ if [ -z "${logHome}" ]; then
+ logHome="${domainPVMountPath}/logs/${domainUID}"
+ fi
+
+ if [ -z "${httpAccessLogInLogHome}" ]; then
+ httpAccessLogInLogHome="true"
+ fi
+
+ if [ -z "${dataHome}" ]; then
+ dataHome=""
+ fi
+
+ if [ -z "${persistentVolumeClaimName}" ]; then
+ persistentVolumeClaimName="${domainUID}-weblogic-sample-pvc"
+ fi
+
+ if [ -z "${weblogicCredentialsSecretName}" ]; then
+ weblogicCredentialsSecretName="${domainUID}-weblogic-credentials"
+ fi
+
+ if [ "${domainHomeInImage}" == "true" ]; then
+ domainPropertiesOutput="${domainOutputDir}/domain.properties"
+ domainHome="${domainHome:-/u01/oracle/user_projects/domains/${domainName}}"
+
+ # Generate the properties file that will be used when creating the weblogic domain
+ echo Generating ${domainPropertiesOutput} from ${domainPropertiesInput}
+
+ cp ${domainPropertiesInput} ${domainPropertiesOutput}
+ sed -i -e "s:%DOMAIN_NAME%:${domainName}:g" ${domainPropertiesOutput}
+ sed -i -e "s:%DOMAIN_HOME%:${domainHome}:g" ${domainPropertiesOutput}
+ sed -i -e "s:%ADMIN_PORT%:${adminPort}:g" ${domainPropertiesOutput}
+ sed -i -e "s:%ADMIN_SERVER_SSL_PORT%:${adminServerSSLPort}:g" ${domainPropertiesOutput}
+ sed -i -e "s:%ADMIN_SERVER_NAME%:${adminServerName}:g" ${domainPropertiesOutput}
+ sed -i -e "s:%MANAGED_SERVER_PORT%:${managedServerPort}:g" ${domainPropertiesOutput}
+ sed -i -e "s:%MANAGED_SERVER_SSL_PORT%:${managedServerSSLPort}:g" ${domainPropertiesOutput}
+ sed -i -e "s:%MANAGED_SERVER_NAME_BASE%:${managedServerNameBase}:g" ${domainPropertiesOutput}
+ sed -i -e "s:%CONFIGURED_MANAGED_SERVER_COUNT%:${configuredManagedServerCount}:g" ${domainPropertiesOutput}
+ sed -i -e "s:%CLUSTER_NAME%:${clusterName}:g" ${domainPropertiesOutput}
+ sed -i -e "s:%SSL_ENABLED%:${sslEnabled}:g" ${domainPropertiesOutput}
+ sed -i -e "s:%PRODUCTION_MODE_ENABLED%:${productionModeEnabled}:g" ${domainPropertiesOutput}
+ sed -i -e "s:%CLUSTER_TYPE%:${clusterType}:g" ${domainPropertiesOutput}
+ sed -i -e "s;%JAVA_OPTIONS%;${javaOptions};g" ${domainPropertiesOutput}
+ sed -i -e "s:%T3_CHANNEL_PORT%:${t3ChannelPort}:g" ${domainPropertiesOutput}
+ sed -i -e "s:%T3_PUBLIC_ADDRESS%:${t3PublicAddress}:g" ${domainPropertiesOutput}
+ sed -i -e "s:%EXPOSE_T3_CHANNEL%:${exposeAdminT3Channel}:g" ${domainPropertiesOutput}
+ sed -i -e "s:%FMW_DOMAIN_TYPE%:${fmwDomainType}:g" ${domainPropertiesOutput}
+ sed -i -e "s:%WDT_DOMAIN_TYPE%:${wdtDomainType}:g" ${domainPropertiesOutput}
+ sed -i -e "s:%ADMIN_USER_NAME%:${username}:g" ${domainPropertiesOutput}
+ sed -i -e "s:%ADMIN_USER_PASS%:${password}:g" ${domainPropertiesOutput}
+ sed -i -e "s:%RCU_SCHEMA_PREFIX%:${rcuSchemaPrefix}:g" ${domainPropertiesOutput}
+ sed -i -e "s:%RCU_SCHEMA_PASSWORD%:${rcuSchemaPassword}:g" ${domainPropertiesOutput}
+ sed -i -e "s|%RCU_DB_CONN_STRING%|${rcuDatabaseURL}|g" ${domainPropertiesOutput}
+
+ if [ -z "${image}" ]; then
+ # calculate the internal name to tag the generated image
+ defaultImageName="domain-home-in-image"
+ baseTag=${domainHomeImageBase#*:}
+ defaultImageName=${defaultImageName}:${baseTag:-"latest"}
+ sed -i -e "s|%IMAGE_NAME%|${defaultImageName}|g" ${domainPropertiesOutput}
+ export BUILD_IMAGE_TAG=${defaultImageName}
+ else
+ sed -i -e "s|%IMAGE_NAME%|${image}|g" ${domainPropertiesOutput}
+ export BUILD_IMAGE_TAG=${image}
+ fi
+ else
+ # we're in the domain in PV case
+
+ wdtVersion="${WDT_VERSION:-${wdtVersion}}"
+ httpsProxy="${https_proxy}"
+
+ createJobOutput="${domainOutputDir}/create-domain-job.yaml"
+ deleteJobOutput="${domainOutputDir}/delete-domain-job.yaml"
+
+ if [ -z "${domainHome}" ]; then
+ domainHome="${domainPVMountPath}/domains/${domainUID}"
+ fi
+
+ # Use the default value if not defined.
+ if [ -z "${createDomainScriptsMountPath}" ]; then
+ createDomainScriptsMountPath="/u01/weblogic"
+ fi
+
+ if [ "${update}" == "true" ]; then
+ createDomainScriptName="update-domain-job.sh"
+ elif [ -z "${createDomainScriptName}" ]; then
+ createDomainScriptName="create-domain-job.sh"
+ fi
+ echo createDomainScriptName is ${createDomainScriptName}
+
+ # Must escape the ':' value in image for sed to properly parse and replace
+ image=$(echo ${image} | sed -e "s/\:/\\\:/g")
+
+ # Generate the yaml to create the kubernetes job that will create the weblogic domain
+ echo Generating ${createJobOutput}
+
+ cp ${createJobInput} ${createJobOutput}
+ sed -i -e "s:%NAMESPACE%:$namespace:g" ${createJobOutput}
+ sed -i -e "s:%WEBLOGIC_CREDENTIALS_SECRET_NAME%:${weblogicCredentialsSecretName}:g" ${createJobOutput}
+ sed -i -e "s:%WEBLOGIC_IMAGE%:${image}:g" ${createJobOutput}
+ sed -i -e "s:%WEBLOGIC_IMAGE_PULL_POLICY%:${imagePullPolicy}:g" ${createJobOutput}
+ sed -i -e "s:%WEBLOGIC_IMAGE_PULL_SECRET_NAME%:${imagePullSecretName}:g" ${createJobOutput}
+ sed -i -e "s:%WEBLOGIC_IMAGE_PULL_SECRET_PREFIX%:${imagePullSecretPrefix}:g" ${createJobOutput}
+ sed -i -e "s:%DOMAIN_UID%:${domainUID}:g" ${createJobOutput}
+ sed -i -e "s:%DOMAIN_NAME%:${domainName}:g" ${createJobOutput}
+ sed -i -e "s:%DOMAIN_HOME%:${domainHome}:g" ${createJobOutput}
+ sed -i -e "s:%SSL_ENABLED%:${sslEnabled}:g" ${createJobOutput}
+ sed -i -e "s:%PRODUCTION_MODE_ENABLED%:${productionModeEnabled}:g" ${createJobOutput}
+ sed -i -e "s:%ADMIN_SERVER_NAME%:${adminServerName}:g" ${createJobOutput}
+ sed -i -e "s:%ADMIN_SERVER_NAME_SVC%:${adminServerNameSVC}:g" ${createJobOutput}
+ sed -i -e "s:%ADMIN_PORT%:${adminPort}:g" ${createJobOutput}
+ sed -i -e "s:%ADMIN_SERVER_SSL_PORT%:${adminServerSSLPort}:g" ${createJobOutput}
+ sed -i -e "s:%CONFIGURED_MANAGED_SERVER_COUNT%:${configuredManagedServerCount}:g" ${createJobOutput}
+ sed -i -e "s:%MANAGED_SERVER_NAME_BASE%:${managedServerNameBase}:g" ${createJobOutput}
+ sed -i -e "s:%MANAGED_SERVER_NAME_BASE_SVC%:${managedServerNameBaseSVC}:g" ${createJobOutput}
+ sed -i -e "s:%MANAGED_SERVER_PORT%:${managedServerPort}:g" ${createJobOutput}
+ sed -i -e "s:%MANAGED_SERVER_SSL_PORT%:${managedServerSSLPort}:g" ${createJobOutput}
+ sed -i -e "s:%T3_CHANNEL_PORT%:${t3ChannelPort}:g" ${createJobOutput}
+ sed -i -e "s:%T3_PUBLIC_ADDRESS%:${t3PublicAddress}:g" ${createJobOutput}
+ sed -i -e "s:%CLUSTER_NAME%:${clusterName}:g" ${createJobOutput}
+ sed -i -e "s:%CLUSTER_TYPE%:${clusterType}:g" ${createJobOutput}
+ sed -i -e "s:%DOMAIN_PVC_NAME%:${persistentVolumeClaimName}:g" ${createJobOutput}
+ sed -i -e "s:%DOMAIN_ROOT_DIR%:${domainPVMountPath}:g" ${createJobOutput}
+ sed -i -e "s:%CREATE_DOMAIN_SCRIPT_DIR%:${createDomainScriptsMountPath}:g" ${createJobOutput}
+ sed -i -e "s:%CREATE_DOMAIN_SCRIPT%:${createDomainScriptName}:g" ${createJobOutput}
+ # extra entries for FMW Infra domains
+ sed -i -e "s:%RCU_CREDENTIALS_SECRET_NAME%:${rcuCredentialsSecret}:g" ${createJobOutput}
+ sed -i -e "s:%CUSTOM_RCUPREFIX%:${rcuSchemaPrefix}:g" ${createJobOutput}
+ sed -i -e "s|%CUSTOM_CONNECTION_STRING%|${rcuDatabaseURL}|g" ${createJobOutput}
+ sed -i -e "s:%EXPOSE_T3_CHANNEL_PREFIX%:${exposeAdminT3Channel}:g" ${createJobOutput}
+ sed -i -e "s:%FRONTEND_HOST%:${frontEndHost}:g" ${createJobOutput}
+ sed -i -e "s:%FRONTEND_PORT%:${frontEndPort}:g" ${createJobOutput}
+ # entries for Istio
+ sed -i -e "s:%ISTIO_PREFIX%:${istioPrefix}:g" ${createJobOutput}
+ sed -i -e "s:%ISTIO_ENABLED%:${istioEnabled}:g" ${createJobOutput}
+ sed -i -e "s:%ISTIO_READINESS_PORT%:${istioReadinessPort}:g" ${createJobOutput}
+ sed -i -e "s:%WDT_VERSION%:${wdtVersion}:g" ${createJobOutput}
+ sed -i -e "s|%DOMAIN_TYPE%|${domain_type}|g" ${createJobOutput}
+ sed -i -e "s|%PROXY_VAL%|${httpsProxy}|g" ${createJobOutput}
+
+ # Generate the yaml to create the kubernetes job that will delete the weblogic domain_home folder
+ echo Generating ${deleteJobOutput}
+
+ cp ${deleteJobInput} ${deleteJobOutput}
+ sed -i -e "s:%NAMESPACE%:$namespace:g" ${deleteJobOutput}
+ sed -i -e "s:%WEBLOGIC_IMAGE%:${image}:g" ${deleteJobOutput}
+ sed -i -e "s:%WEBLOGIC_IMAGE_PULL_POLICY%:${imagePullPolicy}:g" ${deleteJobOutput}
+ sed -i -e "s:%WEBLOGIC_CREDENTIALS_SECRET_NAME%:${weblogicCredentialsSecretName}:g" ${deleteJobOutput}
+ sed -i -e "s:%WEBLOGIC_IMAGE_PULL_SECRET_NAME%:${imagePullSecretName}:g" ${deleteJobOutput}
+ sed -i -e "s:%WEBLOGIC_IMAGE_PULL_SECRET_PREFIX%:${imagePullSecretPrefix}:g" ${deleteJobOutput}
+ sed -i -e "s:%DOMAIN_UID%:${domainUID}:g" ${deleteJobOutput}
+ sed -i -e "s:%DOMAIN_NAME%:${domainName}:g" ${deleteJobOutput}
+ sed -i -e "s:%DOMAIN_HOME%:${domainHome}:g" ${deleteJobOutput}
+ sed -i -e "s:%DOMAIN_PVC_NAME%:${persistentVolumeClaimName}:g" ${deleteJobOutput}
+ sed -i -e "s:%DOMAIN_ROOT_DIR%:${domainPVMountPath}:g" ${deleteJobOutput}
+ fi
+
+ if [ "${domainHomeSourceType}" == "FromModel" ]; then
+ echo domainHomeSourceType is FromModel
+ # leave domainHomeSourceType to FromModel
+ if [ "${logHomeOnPV}" == "true" ]; then
+ logHomeOnPVPrefix="${enabledPrefix}"
+ else
+ logHomeOnPVPrefix="${disabledPrefix}"
+ fi
+ elif [ "${domainHomeInImage}" == "true" ]; then
+ domainHomeSourceType="Image"
+ if [ "${logHomeOnPV}" == "true" ]; then
+ logHomeOnPVPrefix="${enabledPrefix}"
+ else
+ logHomeOnPVPrefix="${disabledPrefix}"
+ fi
+ else
+ domainHomeSourceType="PersistentVolume"
+ logHomeOnPVPrefix="${enabledPrefix}"
+ logHomeOnPV=true
+ fi
+
+ # Generate the yaml file for creating the domain resource
+ # We want to use wdt's extractDomainResource.sh to get the domain resource
+ # for domain on pv use case. For others, generate domain resource here
+
+ if [ "${domainHomeSourceType}" != "PersistentVolume" ] || [ "${wdtDomainType}" != "WLS" ] ||
+ [ "${useWdt}" != true ]; then
+ echo Generating ${dcrOutput}
+
+ cp ${dcrInput} ${dcrOutput}
+ sed -i -e "s:%DOMAIN_UID%:${domainUID}:g" ${dcrOutput}
+ sed -i -e "s:%NAMESPACE%:$namespace:g" ${dcrOutput}
+ sed -i -e "s:%DOMAIN_HOME%:${domainHome}:g" ${dcrOutput}
+ sed -i -e "s:%DOMAIN_HOME_SOURCE_TYPE%:${domainHomeSourceType}:g" ${dcrOutput}
+ sed -i -e "s:%WEBLOGIC_IMAGE_PULL_POLICY%:${imagePullPolicy}:g" ${dcrOutput}
+ sed -i -e "s:%WEBLOGIC_IMAGE_PULL_SECRET_PREFIX%:${imagePullSecretPrefix}:g" ${dcrOutput}
+ sed -i -e "s:%WEBLOGIC_IMAGE_PULL_SECRET_NAME%:${imagePullSecretName}:g" ${dcrOutput}
+ sed -i -e "s:%WEBLOGIC_CREDENTIALS_SECRET_NAME%:${weblogicCredentialsSecretName}:g" ${dcrOutput}
+ sed -i -e "s:%INCLUDE_SERVER_OUT_IN_POD_LOG%:${includeServerOutInPodLog}:g" ${dcrOutput}
+ sed -i -e "s:%LOG_HOME_ON_PV_PREFIX%:${logHomeOnPVPrefix}:g" ${dcrOutput}
+ sed -i -e "s:%LOG_HOME_ENABLED%:${logHomeOnPV}:g" ${dcrOutput}
+ sed -i -e "s:%LOG_HOME%:${logHome}:g" ${dcrOutput}
+ sed -i -e "s:%HTTP_ACCESS_LOG_IN_LOG_HOME%:${httpAccessLogInLogHome}:g" ${dcrOutput}
+ sed -i -e "s:%DATA_HOME%:${dataHome}:g" ${dcrOutput}
+ sed -i -e "s:%SERVER_START_POLICY%:${serverStartPolicy}:g" ${dcrOutput}
+ sed -i -e "s;%JAVA_OPTIONS%;${javaOptions};g" ${dcrOutput}
+ sed -i -e "s:%DOMAIN_PVC_NAME%:${persistentVolumeClaimName}:g" ${dcrOutput}
+ sed -i -e "s:%DOMAIN_ROOT_DIR%:${domainPVMountPath}:g" ${dcrOutput}
+
+ if [ "${istioEnabled}" == "true" ]; then
+ exposeAdminNodePortPrefix="${disabledPrefix}"
+ fi
+
+ sed -i -e "s:%EXPOSE_T3_CHANNEL_PREFIX%:${exposeAdminT3ChannelPrefix}:g" ${dcrOutput}
+ sed -i -e "s:%EXPOSE_ANY_CHANNEL_PREFIX%:${exposeAnyChannelPrefix}:g" ${dcrOutput}
+ sed -i -e "s:%EXPOSE_ADMIN_PORT_PREFIX%:${exposeAdminNodePortPrefix}:g" ${dcrOutput}
+ sed -i -e "s:%ADMIN_NODE_PORT%:${adminNodePort}:g" ${dcrOutput}
+ sed -i -e "s:%CLUSTER_NAME%:${clusterName}:g" ${dcrOutput}
+ sed -i -e "s:%INITIAL_MANAGED_SERVER_REPLICAS%:${initialManagedServerReplicas}:g" ${dcrOutput}
+ sed -i -e "s:%ISTIO_PREFIX%:${istioPrefix}:g" ${dcrOutput}
+ sed -i -e "s:%ISTIO_ENABLED%:${istioEnabled}:g" ${dcrOutput}
+ sed -i -e "s:%ISTIO_READINESS_PORT%:${istioReadinessPort}:g" ${dcrOutput}
+ # MII settings are used for model-in-image integration testing
+ sed -i -e "s:%MII_PREFIX%:${miiPrefix}:g" ${dcrOutput}
+ sed -i -e "s:%MII_CONFIG_MAP_PREFIX%:${miiConfigMapPrefix}:g" ${dcrOutput}
+ sed -i -e "s:%MII_CONFIG_MAP%:${miiConfigMap}:g" ${dcrOutput}
+ sed -i -e "s:%WDT_DOMAIN_TYPE%:${wdtDomainType}:g" ${dcrOutput}
+
+ buildServerPodResources
+ if [ -z "${serverPodResources}" ]; then
+ sed -i -e "/%OPTIONAL_SERVERPOD_RESOURCES%/d" ${dcrOutput}
+ else
+ if [[ $(uname) -eq "Darwin" ]]; then
+ serverPodResources=$(echo "${serverPodResources}" | sed -e 's/\\n/%NEWLINE%/g')
+ sed -i -e "s:%OPTIONAL_SERVERPOD_RESOURCES%:${serverPodResources}:g" ${dcrOutput}
+ sed -i -e $'s|%NEWLINE%|\\\n|g' ${dcrOutput}
+ else
+ sed -i -e "s:%OPTIONAL_SERVERPOD_RESOURCES%:${serverPodResources}:g" ${dcrOutput}
+ fi
+ fi
+
+ if [ "${domainHomeInImage}" == "true" ]; then
+
+ # now we know which image to use, update the domain yaml file
+ if [ -z $image ]; then
+ sed -i -e "s|%WEBLOGIC_IMAGE%|${defaultImageName}|g" ${dcrOutput}
+ else
+ sed -i -e "s|%WEBLOGIC_IMAGE%|${image}|g" ${dcrOutput}
+ fi
+ else
+ sed -i -e "s:%WEBLOGIC_IMAGE%:${image}:g" ${dcrOutput}
+ fi
+ fi
+
+ # Remove any "...yaml-e" and "...properties-e" files left over from running sed
+ rm -f ${domainOutputDir}/*.yaml-e
+ rm -f ${domainOutputDir}/*.properties-e
+
+}
+
+
+#
+# Function to markup the wdt model file
+#
+function updateModelFile {
+ # Update the wdt model file with kubernetes section
+ modelFile="${domainOutputDir}/tmp/wdt_model.yaml"
+ cat ${scriptDir}/wdt_k8s_model_template.yaml >> ${modelFile}
+
+ sed -i -e "s:%DOMAIN_UID%:${domainUID}:g" ${modelFile}
+ sed -i -e "s:%NAMESPACE%:$namespace:g" ${modelFile}
+ sed -i -e "s:%DOMAIN_HOME%:${domainHome}:g" ${modelFile}
+ sed -i -e "s:%DOMAIN_HOME_SOURCE_TYPE%:${domainHomeSourceType}:g" ${modelFile}
+ sed -i -e "s:%WEBLOGIC_IMAGE_PULL_POLICY%:${imagePullPolicy}:g" ${modelFile}
+ sed -i -e "s:%WEBLOGIC_IMAGE_PULL_SECRET_PREFIX%:${imagePullSecretPrefix}:g" ${modelFile}
+ sed -i -e "s:%WEBLOGIC_IMAGE_PULL_SECRET_NAME%:${imagePullSecretName}:g" ${modelFile}
+ sed -i -e "s:%WEBLOGIC_CREDENTIALS_SECRET_NAME%:${weblogicCredentialsSecretName}:g" ${modelFile}
+ sed -i -e "s:%INCLUDE_SERVER_OUT_IN_POD_LOG%:${includeServerOutInPodLog}:g" ${modelFile}
+ sed -i -e "s:%LOG_HOME_ON_PV_PREFIX%:${logHomeOnPVPrefix}:g" ${modelFile}
+ sed -i -e "s:%LOG_HOME_ENABLED%:${logHomeOnPV}:g" ${modelFile}
+ sed -i -e "s:%LOG_HOME%:${logHome}:g" ${modelFile}
+ sed -i -e "s:%HTTP_ACCESS_LOG_IN_LOG_HOME%:${httpAccessLogInLogHome}:g" ${modelFile}
+ sed -i -e "s:%DATA_HOME%:${dataHome}:g" ${modelFile}
+ sed -i -e "s:%SERVER_START_POLICY%:${serverStartPolicy}:g" ${modelFile}
+ sed -i -e "s;%JAVA_OPTIONS%;${javaOptions};g" ${modelFile}
+ sed -i -e "s:%DOMAIN_PVC_NAME%:${persistentVolumeClaimName}:g" ${modelFile}
+ sed -i -e "s:%DOMAIN_ROOT_DIR%:${domainPVMountPath}:g" ${modelFile}
+
+ if [ "${istioEnabled}" == "true" ]; then
+ exposeAdminNodePortPrefix="${disabledPrefix}"
+ fi
+
+ sed -i -e "s:%EXPOSE_T3_CHANNEL_PREFIX%:${exposeAdminT3ChannelPrefix}:g" ${modelFile}
+ sed -i -e "s:%EXPOSE_ANY_CHANNEL_PREFIX%:${exposeAnyChannelPrefix}:g" ${modelFile}
+ 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:%INITIAL_MANAGED_SERVER_REPLICAS%:${initialManagedServerReplicas}:g" ${modelFile}
+ sed -i -e "s:%ISTIO_PREFIX%:${istioPrefix}:g" ${modelFile}
+ sed -i -e "s:%ISTIO_ENABLED%:${istioEnabled}:g" ${modelFile}
+ sed -i -e "s:%ISTIO_READINESS_PORT%:${istioReadinessPort}:g" ${modelFile}
+ # MII settings are used for model-in-image integration testing
+ sed -i -e "s:%MII_PREFIX%:${miiPrefix}:g" ${modelFile}
+ sed -i -e "s:%MII_CONFIG_MAP_PREFIX%:${miiConfigMapPrefix}:g" ${modelFile}
+ sed -i -e "s:%MII_CONFIG_MAP%:${miiConfigMap}:g" ${modelFile}
+ sed -i -e "s:%WDT_DOMAIN_TYPE%:${wdtDomainType}:g" ${modelFile}
+
+ buildServerPodResources
+ if [ -z "${serverPodResources}" ]; then
+ sed -i -e "/%OPTIONAL_SERVERPOD_RESOURCES%/d" ${modelFile}
+ else
+ if [[ $(uname) -eq "Darwin" ]]; then
+ serverPodResources=$(echo "${serverPodResources}" | sed -e 's/\\n/%NEWLINE%/g')
+ sed -i -e "s:%OPTIONAL_SERVERPOD_RESOURCES%:${serverPodResources}:g" ${modelFile}
+ sed -i -e $'s|%NEWLINE%|\\\n|g' ${modelFile}
+ else
+ sed -i -e "s:%OPTIONAL_SERVERPOD_RESOURCES%:${serverPodResources}:g" ${modelFile}
+ fi
+ fi
+
+ sed -i -e "s:%WEBLOGIC_IMAGE%:${image}:g" ${modelFile}
+}
+
+#
+# Function to create the domain recource
+#
+function createDomainResource {
+ kubectl apply -f ${dcrOutput}
+
+ attempts=0
+ while [ "$DCR_AVAIL" != "1" ] && [ ! $attempts -eq 10 ]; do
+ attempts=$((attempts + 1))
+ sleep 1
+ DCR_AVAIL=`kubectl get domain ${domainUID} -n ${namespace} | grep ${domainUID} | wc | awk ' { print $1; } '`
+ done
+ if [ "${DCR_AVAIL}" != "1" ]; then
+ fail "The domain resource ${domainUID} was not found"
+ fi
+}
+
+#
+# Function to create a domain
+# $1 - boolean value indicating the location of the domain home
+# true means domain home in image
+# false means domain home on PV
+#
+function createDomain {
+ if [ "$#" != 1 ]; then
+ fail "The function must be called with domainHomeInImage parameter."
+ fi
+
+ domainHomeInImage="${1}"
+ if [ "true" != "${domainHomeInImage}" ] && [ "false" != "${domainHomeInImage}" ]; then
+ fail "The value of domainHomeInImage must be true or false: ${domainHomeInImage}"
+ fi
+
+ # Setup the environment for running this script and perform initial validation checks
+ initialize
+
+ # Generate files for creating the domain
+ createFiles
+
+ # Check that the domain secret exists and contains the required elements
+ validateDomainSecret
+
+ # Validate the domain's persistent volume claim
+ if [ "${doValidation}" == true ] && [ "${domainHomeInImage}" == false -o "${logHomeOnPV}" == true ]; then
+ validateDomainPVC
+ fi
+
+ # Create the WebLogic domain home
+ createDomainHome
+
+ if [ "${executeIt}" = true ]; then
+ createDomainResource
+ fi
+
+ # Print a summary
+ printSummary
+}
+
+#
+# Function to update a domain
+# $1 - boolean value indicating the location of the domain home
+# true means domain home in image
+# false means domain home on PV
+#
+function updateDomain {
+
+ domainHomeInImage="false"
+
+ # Setup the environment for running this script and perform initial validation checks
+ initialize
+
+ # Generate files for creating the domain
+ createFiles update
+
+ # Check that the domain secret exists and contains the required elements
+ validateDomainSecret
+
+ # Validate the domain's persistent volume claim
+ if [ "${doValidation}" == true ]; then
+ validateDomainPVC
+ fi
+
+ # Create the WebLogic domain home
+ updateDomainHome
+
+ if [ "${executeIt}" = true ]; then
+ createDomainResource
+ fi
+
+ # Print a summary
+ printSummary
+}
+
+# checks if a given pod in a NameSpace has been deleted
+function checkPodDelete(){
+
+ pod=$1
+ ns=$2
+ status="Terminating"
+
+ if [ -z ${1} ]; then
+ echo "No Pod name provided "
+ exit -1
+ fi
+
+ if [ -z ${2} ]; then
+ echo "No NameSpace provided "
+ exit -2
+ fi
+
+ echo "Checking Status for Pod [$pod] in namespace [${ns}]"
+ max=10
+ count=1
+ while [ $count -le $max ] ; do
+ sleep 5
+ pod=`kubectl get po/$1 -n ${ns} | grep -v NAME | awk '{print $1}'`
+ if [ -z ${pod} ]; then
+ status="Terminated"
+ echo "Pod [$1] removed from nameSpace [${ns}]"
+ break;
+ fi
+ count=`expr $count + 1`
+ echo "Pod [$pod] Status [${status}]"
+ done
+
+ if [ $count -gt $max ] ; then
+ echo "[ERROR] The Pod[$1] in NameSpace [$ns] could not be deleted in 50s";
+ exit 1
+ fi
+}
+
+# Checks if all container(s) in a pod are running state based on READY column
+#NAME READY STATUS RESTARTS AGE
+#domain1-adminserver 1/1 Running 0 4m
+
+function checkPodState(){
+
+ status="NotReady"
+ max=60
+ count=1
+
+ pod=$1
+ ns=$2
+ state=${3:-1/1}
+
+ echo "Checking Pod READY column for State [$state]"
+ pname=`kubectl get po -n ${ns} | grep -w ${pod} | awk '{print $1}'`
+ if [ -z ${pname} ]; then
+ echo "No such pod [$pod] exists in NameSpace [$ns] "
+ exit -1
+ fi
+
+ rcode=`kubectl get po ${pname} -n ${ns} | grep -w ${pod} | awk '{print $2}'`
+ [[ ${rcode} -eq "${state}" ]] && status="Ready"
+
+ while [ ${status} != "Ready" -a $count -le $max ] ; do
+ sleep 5
+ rcode=`kubectl get po/$pod -n ${ns} | grep -v NAME | awk '{print $2}'`
+ [[ ${rcode} -eq "1/1" ]] && status="Ready"
+ echo "Pod [$1] Status is ${status} Iter [$count/$max]"
+ count=`expr $count + 1`
+ done
+ if [ $count -gt $max ] ; then
+ echo "[ERROR] Unable to start the Pod [$pod] after 300s ";
+ exit 1
+ fi
+
+ pname=`kubectl get po -n ${ns} | grep -w ${pod} | awk '{print $1}'`
+ kubectl -n ${ns} get po ${pname}
+}
+
+# Checks if a pod is available in a given namespace
+function checkPod(){
+
+ max=20
+ count=1
+
+ pod=$1
+ ns=$2
+
+ pname=`kubectl get po -n ${ns} | grep -w ${pod} | awk '{print $1}'`
+ if [ -z ${pname} ]; then
+ echo "No such pod [$pod] exists in NameSpace [$ns]"
+ sleep 10
+ fi
+
+ rcode=`kubectl get po -n ${ns} | grep -w ${pod} | awk '{print $1}'`
+ if [ ! -z ${rcode} ]; then
+ echo "[$pod] already initialized .. "
+ return 0
+ fi
+
+ echo "The POD [${pod}] has not been initialized ..."
+ while [ -z ${rcode} ]; do
+ [[ $count -gt $max ]] && break
+ echo "Pod[$pod] is being initialized ..."
+ sleep 5
+ rcode=`kubectl get po -n ${ns} | grep $pod | awk '{print $1}'`
+ count=`expr $count + 1`
+ done
+
+ if [ $count -gt $max ] ; then
+ echo "[ERROR] Could not find Pod [$pod] after 120s";
+ exit 1
+ fi
+}
+
+# Checks if a service is available in a given namespace
+function checkService(){
+ svc=$1
+ ns=$2
+ startSecs=$SECONDS
+ maxWaitSecs=20
+ while [ -z "`kubectl get service -n ${ns} | grep -w ${svc}`" ]; do
+ if [ $((SECONDS - startSecs)) -lt $maxWaitSecs ]; then
+ echo "Service [$svc] not found after $((SECONDS - startSecs)) seconds, retrying ..."
+ sleep 5
+ else
+ echo "[Error] Could not find Service [$svc] after $((SECONDS - startSecs)) seconds"
+ exit 1
+ fi
+ done
+ echo "Service [$svc] found"
+}
diff --git a/OracleWebCenterPortal/kubernetes/common/validate.sh b/OracleWebCenterPortal/kubernetes/common/validate.sh
old mode 100644
new mode 100755
index 1a407a99a..20998ac1a
--- a/OracleWebCenterPortal/kubernetes/common/validate.sh
+++ b/OracleWebCenterPortal/kubernetes/common/validate.sh
@@ -1,481 +1,481 @@
-#!/usr/bin/env bash
-# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-#
-# Description
-# Common validation functions shared by all other scripts that process inputs properties.
-#
-
-#
-# Function to note that a validate error has occurred
-#
-function validationError {
- printError $*
- validateErrors=true
-}
-
-#
-# Function to cause the script to fail if there were any validation errors
-#
-function failIfValidationErrors {
- if [ "$validateErrors" = true ]; then
- fail 'The errors listed above must be resolved before the script can continue'
- fi
-}
-
-#
-# Function to validate that a list of required input parameters were specified
-#
-function validateInputParamsSpecified {
- for p in $*; do
- local name=$p
- local val=${!name}
- if [ -z "$val" ]; then
- validationError "The ${name} parameter in ${valuesInputFile} is missing, null or empty"
- fi
- done
-}
-
-#
-# Function to validate that a list of input parameters have boolean values.
-# It assumes that validateInputParamsSpecified will also be called for these params.
-#
-function validateBooleanInputParamsSpecified {
- validateInputParamsSpecified $*
- for p in $*; do
- local name=$p
- local val=${!name}
- if ! [ -z $val ]; then
- if [ "true" != "$val" ] && [ "false" != "$val" ]; then
- validationError "The value of $name must be true or false: $val"
- fi
- fi
- done
-}
-
-#
-# Function to validate that a list of input parameters have integer values.
-#
-function validateIntegerInputParamsSpecified {
- validateInputParamsSpecified $*
- for p in $*; do
- local name=$p
- local val=${!name}
- if ! [ -z $val ]; then
- local intVal=""
- printf -v intVal '%d' "$val" 2>/dev/null
- if ! [ "${val}" == "${intVal}" ]; then
- validationError "The value of $name must be an integer: $val"
- fi
- fi
- done
-}
-
-#
-# Function to check if a value is lowercase
-# $1 - name of object being checked
-# $2 - value to check
-function validateLowerCase {
- local lcVal=$(toLower $2)
- if [ "$lcVal" != "$2" ]; then
- validationError "The value of $1 must be lowercase: $2"
- fi
-}
-
-#
-# Function to check if a value is lowercase and legal DNS name
-# $1 - name of object being checked
-# $2 - value to check
-function validateDNS1123LegalName {
- local val=$(toDNS1123Legal $2)
- if [ "$val" != "$2" ]; then
- validationError "The value of $1 contains invalid charaters: $2"
- fi
-}
-
-#
-# Function to validate the namespace
-#
-function validateNamespace {
- validateLowerCase "namespace" ${namespace}
-}
-
-#
-# Function to validate the version of the inputs file
-#
-function validateVersion {
- local requiredVersion=${requiredInputsVersion}
- if [ "${version}" != "${requiredVersion}" ]; then
- validationError "Invalid version: \"${version}\". Must be ${requiredVersion}."
- fi
-}
-
-#
-# Function to ensure the domain uid is a legal DNS name
-#
-function validateDomainUid {
- validateLowerCase "domainUID" ${domainUID}
- validateDNS1123LegalName domainUID ${domainUID}
-}
-
-#
-# Function to ensure the namespace is lowercase
-#
-function validateNamespace {
- validateLowerCase "namespace" ${namespace}
-}
-
-#
-# Create an instance of clusterName to be used in cases where a legal DNS name is required.
-#
-function validateClusterName {
- clusterNameSVC=$(toDNS1123Legal $clusterName)
-}
-
-#
-# Create an instance of adminServerName to be used in cases where a legal DNS name is required.
-#
-function validateAdminServerName {
- adminServerNameSVC=$(toDNS1123Legal $adminServerName)
-}
-
-#
-# Create an instance of adminServerName to be used in cases where a legal DNS name is required.
-#
-function validateManagedServerNameBase {
- managedServerNameBaseSVC=$(toDNS1123Legal $managedServerNameBase)
-}
-
-#
-# Function to validate the secret name
-#
-function validateWeblogicCredentialsSecretName {
- validateLowerCase "weblogicCredentialsSecretName" ${weblogicCredentialsSecretName}
-}
-
-#
-# Function to validate the weblogic image pull policy
-#
-function validateWeblogicImagePullPolicy {
- if [ ! -z ${imagePullPolicy} ]; then
- case ${imagePullPolicy} in
- "IfNotPresent")
- ;;
- "Always")
- ;;
- "Never")
- ;;
- *)
- validationError "Invalid value for imagePullPolicy: ${imagePullPolicy}. Valid values are IfNotPresent, Always, and Never."
- ;;
- esac
- else
- # Set the default
- imagePullPolicy="IfNotPresent"
- fi
- failIfValidationErrors
-}
-
-#
-# Function to validate the fmwDomainType
-#
-function validateFmwDomainType {
- if [ ! -z ${fmwDomainType} ]; then
- case ${fmwDomainType} in
- "JRF")
- ;;
- "RestrictedJRF")
- ;;
- *)
- validationError "Invalid value for fmwDomainType: ${fmwDomainType}. Valid values are JRF or restrictedJRF."
- ;;
- esac
- else
- # Set the default
- fmwDomainType="JRF"
- fi
- failIfValidationErrors
-}
-
-#
-# Function to validate the weblogic image pull secret name
-#
-function validateWeblogicImagePullSecretName {
- if [ ! -z ${imagePullSecretName} ]; then
- validateLowerCase imagePullSecretName ${imagePullSecretName}
- imagePullSecretPrefix=""
- if [ "${generateOnly}" = false ]; then
- validateWeblogicImagePullSecret
- fi
- else
- # Set name blank when not specified, and comment out the yaml
- imagePullSecretName=""
- imagePullSecretPrefix="#"
- fi
-}
-
-#
-# Function to validate the weblogic image pull secret exists
-#
-function validateWeblogicImagePullSecret {
- # The kubernetes secret for pulling images from a container registry is optional.
- # If it was specified, make sure it exists.
- validateSecretExists ${imagePullSecretName} ${namespace}
- failIfValidationErrors
-}
-
-# try to execute kubectl to see whether kubectl is available
-function validateKubectlAvailable {
- if ! [ -x "$(command -v kubectl)" ]; then
- validationError "kubectl is not installed"
- fi
-}
-
-# Function to validate the server start policy value
-#
-function validateServerStartPolicy {
- validateInputParamsSpecified serverStartPolicy
- if [ ! -z "${serverStartPolicy}" ]; then
- case ${serverStartPolicy} in
- "NEVER")
- ;;
- "ALWAYS")
- ;;
- "IF_NEEDED")
- ;;
- "ADMIN_ONLY")
- ;;
- *)
- validationError "Invalid value for serverStartPolicy: ${serverStartPolicy}. Valid values are 'NEVER', 'ALWAYS', 'IF_NEEDED', and 'ADMIN_ONLY'."
- ;;
- esac
- fi
-}
-
-#
-# Function to validate the weblogic domain storage reclaim policy
-#
-function validateWeblogicDomainStorageReclaimPolicy {
- validateInputParamsSpecified weblogicDomainStorageReclaimPolicy
- if [ ! -z "${weblogicDomainStorageReclaimPolicy}" ]; then
- case ${weblogicDomainStorageReclaimPolicy} in
- "Retain")
- ;;
- "Delete")
- if [ "${weblogicDomainStoragePath:0:5}" != "/tmp/" ]; then
- validationError "ERROR - Invalid value for weblogicDomainStorageReclaimPolicy ${weblogicDomainStorageReclaimPolicy} with weblogicDomainStoragePath ${weblogicDomainStoragePath} that is not /tmp/"
- fi
- ;;
- "Recycle")
- ;;
- *)
- validationError "Invalid value for weblogicDomainStorageReclaimPolicy: ${weblogicDomainStorageReclaimPolicy}. Valid values are Retain, Delete and Recycle."
- ;;
- esac
- fi
-}
-
-#
-# Function to validate the weblogic domain storage type
-#
-function validateWeblogicDomainStorageType {
- validateInputParamsSpecified weblogicDomainStorageType
- if [ ! -z "${weblogicDomainStorageType}" ]; then
- case ${weblogicDomainStorageType} in
- "HOST_PATH")
- ;;
- "NFS")
- validateInputParamsSpecified weblogicDomainStorageNFSServer
- ;;
- *)
- validationError "Invalid value for weblogicDomainStorageType: ${weblogicDomainStorageType}. Valid values are HOST_PATH and NFS."
- ;;
- esac
- fi
-}
-
-#
-# Function to validate the load balancer value
-#
-function validateLoadBalancer {
- validateInputParamsSpecified loadBalancer
- if [ ! -z "${loadBalancer}" ]; then
- case ${loadBalancer} in
- "TRAEFIK")
- ;;
- "APACHE")
- ;;
- "VOYAGER")
- ;;
- "NONE")
- ;;
- *)
- validationError "Invalid value for loadBalancer: ${loadBalancer}. Valid values are APACHE, TRAEFIK, VOYAGER and NONE."
- ;;
- esac
- fi
-}
-
-#
-# Function to validate a kubernetes secret exists
-# $1 - the name of the secret
-# $2 - namespace
-function validateSecretExists {
- echo "Checking to see if the secret ${1} exists in namespace ${2}"
- local SECRET=`kubectl get secret ${1} -n ${2} | grep ${1} | wc | awk ' { print $1; }'`
- if [ "${SECRET}" != "1" ]; then
- validationError "The secret ${1} was not found in namespace ${2}"
- fi
-}
-
-#
-# Function to validate the domain secret
-#
-function validateDomainSecret {
- # Verify the secret exists
- validateSecretExists ${weblogicCredentialsSecretName} ${namespace}
- failIfValidationErrors
-
- # Verify the secret contains a username
- SECRET=`kubectl get secret ${weblogicCredentialsSecretName} -n ${namespace} -o jsonpath='{.data}' | tr -d '"' | grep username: | wc | awk ' { print $1; }'`
- if [ "${SECRET}" != "1" ]; then
- validationError "The domain secret ${weblogicCredentialsSecretName} in namespace ${namespace} does contain a username"
- fi
-
- # Verify the secret contains a password
- SECRET=`kubectl get secret ${weblogicCredentialsSecretName} -n ${namespace} -o jsonpath='{.data}' | tr -d '"'| grep password: | wc | awk ' { print $1; }'`
- if [ "${SECRET}" != "1" ]; then
- validationError "The domain secret ${weblogicCredentialsSecretName} in namespace ${namespace} does contain a password"
- fi
- failIfValidationErrors
-}
-
-#
-# function to validate if we will be using wdt or wlst to create the domain
-#
-function validateDomainFilesDir {
- useWdt=true
- if [ -z "${createDomainFilesDir}" ] || [ "${createDomainFilesDir}" == "wlst" ]; then
- useWdt=false
- fi
-}
-
-#
-# Function to validate the common input parameters
-#
-function validateCommonInputs {
- sample_name=${1:-"other"}
-
- # Parse the common inputs file
- parseCommonInputs
-
- validateInputParamsSpecified \
- adminServerName \
- domainUID \
- clusterName \
- managedServerNameBase \
- namespace \
- includeServerOutInPodLog \
- version
-
- validateIntegerInputParamsSpecified \
- adminPort \
- initialManagedServerReplicas \
- managedServerPort \
- t3ChannelPort \
- adminNodePort
-
- if [ ! "${sample_name}" == "fmw-domain-home-in-image" ]; then
- validateIntegerInputParamsSpecified configuredManagedServerCount
- fi
-
- validateBooleanInputParamsSpecified \
- productionModeEnabled \
- exposeAdminT3Channel \
- exposeAdminNodePort \
- includeServerOutInPodLog
-
- export requiredInputsVersion="create-weblogic-sample-domain-inputs-v1"
- validateVersion
-
- validateDomainUid
- validateNamespace
- validateAdminServerName
- validateManagedServerNameBase
- validateClusterName
- validateWeblogicCredentialsSecretName
- validateServerStartPolicy
- validateWeblogicImagePullPolicy
- validateWeblogicImagePullSecretName
- validateFmwDomainType
- validateDomainFilesDir
- # Below three validate methods are used for MII integration testing
- validateWdtDomainType
- validateWdtModelFile
- validateWdtModelPropertiesFile
-
- failIfValidationErrors
-}
-
-#
-# Function to validate the domain's persistent volume claim has been created
-#
-function validateDomainPVC {
- # Check if the persistent volume claim is already available
- checkPvcExists ${persistentVolumeClaimName} ${namespace}
- if [ "${PVC_EXISTS}" = "false" ]; then
- validationError "The domain persistent volume claim ${persistentVolumeClaimName} does not exist in namespace ${namespace}"
- fi
- failIfValidationErrors
-}
-
-#
-# Function to validate the WDT model file exists
-# used for MII integration testing
-#
-function validateWdtModelFile {
- # Check if the model file exists
- if [ ! -z $wdtModelFile ]; then
- if [ ! -f $wdtModelFile ]; then
- validationError "The WDT model file ${wdtModelFile} does not exist"
- fi
- fi
- failIfValidationErrors
-}
-
-#
-# Function to validate the WDT model property file exists
-# used for MII integration testing
-#
-function validateWdtModelPropertiesFile {
- # Check if the model property file exists
- if [ ! -z $wdtModelPropertiesFile ]; then
- if [ ! -f $wdtModelPropertiesFile ]; then
- validationError "The WDT model property file ${wdtModelPropertiesFile} does not exist"
- fi
- fi
- failIfValidationErrors
-}
-
-# Function to validate the wdtDomainType
-# used for MII integration testing
-function validateWdtDomainType {
- if [ ! -z ${wdtDomainType} ]; then
- case ${wdtDomainType} in
- "WLS")
- ;;
- "JRF")
- ;;
- "RestrictedJRF")
- ;;
- *)
- validationError "Invalid value for wdtDomainType: ${wdtDomainType}. Valid values are WLS or JRF or restrictedJRF."
- ;;
- esac
- else
- # Set the default
- wdtDomainType="WLS"
- fi
- failIfValidationErrors
-}
-
+#!/usr/bin/env bash
+# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+#
+# Description
+# Common validation functions shared by all other scripts that process inputs properties.
+#
+
+#
+# Function to note that a validate error has occurred
+#
+function validationError {
+ printError $*
+ validateErrors=true
+}
+
+#
+# Function to cause the script to fail if there were any validation errors
+#
+function failIfValidationErrors {
+ if [ "$validateErrors" = true ]; then
+ fail 'The errors listed above must be resolved before the script can continue'
+ fi
+}
+
+#
+# Function to validate that a list of required input parameters were specified
+#
+function validateInputParamsSpecified {
+ for p in $*; do
+ local name=$p
+ local val=${!name}
+ if [ -z "$val" ]; then
+ validationError "The ${name} parameter in ${valuesInputFile} is missing, null or empty"
+ fi
+ done
+}
+
+#
+# Function to validate that a list of input parameters have boolean values.
+# It assumes that validateInputParamsSpecified will also be called for these params.
+#
+function validateBooleanInputParamsSpecified {
+ validateInputParamsSpecified $*
+ for p in $*; do
+ local name=$p
+ local val=${!name}
+ if ! [ -z $val ]; then
+ if [ "true" != "$val" ] && [ "false" != "$val" ]; then
+ validationError "The value of $name must be true or false: $val"
+ fi
+ fi
+ done
+}
+
+#
+# Function to validate that a list of input parameters have integer values.
+#
+function validateIntegerInputParamsSpecified {
+ validateInputParamsSpecified $*
+ for p in $*; do
+ local name=$p
+ local val=${!name}
+ if ! [ -z $val ]; then
+ local intVal=""
+ printf -v intVal '%d' "$val" 2>/dev/null
+ if ! [ "${val}" == "${intVal}" ]; then
+ validationError "The value of $name must be an integer: $val"
+ fi
+ fi
+ done
+}
+
+#
+# Function to check if a value is lowercase
+# $1 - name of object being checked
+# $2 - value to check
+function validateLowerCase {
+ local lcVal=$(toLower $2)
+ if [ "$lcVal" != "$2" ]; then
+ validationError "The value of $1 must be lowercase: $2"
+ fi
+}
+
+#
+# Function to check if a value is lowercase and legal DNS name
+# $1 - name of object being checked
+# $2 - value to check
+function validateDNS1123LegalName {
+ local val=$(toDNS1123Legal $2)
+ if [ "$val" != "$2" ]; then
+ validationError "The value of $1 contains invalid charaters: $2"
+ fi
+}
+
+#
+# Function to validate the namespace
+#
+function validateNamespace {
+ validateLowerCase "namespace" ${namespace}
+}
+
+#
+# Function to validate the version of the inputs file
+#
+function validateVersion {
+ local requiredVersion=${requiredInputsVersion}
+ if [ "${version}" != "${requiredVersion}" ]; then
+ validationError "Invalid version: \"${version}\". Must be ${requiredVersion}."
+ fi
+}
+
+#
+# Function to ensure the domain uid is a legal DNS name
+#
+function validateDomainUid {
+ validateLowerCase "domainUID" ${domainUID}
+ validateDNS1123LegalName domainUID ${domainUID}
+}
+
+#
+# Function to ensure the namespace is lowercase
+#
+function validateNamespace {
+ validateLowerCase "namespace" ${namespace}
+}
+
+#
+# Create an instance of clusterName to be used in cases where a legal DNS name is required.
+#
+function validateClusterName {
+ clusterNameSVC=$(toDNS1123Legal $clusterName)
+}
+
+#
+# Create an instance of adminServerName to be used in cases where a legal DNS name is required.
+#
+function validateAdminServerName {
+ adminServerNameSVC=$(toDNS1123Legal $adminServerName)
+}
+
+#
+# Create an instance of adminServerName to be used in cases where a legal DNS name is required.
+#
+function validateManagedServerNameBase {
+ managedServerNameBaseSVC=$(toDNS1123Legal $managedServerNameBase)
+}
+
+#
+# Function to validate the secret name
+#
+function validateWeblogicCredentialsSecretName {
+ validateLowerCase "weblogicCredentialsSecretName" ${weblogicCredentialsSecretName}
+}
+
+#
+# Function to validate the weblogic image pull policy
+#
+function validateWeblogicImagePullPolicy {
+ if [ ! -z ${imagePullPolicy} ]; then
+ case ${imagePullPolicy} in
+ "IfNotPresent")
+ ;;
+ "Always")
+ ;;
+ "Never")
+ ;;
+ *)
+ validationError "Invalid value for imagePullPolicy: ${imagePullPolicy}. Valid values are IfNotPresent, Always, and Never."
+ ;;
+ esac
+ else
+ # Set the default
+ imagePullPolicy="IfNotPresent"
+ fi
+ failIfValidationErrors
+}
+
+#
+# Function to validate the fmwDomainType
+#
+function validateFmwDomainType {
+ if [ ! -z ${fmwDomainType} ]; then
+ case ${fmwDomainType} in
+ "JRF")
+ ;;
+ "RestrictedJRF")
+ ;;
+ *)
+ validationError "Invalid value for fmwDomainType: ${fmwDomainType}. Valid values are JRF or restrictedJRF."
+ ;;
+ esac
+ else
+ # Set the default
+ fmwDomainType="JRF"
+ fi
+ failIfValidationErrors
+}
+
+#
+# Function to validate the weblogic image pull secret name
+#
+function validateWeblogicImagePullSecretName {
+ if [ ! -z ${imagePullSecretName} ]; then
+ validateLowerCase imagePullSecretName ${imagePullSecretName}
+ imagePullSecretPrefix=""
+ if [ "${generateOnly}" = false ]; then
+ validateWeblogicImagePullSecret
+ fi
+ else
+ # Set name blank when not specified, and comment out the yaml
+ imagePullSecretName=""
+ imagePullSecretPrefix="#"
+ fi
+}
+
+#
+# Function to validate the weblogic image pull secret exists
+#
+function validateWeblogicImagePullSecret {
+ # The kubernetes secret for pulling images from a container registry is optional.
+ # If it was specified, make sure it exists.
+ validateSecretExists ${imagePullSecretName} ${namespace}
+ failIfValidationErrors
+}
+
+# try to execute kubectl to see whether kubectl is available
+function validateKubectlAvailable {
+ if ! [ -x "$(command -v kubectl)" ]; then
+ validationError "kubectl is not installed"
+ fi
+}
+
+# Function to validate the server start policy value
+#
+function validateServerStartPolicy {
+ validateInputParamsSpecified serverStartPolicy
+ if [ ! -z "${serverStartPolicy}" ]; then
+ case ${serverStartPolicy} in
+ "NEVER")
+ ;;
+ "ALWAYS")
+ ;;
+ "IF_NEEDED")
+ ;;
+ "ADMIN_ONLY")
+ ;;
+ *)
+ validationError "Invalid value for serverStartPolicy: ${serverStartPolicy}. Valid values are 'NEVER', 'ALWAYS', 'IF_NEEDED', and 'ADMIN_ONLY'."
+ ;;
+ esac
+ fi
+}
+
+#
+# Function to validate the weblogic domain storage reclaim policy
+#
+function validateWeblogicDomainStorageReclaimPolicy {
+ validateInputParamsSpecified weblogicDomainStorageReclaimPolicy
+ if [ ! -z "${weblogicDomainStorageReclaimPolicy}" ]; then
+ case ${weblogicDomainStorageReclaimPolicy} in
+ "Retain")
+ ;;
+ "Delete")
+ if [ "${weblogicDomainStoragePath:0:5}" != "/tmp/" ]; then
+ validationError "ERROR - Invalid value for weblogicDomainStorageReclaimPolicy ${weblogicDomainStorageReclaimPolicy} with weblogicDomainStoragePath ${weblogicDomainStoragePath} that is not /tmp/"
+ fi
+ ;;
+ "Recycle")
+ ;;
+ *)
+ validationError "Invalid value for weblogicDomainStorageReclaimPolicy: ${weblogicDomainStorageReclaimPolicy}. Valid values are Retain, Delete and Recycle."
+ ;;
+ esac
+ fi
+}
+
+#
+# Function to validate the weblogic domain storage type
+#
+function validateWeblogicDomainStorageType {
+ validateInputParamsSpecified weblogicDomainStorageType
+ if [ ! -z "${weblogicDomainStorageType}" ]; then
+ case ${weblogicDomainStorageType} in
+ "HOST_PATH")
+ ;;
+ "NFS")
+ validateInputParamsSpecified weblogicDomainStorageNFSServer
+ ;;
+ *)
+ validationError "Invalid value for weblogicDomainStorageType: ${weblogicDomainStorageType}. Valid values are HOST_PATH and NFS."
+ ;;
+ esac
+ fi
+}
+
+#
+# Function to validate the load balancer value
+#
+function validateLoadBalancer {
+ validateInputParamsSpecified loadBalancer
+ if [ ! -z "${loadBalancer}" ]; then
+ case ${loadBalancer} in
+ "TRAEFIK")
+ ;;
+ "APACHE")
+ ;;
+ "VOYAGER")
+ ;;
+ "NONE")
+ ;;
+ *)
+ validationError "Invalid value for loadBalancer: ${loadBalancer}. Valid values are APACHE, TRAEFIK, VOYAGER and NONE."
+ ;;
+ esac
+ fi
+}
+
+#
+# Function to validate a kubernetes secret exists
+# $1 - the name of the secret
+# $2 - namespace
+function validateSecretExists {
+ echo "Checking to see if the secret ${1} exists in namespace ${2}"
+ local SECRET=`kubectl get secret ${1} -n ${2} | grep ${1} | wc | awk ' { print $1; }'`
+ if [ "${SECRET}" != "1" ]; then
+ validationError "The secret ${1} was not found in namespace ${2}"
+ fi
+}
+
+#
+# Function to validate the domain secret
+#
+function validateDomainSecret {
+ # Verify the secret exists
+ validateSecretExists ${weblogicCredentialsSecretName} ${namespace}
+ failIfValidationErrors
+
+ # Verify the secret contains a username
+ SECRET=`kubectl get secret ${weblogicCredentialsSecretName} -n ${namespace} -o jsonpath='{.data}' | tr -d '"' | grep username: | wc | awk ' { print $1; }'`
+ if [ "${SECRET}" != "1" ]; then
+ validationError "The domain secret ${weblogicCredentialsSecretName} in namespace ${namespace} does contain a username"
+ fi
+
+ # Verify the secret contains a password
+ SECRET=`kubectl get secret ${weblogicCredentialsSecretName} -n ${namespace} -o jsonpath='{.data}' | tr -d '"'| grep password: | wc | awk ' { print $1; }'`
+ if [ "${SECRET}" != "1" ]; then
+ validationError "The domain secret ${weblogicCredentialsSecretName} in namespace ${namespace} does contain a password"
+ fi
+ failIfValidationErrors
+}
+
+#
+# function to validate if we will be using wdt or wlst to create the domain
+#
+function validateDomainFilesDir {
+ useWdt=true
+ if [ -z "${createDomainFilesDir}" ] || [ "${createDomainFilesDir}" == "wlst" ]; then
+ useWdt=false
+ fi
+}
+
+#
+# Function to validate the common input parameters
+#
+function validateCommonInputs {
+ sample_name=${1:-"other"}
+
+ # Parse the common inputs file
+ parseCommonInputs
+
+ validateInputParamsSpecified \
+ adminServerName \
+ domainUID \
+ clusterName \
+ managedServerNameBase \
+ namespace \
+ includeServerOutInPodLog \
+ version
+
+ validateIntegerInputParamsSpecified \
+ adminPort \
+ initialManagedServerReplicas \
+ managedServerPort \
+ t3ChannelPort \
+ adminNodePort
+
+ if [ ! "${sample_name}" == "fmw-domain-home-in-image" ]; then
+ validateIntegerInputParamsSpecified configuredManagedServerCount
+ fi
+
+ validateBooleanInputParamsSpecified \
+ productionModeEnabled \
+ exposeAdminT3Channel \
+ exposeAdminNodePort \
+ includeServerOutInPodLog
+
+ export requiredInputsVersion="create-weblogic-sample-domain-inputs-v1"
+ validateVersion
+
+ validateDomainUid
+ validateNamespace
+ validateAdminServerName
+ validateManagedServerNameBase
+ validateClusterName
+ validateWeblogicCredentialsSecretName
+ validateServerStartPolicy
+ validateWeblogicImagePullPolicy
+ validateWeblogicImagePullSecretName
+ validateFmwDomainType
+ validateDomainFilesDir
+ # Below three validate methods are used for MII integration testing
+ validateWdtDomainType
+ validateWdtModelFile
+ validateWdtModelPropertiesFile
+
+ failIfValidationErrors
+}
+
+#
+# Function to validate the domain's persistent volume claim has been created
+#
+function validateDomainPVC {
+ # Check if the persistent volume claim is already available
+ checkPvcExists ${persistentVolumeClaimName} ${namespace}
+ if [ "${PVC_EXISTS}" = "false" ]; then
+ validationError "The domain persistent volume claim ${persistentVolumeClaimName} does not exist in namespace ${namespace}"
+ fi
+ failIfValidationErrors
+}
+
+#
+# Function to validate the WDT model file exists
+# used for MII integration testing
+#
+function validateWdtModelFile {
+ # Check if the model file exists
+ if [ ! -z $wdtModelFile ]; then
+ if [ ! -f $wdtModelFile ]; then
+ validationError "The WDT model file ${wdtModelFile} does not exist"
+ fi
+ fi
+ failIfValidationErrors
+}
+
+#
+# Function to validate the WDT model property file exists
+# used for MII integration testing
+#
+function validateWdtModelPropertiesFile {
+ # Check if the model property file exists
+ if [ ! -z $wdtModelPropertiesFile ]; then
+ if [ ! -f $wdtModelPropertiesFile ]; then
+ validationError "The WDT model property file ${wdtModelPropertiesFile} does not exist"
+ fi
+ fi
+ failIfValidationErrors
+}
+
+# Function to validate the wdtDomainType
+# used for MII integration testing
+function validateWdtDomainType {
+ if [ ! -z ${wdtDomainType} ]; then
+ case ${wdtDomainType} in
+ "WLS")
+ ;;
+ "JRF")
+ ;;
+ "RestrictedJRF")
+ ;;
+ *)
+ validationError "Invalid value for wdtDomainType: ${wdtDomainType}. Valid values are WLS or JRF or restrictedJRF."
+ ;;
+ esac
+ else
+ # Set the default
+ wdtDomainType="WLS"
+ fi
+ failIfValidationErrors
+}
+
diff --git a/OracleWebCenterPortal/kubernetes/common/wdt-and-wit-utility.sh b/OracleWebCenterPortal/kubernetes/common/wdt-and-wit-utility.sh
old mode 100644
new mode 100755
index aa9cc691c..fd5046d54
--- a/OracleWebCenterPortal/kubernetes/common/wdt-and-wit-utility.sh
+++ b/OracleWebCenterPortal/kubernetes/common/wdt-and-wit-utility.sh
@@ -1,439 +1,439 @@
-#!/bin/bash
-# Copyright (c) 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-#
-# Description:
-#
-# This script contains functions for installing WebLogic Deploy Tool (WDT) and
-# WebLogic Image Tool (WIT), and for running WDT.
-#
-#
-# Usage:
-#
-# Export customized values for the input shell environment variables as needed
-# before calling this script.
-#
-# Outputs:
-#
-# WDT install: WDT_DIR/weblogic-deploy/...
-#
-# Copy of wdt model: WDT_DIR/$(basename WDT_MODEL_FILE)
-# Copy of wdt vars: WDT_DIR/$(basename WDT_VAR_FILE)
-#
-# WDT logs: WDT_DIR/weblogic-deploy/logs/...
-# WDT stdout: WDT_DIR/createDomain.sh.out
-#
-# WebLogic domain home: DOMAIN_HOME_DIR
-# default: /shared/domains/
-#
-# Input environment variables:
-#
-# ORACLE_HOME Oracle home with a WebLogic install.
-# default: /u01/oracle
-#
-# DOMAIN_HOME_DIR Target location for generated domain.
-#
-# WDT_MODEL_FILE Full path to WDT model file.
-# default: the directory that contains this script
-# plus "/wdt_model.yaml"
-#
-# WDT_VAR_FILE Full path to WDT variable file (java properties format).
-# default: the directory that contains this script
-# plus "/create-domain-inputs.yaml"
-#
-# WDT_DIR Target location to install and run WDT, and to keep a copy of
-# $WDT_MODEL_FILE and $WDT_MODEL_VARS. Also the location
-# of WDT log files.
-# default: /shared/wdt
-#
-# WDT_VERSION WDT version to download.
-# default: LATEST
-#
-# WDT_INSTALL_ZIP_FILE Filename of WDT install zip.
-# default: weblogic-deploy.zip
-#
-# WDT_INSTALL_ZIP_URL URL for downloading WDT install zip
-# default: https://github.com/oracle/weblogic-deploy-tooling/releases/latest/download/$WDT_INSTALL_ZIP_FILE
-#
-# WIT_DIR Target location to install WIT
-# default: /shared/imagetool
-#
-# WIT_VERSION WIT version to download.
-# default: LATEST
-#
-# WIT_INSTALL_ZIP_FILE Filename of WIT install zip.
-# default: imagetool.zip
-#
-# WIT_INSTALL_ZIP_URL URL for downloading WIT install zip
-# default: https://github.com/oracle/weblogic-image-tool/releases/latest/download/$WIT_INSTALL_ZIP_FILE
-#
-
-
-# Initialize globals
-
-export ORACLE_HOME=${ORACLE_HOME:-/u01/oracle}
-
-SCRIPTPATH="$( cd "$(dirname "$0")" > /dev/null 2>&1 ; pwd -P )"
-WDT_MODEL_FILE=${WDT_MODEL_FILE:-"$SCRIPTPATH/wdt_model.yaml"}
-WDT_VAR_FILE=${WDT_VAR_FILE:-"$SCRIPTPATH/create-domain-inputs.yaml"}
-
-WDT_DIR=${WDT_DIR:-/shared/wdt}
-WDT_VERSION=${WDT_VERSION:-LATEST}
-
-WIT_DIR=${WIT_DIR:-/shared/imagetool}
-WIT_VERSION=${WIT_VERSION:-LATEST}
-
-DOMAIN_TYPE="${DOMAIN_TYPE:-WLS}"
-
-function download {
- local fileUrl="${1}"
-
- local curl_res=1
- max=20
- count=0
- while [ $curl_res -ne 0 -a $count -lt $max ] ; do
- sleep 1
- count=`expr $count + 1`
- for proxy in "${https_proxy}" "${https_proxy2}"; do
- echo @@ "Info: Downloading $fileUrl with https_proxy=\"$proxy\""
- https_proxy="${proxy}" \
- curl --silent --show-error --connect-timeout 10 -O -L $fileUrl
- curl_res=$?
- [ $curl_res -eq 0 ] && break
- done
- done
- if [ $curl_res -ne 0 ]; then
- echo @@ "Error: Download failed."
- return 1
- fi
-}
-
-function run_wdt {
- #
- # Run WDT using WDT_VAR_FILE, WDT_MODEL_FILE, and ORACLE_HOME.
- # Output:
- # - result domain will be in DOMAIN_HOME_DIR
- # - logging output is in $WDT_DIR/createDomain.sh.out and $WDT_DIR/weblogic-deploy/logs
- # - WDT_VAR_FILE & WDT_MODEL_FILE will be copied to WDT_DIR.
- #
-
- local action="${1}"
-
- # Input files and directories.
-
- local inputs_orig="$WDT_VAR_FILE"
- local model_orig="$WDT_MODEL_FILE"
- local oracle_home="$ORACLE_HOME"
- local domain_type="$DOMAIN_TYPE"
- local wdt_bin_dir="$WDT_DIR/weblogic-deploy/bin"
- local wdt_createDomain_script="$wdt_bin_dir/createDomain.sh"
-
- if [ ${action} = "create" ]; then
- local wdt_domain_script="$wdt_bin_dir/createDomain.sh"
- else
- local wdt_domain_script="$wdt_bin_dir/updateDomain.sh"
- fi
-
- local domain_home_dir="$DOMAIN_HOME_DIR"
- if [ -z "${domain_home_dir}" ]; then
- local domain_dir="/shared/domains"
- local domain_uid=`egrep 'domainUID' $inputs_orig | awk '{print $2}'`
- local domain_home_dir=$domain_dir/$domain_uid
- fi
-
- mkdir -p $domain_home_dir
-
- # Output files and directories.
-
- local inputs_final=$WDT_DIR/$(basename "$inputs_orig")
- local model_final=$WDT_DIR/$(basename "$model_orig")
- if [ ${action} = "create" ]; then
- local out_file=$WDT_DIR/createDomain.sh.out
- else
- local out_file=$WDT_DIR/updateDomain.sh.out
- fi
- local wdt_log_dir="$WDT_DIR/weblogic-deploy/logs"
-
- echo @@ "Info: About to run WDT ${wdt_domain_script}"
-
- for directory in wdt_bin_dir SCRIPTPATH WDT_DIR oracle_home; do
- if [ ! -d "${!directory}" ]; then
- echo @@ "Error: Could not find ${directory} directory ${!directory}."
- return 1
- fi
- done
-
- for fil in inputs_orig model_orig wdt_createDomain_script; do
- if [ ! -f "${!fil}" ]; then
- echo @@ "Error: Could not find ${fil} file ${!fil}."
- return 1
- fi
- done
-
- cp $model_orig $model_final || return 1
- cp $inputs_orig $inputs_final || return 1
-
- local save_dir=`pwd`
- cd $WDT_DIR || return 1
-
- cmd="
- $wdt_domain_script
- -oracle_home $oracle_home
- -domain_type $domain_type
- -domain_home $domain_home_dir
- -model_file $model_final
- -variable_file $inputs_final
- "
-
- echo @@ "Info: About to run the following WDT command:"
- echo "${cmd}"
- echo @@ "Info: WDT output will be in $out_file and $wdt_log_dir"
- eval $cmd > $out_file 2>&1
- local wdt_res=$?
-
- cd $save_dir
-
- if [ $wdt_res -ne 0 ]; then
- if [ ${action} = "create" ]; then
- cat $WDT_DIR/createDomain.sh.out
- echo @@ "Info: WDT createDomain.sh output is in $out_file and $wdt_log_dir"
- echo @@ "Error: WDT createDomain.sh failed."
- return 1
- else
- cat $WDT_DIR/updateDomain.sh.out
- echo @@ "Info: WDT updateDomain.sh output is in $out_file and $wdt_log_dir"
- echo @@ "Error: WDT updateDomain.sh failed."
- return 1
- fi
- fi
-
- cd $WDT_DIR || return 1
-
- cmd="
- $wdt_bin_dir/extractDomainResource.sh
- -oracle_home $oracle_home
- -domain_resource_file domain${action}.yaml
- -domain_home $domain_home_dir
- -model_file $model_final
- -variable_file $inputs_final
- "
- echo @@ "Info: About to run the following WDT command:"
- echo "${cmd}"
- echo @@ "Info: WDT output will be in extract${action}.out and $wdt_log_dir"
- eval $cmd > extract${action}.out 2>&1
- local wdt_res=$?
-
- cd $save_dir
-
- if [ $wdt_res -ne 0 ]; then
- cat $WDT_DIR/extract${action}.out
- echo @@ "Info: WDT extractDomainResource output is in extract${action}.out and $wdt_log_dir"
- echo @@ "Error: WDT createDomain.sh failed."
- return 1
- fi
-
- if [ ${action} = "create" ]; then
- # chmod -R g+w $domain_home_dir || return 1
- echo @@ "Info: WDT createDomain.sh succeeded."
- else
- echo @@ "Info: WDT updateDomain.sh succeeded."
- fi
-
- return 0
-}
-
-function setup_wdt_shared_dir {
- mkdir -p $WDT_DIR || return 1
-}
-
-#
-# Install Weblogic Server Deploy Tooling to ${WDT_DIR}
-#
-function install_wdt {
-
- WDT_INSTALL_ZIP_FILE="${WDT_INSTALL_ZIP_FILE:-weblogic-deploy.zip}"
-
- if [ "$WDT_VERSION" == "LATEST" ]; then
- WDT_INSTALL_ZIP_URL=${WDT_INSTALL_ZIP_URL:-"https://github.com/oracle/weblogic-deploy-tooling/releases/latest/download/$WDT_INSTALL_ZIP_FILE"}
- else
- WDT_INSTALL_ZIP_URL=${WDT_INSTALL_ZIP_URL:-"https://github.com/oracle/weblogic-deploy-tooling/releases/download/release-$WDT_VERSION/$WDT_INSTALL_ZIP_FILE"}
- fi
-
- local save_dir=`pwd`
- cd $WDT_DIR || return 1
-
- echo @@ "Info: Downloading $WDT_INSTALL_ZIP_URL "
- download $WDT_INSTALL_ZIP_URL || return 1
-
- if [ ! -f $WDT_INSTALL_ZIP_FILE ]; then
- cd $save_dir
- echo @@ "Error: Download failed or $WDT_INSTALL_ZIP_FILE not found."
- return 1
- fi
-
- echo @@ "Info: Archive downloaded to $WDT_DIR/$WDT_INSTALL_ZIP_FILE, about to unzip via 'jar xf'."
-
- jar xf $WDT_INSTALL_ZIP_FILE
- local jar_res=$?
-
- cd $save_dir
-
- if [ $jar_res -ne 0 ]; then
- echo @@ "Error: Install failed while unzipping $WDT_DIR/$WDT_INSTALL_ZIP_FILE"
- return $jar_res
- fi
-
- if [ ! -d "$WDT_DIR/weblogic-deploy/bin" ]; then
- echo @@ "Error: Install failed: directory '$WDT_DIR/weblogic-deploy/bin' not found."
- return 1
- fi
-
- chmod 775 $WDT_DIR/weblogic-deploy/bin/* || return 1
-
- echo @@ "Info: Install succeeded, wdt install is in the $WDT_DIR/weblogic-deploy directory."
- return 0
-}
-
-#
-# Install WebLogic Image Tool to ${WIT_DIR}. Used by install_wit_if_needed.
-# Do not call this function directory.
-#
-function install_wit {
-
- WIT_INSTALL_ZIP_FILE="${WIT_INSTALL_ZIP_FILE:-imagetool.zip}"
-
- if [ "$WIT_VERSION" == "LATEST" ]; then
- WIT_INSTALL_ZIP_URL=${WDT_INSTALL_ZIP_URL:-"https://github.com/oracle/weblogic-image-tool/releases/latest/download/$WIT_INSTALL_ZIP_FILE"}
- else
- WIT_INSTALL_ZIP_URL=${WIT_INSTALL_ZIP_URL:-"https://github.com/oracle/weblogic-image-tool/releases/download/release-$WIT_VERSION/$WIT_INSTALL_ZIP_FILE"}
- fi
-
-
-
- local save_dir=`pwd`
-
- echo @@ "imagetool.sh not found in ${imagetoolBinDir}. Installing imagetool..."
-
- echo @@ "Info: Downloading $WIT_INSTALL_ZIP_URL "
- download $WIT_INSTALL_ZIP_URL || return 1
-
- if [ ! -f $WIT_INSTALL_ZIP_FILE ]; then
- cd $save_dir
- echo @@ "Error: Download failed or $WIT_INSTALL_ZIP_FILE not found."
- return 1
- fi
- echo @@ "Info: Archive downloaded to $WIT_DIR/$WIT_INSTALL_ZIP_FILE, about to unzip via 'jar xf'."
-
- jar xf $WIT_INSTALL_ZIP_FILE
- local jar_res=$?
-
- cd $save_dir
-
- if [ $jar_res -ne 0 ]; then
- echo @@ "Error: Install failed while unzipping $WIT_DIR/$WIT_INSTALL_ZIP_FILE"
- return $jar_res
- fi
-
- if [ ! -d "$WIT_DIR/imagetool/bin" ]; then
- echo @@ "Error: Install failed: directory '$WIT_DIR/imagetool/bin' not found."
- return 1
- fi
-
- chmod 775 $WIT_DIR/imagetool/bin/* || return 1
-}
-
-#
-# Checks whether WebLogic Image Tool is already installed under ${WIT_DIR}, and install
-# it if not.
-#
-function install_wit_if_needed {
-
- local save_dir=`pwd`
-
- mkdir -p $WIT_DIR || return 1
- cd $WIT_DIR || return 1
-
- imagetoolBinDir=$WIT_DIR/imagetool/bin
- if [ -f $imagetoolBinDir/imagetool.sh ]; then
- echo @@ "Info: imagetool.sh already exist in ${imagetoolBinDir}. Skipping WIT installation."
- else
- install_wit
- fi
-
- export WLSIMG_CACHEDIR="$WIT_DIR/imagetool-cache"
-
- # Check existing imageTool cache entry for WDT:
- # - if there is already an entry, and the WDT installer file specified in the cache entry exists, skip WDT installation
- # - if file in cache entry doesn't exist, delete cache entry, install WDT, and add WDT installer to cache
- # - if entry does not exist, install WDT, and add WDT installer to cache
- if [ "$WDT_VERSION" == "LATEST" ]; then
- wdtCacheVersion="latest"
- else
- wdtCacheVersion=$WDT_VERSION
- fi
-
- local listItems=$( ${imagetoolBinDir}/imagetool.sh cache listItems | grep "wdt_${wdtCacheVersion}" )
-
- if [ ! -z "$listItems" ]; then
- local wdt_file_path_in_cache=$(echo $listItems | sed 's/.*=\(.*\)/\1/')
- if [ -f "$wdt_file_path_in_cache" ]; then
- skip_wdt_install=true
- else
- echo @@ "Info: imageTool cache contains an entry for WDT zip at $wdt_file_path_in_cache which does not exist. Removing from cache entry."
- ${imagetoolBinDir}/imagetool.sh cache deleteEntry \
- --key wdt_${wdtCacheVersion}
- fi
- fi
-
- if [ -z "$skip_wdt_install" ]; then
- echo @@ "Info: imageTool cache does not contain a valid entry for wdt_${wdtCacheVersion}. Installing WDT"
- setup_wdt_shared_dir || return 1
- install_wdt || return 1
- ${imagetoolBinDir}/imagetool.sh cache addInstaller \
- --type wdt \
- --version $WDT_VERSION \
- --path $WDT_DIR/$WDT_INSTALL_ZIP_FILE || return 1
- else
- echo @@ "Info: imageTool cache already contains entry ${listItems}. Skipping WDT installation."
- fi
-
- cd $save_dir
-
- echo @@ "Info: Install succeeded, imagetool install is in the $WIT_DIR/imagetool directory."
- return 0
-}
-
-function encrypt_model {
- #
- # run encryptModel.sh from WDT to encrypt model and properties files
- #
- local domainOutputDirFullPath=${1} # full path to directory where the model, encrypt file, and domain properties files are
- local model_file=${2} # path to file containing encryption key relative to ${domainOutputDirFullPath}
- local encrypt_key_file=${3} # path to file containing encryption key relative to ${domainOutputDirFullPath}
- local domain_properties_file=${4} # path to domain properties file relative to ${domainOutputDirFullPath}
- local oracle_home="$ORACLE_HOME"
-
- echo @@ "Info: encrypt passwords in the variables file at ${domainOutputDirFullPath}/${domain_properties_file} using encryption key from create-domain.sh argument written to file: ${encrypt_key_file}"
-
- cmd="
- cat /shared/${encrypt_key_file} /shared/${encrypt_key_file} |
- /wdt/bin/encryptModel.sh \
- -oracle_home ${oracle_home} \
- -model_file /shared/${model_file} \
- -variable_file /shared/${domain_properties_file}
- "
- echo $cmd > ${domainOutputDirFullPath}/cmd.sh
- chmod 755 ${domainOutputDirFullPath}/cmd.sh
- echo @@ "Info: Encrypt Model: About to run the following command in container with image ${domainHomeImageBase}:"
- cat ${domainOutputDirFullPath}/cmd.sh
-
- chmod 766 ${domainOutputDirFullPath}/${domain_properties_file}
- docker run -it --rm -v ${domainOutputDirFullPath}:/shared -v ${WDT_DIR}/weblogic-deploy:/wdt ${domainHomeImageBase} /bin/bash -c /shared/cmd.sh || return 1
-
- # clean up the generated files
- rm ${domainOutputDirFullPath}/cmd.sh
-
- echo @@ "Info: encrypt_model Completed"
-}
-
-
+#!/bin/bash
+# Copyright (c) 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+#
+# Description:
+#
+# This script contains functions for installing WebLogic Deploy Tool (WDT) and
+# WebLogic Image Tool (WIT), and for running WDT.
+#
+#
+# Usage:
+#
+# Export customized values for the input shell environment variables as needed
+# before calling this script.
+#
+# Outputs:
+#
+# WDT install: WDT_DIR/weblogic-deploy/...
+#
+# Copy of wdt model: WDT_DIR/$(basename WDT_MODEL_FILE)
+# Copy of wdt vars: WDT_DIR/$(basename WDT_VAR_FILE)
+#
+# WDT logs: WDT_DIR/weblogic-deploy/logs/...
+# WDT stdout: WDT_DIR/createDomain.sh.out
+#
+# WebLogic domain home: DOMAIN_HOME_DIR
+# default: /shared/domains/
+#
+# Input environment variables:
+#
+# ORACLE_HOME Oracle home with a WebLogic install.
+# default: /u01/oracle
+#
+# DOMAIN_HOME_DIR Target location for generated domain.
+#
+# WDT_MODEL_FILE Full path to WDT model file.
+# default: the directory that contains this script
+# plus "/wdt_model.yaml"
+#
+# WDT_VAR_FILE Full path to WDT variable file (java properties format).
+# default: the directory that contains this script
+# plus "/create-domain-inputs.yaml"
+#
+# WDT_DIR Target location to install and run WDT, and to keep a copy of
+# $WDT_MODEL_FILE and $WDT_MODEL_VARS. Also the location
+# of WDT log files.
+# default: /shared/wdt
+#
+# WDT_VERSION WDT version to download.
+# default: LATEST
+#
+# WDT_INSTALL_ZIP_FILE Filename of WDT install zip.
+# default: weblogic-deploy.zip
+#
+# WDT_INSTALL_ZIP_URL URL for downloading WDT install zip
+# default: https://github.com/oracle/weblogic-deploy-tooling/releases/latest/download/$WDT_INSTALL_ZIP_FILE
+#
+# WIT_DIR Target location to install WIT
+# default: /shared/imagetool
+#
+# WIT_VERSION WIT version to download.
+# default: LATEST
+#
+# WIT_INSTALL_ZIP_FILE Filename of WIT install zip.
+# default: imagetool.zip
+#
+# WIT_INSTALL_ZIP_URL URL for downloading WIT install zip
+# default: https://github.com/oracle/weblogic-image-tool/releases/latest/download/$WIT_INSTALL_ZIP_FILE
+#
+
+
+# Initialize globals
+
+export ORACLE_HOME=${ORACLE_HOME:-/u01/oracle}
+
+SCRIPTPATH="$( cd "$(dirname "$0")" > /dev/null 2>&1 ; pwd -P )"
+WDT_MODEL_FILE=${WDT_MODEL_FILE:-"$SCRIPTPATH/wdt_model.yaml"}
+WDT_VAR_FILE=${WDT_VAR_FILE:-"$SCRIPTPATH/create-domain-inputs.yaml"}
+
+WDT_DIR=${WDT_DIR:-/shared/wdt}
+WDT_VERSION=${WDT_VERSION:-LATEST}
+
+WIT_DIR=${WIT_DIR:-/shared/imagetool}
+WIT_VERSION=${WIT_VERSION:-LATEST}
+
+DOMAIN_TYPE="${DOMAIN_TYPE:-WLS}"
+
+function download {
+ local fileUrl="${1}"
+
+ local curl_res=1
+ max=20
+ count=0
+ while [ $curl_res -ne 0 -a $count -lt $max ] ; do
+ sleep 1
+ count=`expr $count + 1`
+ for proxy in "${https_proxy}" "${https_proxy2}"; do
+ echo @@ "Info: Downloading $fileUrl with https_proxy=\"$proxy\""
+ https_proxy="${proxy}" \
+ curl --silent --show-error --connect-timeout 10 -O -L $fileUrl
+ curl_res=$?
+ [ $curl_res -eq 0 ] && break
+ done
+ done
+ if [ $curl_res -ne 0 ]; then
+ echo @@ "Error: Download failed."
+ return 1
+ fi
+}
+
+function run_wdt {
+ #
+ # Run WDT using WDT_VAR_FILE, WDT_MODEL_FILE, and ORACLE_HOME.
+ # Output:
+ # - result domain will be in DOMAIN_HOME_DIR
+ # - logging output is in $WDT_DIR/createDomain.sh.out and $WDT_DIR/weblogic-deploy/logs
+ # - WDT_VAR_FILE & WDT_MODEL_FILE will be copied to WDT_DIR.
+ #
+
+ local action="${1}"
+
+ # Input files and directories.
+
+ local inputs_orig="$WDT_VAR_FILE"
+ local model_orig="$WDT_MODEL_FILE"
+ local oracle_home="$ORACLE_HOME"
+ local domain_type="$DOMAIN_TYPE"
+ local wdt_bin_dir="$WDT_DIR/weblogic-deploy/bin"
+ local wdt_createDomain_script="$wdt_bin_dir/createDomain.sh"
+
+ if [ ${action} = "create" ]; then
+ local wdt_domain_script="$wdt_bin_dir/createDomain.sh"
+ else
+ local wdt_domain_script="$wdt_bin_dir/updateDomain.sh"
+ fi
+
+ local domain_home_dir="$DOMAIN_HOME_DIR"
+ if [ -z "${domain_home_dir}" ]; then
+ local domain_dir="/shared/domains"
+ local domain_uid=`egrep 'domainUID' $inputs_orig | awk '{print $2}'`
+ local domain_home_dir=$domain_dir/$domain_uid
+ fi
+
+ mkdir -p $domain_home_dir
+
+ # Output files and directories.
+
+ local inputs_final=$WDT_DIR/$(basename "$inputs_orig")
+ local model_final=$WDT_DIR/$(basename "$model_orig")
+ if [ ${action} = "create" ]; then
+ local out_file=$WDT_DIR/createDomain.sh.out
+ else
+ local out_file=$WDT_DIR/updateDomain.sh.out
+ fi
+ local wdt_log_dir="$WDT_DIR/weblogic-deploy/logs"
+
+ echo @@ "Info: About to run WDT ${wdt_domain_script}"
+
+ for directory in wdt_bin_dir SCRIPTPATH WDT_DIR oracle_home; do
+ if [ ! -d "${!directory}" ]; then
+ echo @@ "Error: Could not find ${directory} directory ${!directory}."
+ return 1
+ fi
+ done
+
+ for fil in inputs_orig model_orig wdt_createDomain_script; do
+ if [ ! -f "${!fil}" ]; then
+ echo @@ "Error: Could not find ${fil} file ${!fil}."
+ return 1
+ fi
+ done
+
+ cp $model_orig $model_final || return 1
+ cp $inputs_orig $inputs_final || return 1
+
+ local save_dir=`pwd`
+ cd $WDT_DIR || return 1
+
+ cmd="
+ $wdt_domain_script
+ -oracle_home $oracle_home
+ -domain_type $domain_type
+ -domain_home $domain_home_dir
+ -model_file $model_final
+ -variable_file $inputs_final
+ "
+
+ echo @@ "Info: About to run the following WDT command:"
+ echo "${cmd}"
+ echo @@ "Info: WDT output will be in $out_file and $wdt_log_dir"
+ eval $cmd > $out_file 2>&1
+ local wdt_res=$?
+
+ cd $save_dir
+
+ if [ $wdt_res -ne 0 ]; then
+ if [ ${action} = "create" ]; then
+ cat $WDT_DIR/createDomain.sh.out
+ echo @@ "Info: WDT createDomain.sh output is in $out_file and $wdt_log_dir"
+ echo @@ "Error: WDT createDomain.sh failed."
+ return 1
+ else
+ cat $WDT_DIR/updateDomain.sh.out
+ echo @@ "Info: WDT updateDomain.sh output is in $out_file and $wdt_log_dir"
+ echo @@ "Error: WDT updateDomain.sh failed."
+ return 1
+ fi
+ fi
+
+ cd $WDT_DIR || return 1
+
+ cmd="
+ $wdt_bin_dir/extractDomainResource.sh
+ -oracle_home $oracle_home
+ -domain_resource_file domain${action}.yaml
+ -domain_home $domain_home_dir
+ -model_file $model_final
+ -variable_file $inputs_final
+ "
+ echo @@ "Info: About to run the following WDT command:"
+ echo "${cmd}"
+ echo @@ "Info: WDT output will be in extract${action}.out and $wdt_log_dir"
+ eval $cmd > extract${action}.out 2>&1
+ local wdt_res=$?
+
+ cd $save_dir
+
+ if [ $wdt_res -ne 0 ]; then
+ cat $WDT_DIR/extract${action}.out
+ echo @@ "Info: WDT extractDomainResource output is in extract${action}.out and $wdt_log_dir"
+ echo @@ "Error: WDT createDomain.sh failed."
+ return 1
+ fi
+
+ if [ ${action} = "create" ]; then
+ # chmod -R g+w $domain_home_dir || return 1
+ echo @@ "Info: WDT createDomain.sh succeeded."
+ else
+ echo @@ "Info: WDT updateDomain.sh succeeded."
+ fi
+
+ return 0
+}
+
+function setup_wdt_shared_dir {
+ mkdir -p $WDT_DIR || return 1
+}
+
+#
+# Install Weblogic Server Deploy Tooling to ${WDT_DIR}
+#
+function install_wdt {
+
+ WDT_INSTALL_ZIP_FILE="${WDT_INSTALL_ZIP_FILE:-weblogic-deploy.zip}"
+
+ if [ "$WDT_VERSION" == "LATEST" ]; then
+ WDT_INSTALL_ZIP_URL=${WDT_INSTALL_ZIP_URL:-"https://github.com/oracle/weblogic-deploy-tooling/releases/latest/download/$WDT_INSTALL_ZIP_FILE"}
+ else
+ WDT_INSTALL_ZIP_URL=${WDT_INSTALL_ZIP_URL:-"https://github.com/oracle/weblogic-deploy-tooling/releases/download/release-$WDT_VERSION/$WDT_INSTALL_ZIP_FILE"}
+ fi
+
+ local save_dir=`pwd`
+ cd $WDT_DIR || return 1
+
+ echo @@ "Info: Downloading $WDT_INSTALL_ZIP_URL "
+ download $WDT_INSTALL_ZIP_URL || return 1
+
+ if [ ! -f $WDT_INSTALL_ZIP_FILE ]; then
+ cd $save_dir
+ echo @@ "Error: Download failed or $WDT_INSTALL_ZIP_FILE not found."
+ return 1
+ fi
+
+ echo @@ "Info: Archive downloaded to $WDT_DIR/$WDT_INSTALL_ZIP_FILE, about to unzip via 'jar xf'."
+
+ jar xf $WDT_INSTALL_ZIP_FILE
+ local jar_res=$?
+
+ cd $save_dir
+
+ if [ $jar_res -ne 0 ]; then
+ echo @@ "Error: Install failed while unzipping $WDT_DIR/$WDT_INSTALL_ZIP_FILE"
+ return $jar_res
+ fi
+
+ if [ ! -d "$WDT_DIR/weblogic-deploy/bin" ]; then
+ echo @@ "Error: Install failed: directory '$WDT_DIR/weblogic-deploy/bin' not found."
+ return 1
+ fi
+
+ chmod 775 $WDT_DIR/weblogic-deploy/bin/* || return 1
+
+ echo @@ "Info: Install succeeded, wdt install is in the $WDT_DIR/weblogic-deploy directory."
+ return 0
+}
+
+#
+# Install WebLogic Image Tool to ${WIT_DIR}. Used by install_wit_if_needed.
+# Do not call this function directory.
+#
+function install_wit {
+
+ WIT_INSTALL_ZIP_FILE="${WIT_INSTALL_ZIP_FILE:-imagetool.zip}"
+
+ if [ "$WIT_VERSION" == "LATEST" ]; then
+ WIT_INSTALL_ZIP_URL=${WDT_INSTALL_ZIP_URL:-"https://github.com/oracle/weblogic-image-tool/releases/latest/download/$WIT_INSTALL_ZIP_FILE"}
+ else
+ WIT_INSTALL_ZIP_URL=${WIT_INSTALL_ZIP_URL:-"https://github.com/oracle/weblogic-image-tool/releases/download/release-$WIT_VERSION/$WIT_INSTALL_ZIP_FILE"}
+ fi
+
+
+
+ local save_dir=`pwd`
+
+ echo @@ "imagetool.sh not found in ${imagetoolBinDir}. Installing imagetool..."
+
+ echo @@ "Info: Downloading $WIT_INSTALL_ZIP_URL "
+ download $WIT_INSTALL_ZIP_URL || return 1
+
+ if [ ! -f $WIT_INSTALL_ZIP_FILE ]; then
+ cd $save_dir
+ echo @@ "Error: Download failed or $WIT_INSTALL_ZIP_FILE not found."
+ return 1
+ fi
+ echo @@ "Info: Archive downloaded to $WIT_DIR/$WIT_INSTALL_ZIP_FILE, about to unzip via 'jar xf'."
+
+ jar xf $WIT_INSTALL_ZIP_FILE
+ local jar_res=$?
+
+ cd $save_dir
+
+ if [ $jar_res -ne 0 ]; then
+ echo @@ "Error: Install failed while unzipping $WIT_DIR/$WIT_INSTALL_ZIP_FILE"
+ return $jar_res
+ fi
+
+ if [ ! -d "$WIT_DIR/imagetool/bin" ]; then
+ echo @@ "Error: Install failed: directory '$WIT_DIR/imagetool/bin' not found."
+ return 1
+ fi
+
+ chmod 775 $WIT_DIR/imagetool/bin/* || return 1
+}
+
+#
+# Checks whether WebLogic Image Tool is already installed under ${WIT_DIR}, and install
+# it if not.
+#
+function install_wit_if_needed {
+
+ local save_dir=`pwd`
+
+ mkdir -p $WIT_DIR || return 1
+ cd $WIT_DIR || return 1
+
+ imagetoolBinDir=$WIT_DIR/imagetool/bin
+ if [ -f $imagetoolBinDir/imagetool.sh ]; then
+ echo @@ "Info: imagetool.sh already exist in ${imagetoolBinDir}. Skipping WIT installation."
+ else
+ install_wit
+ fi
+
+ export WLSIMG_CACHEDIR="$WIT_DIR/imagetool-cache"
+
+ # Check existing imageTool cache entry for WDT:
+ # - if there is already an entry, and the WDT installer file specified in the cache entry exists, skip WDT installation
+ # - if file in cache entry doesn't exist, delete cache entry, install WDT, and add WDT installer to cache
+ # - if entry does not exist, install WDT, and add WDT installer to cache
+ if [ "$WDT_VERSION" == "LATEST" ]; then
+ wdtCacheVersion="latest"
+ else
+ wdtCacheVersion=$WDT_VERSION
+ fi
+
+ local listItems=$( ${imagetoolBinDir}/imagetool.sh cache listItems | grep "wdt_${wdtCacheVersion}" )
+
+ if [ ! -z "$listItems" ]; then
+ local wdt_file_path_in_cache=$(echo $listItems | sed 's/.*=\(.*\)/\1/')
+ if [ -f "$wdt_file_path_in_cache" ]; then
+ skip_wdt_install=true
+ else
+ echo @@ "Info: imageTool cache contains an entry for WDT zip at $wdt_file_path_in_cache which does not exist. Removing from cache entry."
+ ${imagetoolBinDir}/imagetool.sh cache deleteEntry \
+ --key wdt_${wdtCacheVersion}
+ fi
+ fi
+
+ if [ -z "$skip_wdt_install" ]; then
+ echo @@ "Info: imageTool cache does not contain a valid entry for wdt_${wdtCacheVersion}. Installing WDT"
+ setup_wdt_shared_dir || return 1
+ install_wdt || return 1
+ ${imagetoolBinDir}/imagetool.sh cache addInstaller \
+ --type wdt \
+ --version $WDT_VERSION \
+ --path $WDT_DIR/$WDT_INSTALL_ZIP_FILE || return 1
+ else
+ echo @@ "Info: imageTool cache already contains entry ${listItems}. Skipping WDT installation."
+ fi
+
+ cd $save_dir
+
+ echo @@ "Info: Install succeeded, imagetool install is in the $WIT_DIR/imagetool directory."
+ return 0
+}
+
+function encrypt_model {
+ #
+ # run encryptModel.sh from WDT to encrypt model and properties files
+ #
+ local domainOutputDirFullPath=${1} # full path to directory where the model, encrypt file, and domain properties files are
+ local model_file=${2} # path to file containing encryption key relative to ${domainOutputDirFullPath}
+ local encrypt_key_file=${3} # path to file containing encryption key relative to ${domainOutputDirFullPath}
+ local domain_properties_file=${4} # path to domain properties file relative to ${domainOutputDirFullPath}
+ local oracle_home="$ORACLE_HOME"
+
+ echo @@ "Info: encrypt passwords in the variables file at ${domainOutputDirFullPath}/${domain_properties_file} using encryption key from create-domain.sh argument written to file: ${encrypt_key_file}"
+
+ cmd="
+ cat /shared/${encrypt_key_file} /shared/${encrypt_key_file} |
+ /wdt/bin/encryptModel.sh \
+ -oracle_home ${oracle_home} \
+ -model_file /shared/${model_file} \
+ -variable_file /shared/${domain_properties_file}
+ "
+ echo $cmd > ${domainOutputDirFullPath}/cmd.sh
+ chmod 755 ${domainOutputDirFullPath}/cmd.sh
+ echo @@ "Info: Encrypt Model: About to run the following command in container with image ${domainHomeImageBase}:"
+ cat ${domainOutputDirFullPath}/cmd.sh
+
+ chmod 766 ${domainOutputDirFullPath}/${domain_properties_file}
+ docker run -it --rm -v ${domainOutputDirFullPath}:/shared -v ${WDT_DIR}/weblogic-deploy:/wdt ${domainHomeImageBase} /bin/bash -c /shared/cmd.sh || return 1
+
+ # clean up the generated files
+ rm ${domainOutputDirFullPath}/cmd.sh
+
+ echo @@ "Info: encrypt_model Completed"
+}
+
+
diff --git a/OracleWebCenterPortal/kubernetes/create-kubernetes-secrets/create-azure-storage-credentials-secret.sh b/OracleWebCenterPortal/kubernetes/create-kubernetes-secrets/create-azure-storage-credentials-secret.sh
old mode 100644
new mode 100755
index 8e6d3d947..352c4f562
--- a/OracleWebCenterPortal/kubernetes/create-kubernetes-secrets/create-azure-storage-credentials-secret.sh
+++ b/OracleWebCenterPortal/kubernetes/create-kubernetes-secrets/create-azure-storage-credentials-secret.sh
@@ -1,92 +1,92 @@
-#!/usr/bin/env bash
-# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-#
-# Description
-# This sample script creates a Kubernetes secret for Azure Storage to use Azure file share on AKS.
-#
-# The following pre-requisites must be handled prior to running this script:
-# * The kubernetes namespace must already be created
-#
-
-script="${BASH_SOURCE[0]}"
-
-#
-# Function to exit and print an error message
-# $1 - text of message
-function fail {
- echo [ERROR] $*
- exit 1
-}
-
-# Try to execute kubectl to see whether kubectl is available
-function validateKubectlAvailable {
- if ! [ -x "$(command -v kubectl)" ]; then
- fail "kubectl is not installed"
- fi
-}
-
-function usage {
- echo usage: ${script} -c storageAccountName -k storageAccountKey [-s secretName] [-n namespace] [-h]
- echo " -a storage account name, must be specified."
- echo " -k storage account key, must be specified."
- echo " -s secret name, optional. Use azure-secret if not specified."
- echo " -n namespace, optional. Use the default namespace if not specified."
- echo " -h Help"
- exit $1
-}
-
-#
-# Parse the command line options
-#
-secretName=azure-secret
-namespace=default
-while getopts "ha:k:s:n:" opt; do
- case $opt in
- a) storageAccountName="${OPTARG}"
- ;;
- k) storageAccountKey="${OPTARG}"
- ;;
- s) secretName="${OPTARG}"
- ;;
- n) namespace="${OPTARG}"
- ;;
- h) usage 0
- ;;
- *) usage 1
- ;;
- esac
-done
-
-if [ -z ${storageAccountName} ]; then
- echo "${script}: -e must be specified."
- missingRequiredOption="true"
-fi
-
-if [ -z ${storageAccountKey} ]; then
- echo "${script}: -p must be specified."
- missingRequiredOption="true"
-fi
-
-if [ "${missingRequiredOption}" == "true" ]; then
- usage 1
-fi
-
-# check and see if the secret already exists
-result=`kubectl get secret ${secretName} -n ${namespace} --ignore-not-found=true | grep ${secretName} | wc | awk ' { print $1; }'`
-if [ "${result:=Error}" != "0" ]; then
- fail "The secret ${secretName} already exists in namespace ${namespace}."
-fi
-
-# create the secret
-kubectl -n $namespace create secret generic $secretName \
- --from-literal=azurestorageaccountname=$storageAccountName \
- --from-literal=azurestorageaccountkey=$storageAccountKey
-
-# Verify the secret exists
-SECRET=`kubectl get secret ${secretName} -n ${namespace} | grep ${secretName} | wc | awk ' { print $1; }'`
-if [ "${SECRET}" != "1" ]; then
- fail "The secret ${secretName} was not found in namespace ${namespace}"
-fi
-
-echo "The secret ${secretName} has been successfully created in the ${namespace} namespace."
+#!/usr/bin/env bash
+# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+#
+# Description
+# This sample script creates a Kubernetes secret for Azure Storage to use Azure file share on AKS.
+#
+# The following pre-requisites must be handled prior to running this script:
+# * The kubernetes namespace must already be created
+#
+
+script="${BASH_SOURCE[0]}"
+
+#
+# Function to exit and print an error message
+# $1 - text of message
+function fail {
+ echo [ERROR] $*
+ exit 1
+}
+
+# Try to execute kubectl to see whether kubectl is available
+function validateKubectlAvailable {
+ if ! [ -x "$(command -v kubectl)" ]; then
+ fail "kubectl is not installed"
+ fi
+}
+
+function usage {
+ echo usage: ${script} -c storageAccountName -k storageAccountKey [-s secretName] [-n namespace] [-h]
+ echo " -a storage account name, must be specified."
+ echo " -k storage account key, must be specified."
+ echo " -s secret name, optional. Use azure-secret if not specified."
+ echo " -n namespace, optional. Use the default namespace if not specified."
+ echo " -h Help"
+ exit $1
+}
+
+#
+# Parse the command line options
+#
+secretName=azure-secret
+namespace=default
+while getopts "ha:k:s:n:" opt; do
+ case $opt in
+ a) storageAccountName="${OPTARG}"
+ ;;
+ k) storageAccountKey="${OPTARG}"
+ ;;
+ s) secretName="${OPTARG}"
+ ;;
+ n) namespace="${OPTARG}"
+ ;;
+ h) usage 0
+ ;;
+ *) usage 1
+ ;;
+ esac
+done
+
+if [ -z ${storageAccountName} ]; then
+ echo "${script}: -e must be specified."
+ missingRequiredOption="true"
+fi
+
+if [ -z ${storageAccountKey} ]; then
+ echo "${script}: -p must be specified."
+ missingRequiredOption="true"
+fi
+
+if [ "${missingRequiredOption}" == "true" ]; then
+ usage 1
+fi
+
+# check and see if the secret already exists
+result=`kubectl get secret ${secretName} -n ${namespace} --ignore-not-found=true | grep ${secretName} | wc | awk ' { print $1; }'`
+if [ "${result:=Error}" != "0" ]; then
+ fail "The secret ${secretName} already exists in namespace ${namespace}."
+fi
+
+# create the secret
+kubectl -n $namespace create secret generic $secretName \
+ --from-literal=azurestorageaccountname=$storageAccountName \
+ --from-literal=azurestorageaccountkey=$storageAccountKey
+
+# Verify the secret exists
+SECRET=`kubectl get secret ${secretName} -n ${namespace} | grep ${secretName} | wc | awk ' { print $1; }'`
+if [ "${SECRET}" != "1" ]; then
+ fail "The secret ${secretName} was not found in namespace ${namespace}"
+fi
+
+echo "The secret ${secretName} has been successfully created in the ${namespace} namespace."
diff --git a/OracleWebCenterPortal/kubernetes/create-kubernetes-secrets/create-docker-credentials-secret.sh b/OracleWebCenterPortal/kubernetes/create-kubernetes-secrets/create-docker-credentials-secret.sh
old mode 100644
new mode 100755
index 48f113b93..c984d1741
--- a/OracleWebCenterPortal/kubernetes/create-kubernetes-secrets/create-docker-credentials-secret.sh
+++ b/OracleWebCenterPortal/kubernetes/create-kubernetes-secrets/create-docker-credentials-secret.sh
@@ -1,106 +1,106 @@
-#!/usr/bin/env bash
-# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-#
-# Description
-# This sample script creates a Kubernetes secret for container registry credentials for use with the WLS Operator on AKS.
-#
-# The following pre-requisites must be handled prior to running this script:
-# * The kubernetes namespace must already be created
-#
-
-script="${BASH_SOURCE[0]}"
-
-#
-# Function to exit and print an error message
-# $1 - text of message
-function fail {
- echo [ERROR] $*
- exit 1
-}
-
-# Try to execute kubectl to see whether kubectl is available
-function validateKubectlAvailable {
- if ! [ -x "$(command -v kubectl)" ]; then
- fail "kubectl is not installed"
- fi
-}
-
-function usage {
- echo usage: ${script} -e email -p password -u username [-s secretName] [-d dockerServer] [-n namespace] [-h]
- echo " -e email, must be specified."
- echo " -p password, must be specified."
- echo " -u username, must be specified."
- echo " -s secret name, optional, Use regcred if not specified."
- echo " -d docker server, optional, Use docker.io if not specified."
- echo " -n namespace, optional. Use the default namespace if not specified"
- echo " -h Help"
- exit $1
-}
-
-#
-# Parse the command line options
-#
-secretName=regcred
-namespace=default
-dockerServer=container-registry.oracle.com
-while getopts "he:p:u:n:d:s:d:" opt; do
- case $opt in
- e) email="${OPTARG}"
- ;;
- p) password="${OPTARG}"
- ;;
- u) username="${OPTARG}"
- ;;
- s) secretName="${OPTARG}"
- ;;
- d) dockerServer="${OPTARG}"
- ;;
- n) namespace="${OPTARG}"
- ;;
- h) usage 0
- ;;
- *) usage 1
- ;;
- esac
-done
-
-if [ -z ${email} ]; then
- echo "${script}: -e must be specified."
- missingRequiredOption="true"
-fi
-
-if [ -z ${password} ]; then
- echo "${script}: -p must be specified."
- missingRequiredOption="true"
-fi
-
-if [ -z ${username} ]; then
- echo "${script}: -u must be specified."
- missingRequiredOption="true"
-fi
-
-if [ "${missingRequiredOption}" == "true" ]; then
- usage 1
-fi
-
-# check and see if the secret already exists
-result=`kubectl get secret ${secretName} -n ${namespace} --ignore-not-found=true | grep ${secretName} | wc | awk ' { print $1; }'`
-if [ "${result:=Error}" != "0" ]; then
- fail "The secret ${secretName} already exists in namespace ${namespace}."
-fi
-
-# create the secret
-kubectl -n $namespace create secret docker-registry $secretName \
- --docker-email=$email \
- --docker-password=$password \
- --docker-server=$dockerServer \
- --docker-username=$username
-
-# Verify the secret exists
-SECRET=`kubectl get secret ${secretName} -n ${namespace} | grep ${secretName} | wc | awk ' { print $1; }'`
-if [ "${SECRET}" != "1" ]; then
- fail "The secret ${secretName} was not found in namespace ${namespace}"
-fi
-
-echo "The secret ${secretName} has been successfully created in the ${namespace} namespace."
+#!/usr/bin/env bash
+# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+#
+# Description
+# This sample script creates a Kubernetes secret for container registry credentials for use with the WLS Operator on AKS.
+#
+# The following pre-requisites must be handled prior to running this script:
+# * The kubernetes namespace must already be created
+#
+
+script="${BASH_SOURCE[0]}"
+
+#
+# Function to exit and print an error message
+# $1 - text of message
+function fail {
+ echo [ERROR] $*
+ exit 1
+}
+
+# Try to execute kubectl to see whether kubectl is available
+function validateKubectlAvailable {
+ if ! [ -x "$(command -v kubectl)" ]; then
+ fail "kubectl is not installed"
+ fi
+}
+
+function usage {
+ echo usage: ${script} -e email -p password -u username [-s secretName] [-d dockerServer] [-n namespace] [-h]
+ echo " -e email, must be specified."
+ echo " -p password, must be specified."
+ echo " -u username, must be specified."
+ echo " -s secret name, optional, Use regcred if not specified."
+ echo " -d docker server, optional, Use docker.io if not specified."
+ echo " -n namespace, optional. Use the default namespace if not specified"
+ echo " -h Help"
+ exit $1
+}
+
+#
+# Parse the command line options
+#
+secretName=regcred
+namespace=default
+dockerServer=container-registry.oracle.com
+while getopts "he:p:u:n:d:s:d:" opt; do
+ case $opt in
+ e) email="${OPTARG}"
+ ;;
+ p) password="${OPTARG}"
+ ;;
+ u) username="${OPTARG}"
+ ;;
+ s) secretName="${OPTARG}"
+ ;;
+ d) dockerServer="${OPTARG}"
+ ;;
+ n) namespace="${OPTARG}"
+ ;;
+ h) usage 0
+ ;;
+ *) usage 1
+ ;;
+ esac
+done
+
+if [ -z ${email} ]; then
+ echo "${script}: -e must be specified."
+ missingRequiredOption="true"
+fi
+
+if [ -z ${password} ]; then
+ echo "${script}: -p must be specified."
+ missingRequiredOption="true"
+fi
+
+if [ -z ${username} ]; then
+ echo "${script}: -u must be specified."
+ missingRequiredOption="true"
+fi
+
+if [ "${missingRequiredOption}" == "true" ]; then
+ usage 1
+fi
+
+# check and see if the secret already exists
+result=`kubectl get secret ${secretName} -n ${namespace} --ignore-not-found=true | grep ${secretName} | wc | awk ' { print $1; }'`
+if [ "${result:=Error}" != "0" ]; then
+ fail "The secret ${secretName} already exists in namespace ${namespace}."
+fi
+
+# create the secret
+kubectl -n $namespace create secret docker-registry $secretName \
+ --docker-email=$email \
+ --docker-password=$password \
+ --docker-server=$dockerServer \
+ --docker-username=$username
+
+# Verify the secret exists
+SECRET=`kubectl get secret ${secretName} -n ${namespace} | grep ${secretName} | wc | awk ' { print $1; }'`
+if [ "${SECRET}" != "1" ]; then
+ fail "The secret ${secretName} was not found in namespace ${namespace}"
+fi
+
+echo "The secret ${secretName} has been successfully created in the ${namespace} namespace."
diff --git a/OracleWebCenterPortal/kubernetes/create-oracle-db-service/README.md b/OracleWebCenterPortal/kubernetes/create-oracle-db-service/README.md
old mode 100644
new mode 100755
index 042f8fe11..b34aeed4f
--- a/OracleWebCenterPortal/kubernetes/create-oracle-db-service/README.md
+++ b/OracleWebCenterPortal/kubernetes/create-oracle-db-service/README.md
@@ -1,76 +1,76 @@
-# Managing Oracle Database Service for OracleWebCenterPortal
-
-The sample scripts in this directory demonstrate how to:
-* Start an Oracle Database (DB) service in a Kubernetes cluster.
-* Stop an Oracle DB service in a Kubernetes cluster.
-
-## Start an Oracle Database service in a Kubernetes cluster
-
-Use this script to create an Oracle Database service in a Kubernetes Namespace with the default credentials, in the Oracle Database Slim image.
-
-The script assumes that either the image, `container-registry.oracle.com/database/enterprise:12.2.0.1-slim`, is available in the Docker repository, or an `ImagePullSecret` is created for `container-registry.oracle.com`. To create a secret for accessing `container-registry.oracle.com`, see the script `create-image-pull-secret.sh`.
-
-```
-
-$ ./start-db-service.sh -h
-usage: ./start-db-service.sh -p -i -s -n [-h]
- -i Oracle DB Image (optional)
- (default: container-registry.oracle.com/database/enterprise:12.2.0.1-slim)
- -p DB Service NodePort (optional)
- (default: 30011, set to 'none' to deploy service without a NodePort)
- -s DB Image PullSecret (optional)
- (default: docker-store)
- -n Configurable Kubernetes NameSpace for Oracle DB Service (optional)"
- (default: default)
- -h Help
-
-$ ./start-db-service.sh
-NodePort[30011] ImagePullSecret[docker-store] Image[container-registry.oracle.com/database/enterprise:12.2.0.1-slim]
-deployment.extensions/oracle-db created
-service/oracle-db created
-[oracle-db-54667dfd5f-76sxf] already initialized ..
-Checking Pod READY column for State [1/1]
-Pod [oracle-db-54667dfd5f-76sxf] Status is Ready Iter [1/60]
-NAME READY STATUS RESTARTS AGE
-oracle-db-54667dfd5f-76sxf 1/1 Running 0 8s
-NAME READY STATUS RESTARTS AGE
-oracle-db-54667dfd5f-76sxf 1/1 Running 0 8s
-NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
-kubernetes ClusterIP 10.96.0.1 443/TCP 27d
-oracle-db NodePort 10.99.58.137 1521:30011/TCP 9s
-Oracle DB service is RUNNING with NodePort [30011]
-
-```
-
-For creating a OracleWebCenterPortal domain, you can use the database connection string, `oracle-db.default.svc.cluster.local:1521/devpdb.k8s`,as `rcuDatabaseURL` parameter in the `domain.input.yaml` file.
-
-Note: oracle-db.default.svc.cluster.local:1521/devpdb.k8s can be used as rcuDatabaseURL if the Oracle DB Service is started in `default` NameSpace. For custom NameSpace the URL need to be modified accrodingly e.g. oracle-db.[namespace].svc.cluster.local:1521/devpdb.k8s
-
-You can access the database through the NodePort outside of the Kubernetes cluster, using the URL `:30011/devpdb.k8s`.
-
-**Note**: To create a OracleWebCenterPortal domain image, the domain-in-image model needs a public database URL as an `rcuDatabaseURL` parameter.
-
-## Stop an Oracle Database service in a Kubernetes cluster
-
-Use this script to stop the Oracle Database service you created using the `start-db-service.sh` script.
-
-```
-$ ./stop-db-service.sh -h
-usage: stop-db-service.sh -n namespace [-h]
- -n Kubernetes NameSpace for Oracle DB Service to be Stopped (optional)
- (default: default)
- -h Help
-
-Note: Here the NameSpace refers to the NameSpace used in start-db-service.sh
-
-$ ./stop-db-service.sh
-deployment.extensions "oracle-db" deleted
-service "oracle-db" deleted
-Checking Status for Pod [oracle-db-756f9b99fd-gvv46] in namesapce [default]
-Pod [oracle-db-756f9b99fd-gvv46] Status [Terminating]
-Pod [oracle-db-756f9b99fd-gvv46] Status [Terminating]
-Pod [oracle-db-756f9b99fd-gvv46] Status [Terminating]
-Error from server (NotFound): pods "oracle-db-756f9b99fd-gvv46" not found
-Pod [oracle-db-756f9b99fd-gvv46] removed from nameSpace [default]
-```
-
+# Managing Oracle Database Service for OracleWebCenterPortal
+
+The sample scripts in this directory demonstrate how to:
+* Start an Oracle Database (DB) service in a Kubernetes cluster.
+* Stop an Oracle DB service in a Kubernetes cluster.
+
+## Start an Oracle Database service in a Kubernetes cluster
+
+Use this script to create an Oracle Database service in a Kubernetes Namespace with the default credentials, in the Oracle Database Slim image.
+
+The script assumes that either the image, `container-registry.oracle.com/database/enterprise:12.2.0.1-slim`, is available in the Docker repository, or an `ImagePullSecret` is created for `container-registry.oracle.com`. To create a secret for accessing `container-registry.oracle.com`, see the script `create-image-pull-secret.sh`.
+
+```
+
+$ ./start-db-service.sh -h
+usage: ./start-db-service.sh -p -i -s -n [-h]
+ -i Oracle DB Image (optional)
+ (default: container-registry.oracle.com/database/enterprise:12.2.0.1-slim)
+ -p DB Service NodePort (optional)
+ (default: 30011, set to 'none' to deploy service without a NodePort)
+ -s DB Image PullSecret (optional)
+ (default: docker-store)
+ -n Configurable Kubernetes NameSpace for Oracle DB Service (optional)"
+ (default: default)
+ -h Help
+
+$ ./start-db-service.sh
+NodePort[30011] ImagePullSecret[docker-store] Image[container-registry.oracle.com/database/enterprise:12.2.0.1-slim]
+deployment.extensions/oracle-db created
+service/oracle-db created
+[oracle-db-54667dfd5f-76sxf] already initialized ..
+Checking Pod READY column for State [1/1]
+Pod [oracle-db-54667dfd5f-76sxf] Status is Ready Iter [1/60]
+NAME READY STATUS RESTARTS AGE
+oracle-db-54667dfd5f-76sxf 1/1 Running 0 8s
+NAME READY STATUS RESTARTS AGE
+oracle-db-54667dfd5f-76sxf 1/1 Running 0 8s
+NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
+kubernetes ClusterIP 10.96.0.1 443/TCP 27d
+oracle-db NodePort 10.99.58.137 1521:30011/TCP 9s
+Oracle DB service is RUNNING with NodePort [30011]
+
+```
+
+For creating a OracleWebCenterPortal domain, you can use the database connection string, `oracle-db.default.svc.cluster.local:1521/devpdb.k8s`,as `rcuDatabaseURL` parameter in the `domain.input.yaml` file.
+
+Note: oracle-db.default.svc.cluster.local:1521/devpdb.k8s can be used as rcuDatabaseURL if the Oracle DB Service is started in `default` NameSpace. For custom NameSpace the URL need to be modified accrodingly e.g. oracle-db.[namespace].svc.cluster.local:1521/devpdb.k8s
+
+You can access the database through the NodePort outside of the Kubernetes cluster, using the URL `:30011/devpdb.k8s`.
+
+**Note**: To create a OracleWebCenterPortal domain image, the domain-in-image model needs a public database URL as an `rcuDatabaseURL` parameter.
+
+## Stop an Oracle Database service in a Kubernetes cluster
+
+Use this script to stop the Oracle Database service you created using the `start-db-service.sh` script.
+
+```
+$ ./stop-db-service.sh -h
+usage: stop-db-service.sh -n namespace [-h]
+ -n Kubernetes NameSpace for Oracle DB Service to be Stopped (optional)
+ (default: default)
+ -h Help
+
+Note: Here the NameSpace refers to the NameSpace used in start-db-service.sh
+
+$ ./stop-db-service.sh
+deployment.extensions "oracle-db" deleted
+service "oracle-db" deleted
+Checking Status for Pod [oracle-db-756f9b99fd-gvv46] in namesapce [default]
+Pod [oracle-db-756f9b99fd-gvv46] Status [Terminating]
+Pod [oracle-db-756f9b99fd-gvv46] Status [Terminating]
+Pod [oracle-db-756f9b99fd-gvv46] Status [Terminating]
+Error from server (NotFound): pods "oracle-db-756f9b99fd-gvv46" not found
+Pod [oracle-db-756f9b99fd-gvv46] removed from nameSpace [default]
+```
+
diff --git a/OracleWebCenterPortal/kubernetes/create-oracle-db-service/common/checkDbState.sh b/OracleWebCenterPortal/kubernetes/create-oracle-db-service/common/checkDbState.sh
old mode 100644
new mode 100755
index 9ce5aa3d3..0dfe95259
--- a/OracleWebCenterPortal/kubernetes/create-oracle-db-service/common/checkDbState.sh
+++ b/OracleWebCenterPortal/kubernetes/create-oracle-db-service/common/checkDbState.sh
@@ -1,21 +1,21 @@
-#!/bin/bash
-# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-#
-logfile="/home/oracle/setup/log/setupDB.log"
-max=30
-counter=0
-while [ $counter -le ${max} ]
-do
- grep "Done ! The database is ready for use ." $logfile
- [[ $? == 0 ]] && break;
- ((counter++))
- echo "[$counter/${max}] Retrying for Oracle Database Availability..."
- sleep 10
-done
-
-if [ $counter -gt ${max} ]; then
- echo "[ERRORR] Oracle DB Service is not ready after [${max}] iterations ..."
- exit -1
-fi
-
+#!/bin/bash
+# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+#
+logfile="/home/oracle/setup/log/setupDB.log"
+max=30
+counter=0
+while [ $counter -le ${max} ]
+do
+ grep "Done ! The database is ready for use ." $logfile
+ [[ $? == 0 ]] && break;
+ ((counter++))
+ echo "[$counter/${max}] Retrying for Oracle Database Availability..."
+ sleep 10
+done
+
+if [ $counter -gt ${max} ]; then
+ echo "[ERRORR] Oracle DB Service is not ready after [${max}] iterations ..."
+ exit -1
+fi
+
diff --git a/OracleWebCenterPortal/kubernetes/create-oracle-db-service/common/oracle.db.yaml b/OracleWebCenterPortal/kubernetes/create-oracle-db-service/common/oracle.db.yaml
old mode 100644
new mode 100755
index 4185471f3..37631eae8
--- a/OracleWebCenterPortal/kubernetes/create-oracle-db-service/common/oracle.db.yaml
+++ b/OracleWebCenterPortal/kubernetes/create-oracle-db-service/common/oracle.db.yaml
@@ -1,78 +1,78 @@
-# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-#
-apiVersion: v1
-kind: Service
-metadata:
- name: oracle-db
- namespace: default
-spec:
- ports:
- - name: tns
- port: 1521
- protocol: TCP
- targetPort: 1521
- nodePort: 30011
- selector:
- app.kubernetes.io/instance: dev
- app.kubernetes.io/name: oracle-db
- sessionAffinity: None
- type: NodePort
----
-apiVersion: apps/v1
-kind: Deployment
-metadata:
- name: oracle-db
- namespace: default
-spec:
- replicas: 1
- selector:
- matchLabels:
- app.kubernetes.io/instance: dev
- app.kubernetes.io/name: oracle-db
- strategy:
- rollingUpdate:
- maxSurge: 1
- maxUnavailable: 1
- type: RollingUpdate
- template:
- metadata:
- labels:
- app.kubernetes.io/instance: dev
- app.kubernetes.io/name: oracle-db
- spec:
- containers:
- - env:
- - name: DB_SID
- value: devcdb
- - name: DB_PDB
- value: devpdb
- - name: DB_DOMAIN
- value: k8s
- - name: DB_BUNDLE
- value: basic
- image: container-registry.oracle.com/database/enterprise:12.2.0.1-slim
- imagePullPolicy: IfNotPresent
- name: oracle-db
- ports:
- - containerPort: 1521
- name: tns
- protocol: TCP
- resources:
- limits:
- cpu: "2"
- memory: "6Gi"
- ephemeral-storage: "8Gi"
- requests:
- cpu: 500m
- ephemeral-storage: "6Gi"
- terminationMessagePath: /dev/termination-log
- terminationMessagePolicy: File
- dnsPolicy: ClusterFirst
- restartPolicy: Always
- schedulerName: default-scheduler
- securityContext: {}
- terminationGracePeriodSeconds: 30
- imagePullSecrets:
- - name: docker-store
-
+# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+#
+apiVersion: v1
+kind: Service
+metadata:
+ name: oracle-db
+ namespace: default
+spec:
+ ports:
+ - name: tns
+ port: 1521
+ protocol: TCP
+ targetPort: 1521
+ nodePort: 30011
+ selector:
+ app.kubernetes.io/instance: dev
+ app.kubernetes.io/name: oracle-db
+ sessionAffinity: None
+ type: NodePort
+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: oracle-db
+ namespace: default
+spec:
+ replicas: 1
+ selector:
+ matchLabels:
+ app.kubernetes.io/instance: dev
+ app.kubernetes.io/name: oracle-db
+ strategy:
+ rollingUpdate:
+ maxSurge: 1
+ maxUnavailable: 1
+ type: RollingUpdate
+ template:
+ metadata:
+ labels:
+ app.kubernetes.io/instance: dev
+ app.kubernetes.io/name: oracle-db
+ spec:
+ containers:
+ - env:
+ - name: DB_SID
+ value: devcdb
+ - name: DB_PDB
+ value: devpdb
+ - name: DB_DOMAIN
+ value: k8s
+ - name: DB_BUNDLE
+ value: basic
+ image: container-registry.oracle.com/database/enterprise:12.2.0.1-slim
+ imagePullPolicy: IfNotPresent
+ name: oracle-db
+ ports:
+ - containerPort: 1521
+ name: tns
+ protocol: TCP
+ resources:
+ limits:
+ cpu: "2"
+ memory: "6Gi"
+ ephemeral-storage: "8Gi"
+ requests:
+ cpu: 500m
+ ephemeral-storage: "6Gi"
+ terminationMessagePath: /dev/termination-log
+ terminationMessagePolicy: File
+ dnsPolicy: ClusterFirst
+ restartPolicy: Always
+ schedulerName: default-scheduler
+ securityContext: {}
+ terminationGracePeriodSeconds: 30
+ imagePullSecrets:
+ - name: docker-store
+
diff --git a/OracleWebCenterPortal/kubernetes/create-oracle-db-service/create-image-pull-secret.sh b/OracleWebCenterPortal/kubernetes/create-oracle-db-service/create-image-pull-secret.sh
old mode 100644
new mode 100755
index 3c7db8bc5..583558355
--- a/OracleWebCenterPortal/kubernetes/create-oracle-db-service/create-image-pull-secret.sh
+++ b/OracleWebCenterPortal/kubernetes/create-oracle-db-service/create-image-pull-secret.sh
@@ -1,60 +1,60 @@
-#!/bin/bash
-# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-#
-# Create ImagePullSecret to pull Oracle DB and OracleWebCenterPortal Image
-
-script="${BASH_SOURCE[0]}"
-scriptDir="$( cd "$( dirname "${script}" )" && pwd )"
-
-function usage {
- echo "usage: ${script} -u -p -e -s [-h]"
- echo " -u Oracle Container Registry User Name (needed)"
- echo " -p Oracle Container Registry Password (needed)"
- echo " -e email (needed)"
- echo " -s Generated Secret (optional) "
- echo " (default: docker-store) "
- echo " -h Help"
- exit $1
-}
-
-while getopts ":u:p:s:e:" opt; do
- case $opt in
- u) username="${OPTARG}"
- ;;
- p) password="${OPTARG}"
- ;;
- e) email="${OPTARG}"
- ;;
- s) secert="${OPTARG}"
- ;;
- h) usage 0
- ;;
- *) usage 1
- ;;
- esac
-done
-
-if [ -z ${username} ]; then
- echo "${script}: -u must be specified."
- usage 1
-fi
-
-if [ -z ${password} ]; then
- echo "${script}: -p must be specified."
- usage 1
-fi
-
-if [ -e ${email} ]; then
- echo "${script}: -p must be specified."
- usage 1
-fi
-
-if [ -z ${secret} ]; then
- secret="docker-store"
-fi
-
-kubectl delete secret/${secret} --ignore-not-found
-echo "Creating ImagePullSecret on container-registry.oracle.com"
-kubectl create secret docker-registry ${secret} --docker-server=container-registry.oracle.com --docker-username=${username} --docker-password=${password} --docker-email=${email}
-
+#!/bin/bash
+# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+#
+# Create ImagePullSecret to pull Oracle DB and OracleWebCenterPortal Image
+
+script="${BASH_SOURCE[0]}"
+scriptDir="$( cd "$( dirname "${script}" )" && pwd )"
+
+function usage {
+ echo "usage: ${script} -u -p -e -s [-h]"
+ echo " -u Oracle Container Registry User Name (needed)"
+ echo " -p Oracle Container Registry Password (needed)"
+ echo " -e email (needed)"
+ echo " -s Generated Secret (optional) "
+ echo " (default: docker-store) "
+ echo " -h Help"
+ exit $1
+}
+
+while getopts ":u:p:s:e:" opt; do
+ case $opt in
+ u) username="${OPTARG}"
+ ;;
+ p) password="${OPTARG}"
+ ;;
+ e) email="${OPTARG}"
+ ;;
+ s) secert="${OPTARG}"
+ ;;
+ h) usage 0
+ ;;
+ *) usage 1
+ ;;
+ esac
+done
+
+if [ -z ${username} ]; then
+ echo "${script}: -u must be specified."
+ usage 1
+fi
+
+if [ -z ${password} ]; then
+ echo "${script}: -p must be specified."
+ usage 1
+fi
+
+if [ -e ${email} ]; then
+ echo "${script}: -p must be specified."
+ usage 1
+fi
+
+if [ -z ${secret} ]; then
+ secret="docker-store"
+fi
+
+kubectl delete secret/${secret} --ignore-not-found
+echo "Creating ImagePullSecret on container-registry.oracle.com"
+kubectl create secret docker-registry ${secret} --docker-server=container-registry.oracle.com --docker-username=${username} --docker-password=${password} --docker-email=${email}
+
diff --git a/OracleWebCenterPortal/kubernetes/create-oracle-db-service/start-db-service.sh b/OracleWebCenterPortal/kubernetes/create-oracle-db-service/start-db-service.sh
old mode 100644
new mode 100755
index 9a522d4eb..15df069f6
--- a/OracleWebCenterPortal/kubernetes/create-oracle-db-service/start-db-service.sh
+++ b/OracleWebCenterPortal/kubernetes/create-oracle-db-service/start-db-service.sh
@@ -1,113 +1,113 @@
-#!/bin/bash
-# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-#
-# Bring up Oracle DB Instance in [default] NameSpace with a NodePort Service
-
-script="${BASH_SOURCE[0]}"
-scriptDir="$( cd "$( dirname "${script}" )" && pwd )"
-source ${scriptDir}/../common/utility.sh
-
-function usage {
- echo "usage: ${script} -p -i -s -n [-h]"
- echo " -i Oracle DB Image (optional)"
- echo " (default: container-registry.oracle.com/database/enterprise:12.2.0.1-slim)"
- echo " -p DB Service NodePort (optional)"
- echo " (default: 30011, set to 'none' to deploy service without a NodePort)"
- echo " -s DB Image PullSecret (optional)"
- echo " (default: docker-store) "
- echo " -n Configurable Kubernetes NameSpace for Oracle DB Service (optional)"
- echo " (default: default) "
- echo " -h Help"
- exit $1
-}
-
-while getopts ":h:p:s:i:n:" opt; do
- case $opt in
- p) nodeport="${OPTARG}"
- ;;
- s) pullsecret="${OPTARG}"
- ;;
- i) dbimage="${OPTARG}"
- ;;
- n) namespace="${OPTARG}"
- ;;
- h) usage 0
- ;;
- *) usage 1
- ;;
- esac
-done
-
-if [ -z ${nodeport} ]; then
- nodeport=30011
-fi
-
-if [ -z ${pullsecret} ]; then
- pullsecret="docker-store"
-fi
-
-if [ -z ${namespace} ]; then
- namespace="default"
-fi
-
-echo "Checking Status for NameSpace [$namespace]"
-domns=`kubectl get ns ${namespace} | grep ${namespace} | awk '{print $1}'`
-if [ -z ${domns} ]; then
- echo "Adding NameSpace[$namespace] to Kubernetes Cluster"
- kubectl create namespace ${namespace}
- sleep 5
-else
- echo "Skipping the NameSpace[$namespace] Creation ..."
-fi
-
-if [ -z ${dbimage} ]; then
- dbimage="container-registry.oracle.com/database/enterprise:12.2.0.1-slim"
-fi
-
-echo "NodePort[$nodeport] ImagePullSecret[$pullsecret] Image[${dbimage}] NameSpace[${namespace}]"
-
-# Modify ImagePullSecret and DatabaseImage based on input
-sed -i -e '$d' ${scriptDir}/common/oracle.db.yaml
-echo ' - name: docker-store' >> ${scriptDir}/common/oracle.db.yaml
-sed -i -e "s?name: docker-store?name: ${pullsecret}?g" ${scriptDir}/common/oracle.db.yaml
-sed -i -e "s?image:.*?image: ${dbimage}?g" ${scriptDir}/common/oracle.db.yaml
-sed -i -e "s?namespace:.*?namespace: ${namespace}?g" ${scriptDir}/common/oracle.db.yaml
-
-# Modify the NodePort based on input
-if [ "${nodeport}" = "none" ]; then
- sed -i -e "s? nodePort:? #nodePort:?g" ${scriptDir}/common/oracle.db.yaml
- sed -i -e "s? type:.*NodePort? #type: NodePort?g" ${scriptDir}/common/oracle.db.yaml
-else
- sed -i -e "s?[#]*nodePort:.*?nodePort: ${nodeport}?g" ${scriptDir}/common/oracle.db.yaml
- sed -i -e "s?[#]*type:.*NodePort?type: NodePort?g" ${scriptDir}/common/oracle.db.yaml # default type is ClusterIP
-fi
-
-kubectl delete service oracle-db -n ${namespace} --ignore-not-found
-kubectl apply -f ${scriptDir}/common/oracle.db.yaml
-
-dbpod=`kubectl get po -n ${namespace} | grep oracle-db | cut -f1 -d " " `
-
-checkPod ${dbpod} ${namespace}
-checkPodState ${dbpod} ${namespace} "1/1"
-checkService oracle-db ${namespace}
-
-kubectl get po -n ${namespace}
-kubectl get service -n ${namespace}
-
-kubectl cp ${scriptDir}/common/checkDbState.sh -n ${namespace} ${dbpod}:/home/oracle/
-kubectl exec -it ${dbpod} -n ${namespace} /bin/bash /home/oracle/checkDbState.sh
-if [ $? != 0 ]; then
- echo "######################";
- echo "[ERROR] Could not create Oracle DB Service, check the pod log for pod ${dbpod} in namespace ${namespace}";
- echo "######################";
- exit -3;
-fi
-
-if [ ! "${nodeport}" = "none" ]; then
- echo "Oracle DB Service is RUNNING with NodePort [${nodeport}]"
-else
- echo "Oracle DB Service is RUNNING and does not specify a public NodePort"
-fi
-echo "Oracle DB Service URL [oracle-db.${namespace}.svc.cluster.local:1521/devpdb.k8s]"
-
+#!/bin/bash
+# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+#
+# Bring up Oracle DB Instance in [default] NameSpace with a NodePort Service
+
+script="${BASH_SOURCE[0]}"
+scriptDir="$( cd "$( dirname "${script}" )" && pwd )"
+source ${scriptDir}/../common/utility.sh
+
+function usage {
+ echo "usage: ${script} -p -i -s -n [-h]"
+ echo " -i Oracle DB Image (optional)"
+ echo " (default: container-registry.oracle.com/database/enterprise:12.2.0.1-slim)"
+ echo " -p DB Service NodePort (optional)"
+ echo " (default: 30011, set to 'none' to deploy service without a NodePort)"
+ echo " -s DB Image PullSecret (optional)"
+ echo " (default: docker-store) "
+ echo " -n Configurable Kubernetes NameSpace for Oracle DB Service (optional)"
+ echo " (default: default) "
+ echo " -h Help"
+ exit $1
+}
+
+while getopts ":h:p:s:i:n:" opt; do
+ case $opt in
+ p) nodeport="${OPTARG}"
+ ;;
+ s) pullsecret="${OPTARG}"
+ ;;
+ i) dbimage="${OPTARG}"
+ ;;
+ n) namespace="${OPTARG}"
+ ;;
+ h) usage 0
+ ;;
+ *) usage 1
+ ;;
+ esac
+done
+
+if [ -z ${nodeport} ]; then
+ nodeport=30011
+fi
+
+if [ -z ${pullsecret} ]; then
+ pullsecret="docker-store"
+fi
+
+if [ -z ${namespace} ]; then
+ namespace="default"
+fi
+
+echo "Checking Status for NameSpace [$namespace]"
+domns=`kubectl get ns ${namespace} | grep ${namespace} | awk '{print $1}'`
+if [ -z ${domns} ]; then
+ echo "Adding NameSpace[$namespace] to Kubernetes Cluster"
+ kubectl create namespace ${namespace}
+ sleep 5
+else
+ echo "Skipping the NameSpace[$namespace] Creation ..."
+fi
+
+if [ -z ${dbimage} ]; then
+ dbimage="container-registry.oracle.com/database/enterprise:12.2.0.1-slim"
+fi
+
+echo "NodePort[$nodeport] ImagePullSecret[$pullsecret] Image[${dbimage}] NameSpace[${namespace}]"
+
+# Modify ImagePullSecret and DatabaseImage based on input
+sed -i -e '$d' ${scriptDir}/common/oracle.db.yaml
+echo ' - name: docker-store' >> ${scriptDir}/common/oracle.db.yaml
+sed -i -e "s?name: docker-store?name: ${pullsecret}?g" ${scriptDir}/common/oracle.db.yaml
+sed -i -e "s?image:.*?image: ${dbimage}?g" ${scriptDir}/common/oracle.db.yaml
+sed -i -e "s?namespace:.*?namespace: ${namespace}?g" ${scriptDir}/common/oracle.db.yaml
+
+# Modify the NodePort based on input
+if [ "${nodeport}" = "none" ]; then
+ sed -i -e "s? nodePort:? #nodePort:?g" ${scriptDir}/common/oracle.db.yaml
+ sed -i -e "s? type:.*NodePort? #type: NodePort?g" ${scriptDir}/common/oracle.db.yaml
+else
+ sed -i -e "s?[#]*nodePort:.*?nodePort: ${nodeport}?g" ${scriptDir}/common/oracle.db.yaml
+ sed -i -e "s?[#]*type:.*NodePort?type: NodePort?g" ${scriptDir}/common/oracle.db.yaml # default type is ClusterIP
+fi
+
+kubectl delete service oracle-db -n ${namespace} --ignore-not-found
+kubectl apply -f ${scriptDir}/common/oracle.db.yaml
+
+dbpod=`kubectl get po -n ${namespace} | grep oracle-db | cut -f1 -d " " `
+
+checkPod ${dbpod} ${namespace}
+checkPodState ${dbpod} ${namespace} "1/1"
+checkService oracle-db ${namespace}
+
+kubectl get po -n ${namespace}
+kubectl get service -n ${namespace}
+
+kubectl cp ${scriptDir}/common/checkDbState.sh -n ${namespace} ${dbpod}:/home/oracle/
+kubectl exec -it ${dbpod} -n ${namespace} /bin/bash /home/oracle/checkDbState.sh
+if [ $? != 0 ]; then
+ echo "######################";
+ echo "[ERROR] Could not create Oracle DB Service, check the pod log for pod ${dbpod} in namespace ${namespace}";
+ echo "######################";
+ exit -3;
+fi
+
+if [ ! "${nodeport}" = "none" ]; then
+ echo "Oracle DB Service is RUNNING with NodePort [${nodeport}]"
+else
+ echo "Oracle DB Service is RUNNING and does not specify a public NodePort"
+fi
+echo "Oracle DB Service URL [oracle-db.${namespace}.svc.cluster.local:1521/devpdb.k8s]"
+
diff --git a/OracleWebCenterPortal/kubernetes/create-oracle-db-service/stop-db-service.sh b/OracleWebCenterPortal/kubernetes/create-oracle-db-service/stop-db-service.sh
old mode 100644
new mode 100755
index 7ab14928c..e3e29435f
--- a/OracleWebCenterPortal/kubernetes/create-oracle-db-service/stop-db-service.sh
+++ b/OracleWebCenterPortal/kubernetes/create-oracle-db-service/stop-db-service.sh
@@ -1,45 +1,45 @@
-#!/bin/bash
-# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-#
-# Drop the DB Service created by start-db-service.sh
-
-script="${BASH_SOURCE[0]}"
-scriptDir="$( cd "$( dirname "${script}" )" && pwd )"
-source ${scriptDir}/../common/utility.sh
-
-function usage {
- echo "usage: ${script} -n namespace [-h]"
- echo " -n Kubernetes NameSpace for Oracle DB Service to be Stopped (optional)"
- echo " (default: default) "
- echo " -h Help"
- exit $1
-}
-
-while getopts ":h:n:" opt; do
- case $opt in
- n) namespace="${OPTARG}"
- ;;
- h) usage 0
- ;;
- *) usage 1
- ;;
- esac
-done
-
-
-if [ -z ${namespace} ]; then
- namespace=default
-fi
-
-
-dbpod=`kubectl get po -n ${namespace} | grep oracle-db | cut -f1 -d " " `
-kubectl delete -f ${scriptDir}/common/oracle.db.yaml --ignore-not-found
-
-if [ -z ${dbpod} ]; then
- echo "Couldn't find oracle-db pod in [${namespace}] namesapce"
-else
- checkPodDelete ${dbpod} ${namespace}
- kubectl delete svc/oracle-db -n ${namespace} --ignore-not-found
-fi
-
+#!/bin/bash
+# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+#
+# Drop the DB Service created by start-db-service.sh
+
+script="${BASH_SOURCE[0]}"
+scriptDir="$( cd "$( dirname "${script}" )" && pwd )"
+source ${scriptDir}/../common/utility.sh
+
+function usage {
+ echo "usage: ${script} -n namespace [-h]"
+ echo " -n Kubernetes NameSpace for Oracle DB Service to be Stopped (optional)"
+ echo " (default: default) "
+ echo " -h Help"
+ exit $1
+}
+
+while getopts ":h:n:" opt; do
+ case $opt in
+ n) namespace="${OPTARG}"
+ ;;
+ h) usage 0
+ ;;
+ *) usage 1
+ ;;
+ esac
+done
+
+
+if [ -z ${namespace} ]; then
+ namespace=default
+fi
+
+
+dbpod=`kubectl get po -n ${namespace} | grep oracle-db | cut -f1 -d " " `
+kubectl delete -f ${scriptDir}/common/oracle.db.yaml --ignore-not-found
+
+if [ -z ${dbpod} ]; then
+ echo "Couldn't find oracle-db pod in [${namespace}] namesapce"
+else
+ checkPodDelete ${dbpod} ${namespace}
+ kubectl delete svc/oracle-db -n ${namespace} --ignore-not-found
+fi
+
diff --git a/OracleWebCenterPortal/kubernetes/create-rcu-credentials/README.md b/OracleWebCenterPortal/kubernetes/create-rcu-credentials/README.md
old mode 100644
new mode 100755
index 962f331c3..103dddf94
--- a/OracleWebCenterPortal/kubernetes/create-rcu-credentials/README.md
+++ b/OracleWebCenterPortal/kubernetes/create-rcu-credentials/README.md
@@ -1,56 +1,56 @@
-# Creating RCU credentials for a OracleWebCenterPortal domain
-
-This sample demonstrates how to create a Kubernetes secret containing the
-RCU credentials for a OracleWebCenterPortal domain. The operator expects this secret to be
-named following the pattern `domainUID-rcu-credentials`, where `domainUID`
-is the unique identifier of the domain. It must be in the same namespace
-that the domain will run in.
-
-To use the sample, run the command:
-
-```
-$ ./create-rcu-credentials.sh \
- -u username \
- -p password \
- -a sys_username \
- -q sys_password \
- -d domainUID \
- -n namespace \
- -s secretName
-```
-
-The parameters are as follows:
-
-```
- -u username for schema owner (regular user), must be specified.
- -p password for schema owner (regular user), must be specified.
- -a username for SYSDBA user, must be specified.
- -q password for SYSDBA user, must be specified.
- -d domainUID, optional. The default value is wcp-domain. If specified, the secret will be labeled with the domainUID unless the given value is an empty string.
- -n namespace, optional. Use the wcpns namespace if not specified.
- -s secretName, optional. If not specified, the secret name will be determined based on the domainUID value.
-```
-
-This creates a `generic` secret containing the user name and password as literal values.
-
-You can check the secret with the `kubectl describe secret` command. An example is shown below,
-including the output:
-
-```
-$ kubectl -n wcpns describe secret wcp-domain-rcu-credentials -o yaml
-Name: wcp-domain-rcu-credentials
-Namespace: wcpns
-Labels: weblogic.domainName=wcp-domain
- weblogic.domainUID=wcp-domain
-Annotations:
-
-Type: Opaque
-
-Data
-====
-password: 12 bytes
-sys_password: 12 bytes
-sys_username: 3 bytes
-username: 4 bytes
-```
-
+# Creating RCU credentials for a OracleWebCenterPortal domain
+
+This sample demonstrates how to create a Kubernetes secret containing the
+RCU credentials for a OracleWebCenterPortal domain. The operator expects this secret to be
+named following the pattern `domainUID-rcu-credentials`, where `domainUID`
+is the unique identifier of the domain. It must be in the same namespace
+that the domain will run in.
+
+To use the sample, run the command:
+
+```
+$ ./create-rcu-credentials.sh \
+ -u username \
+ -p password \
+ -a sys_username \
+ -q sys_password \
+ -d domainUID \
+ -n namespace \
+ -s secretName
+```
+
+The parameters are as follows:
+
+```
+ -u username for schema owner (regular user), must be specified.
+ -p password for schema owner (regular user), must be specified.
+ -a username for SYSDBA user, must be specified.
+ -q password for SYSDBA user, must be specified.
+ -d domainUID, optional. The default value is wcp-domain. If specified, the secret will be labeled with the domainUID unless the given value is an empty string.
+ -n namespace, optional. Use the wcpns namespace if not specified.
+ -s secretName, optional. If not specified, the secret name will be determined based on the domainUID value.
+```
+
+This creates a `generic` secret containing the user name and password as literal values.
+
+You can check the secret with the `kubectl describe secret` command. An example is shown below,
+including the output:
+
+```
+$ kubectl -n wcpns describe secret wcp-domain-rcu-credentials -o yaml
+Name: wcp-domain-rcu-credentials
+Namespace: wcpns
+Labels: weblogic.domainName=wcp-domain
+ weblogic.domainUID=wcp-domain
+Annotations:
+
+Type: Opaque
+
+Data
+====
+password: 12 bytes
+sys_password: 12 bytes
+sys_username: 3 bytes
+username: 4 bytes
+```
+
diff --git a/OracleWebCenterPortal/kubernetes/create-rcu-credentials/create-rcu-credentials.sh b/OracleWebCenterPortal/kubernetes/create-rcu-credentials/create-rcu-credentials.sh
old mode 100644
new mode 100755
index f1b492bbd..2dc2845f4
--- a/OracleWebCenterPortal/kubernetes/create-rcu-credentials/create-rcu-credentials.sh
+++ b/OracleWebCenterPortal/kubernetes/create-rcu-credentials/create-rcu-credentials.sh
@@ -1,139 +1,139 @@
-#!/usr/bin/env bash
-# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-#
-# Description
-# This sample script creates a Kubernetes secret for RCU credentials.
-#
-# The following pre-requisites must be handled prior to running this script:
-# * The kubernetes namespace must already be created
-#
-# Secret name determination
-# 1) secretName - if specified
-# 2) wcp-domain-rcu-credentials - if secretName and domainUID are both not specified. This is the default out-of-the-box.
-# 3) -rcu-credentials - if secretName is not specified, and domainUID is specified.
-# 4) rcu-credentials - if secretName is not specified, and domainUID is specified as "".
-#
-# The generated secret will be labeled with
-# weblogic.domainUID=$domainUID
-# and
-# weblogic.domainName=$domainUID
-# Where the $domainUID is the value of the -d command line option, unless the value supplied is an empty String ""
-#
-
-script="${BASH_SOURCE[0]}"
-
-#
-# Function to exit and print an error message
-# $1 - text of message
-function fail {
- echo [ERROR] $*
- exit 1
-}
-
-# Try to execute kubectl to see whether kubectl is available
-function validateKubectlAvailable {
- if ! [ -x "$(command -v kubectl)" ]; then
- fail "kubectl is not installed"
- fi
-}
-
-function usage {
- echo usage: ${script} -u username -p password -a sysuser -q syspassword [-d domainUID] [-n namespace] [-s secretName] [-h]
- echo " -u username for schema owner (regular user), must be specified."
- echo " -p password for schema owner (regular user), must be specified."
- echo " -a username for SYSDBA user, must be specified."
- echo " -q password for SYSDBA user, must be specified."
- echo " -d domainUID, optional. The default value is wcp-domain. If specified, the secret will be labeled with the domainUID unless the given value is an empty string."
- echo " -n namespace, optional. Use the wcpns namespace if not specified"
- echo " -s secretName, optional. If not specified, the secret name will be determined based on the domainUID value"
- echo " -h Help"
- exit $1
-}
-
-#
-# Parse the command line options
-#
-domainUID=wcp-domain
-namespace=wcpns
-while getopts "hu:p:n:d:s:q:a:" opt; do
- case $opt in
- u) username="${OPTARG}"
- ;;
- p) password="${OPTARG}"
- ;;
- a) sys_username="${OPTARG}"
- ;;
- q) sys_password="${OPTARG}"
- ;;
- n) namespace="${OPTARG}"
- ;;
- d) domainUID="${OPTARG}"
- ;;
- s) secretName="${OPTARG}"
- ;;
- h) usage 0
- ;;
- *) usage 1
- ;;
- esac
-done
-
-if [ -z $secretName ]; then
- if [ -z $domainUID ]; then
- secretName=rcu-credentials
- else
- secretName=$domainUID-rcu-credentials
- fi
-fi
-
-if [ -z ${username} ]; then
- echo "${script}: -u must be specified."
- missingRequiredOption="true"
-fi
-
-if [ -z ${password} ]; then
- echo "${script}: -p must be specified."
- missingRequiredOption="true"
-fi
-
-if [ -z ${sys_username} ]; then
- echo "${script}: -s must be specified."
- missingRequiredOption="true"
-fi
-
-if [ -z ${sys_password} ]; then
- echo "${script}: -q must be specified."
- missingRequiredOption="true"
-fi
-
-if [ "${missingRequiredOption}" == "true" ]; then
- usage 1
-fi
-
-# check and see if the secret already exists
-result=`kubectl get secret ${secretName} -n ${namespace} --ignore-not-found=true | grep ${secretName} | wc | awk ' { print $1; }'`
-if [ "${result:=Error}" != "0" ]; then
- fail "The secret ${secretName} already exists in namespace ${namespace}."
-fi
-
-# create the secret
-kubectl -n $namespace create secret generic $secretName \
- --from-literal=username=$username \
- --from-literal=password=$password \
- --from-literal=sys_username=$sys_username \
- --from-literal=sys_password=$sys_password
-
-# label the secret with domainUID if needed
-if [ ! -z $domainUID ]; then
- kubectl label secret ${secretName} -n $namespace weblogic.domainUID=$domainUID weblogic.domainName=$domainUID
-fi
-
-# Verify the secret exists
-SECRET=`kubectl get secret ${secretName} -n ${namespace} | grep ${secretName} | wc | awk ' { print $1; }'`
-if [ "${SECRET}" != "1" ]; then
- fail "The secret ${secretName} was not found in namespace ${namespace}"
-fi
-
-echo "The secret ${secretName} has been successfully created in the ${namespace} namespace."
-
+#!/usr/bin/env bash
+# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+#
+# Description
+# This sample script creates a Kubernetes secret for RCU credentials.
+#
+# The following pre-requisites must be handled prior to running this script:
+# * The kubernetes namespace must already be created
+#
+# Secret name determination
+# 1) secretName - if specified
+# 2) wcp-domain-rcu-credentials - if secretName and domainUID are both not specified. This is the default out-of-the-box.
+# 3) -rcu-credentials - if secretName is not specified, and domainUID is specified.
+# 4) rcu-credentials - if secretName is not specified, and domainUID is specified as "".
+#
+# The generated secret will be labeled with
+# weblogic.domainUID=$domainUID
+# and
+# weblogic.domainName=$domainUID
+# Where the $domainUID is the value of the -d command line option, unless the value supplied is an empty String ""
+#
+
+script="${BASH_SOURCE[0]}"
+
+#
+# Function to exit and print an error message
+# $1 - text of message
+function fail {
+ echo [ERROR] $*
+ exit 1
+}
+
+# Try to execute kubectl to see whether kubectl is available
+function validateKubectlAvailable {
+ if ! [ -x "$(command -v kubectl)" ]; then
+ fail "kubectl is not installed"
+ fi
+}
+
+function usage {
+ echo usage: ${script} -u username -p password -a sysuser -q syspassword [-d domainUID] [-n namespace] [-s secretName] [-h]
+ echo " -u username for schema owner (regular user), must be specified."
+ echo " -p password for schema owner (regular user), must be specified."
+ echo " -a username for SYSDBA user, must be specified."
+ echo " -q password for SYSDBA user, must be specified."
+ echo " -d domainUID, optional. The default value is wcp-domain. If specified, the secret will be labeled with the domainUID unless the given value is an empty string."
+ echo " -n namespace, optional. Use the wcpns namespace if not specified"
+ echo " -s secretName, optional. If not specified, the secret name will be determined based on the domainUID value"
+ echo " -h Help"
+ exit $1
+}
+
+#
+# Parse the command line options
+#
+domainUID=wcp-domain
+namespace=wcpns
+while getopts "hu:p:n:d:s:q:a:" opt; do
+ case $opt in
+ u) username="${OPTARG}"
+ ;;
+ p) password="${OPTARG}"
+ ;;
+ a) sys_username="${OPTARG}"
+ ;;
+ q) sys_password="${OPTARG}"
+ ;;
+ n) namespace="${OPTARG}"
+ ;;
+ d) domainUID="${OPTARG}"
+ ;;
+ s) secretName="${OPTARG}"
+ ;;
+ h) usage 0
+ ;;
+ *) usage 1
+ ;;
+ esac
+done
+
+if [ -z $secretName ]; then
+ if [ -z $domainUID ]; then
+ secretName=rcu-credentials
+ else
+ secretName=$domainUID-rcu-credentials
+ fi
+fi
+
+if [ -z ${username} ]; then
+ echo "${script}: -u must be specified."
+ missingRequiredOption="true"
+fi
+
+if [ -z ${password} ]; then
+ echo "${script}: -p must be specified."
+ missingRequiredOption="true"
+fi
+
+if [ -z ${sys_username} ]; then
+ echo "${script}: -s must be specified."
+ missingRequiredOption="true"
+fi
+
+if [ -z ${sys_password} ]; then
+ echo "${script}: -q must be specified."
+ missingRequiredOption="true"
+fi
+
+if [ "${missingRequiredOption}" == "true" ]; then
+ usage 1
+fi
+
+# check and see if the secret already exists
+result=`kubectl get secret ${secretName} -n ${namespace} --ignore-not-found=true | grep ${secretName} | wc | awk ' { print $1; }'`
+if [ "${result:=Error}" != "0" ]; then
+ fail "The secret ${secretName} already exists in namespace ${namespace}."
+fi
+
+# create the secret
+kubectl -n $namespace create secret generic $secretName \
+ --from-literal=username=$username \
+ --from-literal=password=$password \
+ --from-literal=sys_username=$sys_username \
+ --from-literal=sys_password=$sys_password
+
+# label the secret with domainUID if needed
+if [ ! -z $domainUID ]; then
+ kubectl label secret ${secretName} -n $namespace weblogic.domainUID=$domainUID weblogic.domainName=$domainUID
+fi
+
+# Verify the secret exists
+SECRET=`kubectl get secret ${secretName} -n ${namespace} | grep ${secretName} | wc | awk ' { print $1; }'`
+if [ "${SECRET}" != "1" ]; then
+ fail "The secret ${secretName} was not found in namespace ${namespace}"
+fi
+
+echo "The secret ${secretName} has been successfully created in the ${namespace} namespace."
+
diff --git a/OracleWebCenterPortal/kubernetes/create-rcu-schema/README.md b/OracleWebCenterPortal/kubernetes/create-rcu-schema/README.md
old mode 100644
new mode 100755
index 38b0068fa..6ad38b1fe
--- a/OracleWebCenterPortal/kubernetes/create-rcu-schema/README.md
+++ b/OracleWebCenterPortal/kubernetes/create-rcu-schema/README.md
@@ -1,219 +1,219 @@
-# Managing RCU schema for a OracleWebCenterPortal domain
-
-The sample scripts in this directory demonstrate how to:
-* Create an RCU schema in the Oracle DB that will be used by a OracleWebCenterPortal domain.
-* Delete the RCU schema in the Oracle DB used by a OracleWebCenterPortal domain.
-
-## Start an Oracle Database service in a Kubernetes cluster
-
-Use the script ``samples/scripts/create-oracle-db-service/start-db-service.sh``
-
-For creating a OracleWebCenterPortal domain, you can use the Database connection string, `oracle-db.default.svc.cluster.local:1521/devpdb.k8s`, as an `rcuDatabaseURL` parameter in the `domain.input.yaml` file.
-
-You can access the Database through the NodePort outside of the Kubernetes cluster, using the URL `:30011/devpdb.k8s`.
-
-**Note**: To create a OracleWebCenterPortal domain image, the domain-in-image model needs a public Database URL as an `rcuDatabaseURL` parameter.
-
-
-## Create the RCU schema in the Oracle Database
-
-This script generates the RCU schema based `schemaPrefix` and `dburl`.
-
-The script assumes that either the image, `oracle/wcportal:12.2.1.4`, is available in the nodes or an `ImagePullSecret` is created to pull the image. To create a secret, see the script `create-image-pull-secret.sh`.
-
-```
-$ ./create-rcu-schema.sh -h
-usage: ./create-rcu-schema.sh -s -t -d -i -u -p -n -q -r -o -c [-h]
- -s RCU Schema Prefix (required)
- -t RCU Schema Type (optional)
- (supported values: wcp,wcpp)
- -d RCU Oracle Database URL (optional)
- (default: oracle-db.default.svc.cluster.local:1521/devpdb.k8s)
- -p OracleWebCenterPortal ImagePullSecret (optional)
- (default: none)
- -i OracleWebCenterPortal Image (optional)
- (default: oracle/wcportal:12.2.1.4)
- -u OracleWebCenterPortal ImagePullPolicy (optional)
- (default: IfNotPresent)
- -n Namespace for RCU pod (optional)
- (default: default)
- -q password for database SYSDBA user. (optional)
- (default: Oradoc_db1)
- -r password for all schema owner (regular user). (optional)
- (default: Oradoc_db1)
- -o Output directory for the generated YAML file. (optional)
- (default: rcuoutput)
- -c Comma-separated variables in the format variablename=value. (optional).
- (default: none)
- -h Help
-
-$ ./create-rcu-schema.sh -s domain1
-ImagePullSecret[none] Image[oracle/wcportal:12.2.1.4] dburl[oracle-db.default.svc.cluster.local:1521/devpdb.k8s] rcuType[wcp] customVariables[none]
-pod/rcu created
-[rcu] already initialized ..
-Checking Pod READY column for State [1/1]
-Pod [rcu] Status is Ready Iter [1/60]
-NAME READY STATUS RESTARTS AGE
-rcu 1/1 Running 0 6s
-NAME READY STATUS RESTARTS AGE
-rcu 1/1 Running 0 11s
-CLASSPATH=/u01/jdk/lib/tools.jar:/u01/oracle/wlserver/modules/features/wlst.wls.classpath.jar:
-
-PATH=/u01/oracle/wlserver/server/bin:/u01/oracle/wlserver/../oracle_common/modules/thirdparty/org.apache.ant/1.10.5.0.0/apache-ant-1.10.5/bin:/u01/jdk/jre/bin:/u01/jdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/u01/jdk/bin:/u01/oracle/oracle_common/common/bin:/u01/oracle/wlserver/common/bin:/u01/oracle:/u01/oracle/wlserver/../oracle_common/modules/org.apache.maven_3.2.5/bin
-
-Your environment has been set.
-Check if the DB Service is ready to accept request
-DB Connection String [oracle-db.default.svc.cluster.local:1521/devpdb.k8s], schemaPrefix [wcp-domain] rcuType [wcp]
-
-**** Success!!! ****
-
-You can connect to the database in your app using:
-
- java.util.Properties props = new java.util.Properties();
- props.put("user", "sys as sysdba");
- props.put("password", "Oradoc_db1");
- java.sql.Driver d =
- Class.forName("oracle.jdbc.OracleDriver").newInstance();
- java.sql.Connection conn =
- Driver.connect("sys as sysdba", props);
-Creating RCU Schema for OracleWebCenterPortal Domain ...
-Extra RCU Schema Component Choosen[]
-
-Processing command line ....
-
-Repository Creation Utility - Checking Prerequisites
-Checking Component Prerequisites
-Repository Creation Utility - Creating Tablespaces
-Validating and Creating Tablespaces
-Create tablespaces in the repository database
-Repository Creation Utility - Create
-Repository Create in progress.
-Executing pre create operations
- Percent Complete: 20
- Percent Complete: 20
- .....
- Percent Complete: 96
- Percent Complete: 100
- .....
-Executing post create operations
-
-Repository Creation Utility: Create - Completion Summary
-
-Database details:
------------------------------
-Host Name : oracle-db.default.svc.cluster.local
-Port : 1521
-Service Name : DEVPDB.K8S
-Connected As : sys
-Prefix for (prefixable) Schema Owners : DOMAIN1
-RCU Logfile : /tmp/RCU2020-05-01_14-35_1160633335/logs/rcu.log
-
-Component schemas created:
------------------------------
-Component Status Logfile
-
-Common Infrastructure Services Success /tmp/RCU2020-05-01_14-35_1160633335/logs/stb.log
-Oracle Platform Security Services Success /tmp/RCU2020-05-01_14-35_1160633335/logs/opss.log
-Audit Services Success /tmp/RCU2020-05-01_14-35_1160633335/logs/iau.log
-Audit Services Append Success /tmp/RCU2020-05-01_14-35_1160633335/logs/iau_append.log
-Audit Services Viewer Success /tmp/RCU2020-05-01_14-35_1160633335/logs/iau_viewer.log
-Metadata Services Success /tmp/RCU2020-05-01_14-35_1160633335/logs/mds.log
-WebLogic Services Success /tmp/RCU2020-05-01_14-35_1160633335/logs/wls.log
-
-Repository Creation Utility - Create : Operation Completed
-[INFO] Modify the domain.input.yaml to use [oracle-db.default.svc.cluster.local:1521/devpdb.k8s] as rcuDatabaseURL and [domain1] as rcuSchemaPrefix
-```
-
-## Drop the RCU schema from the Oracle Database
-
-Use this script to drop the RCU schema based `schemaPrefix` and `dburl`.
-
-```
-$ ./drop-rcu-schema.sh -h
-usage: ./drop-rcu-schema.sh -s -d -n -q -r [-h]
- -s RCU Schema Prefix (required)
- -t RCU Schema Type (optional)
- (supported values: wcp,wcpp)
- -d Oracle Database URL (optional)
- (default: oracle-db.default.svc.cluster.local:1521/devpdb.k8s)
- -n Namespace where RCU pod is deployed (optional)
- (default: default)
- -q password for database SYSDBA user. (optional)
- (default: Oradoc_db1)
- -r password for all schema owner (regular user). (optional)
- (default: Oradoc_db1)
- -c Comma-separated variables in the format variablename=value. (optional).
- (default: none)
- -h Help
-
-$ ./drop-rcu-schema.sh -s domain1
-CLASSPATH=/u01/jdk/lib/tools.jar:/u01/oracle/wlserver/modules/features/wlst.wls.classpath.jar:
-
-PATH=/u01/oracle/wlserver/server/bin:/u01/oracle/wlserver/../oracle_common/modules/thirdparty/org.apache.ant/1.10.5.0.0/apache-ant-1.10.5/bin:/u01/jdk/jre/bin:/u01/jdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/u01/jdk/bin:/u01/oracle/oracle_common/common/bin:/u01/oracle/wlserver/common/bin:/u01/oracle:/u01/oracle/wlserver/../oracle_common/modules/org.apache.maven_3.2.5/bin
-
-Your environment has been set.
-Check if the DB Service is ready to accept request
-DB Connection String [oracle-db.default.svc.cluster.local:1521/devpdb.k8s] schemaPrefix [domain1] rcuType[wcp]
-
-**** Success!!! ****
-
-You can connect to the database in your app using:
-
- java.util.Properties props = new java.util.Properties();
- props.put("user", "sys as sysdba");
- props.put("password", "Oradoc_db1");
- java.sql.Driver d =
- Class.forName("oracle.jdbc.OracleDriver").newInstance();
- java.sql.Connection conn =
- Driver.connect("sys as sysdba", props);
-Dropping RCU Schema for OracleWebCenterPortal Domain ...
-Extra RCU Schema Component(s) Choosen[]
-
-Processing command line ....
-Repository Creation Utility - Checking Prerequisites
-Checking Global Prerequisites
-Repository Creation Utility - Checking Prerequisites
-Checking Component Prerequisites
-Repository Creation Utility - Drop
-Repository Drop in progress.
- Percent Complete: 2
- Percent Complete: 14
- .....
- Percent Complete: 99
- Percent Complete: 100
- .....
-
-Repository Creation Utility: Drop - Completion Summary
-
-Database details:
------------------------------
-Host Name : oracle-db.default.svc.cluster.local
-Port : 1521
-Service Name : DEVPDB.K8S
-Connected As : sys
-Prefix for (prefixable) Schema Owners : DOMAIN1
-RCU Logfile : /tmp/RCU2020-05-01_14-42_651700358/logs/rcu.log
-
-Component schemas dropped:
------------------------------
-Component Status Logfile
-
-Common Infrastructure Services Success /tmp/RCU2020-05-01_14-42_651700358/logs/stb.log
-Oracle Platform Security Services Success /tmp/RCU2020-05-01_14-42_651700358/logs/opss.log
-Audit Services Success /tmp/RCU2020-05-01_14-42_651700358/logs/iau.log
-Audit Services Append Success /tmp/RCU2020-05-01_14-42_651700358/logs/iau_append.log
-Audit Services Viewer Success /tmp/RCU2020-05-01_14-42_651700358/logs/iau_viewer.log
-Metadata Services Success /tmp/RCU2020-05-01_14-42_651700358/logs/mds.log
-WebLogic Services Success /tmp/RCU2020-05-01_14-42_651700358/logs/wls.log
-
-Repository Creation Utility - Drop : Operation Completed
-pod "rcu" deleted
-Checking Status for Pod [rcu] in namesapce [default]
-Error from server (NotFound): pods "rcu" not found
-Pod [rcu] removed from nameSpace [default]
-```
-
-## Stop an Oracle Database service in a Kubernetes cluster
-
-Use the script ``samples/scripts/create-oracle-db-service/stop-db-service.sh``
-
+# Managing RCU schema for a OracleWebCenterPortal domain
+
+The sample scripts in this directory demonstrate how to:
+* Create an RCU schema in the Oracle DB that will be used by a OracleWebCenterPortal domain.
+* Delete the RCU schema in the Oracle DB used by a OracleWebCenterPortal domain.
+
+## Start an Oracle Database service in a Kubernetes cluster
+
+Use the script ``samples/scripts/create-oracle-db-service/start-db-service.sh``
+
+For creating a OracleWebCenterPortal domain, you can use the Database connection string, `oracle-db.default.svc.cluster.local:1521/devpdb.k8s`, as an `rcuDatabaseURL` parameter in the `domain.input.yaml` file.
+
+You can access the Database through the NodePort outside of the Kubernetes cluster, using the URL `:30011/devpdb.k8s`.
+
+**Note**: To create a OracleWebCenterPortal domain image, the domain-in-image model needs a public Database URL as an `rcuDatabaseURL` parameter.
+
+
+## Create the RCU schema in the Oracle Database
+
+This script generates the RCU schema based `schemaPrefix` and `dburl`.
+
+The script assumes that either the image, `oracle/wcportal:12.2.1.4`, is available in the nodes or an `ImagePullSecret` is created to pull the image. To create a secret, see the script `create-image-pull-secret.sh`.
+
+```
+$ ./create-rcu-schema.sh -h
+usage: ./create-rcu-schema.sh -s -t -d -i -u -p -n -q -r -o -c [-h]
+ -s RCU Schema Prefix (required)
+ -t RCU Schema Type (optional)
+ (supported values: wcp,wcpp)
+ -d RCU Oracle Database URL (optional)
+ (default: oracle-db.default.svc.cluster.local:1521/devpdb.k8s)
+ -p OracleWebCenterPortal ImagePullSecret (optional)
+ (default: none)
+ -i OracleWebCenterPortal Image (optional)
+ (default: oracle/wcportal:12.2.1.4)
+ -u OracleWebCenterPortal ImagePullPolicy (optional)
+ (default: IfNotPresent)
+ -n Namespace for RCU pod (optional)
+ (default: default)
+ -q password for database SYSDBA user. (optional)
+ (default: Oradoc_db1)
+ -r password for all schema owner (regular user). (optional)
+ (default: Oradoc_db1)
+ -o Output directory for the generated YAML file. (optional)
+ (default: rcuoutput)
+ -c Comma-separated variables in the format variablename=value. (optional).
+ (default: none)
+ -h Help
+
+$ ./create-rcu-schema.sh -s domain1
+ImagePullSecret[none] Image[oracle/wcportal:12.2.1.4] dburl[oracle-db.default.svc.cluster.local:1521/devpdb.k8s] rcuType[wcp] customVariables[none]
+pod/rcu created
+[rcu] already initialized ..
+Checking Pod READY column for State [1/1]
+Pod [rcu] Status is Ready Iter [1/60]
+NAME READY STATUS RESTARTS AGE
+rcu 1/1 Running 0 6s
+NAME READY STATUS RESTARTS AGE
+rcu 1/1 Running 0 11s
+CLASSPATH=/u01/jdk/lib/tools.jar:/u01/oracle/wlserver/modules/features/wlst.wls.classpath.jar:
+
+PATH=/u01/oracle/wlserver/server/bin:/u01/oracle/wlserver/../oracle_common/modules/thirdparty/org.apache.ant/1.10.5.0.0/apache-ant-1.10.5/bin:/u01/jdk/jre/bin:/u01/jdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/u01/jdk/bin:/u01/oracle/oracle_common/common/bin:/u01/oracle/wlserver/common/bin:/u01/oracle:/u01/oracle/wlserver/../oracle_common/modules/org.apache.maven_3.2.5/bin
+
+Your environment has been set.
+Check if the DB Service is ready to accept request
+DB Connection String [oracle-db.default.svc.cluster.local:1521/devpdb.k8s], schemaPrefix [wcp-domain] rcuType [wcp]
+
+**** Success!!! ****
+
+You can connect to the database in your app using:
+
+ java.util.Properties props = new java.util.Properties();
+ props.put("user", "sys as sysdba");
+ props.put("password", "Oradoc_db1");
+ java.sql.Driver d =
+ Class.forName("oracle.jdbc.OracleDriver").newInstance();
+ java.sql.Connection conn =
+ Driver.connect("sys as sysdba", props);
+Creating RCU Schema for OracleWebCenterPortal Domain ...
+Extra RCU Schema Component Choosen[]
+
+Processing command line ....
+
+Repository Creation Utility - Checking Prerequisites
+Checking Component Prerequisites
+Repository Creation Utility - Creating Tablespaces
+Validating and Creating Tablespaces
+Create tablespaces in the repository database
+Repository Creation Utility - Create
+Repository Create in progress.
+Executing pre create operations
+ Percent Complete: 20
+ Percent Complete: 20
+ .....
+ Percent Complete: 96
+ Percent Complete: 100
+ .....
+Executing post create operations
+
+Repository Creation Utility: Create - Completion Summary
+
+Database details:
+-----------------------------
+Host Name : oracle-db.default.svc.cluster.local
+Port : 1521
+Service Name : DEVPDB.K8S
+Connected As : sys
+Prefix for (prefixable) Schema Owners : DOMAIN1
+RCU Logfile : /tmp/RCU2020-05-01_14-35_1160633335/logs/rcu.log
+
+Component schemas created:
+-----------------------------
+Component Status Logfile
+
+Common Infrastructure Services Success /tmp/RCU2020-05-01_14-35_1160633335/logs/stb.log
+Oracle Platform Security Services Success /tmp/RCU2020-05-01_14-35_1160633335/logs/opss.log
+Audit Services Success /tmp/RCU2020-05-01_14-35_1160633335/logs/iau.log
+Audit Services Append Success /tmp/RCU2020-05-01_14-35_1160633335/logs/iau_append.log
+Audit Services Viewer Success /tmp/RCU2020-05-01_14-35_1160633335/logs/iau_viewer.log
+Metadata Services Success /tmp/RCU2020-05-01_14-35_1160633335/logs/mds.log
+WebLogic Services Success /tmp/RCU2020-05-01_14-35_1160633335/logs/wls.log
+
+Repository Creation Utility - Create : Operation Completed
+[INFO] Modify the domain.input.yaml to use [oracle-db.default.svc.cluster.local:1521/devpdb.k8s] as rcuDatabaseURL and [domain1] as rcuSchemaPrefix
+```
+
+## Drop the RCU schema from the Oracle Database
+
+Use this script to drop the RCU schema based `schemaPrefix` and `dburl`.
+
+```
+$ ./drop-rcu-schema.sh -h
+usage: ./drop-rcu-schema.sh -s -d -n -q -r [-h]
+ -s RCU Schema Prefix (required)
+ -t RCU Schema Type (optional)
+ (supported values: wcp,wcpp)
+ -d Oracle Database URL (optional)
+ (default: oracle-db.default.svc.cluster.local:1521/devpdb.k8s)
+ -n Namespace where RCU pod is deployed (optional)
+ (default: default)
+ -q password for database SYSDBA user. (optional)
+ (default: Oradoc_db1)
+ -r password for all schema owner (regular user). (optional)
+ (default: Oradoc_db1)
+ -c Comma-separated variables in the format variablename=value. (optional).
+ (default: none)
+ -h Help
+
+$ ./drop-rcu-schema.sh -s domain1
+CLASSPATH=/u01/jdk/lib/tools.jar:/u01/oracle/wlserver/modules/features/wlst.wls.classpath.jar:
+
+PATH=/u01/oracle/wlserver/server/bin:/u01/oracle/wlserver/../oracle_common/modules/thirdparty/org.apache.ant/1.10.5.0.0/apache-ant-1.10.5/bin:/u01/jdk/jre/bin:/u01/jdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/u01/jdk/bin:/u01/oracle/oracle_common/common/bin:/u01/oracle/wlserver/common/bin:/u01/oracle:/u01/oracle/wlserver/../oracle_common/modules/org.apache.maven_3.2.5/bin
+
+Your environment has been set.
+Check if the DB Service is ready to accept request
+DB Connection String [oracle-db.default.svc.cluster.local:1521/devpdb.k8s] schemaPrefix [domain1] rcuType[wcp]
+
+**** Success!!! ****
+
+You can connect to the database in your app using:
+
+ java.util.Properties props = new java.util.Properties();
+ props.put("user", "sys as sysdba");
+ props.put("password", "Oradoc_db1");
+ java.sql.Driver d =
+ Class.forName("oracle.jdbc.OracleDriver").newInstance();
+ java.sql.Connection conn =
+ Driver.connect("sys as sysdba", props);
+Dropping RCU Schema for OracleWebCenterPortal Domain ...
+Extra RCU Schema Component(s) Choosen[]
+
+Processing command line ....
+Repository Creation Utility - Checking Prerequisites
+Checking Global Prerequisites
+Repository Creation Utility - Checking Prerequisites
+Checking Component Prerequisites
+Repository Creation Utility - Drop
+Repository Drop in progress.
+ Percent Complete: 2
+ Percent Complete: 14
+ .....
+ Percent Complete: 99
+ Percent Complete: 100
+ .....
+
+Repository Creation Utility: Drop - Completion Summary
+
+Database details:
+-----------------------------
+Host Name : oracle-db.default.svc.cluster.local
+Port : 1521
+Service Name : DEVPDB.K8S
+Connected As : sys
+Prefix for (prefixable) Schema Owners : DOMAIN1
+RCU Logfile : /tmp/RCU2020-05-01_14-42_651700358/logs/rcu.log
+
+Component schemas dropped:
+-----------------------------
+Component Status Logfile
+
+Common Infrastructure Services Success /tmp/RCU2020-05-01_14-42_651700358/logs/stb.log
+Oracle Platform Security Services Success /tmp/RCU2020-05-01_14-42_651700358/logs/opss.log
+Audit Services Success /tmp/RCU2020-05-01_14-42_651700358/logs/iau.log
+Audit Services Append Success /tmp/RCU2020-05-01_14-42_651700358/logs/iau_append.log
+Audit Services Viewer Success /tmp/RCU2020-05-01_14-42_651700358/logs/iau_viewer.log
+Metadata Services Success /tmp/RCU2020-05-01_14-42_651700358/logs/mds.log
+WebLogic Services Success /tmp/RCU2020-05-01_14-42_651700358/logs/wls.log
+
+Repository Creation Utility - Drop : Operation Completed
+pod "rcu" deleted
+Checking Status for Pod [rcu] in namesapce [default]
+Error from server (NotFound): pods "rcu" not found
+Pod [rcu] removed from nameSpace [default]
+```
+
+## Stop an Oracle Database service in a Kubernetes cluster
+
+Use the script ``samples/scripts/create-oracle-db-service/stop-db-service.sh``
+
diff --git a/OracleWebCenterPortal/kubernetes/create-rcu-schema/common/createRepository.sh b/OracleWebCenterPortal/kubernetes/create-rcu-schema/common/createRepository.sh
old mode 100644
new mode 100755
index 61da67e55..c4297fbb2
--- a/OracleWebCenterPortal/kubernetes/create-rcu-schema/common/createRepository.sh
+++ b/OracleWebCenterPortal/kubernetes/create-rcu-schema/common/createRepository.sh
@@ -1,72 +1,72 @@
-#!/bin/bash
-# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-#
-. /u01/oracle/wlserver/server/bin/setWLSEnv.sh
-
-echo "Check if the DB Service is ready to accept request "
-connectString=${1:-oracle-db.default.svc.cluster.local:1521/devpdb.k8s}
-schemaPrefix=${2:-wcp-domain}
-rcuType=${3:-wcp}
-sysPassword=${4:-Oradoc_db1}
-customVariables=${5:-none}
-
-echo "DB Connection String [$connectString], schemaPrefix [${schemaPrefix}] rcuType [${rcuType}] customVariables [${customVariables}]"
-
-max=100
-counter=0
-while [ $counter -le ${max} ]
-do
- java utils.dbping ORACLE_THIN "sys as sysdba" ${sysPassword} ${connectString} > dbping.err 2>&1
- [[ $? == 0 ]] && break;
- ((counter++))
- echo "[$counter/${max}] Retrying the DB Connection ..."
- sleep 10
-done
-
-if [ $counter -gt ${max} ]; then
- echo "Error output from 'java utils.dbping ORACLE_THIN \"sys as sysdba\" SYSPASSWORD ${connectString}' from '$(pwd)/dbping.err':"
- cat dbping.err
- echo "[ERROR] Oracle DB Service is not ready after [${max}] iterations ..."
- exit -1
-else
- java utils.dbping ORACLE_THIN "sys as sysdba" ${sysPassword} ${connectString}
-fi
-
-if [ $customVariables != "none" ]; then
- extVariables="-variables $customVariables"
-else
- extVariables=""
-fi
-case $rcuType in
-
-wcp)
- extComponents="-component WEBCENTER -component ACTIVITIES"
- echo "Creating RCU Schema for OracleWebCenterPortal Domain ..."
- ;;
-wcpp)
- extComponents="-component WEBCENTER -component PORTLET -component ACTIVITIES"
- echo "Creating RCU Schema for OracleWebCenterPortal Domain ..."
- ;;
- * )
- echo "[ERROR] Unknown RCU Schema Type [$rcuType]"
- echo "Supported values: wcp,wcpp"
- exit -1
- ;;
-esac
-
-echo "Extra RCU Schema Component Choosen[${extComponents}]"
-echo "Extra RCU Schema Variable Choosen[${extVariables}]"
-
-#Debug
-#export DISPLAY=0.0
-#/u01/oracle/oracle_common/bin/rcu -listComponents
-
-/u01/oracle/oracle_common/bin/rcu -silent -createRepository \
- -databaseType ORACLE -connectString ${connectString} \
- -dbUser sys -dbRole sysdba -useSamePasswordForAllSchemaUsers true \
- -selectDependentsForComponents true \
- -schemaPrefix ${schemaPrefix} ${extComponents} ${extVariables} \
- -component MDS -component IAU -component IAU_APPEND -component IAU_VIEWER \
- -component OPSS -component WLS -component STB < /u01/oracle/pwd.txt
-
+#!/bin/bash
+# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+#
+. /u01/oracle/wlserver/server/bin/setWLSEnv.sh
+
+echo "Check if the DB Service is ready to accept request "
+connectString=${1:-oracle-db.default.svc.cluster.local:1521/devpdb.k8s}
+schemaPrefix=${2:-wcp-domain}
+rcuType=${3:-wcp}
+sysPassword=${4:-Oradoc_db1}
+customVariables=${5:-none}
+
+echo "DB Connection String [$connectString], schemaPrefix [${schemaPrefix}] rcuType [${rcuType}] customVariables [${customVariables}]"
+
+max=100
+counter=0
+while [ $counter -le ${max} ]
+do
+ java utils.dbping ORACLE_THIN "sys as sysdba" ${sysPassword} ${connectString} > dbping.err 2>&1
+ [[ $? == 0 ]] && break;
+ ((counter++))
+ echo "[$counter/${max}] Retrying the DB Connection ..."
+ sleep 10
+done
+
+if [ $counter -gt ${max} ]; then
+ echo "Error output from 'java utils.dbping ORACLE_THIN \"sys as sysdba\" SYSPASSWORD ${connectString}' from '$(pwd)/dbping.err':"
+ cat dbping.err
+ echo "[ERROR] Oracle DB Service is not ready after [${max}] iterations ..."
+ exit -1
+else
+ java utils.dbping ORACLE_THIN "sys as sysdba" ${sysPassword} ${connectString}
+fi
+
+if [ $customVariables != "none" ]; then
+ extVariables="-variables $customVariables"
+else
+ extVariables=""
+fi
+case $rcuType in
+
+wcp)
+ extComponents="-component WEBCENTER -component ACTIVITIES"
+ echo "Creating RCU Schema for OracleWebCenterPortal Domain ..."
+ ;;
+wcpp)
+ extComponents="-component WEBCENTER -component PORTLET -component ACTIVITIES"
+ echo "Creating RCU Schema for OracleWebCenterPortal Domain ..."
+ ;;
+ * )
+ echo "[ERROR] Unknown RCU Schema Type [$rcuType]"
+ echo "Supported values: wcp,wcpp"
+ exit -1
+ ;;
+esac
+
+echo "Extra RCU Schema Component Choosen[${extComponents}]"
+echo "Extra RCU Schema Variable Choosen[${extVariables}]"
+
+#Debug
+#export DISPLAY=0.0
+#/u01/oracle/oracle_common/bin/rcu -listComponents
+
+/u01/oracle/oracle_common/bin/rcu -silent -createRepository \
+ -databaseType ORACLE -connectString ${connectString} \
+ -dbUser sys -dbRole sysdba -useSamePasswordForAllSchemaUsers true \
+ -selectDependentsForComponents true \
+ -schemaPrefix ${schemaPrefix} ${extComponents} ${extVariables} \
+ -component MDS -component IAU -component IAU_APPEND -component IAU_VIEWER \
+ -component OPSS -component WLS -component STB < /u01/oracle/pwd.txt
+
diff --git a/OracleWebCenterPortal/kubernetes/create-rcu-schema/common/dropRepository.sh b/OracleWebCenterPortal/kubernetes/create-rcu-schema/common/dropRepository.sh
old mode 100644
new mode 100755
index 52b6b618c..d77d47618
--- a/OracleWebCenterPortal/kubernetes/create-rcu-schema/common/dropRepository.sh
+++ b/OracleWebCenterPortal/kubernetes/create-rcu-schema/common/dropRepository.sh
@@ -1,66 +1,66 @@
-#!/bin/bash
-# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-#
-. /u01/oracle/wlserver/server/bin/setWLSEnv.sh
-
-echo "Check if the DB Service is ready to accept request "
-connectString=${1:-oracle-db.default.svc.cluster.local:1521/devpdb.k8s}
-schemaPrefix=${2:-wcp-domain}
-rcuType=${3:-wcp}
-sysPassword=${4:-Oradoc_db1}
-customVariables=${5:-none}
-
-echo "DB Connection String [$connectString] schemaPrefix [${schemaPrefix}] rcuType[${rcuType}] customVariables[${customVariables}]"
-
-max=20
-counter=0
-while [ $counter -le ${max} ]
-do
- java utils.dbping ORACLE_THIN "sys as sysdba" ${sysPassword} ${connectString} > dbping.err 2>&1
- [[ $? == 0 ]] && break;
- ((counter++))
- echo "[$counter/${max}] Retrying the DB Connection ..."
- sleep 10
-done
-
-if [ $counter -gt ${max} ]; then
- echo "[ERROR] Oracle DB Service is not ready after [${max}] iterations ..."
- exit -1
-else
- java utils.dbping ORACLE_THIN "sys as sysdba" ${sysPassword} ${connectString}
-fi
-
-if [ $customVariables != "none" ]; then
- extVariables="-variables $customVariables"
-else
- extVariables=""
-fi
-
-case $rcuType in
-wcp)
- extComponents="-component WEBCENTER -component ACTIVITIES"
- echo "Dropping RCU Schema for OracleWebCenterPortal Domain ..."
- ;;
-wcpp)
- extComponents="-component WEBCENTER -component PORTLET -component ACTIVITIES"
- echo "Dropping RCU Schema for OracleWebCenterPortal Domain ..."
- ;;
- * )
- echo "[ERROR] Unknown RCU Schema Type [$rcuType]"
- echo "Supported values: wcp,wcpp"
- exit -1
- ;;
-esac
-
-echo "Extra RCU Schema Component(s) Choosen[${extComponents}]"
-echo "Extra RCU Schema Variable(s) Choosen[${extVariables}]"
-
-/u01/oracle/oracle_common/bin/rcu -silent -dropRepository \
- -databaseType ORACLE -connectString ${connectString} \
- -dbUser sys -dbRole sysdba \
- -selectDependentsForComponents true \
- -schemaPrefix ${schemaPrefix} ${extComponents} ${extVariables} \
- -component MDS -component IAU -component IAU_APPEND -component IAU_VIEWER \
- -component OPSS -component WLS -component STB < /u01/oracle/pwd.txt
-
+#!/bin/bash
+# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+#
+. /u01/oracle/wlserver/server/bin/setWLSEnv.sh
+
+echo "Check if the DB Service is ready to accept request "
+connectString=${1:-oracle-db.default.svc.cluster.local:1521/devpdb.k8s}
+schemaPrefix=${2:-wcp-domain}
+rcuType=${3:-wcp}
+sysPassword=${4:-Oradoc_db1}
+customVariables=${5:-none}
+
+echo "DB Connection String [$connectString] schemaPrefix [${schemaPrefix}] rcuType[${rcuType}] customVariables[${customVariables}]"
+
+max=20
+counter=0
+while [ $counter -le ${max} ]
+do
+ java utils.dbping ORACLE_THIN "sys as sysdba" ${sysPassword} ${connectString} > dbping.err 2>&1
+ [[ $? == 0 ]] && break;
+ ((counter++))
+ echo "[$counter/${max}] Retrying the DB Connection ..."
+ sleep 10
+done
+
+if [ $counter -gt ${max} ]; then
+ echo "[ERROR] Oracle DB Service is not ready after [${max}] iterations ..."
+ exit -1
+else
+ java utils.dbping ORACLE_THIN "sys as sysdba" ${sysPassword} ${connectString}
+fi
+
+if [ $customVariables != "none" ]; then
+ extVariables="-variables $customVariables"
+else
+ extVariables=""
+fi
+
+case $rcuType in
+wcp)
+ extComponents="-component WEBCENTER -component ACTIVITIES"
+ echo "Dropping RCU Schema for OracleWebCenterPortal Domain ..."
+ ;;
+wcpp)
+ extComponents="-component WEBCENTER -component PORTLET -component ACTIVITIES"
+ echo "Dropping RCU Schema for OracleWebCenterPortal Domain ..."
+ ;;
+ * )
+ echo "[ERROR] Unknown RCU Schema Type [$rcuType]"
+ echo "Supported values: wcp,wcpp"
+ exit -1
+ ;;
+esac
+
+echo "Extra RCU Schema Component(s) Choosen[${extComponents}]"
+echo "Extra RCU Schema Variable(s) Choosen[${extVariables}]"
+
+/u01/oracle/oracle_common/bin/rcu -silent -dropRepository \
+ -databaseType ORACLE -connectString ${connectString} \
+ -dbUser sys -dbRole sysdba \
+ -selectDependentsForComponents true \
+ -schemaPrefix ${schemaPrefix} ${extComponents} ${extVariables} \
+ -component MDS -component IAU -component IAU_APPEND -component IAU_VIEWER \
+ -component OPSS -component WLS -component STB < /u01/oracle/pwd.txt
+
diff --git a/OracleWebCenterPortal/kubernetes/create-rcu-schema/common/rcu.yaml b/OracleWebCenterPortal/kubernetes/create-rcu-schema/common/rcu.yaml
old mode 100644
new mode 100755
index e292646b9..50ea4a9aa
--- a/OracleWebCenterPortal/kubernetes/create-rcu-schema/common/rcu.yaml
+++ b/OracleWebCenterPortal/kubernetes/create-rcu-schema/common/rcu.yaml
@@ -1,20 +1,20 @@
-# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-#
-apiVersion: v1
-kind: Pod
-metadata:
- labels:
- run: rcu
- name: rcu
- namespace: default
-spec:
- containers:
- - args:
- - sleep
- - infinity
- image: oracle/wcportal:12.2.1.4
- imagePullPolicy: IfNotPresent
- name: rcu
- imagePullSecrets:
- - name: docker-store
+# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+#
+apiVersion: v1
+kind: Pod
+metadata:
+ labels:
+ run: rcu
+ name: rcu
+ namespace: default
+spec:
+ containers:
+ - args:
+ - sleep
+ - infinity
+ image: oracle/wcportal:12.2.1.4
+ imagePullPolicy: IfNotPresent
+ name: rcu
+ imagePullSecrets:
+ - name: docker-store
diff --git a/OracleWebCenterPortal/kubernetes/create-rcu-schema/common/template/rcu.yaml.template b/OracleWebCenterPortal/kubernetes/create-rcu-schema/common/template/rcu.yaml.template
old mode 100644
new mode 100755
index b4463793c..87618bb66
--- a/OracleWebCenterPortal/kubernetes/create-rcu-schema/common/template/rcu.yaml.template
+++ b/OracleWebCenterPortal/kubernetes/create-rcu-schema/common/template/rcu.yaml.template
@@ -1,22 +1,22 @@
-# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-#
-# This is a template for RCU Pod
-#
-apiVersion: v1
-kind: Pod
-metadata:
- labels:
- run: rcu
- name: rcu
- namespace: %NAMESPACE%
-spec:
- containers:
- - args:
- - sleep
- - infinity
- image: oracle/wcportal:12.2.1.4
- imagePullPolicy: %WEBLOGIC_IMAGE_PULL_POLICY%
- name: rcu
- %WEBLOGIC_IMAGE_PULL_SECRET_PREFIX%imagePullSecrets:
- %WEBLOGIC_IMAGE_PULL_SECRET_PREFIX%- name: %WEBLOGIC_IMAGE_PULL_SECRET_NAME%
+# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+#
+# This is a template for RCU Pod
+#
+apiVersion: v1
+kind: Pod
+metadata:
+ labels:
+ run: rcu
+ name: rcu
+ namespace: %NAMESPACE%
+spec:
+ containers:
+ - args:
+ - sleep
+ - infinity
+ image: oracle/wcportal:12.2.1.4
+ imagePullPolicy: %WEBLOGIC_IMAGE_PULL_POLICY%
+ name: rcu
+ %WEBLOGIC_IMAGE_PULL_SECRET_PREFIX%imagePullSecrets:
+ %WEBLOGIC_IMAGE_PULL_SECRET_PREFIX%- name: %WEBLOGIC_IMAGE_PULL_SECRET_NAME%
diff --git a/OracleWebCenterPortal/kubernetes/create-rcu-schema/create-image-pull-secret.sh b/OracleWebCenterPortal/kubernetes/create-rcu-schema/create-image-pull-secret.sh
old mode 100644
new mode 100755
index abf2dcbf9..2ebf08c6e
--- a/OracleWebCenterPortal/kubernetes/create-rcu-schema/create-image-pull-secret.sh
+++ b/OracleWebCenterPortal/kubernetes/create-rcu-schema/create-image-pull-secret.sh
@@ -1,59 +1,59 @@
-#!/bin/bash
-# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-#
-# Create ImagePullSecret to pull Oracle DB and OracleWebCenterPortal Image
-
-script="${BASH_SOURCE[0]}"
-scriptDir="$( cd "$( dirname "${script}" )" && pwd )"
-
-function usage {
- echo "usage: ${script} -u -p -e -s [-h]"
- echo " -u Oracle Container Registry User Name (needed)"
- echo " -p Oracle Container Registry Password (needed)"
- echo " -e email (needed)"
- echo " -s Generated Secret (optional) "
- echo " (default: docker-store) "
- echo " -h Help"
- exit $1
-}
-
-while getopts ":u:p:s:e:" opt; do
- case $opt in
- u) username="${OPTARG}"
- ;;
- p) password="${OPTARG}"
- ;;
- e) email="${OPTARG}"
- ;;
- s) secert="${OPTARG}"
- ;;
- h) usage 0
- ;;
- *) usage 1
- ;;
- esac
-done
-
-if [ -z ${username} ]; then
- echo "${script}: -u must be specified."
- usage 1
-fi
-
-if [ -z ${password} ]; then
- echo "${script}: -p must be specified."
- usage 1
-fi
-
-if [ -e ${email} ]; then
- echo "${script}: -p must be specified."
- usage 1
-fi
-
-if [ -z ${secret} ]; then
- secret="docker-store"
-fi
-
-kubectl delete secret/${secret} --ignore-not-found
-echo "Creating ImagePullSecret on container-registry.oracle.com"
-kubectl create secret docker-registry ${secret} --docker-server=container-registry.oracle.com --docker-username=${username} --docker-password=${password} --docker-email=${email}
+#!/bin/bash
+# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+#
+# Create ImagePullSecret to pull Oracle DB and OracleWebCenterPortal Image
+
+script="${BASH_SOURCE[0]}"
+scriptDir="$( cd "$( dirname "${script}" )" && pwd )"
+
+function usage {
+ echo "usage: ${script} -u -p -e -s [-h]"
+ echo " -u Oracle Container Registry User Name (needed)"
+ echo " -p Oracle Container Registry Password (needed)"
+ echo " -e email (needed)"
+ echo " -s Generated Secret (optional) "
+ echo " (default: docker-store) "
+ echo " -h Help"
+ exit $1
+}
+
+while getopts ":u:p:s:e:" opt; do
+ case $opt in
+ u) username="${OPTARG}"
+ ;;
+ p) password="${OPTARG}"
+ ;;
+ e) email="${OPTARG}"
+ ;;
+ s) secert="${OPTARG}"
+ ;;
+ h) usage 0
+ ;;
+ *) usage 1
+ ;;
+ esac
+done
+
+if [ -z ${username} ]; then
+ echo "${script}: -u must be specified."
+ usage 1
+fi
+
+if [ -z ${password} ]; then
+ echo "${script}: -p must be specified."
+ usage 1
+fi
+
+if [ -e ${email} ]; then
+ echo "${script}: -p must be specified."
+ usage 1
+fi
+
+if [ -z ${secret} ]; then
+ secret="docker-store"
+fi
+
+kubectl delete secret/${secret} --ignore-not-found
+echo "Creating ImagePullSecret on container-registry.oracle.com"
+kubectl create secret docker-registry ${secret} --docker-server=container-registry.oracle.com --docker-username=${username} --docker-password=${password} --docker-email=${email}
diff --git a/OracleWebCenterPortal/kubernetes/create-rcu-schema/create-rcu-schema.sh b/OracleWebCenterPortal/kubernetes/create-rcu-schema/create-rcu-schema.sh
old mode 100644
new mode 100755
index e7ec8023e..be1c31663
--- a/OracleWebCenterPortal/kubernetes/create-rcu-schema/create-rcu-schema.sh
+++ b/OracleWebCenterPortal/kubernetes/create-rcu-schema/create-rcu-schema.sh
@@ -1,204 +1,204 @@
-#!/bin/bash
-# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-#
-# Configure RCU schema based on schemaPreifix and rcuDatabaseURL
-
-script="${BASH_SOURCE[0]}"
-scriptDir="$( cd "$( dirname "${script}" )" && pwd )"
-source ${scriptDir}/../common/utility.sh
-
-function usage {
- echo "usage: ${script} -s -t -d -i -u -p -n -q -r -o -c [-l] [-h] "
- echo " -s RCU Schema Prefix (required)"
- echo " -t RCU Schema Type (optional)"
- echo " (supported values: wcp,wcpp)"
- echo " -d RCU Oracle Database URL (optional) "
- echo " (default: oracle-db.default.svc.cluster.local:1521/devpdb.k8s) "
- echo " -p OracleWebCenterPortal ImagePullSecret (optional) "
- echo " (default: none) "
- echo " -i OracleWebCenterPortal Image (optional) "
- echo " (default: oracle/wcportal:12.2.1.4) "
- echo " -u OracleWebCenterPortal ImagePullPolicy (optional) "
- echo " (default: IfNotPresent) "
- echo " -n Namespace for RCU pod (optional)"
- echo " (default: default)"
- echo " -q password for database SYSDBA user. (optional)"
- echo " (default: Oradoc_db1)"
- echo " -r password for all schema owner (regular user). (optional)"
- echo " (default: Oradoc_db1)"
- echo " -o Output directory for the generated YAML file. (optional)"
- echo " (default: rcuoutput)"
- echo " -c Comma-separated custom variables in the format variablename=value. (optional)."
- echo " (default: none)"
- echo " -l Timeout limit in seconds. (optional)."
- echo " (default: 300)"
- echo " -h Help"
- exit $1
-}
-
-# Checks if all container(s) in a pod are running state based on READY column using given timeout limit
-# NAME READY STATUS RESTARTS AGE
-# domain1-adminserver 1/1 Running 0 4m
-function checkPodStateUsingCustomTimeout(){
-
- status="NotReady"
- count=1
-
- pod=$1
- ns=$2
- state=${3:-1/1}
- timeoutLimit=${4:-300}
- max=`expr ${timeoutLimit} / 5`
-
- echo "Checking Pod READY column for State [$state]"
- pname=`kubectl get po -n ${ns} | grep -w ${pod} | awk '{print $1}'`
- if [ -z ${pname} ]; then
- echo "No such pod [$pod] exists in NameSpace [$ns] "
- exit -1
- fi
-
- rcode=`kubectl get po ${pname} -n ${ns} | grep -w ${pod} | awk '{print $2}'`
- [[ ${rcode} -eq "${state}" ]] && status="Ready"
-
- while [ ${status} != "Ready" -a $count -le $max ] ; do
- sleep 5
- rcode=`kubectl get po/$pod -n ${ns} | grep -v NAME | awk '{print $2}'`
- [[ ${rcode} -eq "1/1" ]] && status="Ready"
- echo "Pod [$1] Status is ${status} Iter [$count/$max]"
- count=`expr $count + 1`
- done
- if [ $count -gt $max ] ; then
- echo "[ERROR] Unable to start the Pod [$pod] after 300s ";
- exit 1
- fi
-
- pname=`kubectl get po -n ${ns} | grep -w ${pod} | awk '{print $1}'`
- kubectl -n ${ns} get po ${pname}
-}
-
-timeout=300
-
-while getopts ":h:s:d:p:i:t:n:q:r:o:u:c:l:" opt; do
- case $opt in
- s) schemaPrefix="${OPTARG}"
- ;;
- t) rcuType="${OPTARG}"
- ;;
- d) dburl="${OPTARG}"
- ;;
- p) pullsecret="${OPTARG}"
- ;;
- i) fmwimage="${OPTARG}"
- ;;
- n) namespace="${OPTARG}"
- ;;
- q) sysPassword="${OPTARG}"
- ;;
- r) schemaPassword="${OPTARG}"
- ;;
- o) rcuOutputDir="${OPTARG}"
- ;;
- u) imagePullPolicy="${OPTARG}"
- ;;
- c) customVariables="${OPTARG}"
- ;;
- l) timeout="${OPTARG}"
- ;;
- h) usage 0
- ;;
- *) usage 1
- ;;
- esac
-done
-
-if [ -z ${schemaPrefix} ]; then
- echo "${script}: -s must be specified."
- usage 1
-fi
-
-if [ -z ${dburl} ]; then
- dburl="oracle-db.default.svc.cluster.local:1521/devpdb.k8s"
-fi
-
-if [ -z ${rcuType} ]; then
- rcuType="wcp"
-fi
-
-if [ -z ${pullsecret} ]; then
- pullsecret="none"
- pullsecretPrefix="#"
-fi
-
-if [ -z ${fmwimage} ]; then
- fmwimage="oracle/wcportal:12.2.1.4"
-fi
-
-if [ -z ${imagePullPolicy} ]; then
- imagePullPolicy="IfNotPresent"
-fi
-
-if [ -z ${namespace} ]; then
- namespace="default"
-fi
-
-if [ -z ${sysPassword} ]; then
- sysPassword="Oradoc_db1"
-fi
-
-if [ -z ${schemaPassword} ]; then
- schemaPassword="Oradoc_db1"
-fi
-
-if [ -z ${rcuOutputDir} ]; then
- rcuOutputDir="rcuoutput"
-fi
-
-if [ -z ${customVariables} ]; then
- customVariables="none"
-fi
-
-if [ -z ${timeout} ]; then
- timeout=300
-fi
-
-echo "ImagePullSecret[$pullsecret] Image[${fmwimage}] dburl[${dburl}] rcuType[${rcuType}] customVariables[${customVariables}]"
-
-mkdir -p ${rcuOutputDir}
-rcuYaml=${rcuOutputDir}/rcu.yaml
-rm -f ${rcuYaml}
-rcuYamlTemp=${scriptDir}/common/template/rcu.yaml.template
-cp $rcuYamlTemp $rcuYaml
-
-# Modify the ImagePullSecret based on input
-sed -i -e "s:%NAMESPACE%:${namespace}:g" $rcuYaml
-sed -i -e "s:%WEBLOGIC_IMAGE_PULL_POLICY%:${imagePullPolicy}:g" $rcuYaml
-sed -i -e "s:%WEBLOGIC_IMAGE_PULL_SECRET_NAME%:${pullsecret}:g" $rcuYaml
-sed -i -e "s:%WEBLOGIC_IMAGE_PULL_SECRET_PREFIX%:${pullsecretPrefix}:g" $rcuYaml
-sed -i -e "s?image:.*?image: ${fmwimage}?g" $rcuYaml
-kubectl apply -f $rcuYaml
-
-# Make sure the rcu deployment Pod is RUNNING
-checkPod rcu $namespace
-checkPodStateUsingCustomTimeout rcu $namespace "1/1" ${timeout}
-sleep 5
-kubectl get po/rcu -n $namespace
-
-# Generate the default password files for rcu command
-echo "$sysPassword" > pwd.txt
-echo "$schemaPassword" >> pwd.txt
-
-kubectl exec -n $namespace -i rcu -- bash -c 'cat > /u01/oracle/createRepository.sh' < ${scriptDir}/common/createRepository.sh
-kubectl exec -n $namespace -i rcu -- bash -c 'cat > /u01/oracle/pwd.txt' < pwd.txt
-rm -rf createRepository.sh pwd.txt
-
-kubectl exec -n $namespace -i rcu /bin/bash /u01/oracle/createRepository.sh ${dburl} ${schemaPrefix} ${rcuType} ${sysPassword} ${customVariables}
-if [ $? != 0 ]; then
- echo "######################";
- echo "[ERROR] Could not create the RCU Repository";
- echo "######################";
- exit -3;
-fi
-
-echo "[INFO] Modify the domain.input.yaml to use [$dburl] as rcuDatabaseURL and [${schemaPrefix}] as rcuSchemaPrefix "
-
+#!/bin/bash
+# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+#
+# Configure RCU schema based on schemaPreifix and rcuDatabaseURL
+
+script="${BASH_SOURCE[0]}"
+scriptDir="$( cd "$( dirname "${script}" )" && pwd )"
+source ${scriptDir}/../common/utility.sh
+
+function usage {
+ echo "usage: ${script} -s -t -d -i -u -p -n -q -r -o -c [-l] [-h] "
+ echo " -s RCU Schema Prefix (required)"
+ echo " -t RCU Schema Type (optional)"
+ echo " (supported values: wcp,wcpp)"
+ echo " -d RCU Oracle Database URL (optional) "
+ echo " (default: oracle-db.default.svc.cluster.local:1521/devpdb.k8s) "
+ echo " -p OracleWebCenterPortal ImagePullSecret (optional) "
+ echo " (default: none) "
+ echo " -i OracleWebCenterPortal Image (optional) "
+ echo " (default: oracle/wcportal:12.2.1.4) "
+ echo " -u OracleWebCenterPortal ImagePullPolicy (optional) "
+ echo " (default: IfNotPresent) "
+ echo " -n Namespace for RCU pod (optional)"
+ echo " (default: default)"
+ echo " -q password for database SYSDBA user. (optional)"
+ echo " (default: Oradoc_db1)"
+ echo " -r password for all schema owner (regular user). (optional)"
+ echo " (default: Oradoc_db1)"
+ echo " -o Output directory for the generated YAML file. (optional)"
+ echo " (default: rcuoutput)"
+ echo " -c Comma-separated custom variables in the format variablename=value. (optional)."
+ echo " (default: none)"
+ echo " -l Timeout limit in seconds. (optional)."
+ echo " (default: 300)"
+ echo " -h Help"
+ exit $1
+}
+
+# Checks if all container(s) in a pod are running state based on READY column using given timeout limit
+# NAME READY STATUS RESTARTS AGE
+# domain1-adminserver 1/1 Running 0 4m
+function checkPodStateUsingCustomTimeout(){
+
+ status="NotReady"
+ count=1
+
+ pod=$1
+ ns=$2
+ state=${3:-1/1}
+ timeoutLimit=${4:-300}
+ max=`expr ${timeoutLimit} / 5`
+
+ echo "Checking Pod READY column for State [$state]"
+ pname=`kubectl get po -n ${ns} | grep -w ${pod} | awk '{print $1}'`
+ if [ -z ${pname} ]; then
+ echo "No such pod [$pod] exists in NameSpace [$ns] "
+ exit -1
+ fi
+
+ rcode=`kubectl get po ${pname} -n ${ns} | grep -w ${pod} | awk '{print $2}'`
+ [[ ${rcode} -eq "${state}" ]] && status="Ready"
+
+ while [ ${status} != "Ready" -a $count -le $max ] ; do
+ sleep 5
+ rcode=`kubectl get po/$pod -n ${ns} | grep -v NAME | awk '{print $2}'`
+ [[ ${rcode} -eq "1/1" ]] && status="Ready"
+ echo "Pod [$1] Status is ${status} Iter [$count/$max]"
+ count=`expr $count + 1`
+ done
+ if [ $count -gt $max ] ; then
+ echo "[ERROR] Unable to start the Pod [$pod] after 300s ";
+ exit 1
+ fi
+
+ pname=`kubectl get po -n ${ns} | grep -w ${pod} | awk '{print $1}'`
+ kubectl -n ${ns} get po ${pname}
+}
+
+timeout=300
+
+while getopts ":h:s:d:p:i:t:n:q:r:o:u:c:l:" opt; do
+ case $opt in
+ s) schemaPrefix="${OPTARG}"
+ ;;
+ t) rcuType="${OPTARG}"
+ ;;
+ d) dburl="${OPTARG}"
+ ;;
+ p) pullsecret="${OPTARG}"
+ ;;
+ i) fmwimage="${OPTARG}"
+ ;;
+ n) namespace="${OPTARG}"
+ ;;
+ q) sysPassword="${OPTARG}"
+ ;;
+ r) schemaPassword="${OPTARG}"
+ ;;
+ o) rcuOutputDir="${OPTARG}"
+ ;;
+ u) imagePullPolicy="${OPTARG}"
+ ;;
+ c) customVariables="${OPTARG}"
+ ;;
+ l) timeout="${OPTARG}"
+ ;;
+ h) usage 0
+ ;;
+ *) usage 1
+ ;;
+ esac
+done
+
+if [ -z ${schemaPrefix} ]; then
+ echo "${script}: -s must be specified."
+ usage 1
+fi
+
+if [ -z ${dburl} ]; then
+ dburl="oracle-db.default.svc.cluster.local:1521/devpdb.k8s"
+fi
+
+if [ -z ${rcuType} ]; then
+ rcuType="wcp"
+fi
+
+if [ -z ${pullsecret} ]; then
+ pullsecret="none"
+ pullsecretPrefix="#"
+fi
+
+if [ -z ${fmwimage} ]; then
+ fmwimage="oracle/wcportal:12.2.1.4"
+fi
+
+if [ -z ${imagePullPolicy} ]; then
+ imagePullPolicy="IfNotPresent"
+fi
+
+if [ -z ${namespace} ]; then
+ namespace="default"
+fi
+
+if [ -z ${sysPassword} ]; then
+ sysPassword="Oradoc_db1"
+fi
+
+if [ -z ${schemaPassword} ]; then
+ schemaPassword="Oradoc_db1"
+fi
+
+if [ -z ${rcuOutputDir} ]; then
+ rcuOutputDir="rcuoutput"
+fi
+
+if [ -z ${customVariables} ]; then
+ customVariables="none"
+fi
+
+if [ -z ${timeout} ]; then
+ timeout=300
+fi
+
+echo "ImagePullSecret[$pullsecret] Image[${fmwimage}] dburl[${dburl}] rcuType[${rcuType}] customVariables[${customVariables}]"
+
+mkdir -p ${rcuOutputDir}
+rcuYaml=${rcuOutputDir}/rcu.yaml
+rm -f ${rcuYaml}
+rcuYamlTemp=${scriptDir}/common/template/rcu.yaml.template
+cp $rcuYamlTemp $rcuYaml
+
+# Modify the ImagePullSecret based on input
+sed -i -e "s:%NAMESPACE%:${namespace}:g" $rcuYaml
+sed -i -e "s:%WEBLOGIC_IMAGE_PULL_POLICY%:${imagePullPolicy}:g" $rcuYaml
+sed -i -e "s:%WEBLOGIC_IMAGE_PULL_SECRET_NAME%:${pullsecret}:g" $rcuYaml
+sed -i -e "s:%WEBLOGIC_IMAGE_PULL_SECRET_PREFIX%:${pullsecretPrefix}:g" $rcuYaml
+sed -i -e "s?image:.*?image: ${fmwimage}?g" $rcuYaml
+kubectl apply -f $rcuYaml
+
+# Make sure the rcu deployment Pod is RUNNING
+checkPod rcu $namespace
+checkPodStateUsingCustomTimeout rcu $namespace "1/1" ${timeout}
+sleep 5
+kubectl get po/rcu -n $namespace
+
+# Generate the default password files for rcu command
+echo "$sysPassword" > pwd.txt
+echo "$schemaPassword" >> pwd.txt
+
+kubectl exec -n $namespace -i rcu -- bash -c 'cat > /u01/oracle/createRepository.sh' < ${scriptDir}/common/createRepository.sh
+kubectl exec -n $namespace -i rcu -- bash -c 'cat > /u01/oracle/pwd.txt' < pwd.txt
+rm -rf createRepository.sh pwd.txt
+
+kubectl exec -n $namespace -i rcu /bin/bash /u01/oracle/createRepository.sh ${dburl} ${schemaPrefix} ${rcuType} ${sysPassword} ${customVariables}
+if [ $? != 0 ]; then
+ echo "######################";
+ echo "[ERROR] Could not create the RCU Repository";
+ echo "######################";
+ exit -3;
+fi
+
+echo "[INFO] Modify the domain.input.yaml to use [$dburl] as rcuDatabaseURL and [${schemaPrefix}] as rcuSchemaPrefix "
+
diff --git a/OracleWebCenterPortal/kubernetes/create-rcu-schema/drop-rcu-schema.sh b/OracleWebCenterPortal/kubernetes/create-rcu-schema/drop-rcu-schema.sh
old mode 100644
new mode 100755
index 11f8e55fb..1e2d165ad
--- a/OracleWebCenterPortal/kubernetes/create-rcu-schema/drop-rcu-schema.sh
+++ b/OracleWebCenterPortal/kubernetes/create-rcu-schema/drop-rcu-schema.sh
@@ -1,108 +1,108 @@
-#!/bin/bash
-# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-#
-# Drop the RCU schema based on schemaPreifix and Database URL
-
-script="${BASH_SOURCE[0]}"
-scriptDir="$( cd "$( dirname "${script}" )" && pwd )"
-source ${scriptDir}/../common/utility.sh
-
-function usage {
- echo "usage: ${script} -s -d -n -q -r -c [-h]"
- echo " -s RCU Schema Prefix (required)"
- echo " -t RCU Schema Type (optional)"
- echo " (supported values: wcp,wcpp) "
- echo " -d Oracle Database URL (optional)"
- echo " (default: oracle-db.default.svc.cluster.local:1521/devpdb.k8s) "
- echo " -n Namespace where RCU pod is deployed (optional)"
- echo " (default: default) "
- echo " -q password for database SYSDBA user. (optional)"
- echo " (default: Oradoc_db1)"
- echo " -r password for all schema owner (regular user). (optional)"
- echo " (default: Oradoc_db1)"
- echo " -c Comma-separated custom variables in the format variablename=value. (optional)."
- echo " (default: none)"
- echo " -h Help"
- exit $1
-}
-
-while getopts ":h:s:d:t:n:q:r:c:" opt; do
- case $opt in
- s) schemaPrefix="${OPTARG}"
- ;;
- t) rcuType="${OPTARG}"
- ;;
- d) dburl="${OPTARG}"
- ;;
- n) namespace="${OPTARG}"
- ;;
- q) sysPassword="${OPTARG}"
- ;;
- r) schemaPassword="${OPTARG}"
- ;;
- c) customVariables="${OPTARG}"
- ;;
- h) usage 0
- ;;
- *) usage 1
- ;;
- esac
-done
-
-if [ -z ${schemaPrefix} ]; then
- echo "${script}: -s must be specified."
- usage 1
-fi
-
-if [ -z ${dburl} ]; then
- dburl="oracle-db.default.svc.cluster.local:1521/devpdb.k8s"
-fi
-
-if [ -z ${rcuType} ]; then
- rcuType="wcp"
-fi
-
-if [ -z ${namespace} ]; then
- namespace="default"
-fi
-
-if [ -z ${sysPassword} ]; then
- sysPassword="Oradoc_db1"
-fi
-
-if [ -z ${schemaPassword} ]; then
- schemaPassword="Oradoc_db1"
-fi
-
-if [ -z ${customVariables} ]; then
- customVariables="none"
-fi
-
-rcupod=`kubectl get po -n ${namespace} | grep rcu | cut -f1 -d " " `
-if [ -z ${rcupod} ]; then
- echo "RCU deployment pod not found in [$namespace] Namespace"
- exit -2
-fi
-
-#fmwimage=`kubectl get pod/rcu -o jsonpath="{..image}"`
-echo "DB Connection String [$dbUrl], schemaPrefix [${schemaPrefix}] rcuType [${rcuType}] schemaProfileType [${customVariables}]"
-
-echo "${sysPassword}" > pwd.txt
-echo "${schemaPassword}" >> pwd.txt
-
-kubectl exec -n $namespace -i rcu -- bash -c 'cat > /u01/oracle/dropRepository.sh' < ${scriptDir}/common/dropRepository.sh
-kubectl exec -n $namespace -i rcu -- bash -c 'cat > /u01/oracle/pwd.txt' < pwd.txt
-rm -rf dropRepository.sh pwd.txt
-
-kubectl exec -n $namespace -i rcu /bin/bash /u01/oracle/dropRepository.sh ${dburl} ${schemaPrefix} ${rcuType} ${sysPassword} ${customVariables}
-if [ $? != 0 ]; then
- echo "######################";
- echo "[ERROR] Could not drop the RCU Repository based on dburl[${dburl}] schemaPrefix[${schemaPrefix}] ";
- echo "######################";
- exit -3;
-fi
-
-kubectl delete pod rcu -n ${namespace}
-checkPodDelete rcu ${namespace}
-
+#!/bin/bash
+# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+#
+# Drop the RCU schema based on schemaPreifix and Database URL
+
+script="${BASH_SOURCE[0]}"
+scriptDir="$( cd "$( dirname "${script}" )" && pwd )"
+source ${scriptDir}/../common/utility.sh
+
+function usage {
+ echo "usage: ${script} -s -d -n -q -r -c [-h]"
+ echo " -s RCU Schema Prefix (required)"
+ echo " -t RCU Schema Type (optional)"
+ echo " (supported values: wcp,wcpp) "
+ echo " -d Oracle Database URL (optional)"
+ echo " (default: oracle-db.default.svc.cluster.local:1521/devpdb.k8s) "
+ echo " -n Namespace where RCU pod is deployed (optional)"
+ echo " (default: default) "
+ echo " -q password for database SYSDBA user. (optional)"
+ echo " (default: Oradoc_db1)"
+ echo " -r password for all schema owner (regular user). (optional)"
+ echo " (default: Oradoc_db1)"
+ echo " -c Comma-separated custom variables in the format variablename=value. (optional)."
+ echo " (default: none)"
+ echo " -h Help"
+ exit $1
+}
+
+while getopts ":h:s:d:t:n:q:r:c:" opt; do
+ case $opt in
+ s) schemaPrefix="${OPTARG}"
+ ;;
+ t) rcuType="${OPTARG}"
+ ;;
+ d) dburl="${OPTARG}"
+ ;;
+ n) namespace="${OPTARG}"
+ ;;
+ q) sysPassword="${OPTARG}"
+ ;;
+ r) schemaPassword="${OPTARG}"
+ ;;
+ c) customVariables="${OPTARG}"
+ ;;
+ h) usage 0
+ ;;
+ *) usage 1
+ ;;
+ esac
+done
+
+if [ -z ${schemaPrefix} ]; then
+ echo "${script}: -s must be specified."
+ usage 1
+fi
+
+if [ -z ${dburl} ]; then
+ dburl="oracle-db.default.svc.cluster.local:1521/devpdb.k8s"
+fi
+
+if [ -z ${rcuType} ]; then
+ rcuType="wcp"
+fi
+
+if [ -z ${namespace} ]; then
+ namespace="default"
+fi
+
+if [ -z ${sysPassword} ]; then
+ sysPassword="Oradoc_db1"
+fi
+
+if [ -z ${schemaPassword} ]; then
+ schemaPassword="Oradoc_db1"
+fi
+
+if [ -z ${customVariables} ]; then
+ customVariables="none"
+fi
+
+rcupod=`kubectl get po -n ${namespace} | grep rcu | cut -f1 -d " " `
+if [ -z ${rcupod} ]; then
+ echo "RCU deployment pod not found in [$namespace] Namespace"
+ exit -2
+fi
+
+#fmwimage=`kubectl get pod/rcu -o jsonpath="{..image}"`
+echo "DB Connection String [$dbUrl], schemaPrefix [${schemaPrefix}] rcuType [${rcuType}] schemaProfileType [${customVariables}]"
+
+echo "${sysPassword}" > pwd.txt
+echo "${schemaPassword}" >> pwd.txt
+
+kubectl exec -n $namespace -i rcu -- bash -c 'cat > /u01/oracle/dropRepository.sh' < ${scriptDir}/common/dropRepository.sh
+kubectl exec -n $namespace -i rcu -- bash -c 'cat > /u01/oracle/pwd.txt' < pwd.txt
+rm -rf dropRepository.sh pwd.txt
+
+kubectl exec -n $namespace -i rcu /bin/bash /u01/oracle/dropRepository.sh ${dburl} ${schemaPrefix} ${rcuType} ${sysPassword} ${customVariables}
+if [ $? != 0 ]; then
+ echo "######################";
+ echo "[ERROR] Could not drop the RCU Repository based on dburl[${dburl}] schemaPrefix[${schemaPrefix}] ";
+ echo "######################";
+ exit -3;
+fi
+
+kubectl delete pod rcu -n ${namespace}
+checkPodDelete rcu ${namespace}
+
diff --git a/OracleWebCenterPortal/kubernetes/create-wcp-domain/utils/utility.sh b/OracleWebCenterPortal/kubernetes/create-wcp-domain/utils/utility.sh
old mode 100644
new mode 100755
index 61fa27436..d85f40383
--- a/OracleWebCenterPortal/kubernetes/create-wcp-domain/utils/utility.sh
+++ b/OracleWebCenterPortal/kubernetes/create-wcp-domain/utils/utility.sh
@@ -1,390 +1,390 @@
-#!/usr/bin/env bash
-# Copyright (c) 2022, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-
-# Function to generate the properties and yaml files for creating a domain
-#
-function createFiles_WCP {
-
- update=false
- if [ "$#" == 1 ]; then
- echo Trying to update the domain
- update=true
- fi
-
- # Make sure the output directory has a copy of the inputs file.
- # The user can either pre-create the output directory, put the inputs
- # file there, and create the domain from it, or the user can put the
- # inputs file some place else and let this script create the output directory
- # (if needed) and copy the inputs file there.
- echo createFiles - valuesInputFile is ${valuesInputFile}
- copyInputsFileToOutputDirectory ${valuesInputFile} "${domainOutputDir}/create-domain-inputs.yaml"
-
- if [ "${domainHomeInImage}" == "true" ]; then
- if [ -z "${domainHomeImageBase}" ]; then
- fail "Please specify domainHomeImageBase in your input YAML"
- fi
- else
- if [ -z "${image}" ]; then
- fail "Please specify image in your input YAML"
- fi
- fi
-
- dcrOutput="${domainOutputDir}/domain.yaml"
-
- domainName=${domainUID}
-
- enabledPrefix="" # uncomment the feature
- disabledPrefix="# " # comment out the feature
-
- exposeAnyChannelPrefix="${disabledPrefix}"
- if [ "${exposeAdminT3Channel}" = true ]; then
- exposeAdminT3ChannelPrefix="${enabledPrefix}"
- exposeAnyChannelPrefix="${enabledPrefix}"
- # set t3PublicAddress if not set
- if [ -z "${t3PublicAddress}" ]; then
- getKubernetesClusterIP
- t3PublicAddress="${K8S_IP}"
- fi
- else
- exposeAdminT3ChannelPrefix="${disabledPrefix}"
- fi
-
- if [ "${exposeAdminNodePort}" = true ]; then
- exposeAdminNodePortPrefix="${enabledPrefix}"
- exposeAnyChannelPrefix="${enabledPrefix}"
- else
- exposeAdminNodePortPrefix="${disabledPrefix}"
- fi
-
- if [ "${istioEnabled}" == "true" ]; then
- istioPrefix="${enabledPrefix}"
- else
- istioPrefix="${disabledPrefix}"
- fi
-
- # The FromModel, MII (model-in-image), and WDT_DOMAIN_TYPE updates in this script
- # must remain even though they are not referenced by a sample. They're used by the
- # Operator integration test code. If you're interested in MII,
- # see './kubernetes/samples/scripts/create-weblogic-domain/model-in-image'.
-
- # MII settings are used for model-in-image integration testing
- if [ "${domainHomeSourceType}" == "FromModel" ]; then
- miiPrefix="${enabledPrefix}"
- else
- miiPrefix="${disabledPrefix}"
- fi
-
- # MII settings are used for model-in-image integration testing
- if [ -z "${miiConfigMap}" ]; then
- miiConfigMapPrefix="${disabledPrefix}"
- else
- miiConfigMapPrefix="${enabledPrefix}"
- fi
-
- # For some parameters, use the default value if not defined.
- if [ -z "${domainPVMountPath}" ]; then
- domainPVMountPath="/shared"
- fi
-
- if [ -z "${logHome}" ]; then
- logHome="${domainPVMountPath}/logs/${domainUID}"
- fi
-
- if [ -z "${httpAccessLogInLogHome}" ]; then
- httpAccessLogInLogHome="true"
- fi
-
- if [ -z "${dataHome}" ]; then
- dataHome=""
- fi
-
- if [ -z "${persistentVolumeClaimName}" ]; then
- persistentVolumeClaimName="${domainUID}-weblogic-sample-pvc"
- fi
-
- if [ -z "${weblogicCredentialsSecretName}" ]; then
- weblogicCredentialsSecretName="${domainUID}-weblogic-credentials"
- fi
-
- if [ "${domainHomeInImage}" == "true" ]; then
- domainPropertiesOutput="${domainOutputDir}/domain.properties"
- domainHome="${domainHome:-/u01/oracle/user_projects/domains/${domainName}}"
-
- # Generate the properties file that will be used when creating the weblogic domain
- echo Generating ${domainPropertiesOutput} from ${domainPropertiesInput}
-
- cp ${domainPropertiesInput} ${domainPropertiesOutput}
- sed -i -e "s:%DOMAIN_NAME%:${domainName}:g" ${domainPropertiesOutput}
- sed -i -e "s:%DOMAIN_HOME%:${domainHome}:g" ${domainPropertiesOutput}
- sed -i -e "s:%ADMIN_PORT%:${adminPort}:g" ${domainPropertiesOutput}
- sed -i -e "s:%ADMIN_SERVER_SSL_PORT%:${adminServerSSLPort}:g" ${domainPropertiesOutput}
- sed -i -e "s:%ADMIN_SERVER_NAME%:${adminServerName}:g" ${domainPropertiesOutput}
- sed -i -e "s:%MANAGED_SERVER_PORT%:${managedServerPort}:g" ${domainPropertiesOutput}
- sed -i -e "s:%MANAGED_SERVER_SSL_PORT%:${managedServerSSLPort}:g" ${domainPropertiesOutput}
- sed -i -e "s:%MANAGED_SERVER_NAME_BASE%:${managedServerNameBase}:g" ${domainPropertiesOutput}
- sed -i -e "s:%CONFIGURED_MANAGED_SERVER_COUNT%:${configuredManagedServerCount}:g" ${domainPropertiesOutput}
- sed -i -e "s:%CLUSTER_NAME%:${clusterName}:g" ${domainPropertiesOutput}
- sed -i -e "s:%SSL_ENABLED%:${sslEnabled}:g" ${domainPropertiesOutput}
- sed -i -e "s:%PRODUCTION_MODE_ENABLED%:${productionModeEnabled}:g" ${domainPropertiesOutput}
- sed -i -e "s:%CLUSTER_TYPE%:${clusterType}:g" ${domainPropertiesOutput}
- sed -i -e "s;%JAVA_OPTIONS%;${javaOptions};g" ${domainPropertiesOutput}
- sed -i -e "s:%T3_CHANNEL_PORT%:${t3ChannelPort}:g" ${domainPropertiesOutput}
- sed -i -e "s:%T3_PUBLIC_ADDRESS%:${t3PublicAddress}:g" ${domainPropertiesOutput}
- sed -i -e "s:%EXPOSE_T3_CHANNEL%:${exposeAdminT3Channel}:g" ${domainPropertiesOutput}
- sed -i -e "s:%FMW_DOMAIN_TYPE%:${fmwDomainType}:g" ${domainPropertiesOutput}
- sed -i -e "s:%WDT_DOMAIN_TYPE%:${wdtDomainType}:g" ${domainPropertiesOutput}
- sed -i -e "s:%ADMIN_USER_NAME%:${username}:g" ${domainPropertiesOutput}
- sed -i -e "s:%ADMIN_USER_PASS%:${password}:g" ${domainPropertiesOutput}
- sed -i -e "s:%RCU_SCHEMA_PREFIX%:${rcuSchemaPrefix}:g" ${domainPropertiesOutput}
- sed -i -e "s:%RCU_SCHEMA_PASSWORD%:${rcuSchemaPassword}:g" ${domainPropertiesOutput}
- sed -i -e "s|%RCU_DB_CONN_STRING%|${rcuDatabaseURL}|g" ${domainPropertiesOutput}
-
- if [ -z "${image}" ]; then
- # calculate the internal name to tag the generated image
- defaultImageName="domain-home-in-image"
- baseTag=${domainHomeImageBase#*:}
- defaultImageName=${defaultImageName}:${baseTag:-"latest"}
- sed -i -e "s|%IMAGE_NAME%|${defaultImageName}|g" ${domainPropertiesOutput}
- export BUILD_IMAGE_TAG=${defaultImageName}
- else
- sed -i -e "s|%IMAGE_NAME%|${image}|g" ${domainPropertiesOutput}
- export BUILD_IMAGE_TAG=${image}
- fi
- else
- # we're in the domain in PV case
-
- wdtVersion="${WDT_VERSION:-${wdtVersion}}"
- httpsProxy="${https_proxy}"
-
- createJobOutput="${domainOutputDir}/create-domain-job.yaml"
- deleteJobOutput="${domainOutputDir}/delete-domain-job.yaml"
-
- if [ -z "${domainHome}" ]; then
- domainHome="${domainPVMountPath}/domains/${domainUID}"
- fi
-
- # Use the default value if not defined.
- if [ -z "${createDomainScriptsMountPath}" ]; then
- createDomainScriptsMountPath="/u01/weblogic"
- fi
-
- if [ "${update}" == "true" ]; then
- createDomainScriptName="update-domain-job.sh"
- elif [ -z "${createDomainScriptName}" ]; then
- createDomainScriptName="create-domain-job.sh"
- fi
- echo createDomainScriptName is ${createDomainScriptName}
-
- # Must escape the ':' value in image for sed to properly parse and replace
- image=$(echo ${image} | sed -e "s/\:/\\\:/g")
-
- # Generate the yaml to create the kubernetes job that will create the weblogic domain
- echo Generating ${createJobOutput}
-
- cp ${createJobInput} ${createJobOutput}
- sed -i -e "s:%NAMESPACE%:$namespace:g" ${createJobOutput}
- sed -i -e "s:%WEBLOGIC_CREDENTIALS_SECRET_NAME%:${weblogicCredentialsSecretName}:g" ${createJobOutput}
- sed -i -e "s:%WEBLOGIC_IMAGE%:${image}:g" ${createJobOutput}
- sed -i -e "s:%WEBLOGIC_IMAGE_PULL_POLICY%:${imagePullPolicy}:g" ${createJobOutput}
- sed -i -e "s:%WEBLOGIC_IMAGE_PULL_SECRET_NAME%:${imagePullSecretName}:g" ${createJobOutput}
- sed -i -e "s:%WEBLOGIC_IMAGE_PULL_SECRET_PREFIX%:${imagePullSecretPrefix}:g" ${createJobOutput}
- sed -i -e "s:%DOMAIN_UID%:${domainUID}:g" ${createJobOutput}
- sed -i -e "s:%DOMAIN_NAME%:${domainName}:g" ${createJobOutput}
- sed -i -e "s:%DOMAIN_HOME%:${domainHome}:g" ${createJobOutput}
- sed -i -e "s:%SSL_ENABLED%:${sslEnabled}:g" ${createJobOutput}
- sed -i -e "s:%PRODUCTION_MODE_ENABLED%:${productionModeEnabled}:g" ${createJobOutput}
- sed -i -e "s:%ADMIN_SERVER_NAME%:${adminServerName}:g" ${createJobOutput}
- sed -i -e "s:%ADMIN_SERVER_NAME_SVC%:${adminServerNameSVC}:g" ${createJobOutput}
- sed -i -e "s:%ADMIN_PORT%:${adminPort}:g" ${createJobOutput}
- sed -i -e "s:%ADMIN_SERVER_SSL_PORT%:${adminServerSSLPort}:g" ${createJobOutput}
- sed -i -e "s:%CONFIGURED_MANAGED_SERVER_COUNT%:${configuredManagedServerCount}:g" ${createJobOutput}
- sed -i -e "s:%MANAGED_SERVER_NAME_BASE%:${managedServerNameBase}:g" ${createJobOutput}
- sed -i -e "s:%MANAGED_SERVER_NAME_BASE_SVC%:${managedServerNameBaseSVC}:g" ${createJobOutput}
- sed -i -e "s:%MANAGED_SERVER_PORT%:${managedServerPort}:g" ${createJobOutput}
- sed -i -e "s:%MANAGED_SERVER_SSL_PORT%:${managedServerSSLPort}:g" ${createJobOutput}
- sed -i -e "s:%T3_CHANNEL_PORT%:${t3ChannelPort}:g" ${createJobOutput}
- sed -i -e "s:%T3_PUBLIC_ADDRESS%:${t3PublicAddress}:g" ${createJobOutput}
- sed -i -e "s:%CLUSTER_NAME%:${clusterName}:g" ${createJobOutput}
- sed -i -e "s:%CLUSTER_TYPE%:${clusterType}:g" ${createJobOutput}
- sed -i -e "s:%DOMAIN_PVC_NAME%:${persistentVolumeClaimName}:g" ${createJobOutput}
- sed -i -e "s:%DOMAIN_ROOT_DIR%:${domainPVMountPath}:g" ${createJobOutput}
- sed -i -e "s:%CREATE_DOMAIN_SCRIPT_DIR%:${createDomainScriptsMountPath}:g" ${createJobOutput}
- sed -i -e "s:%CREATE_DOMAIN_SCRIPT%:${createDomainScriptName}:g" ${createJobOutput}
- # extra entries for FMW Infra domains
- sed -i -e "s:%RCU_CREDENTIALS_SECRET_NAME%:${rcuCredentialsSecret}:g" ${createJobOutput}
- sed -i -e "s:%CUSTOM_RCUPREFIX%:${rcuSchemaPrefix}:g" ${createJobOutput}
- sed -i -e "s|%CUSTOM_CONNECTION_STRING%|${rcuDatabaseURL}|g" ${createJobOutput}
- sed -i -e "s:%EXPOSE_T3_CHANNEL_PREFIX%:${exposeAdminT3Channel}:g" ${createJobOutput}
- sed -i -e "s:%FRONTEND_HOST%:${frontEndHost}:g" ${createJobOutput}
- sed -i -e "s:%FRONTEND_PORT%:${frontEndPort}:g" ${createJobOutput}
- # entries for Istio
- sed -i -e "s:%ISTIO_PREFIX%:${istioPrefix}:g" ${createJobOutput}
- sed -i -e "s:%ISTIO_ENABLED%:${istioEnabled}:g" ${createJobOutput}
- sed -i -e "s:%ISTIO_READINESS_PORT%:${istioReadinessPort}:g" ${createJobOutput}
- sed -i -e "s:%WDT_VERSION%:${wdtVersion}:g" ${createJobOutput}
- sed -i -e "s|%DOMAIN_TYPE%|${domain_type}|g" ${createJobOutput}
- sed -i -e "s|%PROXY_VAL%|${httpsProxy}|g" ${createJobOutput}
- sed -i -e "s:%CONFIGURE_PORTLET_SERVER%:${configurePortletServer}:g" ${createJobOutput}
- sed -i -e "s:%PORTLET_SERVER_PORT%:${portletServerPort}:g" ${createJobOutput}
- sed -i -e "s:%PORTLET_SERVER_SSL_PORT%:${portletServerSSLPort}:g" ${createJobOutput}
- sed -i -e "s:%PORTLET_CLUSTER_NAME%:${portletClusterName}:g" ${createJobOutput}
- sed -i -e "s:%PORTLET_SERVER_NAME_BASE%:${portletServerNameBase}:g" ${createJobOutput}
-
- # Generate the yaml to create the kubernetes job that will delete the weblogic domain_home folder
- echo Generating ${deleteJobOutput}
-
- cp ${deleteJobInput} ${deleteJobOutput}
- sed -i -e "s:%NAMESPACE%:$namespace:g" ${deleteJobOutput}
- sed -i -e "s:%WEBLOGIC_IMAGE%:${image}:g" ${deleteJobOutput}
- sed -i -e "s:%WEBLOGIC_IMAGE_PULL_POLICY%:${imagePullPolicy}:g" ${deleteJobOutput}
- sed -i -e "s:%WEBLOGIC_CREDENTIALS_SECRET_NAME%:${weblogicCredentialsSecretName}:g" ${deleteJobOutput}
- sed -i -e "s:%WEBLOGIC_IMAGE_PULL_SECRET_NAME%:${imagePullSecretName}:g" ${deleteJobOutput}
- sed -i -e "s:%WEBLOGIC_IMAGE_PULL_SECRET_PREFIX%:${imagePullSecretPrefix}:g" ${deleteJobOutput}
- sed -i -e "s:%DOMAIN_UID%:${domainUID}:g" ${deleteJobOutput}
- sed -i -e "s:%DOMAIN_NAME%:${domainName}:g" ${deleteJobOutput}
- sed -i -e "s:%DOMAIN_HOME%:${domainHome}:g" ${deleteJobOutput}
- sed -i -e "s:%DOMAIN_PVC_NAME%:${persistentVolumeClaimName}:g" ${deleteJobOutput}
- sed -i -e "s:%DOMAIN_ROOT_DIR%:${domainPVMountPath}:g" ${deleteJobOutput}
- fi
-
- if [ "${domainHomeSourceType}" == "FromModel" ]; then
- echo domainHomeSourceType is FromModel
- # leave domainHomeSourceType to FromModel
- if [ "${logHomeOnPV}" == "true" ]; then
- logHomeOnPVPrefix="${enabledPrefix}"
- else
- logHomeOnPVPrefix="${disabledPrefix}"
- fi
- elif [ "${domainHomeInImage}" == "true" ]; then
- domainHomeSourceType="Image"
- if [ "${logHomeOnPV}" == "true" ]; then
- logHomeOnPVPrefix="${enabledPrefix}"
- else
- logHomeOnPVPrefix="${disabledPrefix}"
- fi
- else
- domainHomeSourceType="PersistentVolume"
- logHomeOnPVPrefix="${enabledPrefix}"
- logHomeOnPV=true
- fi
-
- # Generate the yaml file for creating the domain resource
- # We want to use wdt's extractDomainResource.sh to get the domain resource
- # for domain on pv use case. For others, generate domain resource here
-
- if [ "${domainHomeSourceType}" != "PersistentVolume" ] || [ "${wdtDomainType}" != "WLS" ] ||
- [ "${useWdt}" != true ]; then
- echo Generating ${dcrOutput}
-
- cp ${dcrInput} ${dcrOutput}
- sed -i -e "s:%DOMAIN_UID%:${domainUID}:g" ${dcrOutput}
- sed -i -e "s:%NAMESPACE%:$namespace:g" ${dcrOutput}
- sed -i -e "s:%DOMAIN_HOME%:${domainHome}:g" ${dcrOutput}
- sed -i -e "s:%DOMAIN_HOME_SOURCE_TYPE%:${domainHomeSourceType}:g" ${dcrOutput}
- sed -i -e "s:%WEBLOGIC_IMAGE_PULL_POLICY%:${imagePullPolicy}:g" ${dcrOutput}
- sed -i -e "s:%WEBLOGIC_IMAGE_PULL_SECRET_PREFIX%:${imagePullSecretPrefix}:g" ${dcrOutput}
- sed -i -e "s:%WEBLOGIC_IMAGE_PULL_SECRET_NAME%:${imagePullSecretName}:g" ${dcrOutput}
- sed -i -e "s:%WEBLOGIC_CREDENTIALS_SECRET_NAME%:${weblogicCredentialsSecretName}:g" ${dcrOutput}
- sed -i -e "s:%INCLUDE_SERVER_OUT_IN_POD_LOG%:${includeServerOutInPodLog}:g" ${dcrOutput}
- sed -i -e "s:%LOG_HOME_ON_PV_PREFIX%:${logHomeOnPVPrefix}:g" ${dcrOutput}
- sed -i -e "s:%LOG_HOME_ENABLED%:${logHomeOnPV}:g" ${dcrOutput}
- sed -i -e "s:%LOG_HOME%:${logHome}:g" ${dcrOutput}
- sed -i -e "s:%HTTP_ACCESS_LOG_IN_LOG_HOME%:${httpAccessLogInLogHome}:g" ${dcrOutput}
- sed -i -e "s:%DATA_HOME%:${dataHome}:g" ${dcrOutput}
- sed -i -e "s:%SERVER_START_POLICY%:${serverStartPolicy}:g" ${dcrOutput}
- sed -i -e "s;%JAVA_OPTIONS%;${javaOptions};g" ${dcrOutput}
- sed -i -e "s:%DOMAIN_PVC_NAME%:${persistentVolumeClaimName}:g" ${dcrOutput}
- sed -i -e "s:%DOMAIN_ROOT_DIR%:${domainPVMountPath}:g" ${dcrOutput}
-
- if [ "${istioEnabled}" == "true" ]; then
- exposeAdminNodePortPrefix="${disabledPrefix}"
- fi
-
- sed -i -e "s:%EXPOSE_T3_CHANNEL_PREFIX%:${exposeAdminT3ChannelPrefix}:g" ${dcrOutput}
- sed -i -e "s:%EXPOSE_ANY_CHANNEL_PREFIX%:${exposeAnyChannelPrefix}:g" ${dcrOutput}
- sed -i -e "s:%EXPOSE_ADMIN_PORT_PREFIX%:${exposeAdminNodePortPrefix}:g" ${dcrOutput}
- sed -i -e "s:%ADMIN_NODE_PORT%:${adminNodePort}:g" ${dcrOutput}
- sed -i -e "s:%CLUSTER_NAME%:${clusterName}:g" ${dcrOutput}
- sed -i -e "s:%INITIAL_MANAGED_SERVER_REPLICAS%:${initialManagedServerReplicas}:g" ${dcrOutput}
- sed -i -e "s:%ISTIO_PREFIX%:${istioPrefix}:g" ${dcrOutput}
- sed -i -e "s:%ISTIO_ENABLED%:${istioEnabled}:g" ${dcrOutput}
- sed -i -e "s:%ISTIO_READINESS_PORT%:${istioReadinessPort}:g" ${dcrOutput}
- # MII settings are used for model-in-image integration testing
- sed -i -e "s:%MII_PREFIX%:${miiPrefix}:g" ${dcrOutput}
- sed -i -e "s:%MII_CONFIG_MAP_PREFIX%:${miiConfigMapPrefix}:g" ${dcrOutput}
- sed -i -e "s:%MII_CONFIG_MAP%:${miiConfigMap}:g" ${dcrOutput}
- sed -i -e "s:%WDT_DOMAIN_TYPE%:${wdtDomainType}:g" ${dcrOutput}
-
- buildServerPodResources
- if [ -z "${serverPodResources}" ]; then
- sed -i -e "/%OPTIONAL_SERVERPOD_RESOURCES%/d" ${dcrOutput}
- else
- if [[ $(uname) -eq "Darwin" ]]; then
- serverPodResources=$(echo "${serverPodResources}" | sed -e 's/\\n/%NEWLINE%/g')
- sed -i -e "s:%OPTIONAL_SERVERPOD_RESOURCES%:${serverPodResources}:g" ${dcrOutput}
- sed -i -e $'s|%NEWLINE%|\\\n|g' ${dcrOutput}
- else
- sed -i -e "s:%OPTIONAL_SERVERPOD_RESOURCES%:${serverPodResources}:g" ${dcrOutput}
- fi
- fi
-
- if [ "${domainHomeInImage}" == "true" ]; then
-
- # now we know which image to use, update the domain yaml file
- if [ -z $image ]; then
- sed -i -e "s|%WEBLOGIC_IMAGE%|${defaultImageName}|g" ${dcrOutput}
- else
- sed -i -e "s|%WEBLOGIC_IMAGE%|${image}|g" ${dcrOutput}
- fi
- else
- sed -i -e "s:%WEBLOGIC_IMAGE%:${image}:g" ${dcrOutput}
- fi
- fi
-
- # Remove any "...yaml-e" and "...properties-e" files left over from running sed
- rm -f ${domainOutputDir}/*.yaml-e
- rm -f ${domainOutputDir}/*.properties-e
-
-}
-
-#
-# Function to create a domain
-# $1 - boolean value indicating the location of the domain home
-# true means domain home in image
-# false means domain home on PV
-#
-function createDomain_WCP {
- if [ "$#" != 1 ]; then
- fail "The function must be called with domainHomeInImage parameter."
- fi
-
- domainHomeInImage="${1}"
- if [ "true" != "${domainHomeInImage}" ] && [ "false" != "${domainHomeInImage}" ]; then
- fail "The value of domainHomeInImage must be true or false: ${domainHomeInImage}"
- fi
-
- # Setup the environment for running this script and perform initial validation checks
- initialize
-
- # Generate files for creating the domain
- createFiles_WCP
-
- # Check that the domain secret exists and contains the required elements
- validateDomainSecret
-
- # Validate the domain's persistent volume claim
- if [ "${doValidation}" == true ] && [ "${domainHomeInImage}" == false -o "${logHomeOnPV}" == true ]; then
- validateDomainPVC
- fi
-
- # Create the WebLogic domain home
- createDomainHome
-
- if [ "${executeIt}" = true ]; then
- createDomainResource
- fi
-
- # Print a summary
- printSummary
-}
+#!/usr/bin/env bash
+# Copyright (c) 2022, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+
+# Function to generate the properties and yaml files for creating a domain
+#
+function createFiles_WCP {
+
+ update=false
+ if [ "$#" == 1 ]; then
+ echo Trying to update the domain
+ update=true
+ fi
+
+ # Make sure the output directory has a copy of the inputs file.
+ # The user can either pre-create the output directory, put the inputs
+ # file there, and create the domain from it, or the user can put the
+ # inputs file some place else and let this script create the output directory
+ # (if needed) and copy the inputs file there.
+ echo createFiles - valuesInputFile is ${valuesInputFile}
+ copyInputsFileToOutputDirectory ${valuesInputFile} "${domainOutputDir}/create-domain-inputs.yaml"
+
+ if [ "${domainHomeInImage}" == "true" ]; then
+ if [ -z "${domainHomeImageBase}" ]; then
+ fail "Please specify domainHomeImageBase in your input YAML"
+ fi
+ else
+ if [ -z "${image}" ]; then
+ fail "Please specify image in your input YAML"
+ fi
+ fi
+
+ dcrOutput="${domainOutputDir}/domain.yaml"
+
+ domainName=${domainUID}
+
+ enabledPrefix="" # uncomment the feature
+ disabledPrefix="# " # comment out the feature
+
+ exposeAnyChannelPrefix="${disabledPrefix}"
+ if [ "${exposeAdminT3Channel}" = true ]; then
+ exposeAdminT3ChannelPrefix="${enabledPrefix}"
+ exposeAnyChannelPrefix="${enabledPrefix}"
+ # set t3PublicAddress if not set
+ if [ -z "${t3PublicAddress}" ]; then
+ getKubernetesClusterIP
+ t3PublicAddress="${K8S_IP}"
+ fi
+ else
+ exposeAdminT3ChannelPrefix="${disabledPrefix}"
+ fi
+
+ if [ "${exposeAdminNodePort}" = true ]; then
+ exposeAdminNodePortPrefix="${enabledPrefix}"
+ exposeAnyChannelPrefix="${enabledPrefix}"
+ else
+ exposeAdminNodePortPrefix="${disabledPrefix}"
+ fi
+
+ if [ "${istioEnabled}" == "true" ]; then
+ istioPrefix="${enabledPrefix}"
+ else
+ istioPrefix="${disabledPrefix}"
+ fi
+
+ # The FromModel, MII (model-in-image), and WDT_DOMAIN_TYPE updates in this script
+ # must remain even though they are not referenced by a sample. They're used by the
+ # Operator integration test code. If you're interested in MII,
+ # see './kubernetes/samples/scripts/create-weblogic-domain/model-in-image'.
+
+ # MII settings are used for model-in-image integration testing
+ if [ "${domainHomeSourceType}" == "FromModel" ]; then
+ miiPrefix="${enabledPrefix}"
+ else
+ miiPrefix="${disabledPrefix}"
+ fi
+
+ # MII settings are used for model-in-image integration testing
+ if [ -z "${miiConfigMap}" ]; then
+ miiConfigMapPrefix="${disabledPrefix}"
+ else
+ miiConfigMapPrefix="${enabledPrefix}"
+ fi
+
+ # For some parameters, use the default value if not defined.
+ if [ -z "${domainPVMountPath}" ]; then
+ domainPVMountPath="/shared"
+ fi
+
+ if [ -z "${logHome}" ]; then
+ logHome="${domainPVMountPath}/logs/${domainUID}"
+ fi
+
+ if [ -z "${httpAccessLogInLogHome}" ]; then
+ httpAccessLogInLogHome="true"
+ fi
+
+ if [ -z "${dataHome}" ]; then
+ dataHome=""
+ fi
+
+ if [ -z "${persistentVolumeClaimName}" ]; then
+ persistentVolumeClaimName="${domainUID}-weblogic-sample-pvc"
+ fi
+
+ if [ -z "${weblogicCredentialsSecretName}" ]; then
+ weblogicCredentialsSecretName="${domainUID}-weblogic-credentials"
+ fi
+
+ if [ "${domainHomeInImage}" == "true" ]; then
+ domainPropertiesOutput="${domainOutputDir}/domain.properties"
+ domainHome="${domainHome:-/u01/oracle/user_projects/domains/${domainName}}"
+
+ # Generate the properties file that will be used when creating the weblogic domain
+ echo Generating ${domainPropertiesOutput} from ${domainPropertiesInput}
+
+ cp ${domainPropertiesInput} ${domainPropertiesOutput}
+ sed -i -e "s:%DOMAIN_NAME%:${domainName}:g" ${domainPropertiesOutput}
+ sed -i -e "s:%DOMAIN_HOME%:${domainHome}:g" ${domainPropertiesOutput}
+ sed -i -e "s:%ADMIN_PORT%:${adminPort}:g" ${domainPropertiesOutput}
+ sed -i -e "s:%ADMIN_SERVER_SSL_PORT%:${adminServerSSLPort}:g" ${domainPropertiesOutput}
+ sed -i -e "s:%ADMIN_SERVER_NAME%:${adminServerName}:g" ${domainPropertiesOutput}
+ sed -i -e "s:%MANAGED_SERVER_PORT%:${managedServerPort}:g" ${domainPropertiesOutput}
+ sed -i -e "s:%MANAGED_SERVER_SSL_PORT%:${managedServerSSLPort}:g" ${domainPropertiesOutput}
+ sed -i -e "s:%MANAGED_SERVER_NAME_BASE%:${managedServerNameBase}:g" ${domainPropertiesOutput}
+ sed -i -e "s:%CONFIGURED_MANAGED_SERVER_COUNT%:${configuredManagedServerCount}:g" ${domainPropertiesOutput}
+ sed -i -e "s:%CLUSTER_NAME%:${clusterName}:g" ${domainPropertiesOutput}
+ sed -i -e "s:%SSL_ENABLED%:${sslEnabled}:g" ${domainPropertiesOutput}
+ sed -i -e "s:%PRODUCTION_MODE_ENABLED%:${productionModeEnabled}:g" ${domainPropertiesOutput}
+ sed -i -e "s:%CLUSTER_TYPE%:${clusterType}:g" ${domainPropertiesOutput}
+ sed -i -e "s;%JAVA_OPTIONS%;${javaOptions};g" ${domainPropertiesOutput}
+ sed -i -e "s:%T3_CHANNEL_PORT%:${t3ChannelPort}:g" ${domainPropertiesOutput}
+ sed -i -e "s:%T3_PUBLIC_ADDRESS%:${t3PublicAddress}:g" ${domainPropertiesOutput}
+ sed -i -e "s:%EXPOSE_T3_CHANNEL%:${exposeAdminT3Channel}:g" ${domainPropertiesOutput}
+ sed -i -e "s:%FMW_DOMAIN_TYPE%:${fmwDomainType}:g" ${domainPropertiesOutput}
+ sed -i -e "s:%WDT_DOMAIN_TYPE%:${wdtDomainType}:g" ${domainPropertiesOutput}
+ sed -i -e "s:%ADMIN_USER_NAME%:${username}:g" ${domainPropertiesOutput}
+ sed -i -e "s:%ADMIN_USER_PASS%:${password}:g" ${domainPropertiesOutput}
+ sed -i -e "s:%RCU_SCHEMA_PREFIX%:${rcuSchemaPrefix}:g" ${domainPropertiesOutput}
+ sed -i -e "s:%RCU_SCHEMA_PASSWORD%:${rcuSchemaPassword}:g" ${domainPropertiesOutput}
+ sed -i -e "s|%RCU_DB_CONN_STRING%|${rcuDatabaseURL}|g" ${domainPropertiesOutput}
+
+ if [ -z "${image}" ]; then
+ # calculate the internal name to tag the generated image
+ defaultImageName="domain-home-in-image"
+ baseTag=${domainHomeImageBase#*:}
+ defaultImageName=${defaultImageName}:${baseTag:-"latest"}
+ sed -i -e "s|%IMAGE_NAME%|${defaultImageName}|g" ${domainPropertiesOutput}
+ export BUILD_IMAGE_TAG=${defaultImageName}
+ else
+ sed -i -e "s|%IMAGE_NAME%|${image}|g" ${domainPropertiesOutput}
+ export BUILD_IMAGE_TAG=${image}
+ fi
+ else
+ # we're in the domain in PV case
+
+ wdtVersion="${WDT_VERSION:-${wdtVersion}}"
+ httpsProxy="${https_proxy}"
+
+ createJobOutput="${domainOutputDir}/create-domain-job.yaml"
+ deleteJobOutput="${domainOutputDir}/delete-domain-job.yaml"
+
+ if [ -z "${domainHome}" ]; then
+ domainHome="${domainPVMountPath}/domains/${domainUID}"
+ fi
+
+ # Use the default value if not defined.
+ if [ -z "${createDomainScriptsMountPath}" ]; then
+ createDomainScriptsMountPath="/u01/weblogic"
+ fi
+
+ if [ "${update}" == "true" ]; then
+ createDomainScriptName="update-domain-job.sh"
+ elif [ -z "${createDomainScriptName}" ]; then
+ createDomainScriptName="create-domain-job.sh"
+ fi
+ echo createDomainScriptName is ${createDomainScriptName}
+
+ # Must escape the ':' value in image for sed to properly parse and replace
+ image=$(echo ${image} | sed -e "s/\:/\\\:/g")
+
+ # Generate the yaml to create the kubernetes job that will create the weblogic domain
+ echo Generating ${createJobOutput}
+
+ cp ${createJobInput} ${createJobOutput}
+ sed -i -e "s:%NAMESPACE%:$namespace:g" ${createJobOutput}
+ sed -i -e "s:%WEBLOGIC_CREDENTIALS_SECRET_NAME%:${weblogicCredentialsSecretName}:g" ${createJobOutput}
+ sed -i -e "s:%WEBLOGIC_IMAGE%:${image}:g" ${createJobOutput}
+ sed -i -e "s:%WEBLOGIC_IMAGE_PULL_POLICY%:${imagePullPolicy}:g" ${createJobOutput}
+ sed -i -e "s:%WEBLOGIC_IMAGE_PULL_SECRET_NAME%:${imagePullSecretName}:g" ${createJobOutput}
+ sed -i -e "s:%WEBLOGIC_IMAGE_PULL_SECRET_PREFIX%:${imagePullSecretPrefix}:g" ${createJobOutput}
+ sed -i -e "s:%DOMAIN_UID%:${domainUID}:g" ${createJobOutput}
+ sed -i -e "s:%DOMAIN_NAME%:${domainName}:g" ${createJobOutput}
+ sed -i -e "s:%DOMAIN_HOME%:${domainHome}:g" ${createJobOutput}
+ sed -i -e "s:%SSL_ENABLED%:${sslEnabled}:g" ${createJobOutput}
+ sed -i -e "s:%PRODUCTION_MODE_ENABLED%:${productionModeEnabled}:g" ${createJobOutput}
+ sed -i -e "s:%ADMIN_SERVER_NAME%:${adminServerName}:g" ${createJobOutput}
+ sed -i -e "s:%ADMIN_SERVER_NAME_SVC%:${adminServerNameSVC}:g" ${createJobOutput}
+ sed -i -e "s:%ADMIN_PORT%:${adminPort}:g" ${createJobOutput}
+ sed -i -e "s:%ADMIN_SERVER_SSL_PORT%:${adminServerSSLPort}:g" ${createJobOutput}
+ sed -i -e "s:%CONFIGURED_MANAGED_SERVER_COUNT%:${configuredManagedServerCount}:g" ${createJobOutput}
+ sed -i -e "s:%MANAGED_SERVER_NAME_BASE%:${managedServerNameBase}:g" ${createJobOutput}
+ sed -i -e "s:%MANAGED_SERVER_NAME_BASE_SVC%:${managedServerNameBaseSVC}:g" ${createJobOutput}
+ sed -i -e "s:%MANAGED_SERVER_PORT%:${managedServerPort}:g" ${createJobOutput}
+ sed -i -e "s:%MANAGED_SERVER_SSL_PORT%:${managedServerSSLPort}:g" ${createJobOutput}
+ sed -i -e "s:%T3_CHANNEL_PORT%:${t3ChannelPort}:g" ${createJobOutput}
+ sed -i -e "s:%T3_PUBLIC_ADDRESS%:${t3PublicAddress}:g" ${createJobOutput}
+ sed -i -e "s:%CLUSTER_NAME%:${clusterName}:g" ${createJobOutput}
+ sed -i -e "s:%CLUSTER_TYPE%:${clusterType}:g" ${createJobOutput}
+ sed -i -e "s:%DOMAIN_PVC_NAME%:${persistentVolumeClaimName}:g" ${createJobOutput}
+ sed -i -e "s:%DOMAIN_ROOT_DIR%:${domainPVMountPath}:g" ${createJobOutput}
+ sed -i -e "s:%CREATE_DOMAIN_SCRIPT_DIR%:${createDomainScriptsMountPath}:g" ${createJobOutput}
+ sed -i -e "s:%CREATE_DOMAIN_SCRIPT%:${createDomainScriptName}:g" ${createJobOutput}
+ # extra entries for FMW Infra domains
+ sed -i -e "s:%RCU_CREDENTIALS_SECRET_NAME%:${rcuCredentialsSecret}:g" ${createJobOutput}
+ sed -i -e "s:%CUSTOM_RCUPREFIX%:${rcuSchemaPrefix}:g" ${createJobOutput}
+ sed -i -e "s|%CUSTOM_CONNECTION_STRING%|${rcuDatabaseURL}|g" ${createJobOutput}
+ sed -i -e "s:%EXPOSE_T3_CHANNEL_PREFIX%:${exposeAdminT3Channel}:g" ${createJobOutput}
+ sed -i -e "s:%FRONTEND_HOST%:${frontEndHost}:g" ${createJobOutput}
+ sed -i -e "s:%FRONTEND_PORT%:${frontEndPort}:g" ${createJobOutput}
+ # entries for Istio
+ sed -i -e "s:%ISTIO_PREFIX%:${istioPrefix}:g" ${createJobOutput}
+ sed -i -e "s:%ISTIO_ENABLED%:${istioEnabled}:g" ${createJobOutput}
+ sed -i -e "s:%ISTIO_READINESS_PORT%:${istioReadinessPort}:g" ${createJobOutput}
+ sed -i -e "s:%WDT_VERSION%:${wdtVersion}:g" ${createJobOutput}
+ sed -i -e "s|%DOMAIN_TYPE%|${domain_type}|g" ${createJobOutput}
+ sed -i -e "s|%PROXY_VAL%|${httpsProxy}|g" ${createJobOutput}
+ sed -i -e "s:%CONFIGURE_PORTLET_SERVER%:${configurePortletServer}:g" ${createJobOutput}
+ sed -i -e "s:%PORTLET_SERVER_PORT%:${portletServerPort}:g" ${createJobOutput}
+ sed -i -e "s:%PORTLET_SERVER_SSL_PORT%:${portletServerSSLPort}:g" ${createJobOutput}
+ sed -i -e "s:%PORTLET_CLUSTER_NAME%:${portletClusterName}:g" ${createJobOutput}
+ sed -i -e "s:%PORTLET_SERVER_NAME_BASE%:${portletServerNameBase}:g" ${createJobOutput}
+
+ # Generate the yaml to create the kubernetes job that will delete the weblogic domain_home folder
+ echo Generating ${deleteJobOutput}
+
+ cp ${deleteJobInput} ${deleteJobOutput}
+ sed -i -e "s:%NAMESPACE%:$namespace:g" ${deleteJobOutput}
+ sed -i -e "s:%WEBLOGIC_IMAGE%:${image}:g" ${deleteJobOutput}
+ sed -i -e "s:%WEBLOGIC_IMAGE_PULL_POLICY%:${imagePullPolicy}:g" ${deleteJobOutput}
+ sed -i -e "s:%WEBLOGIC_CREDENTIALS_SECRET_NAME%:${weblogicCredentialsSecretName}:g" ${deleteJobOutput}
+ sed -i -e "s:%WEBLOGIC_IMAGE_PULL_SECRET_NAME%:${imagePullSecretName}:g" ${deleteJobOutput}
+ sed -i -e "s:%WEBLOGIC_IMAGE_PULL_SECRET_PREFIX%:${imagePullSecretPrefix}:g" ${deleteJobOutput}
+ sed -i -e "s:%DOMAIN_UID%:${domainUID}:g" ${deleteJobOutput}
+ sed -i -e "s:%DOMAIN_NAME%:${domainName}:g" ${deleteJobOutput}
+ sed -i -e "s:%DOMAIN_HOME%:${domainHome}:g" ${deleteJobOutput}
+ sed -i -e "s:%DOMAIN_PVC_NAME%:${persistentVolumeClaimName}:g" ${deleteJobOutput}
+ sed -i -e "s:%DOMAIN_ROOT_DIR%:${domainPVMountPath}:g" ${deleteJobOutput}
+ fi
+
+ if [ "${domainHomeSourceType}" == "FromModel" ]; then
+ echo domainHomeSourceType is FromModel
+ # leave domainHomeSourceType to FromModel
+ if [ "${logHomeOnPV}" == "true" ]; then
+ logHomeOnPVPrefix="${enabledPrefix}"
+ else
+ logHomeOnPVPrefix="${disabledPrefix}"
+ fi
+ elif [ "${domainHomeInImage}" == "true" ]; then
+ domainHomeSourceType="Image"
+ if [ "${logHomeOnPV}" == "true" ]; then
+ logHomeOnPVPrefix="${enabledPrefix}"
+ else
+ logHomeOnPVPrefix="${disabledPrefix}"
+ fi
+ else
+ domainHomeSourceType="PersistentVolume"
+ logHomeOnPVPrefix="${enabledPrefix}"
+ logHomeOnPV=true
+ fi
+
+ # Generate the yaml file for creating the domain resource
+ # We want to use wdt's extractDomainResource.sh to get the domain resource
+ # for domain on pv use case. For others, generate domain resource here
+
+ if [ "${domainHomeSourceType}" != "PersistentVolume" ] || [ "${wdtDomainType}" != "WLS" ] ||
+ [ "${useWdt}" != true ]; then
+ echo Generating ${dcrOutput}
+
+ cp ${dcrInput} ${dcrOutput}
+ sed -i -e "s:%DOMAIN_UID%:${domainUID}:g" ${dcrOutput}
+ sed -i -e "s:%NAMESPACE%:$namespace:g" ${dcrOutput}
+ sed -i -e "s:%DOMAIN_HOME%:${domainHome}:g" ${dcrOutput}
+ sed -i -e "s:%DOMAIN_HOME_SOURCE_TYPE%:${domainHomeSourceType}:g" ${dcrOutput}
+ sed -i -e "s:%WEBLOGIC_IMAGE_PULL_POLICY%:${imagePullPolicy}:g" ${dcrOutput}
+ sed -i -e "s:%WEBLOGIC_IMAGE_PULL_SECRET_PREFIX%:${imagePullSecretPrefix}:g" ${dcrOutput}
+ sed -i -e "s:%WEBLOGIC_IMAGE_PULL_SECRET_NAME%:${imagePullSecretName}:g" ${dcrOutput}
+ sed -i -e "s:%WEBLOGIC_CREDENTIALS_SECRET_NAME%:${weblogicCredentialsSecretName}:g" ${dcrOutput}
+ sed -i -e "s:%INCLUDE_SERVER_OUT_IN_POD_LOG%:${includeServerOutInPodLog}:g" ${dcrOutput}
+ sed -i -e "s:%LOG_HOME_ON_PV_PREFIX%:${logHomeOnPVPrefix}:g" ${dcrOutput}
+ sed -i -e "s:%LOG_HOME_ENABLED%:${logHomeOnPV}:g" ${dcrOutput}
+ sed -i -e "s:%LOG_HOME%:${logHome}:g" ${dcrOutput}
+ sed -i -e "s:%HTTP_ACCESS_LOG_IN_LOG_HOME%:${httpAccessLogInLogHome}:g" ${dcrOutput}
+ sed -i -e "s:%DATA_HOME%:${dataHome}:g" ${dcrOutput}
+ sed -i -e "s:%SERVER_START_POLICY%:${serverStartPolicy}:g" ${dcrOutput}
+ sed -i -e "s;%JAVA_OPTIONS%;${javaOptions};g" ${dcrOutput}
+ sed -i -e "s:%DOMAIN_PVC_NAME%:${persistentVolumeClaimName}:g" ${dcrOutput}
+ sed -i -e "s:%DOMAIN_ROOT_DIR%:${domainPVMountPath}:g" ${dcrOutput}
+
+ if [ "${istioEnabled}" == "true" ]; then
+ exposeAdminNodePortPrefix="${disabledPrefix}"
+ fi
+
+ sed -i -e "s:%EXPOSE_T3_CHANNEL_PREFIX%:${exposeAdminT3ChannelPrefix}:g" ${dcrOutput}
+ sed -i -e "s:%EXPOSE_ANY_CHANNEL_PREFIX%:${exposeAnyChannelPrefix}:g" ${dcrOutput}
+ sed -i -e "s:%EXPOSE_ADMIN_PORT_PREFIX%:${exposeAdminNodePortPrefix}:g" ${dcrOutput}
+ sed -i -e "s:%ADMIN_NODE_PORT%:${adminNodePort}:g" ${dcrOutput}
+ sed -i -e "s:%CLUSTER_NAME%:${clusterName}:g" ${dcrOutput}
+ sed -i -e "s:%INITIAL_MANAGED_SERVER_REPLICAS%:${initialManagedServerReplicas}:g" ${dcrOutput}
+ sed -i -e "s:%ISTIO_PREFIX%:${istioPrefix}:g" ${dcrOutput}
+ sed -i -e "s:%ISTIO_ENABLED%:${istioEnabled}:g" ${dcrOutput}
+ sed -i -e "s:%ISTIO_READINESS_PORT%:${istioReadinessPort}:g" ${dcrOutput}
+ # MII settings are used for model-in-image integration testing
+ sed -i -e "s:%MII_PREFIX%:${miiPrefix}:g" ${dcrOutput}
+ sed -i -e "s:%MII_CONFIG_MAP_PREFIX%:${miiConfigMapPrefix}:g" ${dcrOutput}
+ sed -i -e "s:%MII_CONFIG_MAP%:${miiConfigMap}:g" ${dcrOutput}
+ sed -i -e "s:%WDT_DOMAIN_TYPE%:${wdtDomainType}:g" ${dcrOutput}
+
+ buildServerPodResources
+ if [ -z "${serverPodResources}" ]; then
+ sed -i -e "/%OPTIONAL_SERVERPOD_RESOURCES%/d" ${dcrOutput}
+ else
+ if [[ $(uname) -eq "Darwin" ]]; then
+ serverPodResources=$(echo "${serverPodResources}" | sed -e 's/\\n/%NEWLINE%/g')
+ sed -i -e "s:%OPTIONAL_SERVERPOD_RESOURCES%:${serverPodResources}:g" ${dcrOutput}
+ sed -i -e $'s|%NEWLINE%|\\\n|g' ${dcrOutput}
+ else
+ sed -i -e "s:%OPTIONAL_SERVERPOD_RESOURCES%:${serverPodResources}:g" ${dcrOutput}
+ fi
+ fi
+
+ if [ "${domainHomeInImage}" == "true" ]; then
+
+ # now we know which image to use, update the domain yaml file
+ if [ -z $image ]; then
+ sed -i -e "s|%WEBLOGIC_IMAGE%|${defaultImageName}|g" ${dcrOutput}
+ else
+ sed -i -e "s|%WEBLOGIC_IMAGE%|${image}|g" ${dcrOutput}
+ fi
+ else
+ sed -i -e "s:%WEBLOGIC_IMAGE%:${image}:g" ${dcrOutput}
+ fi
+ fi
+
+ # Remove any "...yaml-e" and "...properties-e" files left over from running sed
+ rm -f ${domainOutputDir}/*.yaml-e
+ rm -f ${domainOutputDir}/*.properties-e
+
+}
+
+#
+# Function to create a domain
+# $1 - boolean value indicating the location of the domain home
+# true means domain home in image
+# false means domain home on PV
+#
+function createDomain_WCP {
+ if [ "$#" != 1 ]; then
+ fail "The function must be called with domainHomeInImage parameter."
+ fi
+
+ domainHomeInImage="${1}"
+ if [ "true" != "${domainHomeInImage}" ] && [ "false" != "${domainHomeInImage}" ]; then
+ fail "The value of domainHomeInImage must be true or false: ${domainHomeInImage}"
+ fi
+
+ # Setup the environment for running this script and perform initial validation checks
+ initialize
+
+ # Generate files for creating the domain
+ createFiles_WCP
+
+ # Check that the domain secret exists and contains the required elements
+ validateDomainSecret
+
+ # Validate the domain's persistent volume claim
+ if [ "${doValidation}" == true ] && [ "${domainHomeInImage}" == false -o "${logHomeOnPV}" == true ]; then
+ validateDomainPVC
+ fi
+
+ # Create the WebLogic domain home
+ createDomainHome
+
+ if [ "${executeIt}" = true ]; then
+ createDomainResource
+ fi
+
+ # Print a summary
+ printSummary
+}
diff --git a/OracleWebCenterPortal/kubernetes/create-wcp-domain/utils/wcp-domain-template.yaml b/OracleWebCenterPortal/kubernetes/create-wcp-domain/utils/wcp-domain-template.yaml
old mode 100644
new mode 100755
index 7988e8f53..e49084af0
--- a/OracleWebCenterPortal/kubernetes/create-wcp-domain/utils/wcp-domain-template.yaml
+++ b/OracleWebCenterPortal/kubernetes/create-wcp-domain/utils/wcp-domain-template.yaml
@@ -1,123 +1,123 @@
-# Copyright (c) 2022, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-#
-# This is an example of how to define a Domain resource.
-#
-apiVersion: "weblogic.oracle/v8"
-kind: Domain
-metadata:
- name: %DOMAIN_UID%
- namespace: %NAMESPACE%
- labels:
- weblogic.domainUID: %DOMAIN_UID%
-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 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, introspector 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%"
-
- # 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%"
-
- 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 -Xms256m -Xmx1024m "
- %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%- mountPath: %DOMAIN_ROOT_DIR%
- %LOG_HOME_ON_PV_PREFIX% name: weblogic-domain-storage-volume
-
- # adminServer is used to configure the desired behavior for starting the administration server.
- adminServer:
- # serverStartState legal values are "RUNNING" or "ADMIN"
- # "RUNNING" means the listed server will be started up to "RUNNING" mode
- # "ADMIN" means the listed server will be start up to "ADMIN" mode
- serverStartState: "RUNNING"
- %EXPOSE_ANY_CHANNEL_PREFIX%adminService:
- %EXPOSE_ANY_CHANNEL_PREFIX% channels:
- # The Admin Server's NodePort
- %EXPOSE_ADMIN_PORT_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 admin servers
- env:
- - 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.
- clusters:
- - clusterName: %CLUSTER_NAME%
- serverStartState: "RUNNING"
- serverPod:
- # Instructs Kubernetes scheduler to prefer nodes for new cluster members where there are not
- # already members of the same cluster.
- affinity:
- podAntiAffinity:
- preferredDuringSchedulingIgnoredDuringExecution:
- - weight: 100
- podAffinityTerm:
- labelSelector:
- matchExpressions:
- - key: "weblogic.clusterName"
- operator: In
- values:
- - $(CLUSTER_NAME)
- topologyKey: "kubernetes.io/hostname"
- replicas: %INITIAL_MANAGED_SERVER_REPLICAS%
- # The number of managed servers to start for unlisted clusters
- # replicas: 1
-
- # Istio
- %ISTIO_PREFIX%configuration:
- %ISTIO_PREFIX% istio:
- %ISTIO_PREFIX% enabled: %ISTIO_ENABLED%
- %ISTIO_PREFIX% readinessPort: %ISTIO_READINESS_PORT%
-
+# Copyright (c) 2022, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+#
+# This is an example of how to define a Domain resource.
+#
+apiVersion: "weblogic.oracle/v8"
+kind: Domain
+metadata:
+ name: %DOMAIN_UID%
+ namespace: %NAMESPACE%
+ labels:
+ weblogic.domainUID: %DOMAIN_UID%
+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 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, introspector 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%"
+
+ # 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%"
+
+ 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 -Xms256m -Xmx1024m "
+ %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%- mountPath: %DOMAIN_ROOT_DIR%
+ %LOG_HOME_ON_PV_PREFIX% name: weblogic-domain-storage-volume
+
+ # adminServer is used to configure the desired behavior for starting the administration server.
+ adminServer:
+ # serverStartState legal values are "RUNNING" or "ADMIN"
+ # "RUNNING" means the listed server will be started up to "RUNNING" mode
+ # "ADMIN" means the listed server will be start up to "ADMIN" mode
+ serverStartState: "RUNNING"
+ %EXPOSE_ANY_CHANNEL_PREFIX%adminService:
+ %EXPOSE_ANY_CHANNEL_PREFIX% channels:
+ # The Admin Server's NodePort
+ %EXPOSE_ADMIN_PORT_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 admin servers
+ env:
+ - 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.
+ clusters:
+ - clusterName: %CLUSTER_NAME%
+ serverStartState: "RUNNING"
+ serverPod:
+ # Instructs Kubernetes scheduler to prefer nodes for new cluster members where there are not
+ # already members of the same cluster.
+ affinity:
+ podAntiAffinity:
+ preferredDuringSchedulingIgnoredDuringExecution:
+ - weight: 100
+ podAffinityTerm:
+ labelSelector:
+ matchExpressions:
+ - key: "weblogic.clusterName"
+ operator: In
+ values:
+ - $(CLUSTER_NAME)
+ topologyKey: "kubernetes.io/hostname"
+ replicas: %INITIAL_MANAGED_SERVER_REPLICAS%
+ # The number of managed servers to start for unlisted clusters
+ # replicas: 1
+
+ # Istio
+ %ISTIO_PREFIX%configuration:
+ %ISTIO_PREFIX% istio:
+ %ISTIO_PREFIX% enabled: %ISTIO_ENABLED%
+ %ISTIO_PREFIX% readinessPort: %ISTIO_READINESS_PORT%
+
diff --git a/OracleWebCenterPortal/kubernetes/create-weblogic-domain-credentials/README.md b/OracleWebCenterPortal/kubernetes/create-weblogic-domain-credentials/README.md
old mode 100644
new mode 100755
index adfa4c097..be01bf440
--- a/OracleWebCenterPortal/kubernetes/create-weblogic-domain-credentials/README.md
+++ b/OracleWebCenterPortal/kubernetes/create-weblogic-domain-credentials/README.md
@@ -1,50 +1,50 @@
-# Creating credentials for a WebLogic domain
-
-This sample demonstrates how to create a Kubernetes secret containing the
-credentials for a WebLogic domain. The operator expects this secret to be
-named following the pattern `domainUID-weblogic-credentials`, where `domainUID`
-is the unique identifier of the domain. It must be in the same namespace
-that the domain will run in.
-
-To use the sample, run the command:
-
-```
-$ ./create-weblogic-credentials.sh -u username -p password -d domainUID -n namespace -s secretName
-```
-
-The parameters are as follows:
-
-```
- -u user name, must be specified.
- -p password, must be specified.
- -d domainUID, optional. The default value is wcp-domain. If specified, the secret will be labeled with the domainUID unless the given value is an empty string.
- -n namespace, optional. Use the wcpns namespace if not specified.
- -s secretName, optional. If not specified, the secret name will be determined based on the domainUID value.
-```
-
-This creates a `generic` secret containing the user name and password as literal values.
-
-You can check the secret with the `kubectl get secret` command. An example is shown below,
-including the output:
-
-```
-$ kubectl -n wcpns get secret wcp-domain-weblogic-credentials -o yaml
-apiVersion: v1
-data:
- password: d2VsY29tZTE=
- username: d2VibG9naWM=
-kind: Secret
-metadata:
- creationTimestamp: 2018-12-12T20:25:20Z
- labels:
- weblogic.domainName: wcp-domain
- weblogic.domainUID: wcp-domain
- name: wcp-domain-weblogic-credentials
- namespace: wcpns
- resourceVersion: "5680"
- selfLink: /api/v1/namespaces/wcpns/secrets/wcp-domain-weblogic-credentials
- uid: 0c2b3510-fe4c-11e8-994d-00001700101d
-type: Opaque
-
-```
-
+# Creating credentials for a WebLogic domain
+
+This sample demonstrates how to create a Kubernetes secret containing the
+credentials for a WebLogic domain. The operator expects this secret to be
+named following the pattern `domainUID-weblogic-credentials`, where `domainUID`
+is the unique identifier of the domain. It must be in the same namespace
+that the domain will run in.
+
+To use the sample, run the command:
+
+```
+$ ./create-weblogic-credentials.sh -u username -p password -d domainUID -n namespace -s secretName
+```
+
+The parameters are as follows:
+
+```
+ -u user name, must be specified.
+ -p password, must be specified.
+ -d domainUID, optional. The default value is wcp-domain. If specified, the secret will be labeled with the domainUID unless the given value is an empty string.
+ -n namespace, optional. Use the wcpns namespace if not specified.
+ -s secretName, optional. If not specified, the secret name will be determined based on the domainUID value.
+```
+
+This creates a `generic` secret containing the user name and password as literal values.
+
+You can check the secret with the `kubectl get secret` command. An example is shown below,
+including the output:
+
+```
+$ kubectl -n wcpns get secret wcp-domain-weblogic-credentials -o yaml
+apiVersion: v1
+data:
+ password: d2VsY29tZTE=
+ username: d2VibG9naWM=
+kind: Secret
+metadata:
+ creationTimestamp: 2018-12-12T20:25:20Z
+ labels:
+ weblogic.domainName: wcp-domain
+ weblogic.domainUID: wcp-domain
+ name: wcp-domain-weblogic-credentials
+ namespace: wcpns
+ resourceVersion: "5680"
+ selfLink: /api/v1/namespaces/wcpns/secrets/wcp-domain-weblogic-credentials
+ uid: 0c2b3510-fe4c-11e8-994d-00001700101d
+type: Opaque
+
+```
+
diff --git a/OracleWebCenterPortal/kubernetes/create-weblogic-domain-credentials/create-weblogic-credentials.sh b/OracleWebCenterPortal/kubernetes/create-weblogic-domain-credentials/create-weblogic-credentials.sh
old mode 100644
new mode 100755
index 8780639a5..86dfa1154
--- a/OracleWebCenterPortal/kubernetes/create-weblogic-domain-credentials/create-weblogic-credentials.sh
+++ b/OracleWebCenterPortal/kubernetes/create-weblogic-domain-credentials/create-weblogic-credentials.sh
@@ -1,121 +1,121 @@
-#!/usr/bin/env bash
-# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-#
-# Description
-# This sample script creates a Kubernetes secret for WebLogic domain admin credentials.
-#
-# The following pre-requisites must be handled prior to running this script:
-# * The kubernetes namespace must already be created
-#
-# Secret name determination
-# 1) secretName - if specified
-# 2) wcp-domain-weblogic-credentials - if secretName and domainUID are both not specified. This is the default out-of-the-box.
-# 3) -weblogic-credentials - if secretName is not specified, and domainUID is specified.
-# 4) weblogic-credentials - if secretName is not specified, and domainUID is specified as "".
-#
-# The generated secret will be labeled with
-# weblogic.domainUID=$domainUID
-# and
-# weblogic.domainName=$domainUID
-# Where the $domainUID is the value of the -d command line option, unless the value supplied is an empty String ""
-#
-
-script="${BASH_SOURCE[0]}"
-
-#
-# Function to exit and print an error message
-# $1 - text of message
-function fail {
- echo [ERROR] $*
- exit 1
-}
-
-# Try to execute kubectl to see whether kubectl is available
-function validateKubectlAvailable {
- if ! [ -x "$(command -v kubectl)" ]; then
- fail "kubectl is not installed"
- fi
-}
-
-function usage {
- echo usage: ${script} -u username -p password [-d domainUID] [-n namespace] [-s secretName] [-h]
- echo " -u username, must be specified."
- echo " -p password, must be specified."
- echo " -d domainUID, optional. The default value is wcp-domain. If specified, the secret will be labeled with the domainUID unless the given value is an empty string."
- echo " -n namespace, optional. Use the wcpns namespace if not specified"
- echo " -s secretName, optional. If not specified, the secret name will be determined based on the domainUID value"
- echo " -h Help"
- exit $1
-}
-
-#
-# Parse the command line options
-#
-domainUID=wcp-domain
-namespace=wcpns
-while getopts "hu:p:n:d:s:" opt; do
- case $opt in
- u) username="${OPTARG}"
- ;;
- p) password="${OPTARG}"
- ;;
- n) namespace="${OPTARG}"
- ;;
- d) domainUID="${OPTARG}"
- ;;
- s) secretName="${OPTARG}"
- ;;
- h) usage 0
- ;;
- *) usage 1
- ;;
- esac
-done
-
-if [ -z $secretName ]; then
- if [ -z $domainUID ]; then
- secretName=weblogic-credentials
- else
- secretName=$domainUID-weblogic-credentials
- fi
-fi
-
-if [ -z ${username} ]; then
- echo "${script}: -u must be specified."
- missingRequiredOption="true"
-fi
-
-if [ -z ${password} ]; then
- echo "${script}: -p must be specified."
- missingRequiredOption="true"
-fi
-
-if [ "${missingRequiredOption}" == "true" ]; then
- usage 1
-fi
-
-# check and see if the secret already exists
-result=`kubectl get secret ${secretName} -n ${namespace} --ignore-not-found=true | grep ${secretName} | wc | awk ' { print $1; }'`
-if [ "${result:=Error}" != "0" ]; then
- fail "The secret ${secretName} already exists in namespace ${namespace}."
-fi
-
-# create the secret
-kubectl -n $namespace create secret generic $secretName \
- --from-literal=username=$username \
- --from-literal=password=$password
-
-# label the secret with domainUID if needed
-if [ ! -z $domainUID ]; then
- kubectl label secret ${secretName} -n $namespace weblogic.domainUID=$domainUID weblogic.domainName=$domainUID
-fi
-
-# Verify the secret exists
-SECRET=`kubectl get secret ${secretName} -n ${namespace} | grep ${secretName} | wc | awk ' { print $1; }'`
-if [ "${SECRET}" != "1" ]; then
- fail "The secret ${secretName} was not found in namespace ${namespace}"
-fi
-
-echo "The secret ${secretName} has been successfully created in the ${namespace} namespace."
-
+#!/usr/bin/env bash
+# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+#
+# Description
+# This sample script creates a Kubernetes secret for WebLogic domain admin credentials.
+#
+# The following pre-requisites must be handled prior to running this script:
+# * The kubernetes namespace must already be created
+#
+# Secret name determination
+# 1) secretName - if specified
+# 2) wcp-domain-weblogic-credentials - if secretName and domainUID are both not specified. This is the default out-of-the-box.
+# 3) -weblogic-credentials - if secretName is not specified, and domainUID is specified.
+# 4) weblogic-credentials - if secretName is not specified, and domainUID is specified as "".
+#
+# The generated secret will be labeled with
+# weblogic.domainUID=$domainUID
+# and
+# weblogic.domainName=$domainUID
+# Where the $domainUID is the value of the -d command line option, unless the value supplied is an empty String ""
+#
+
+script="${BASH_SOURCE[0]}"
+
+#
+# Function to exit and print an error message
+# $1 - text of message
+function fail {
+ echo [ERROR] $*
+ exit 1
+}
+
+# Try to execute kubectl to see whether kubectl is available
+function validateKubectlAvailable {
+ if ! [ -x "$(command -v kubectl)" ]; then
+ fail "kubectl is not installed"
+ fi
+}
+
+function usage {
+ echo usage: ${script} -u username -p password [-d domainUID] [-n namespace] [-s secretName] [-h]
+ echo " -u username, must be specified."
+ echo " -p password, must be specified."
+ echo " -d domainUID, optional. The default value is wcp-domain. If specified, the secret will be labeled with the domainUID unless the given value is an empty string."
+ echo " -n namespace, optional. Use the wcpns namespace if not specified"
+ echo " -s secretName, optional. If not specified, the secret name will be determined based on the domainUID value"
+ echo " -h Help"
+ exit $1
+}
+
+#
+# Parse the command line options
+#
+domainUID=wcp-domain
+namespace=wcpns
+while getopts "hu:p:n:d:s:" opt; do
+ case $opt in
+ u) username="${OPTARG}"
+ ;;
+ p) password="${OPTARG}"
+ ;;
+ n) namespace="${OPTARG}"
+ ;;
+ d) domainUID="${OPTARG}"
+ ;;
+ s) secretName="${OPTARG}"
+ ;;
+ h) usage 0
+ ;;
+ *) usage 1
+ ;;
+ esac
+done
+
+if [ -z $secretName ]; then
+ if [ -z $domainUID ]; then
+ secretName=weblogic-credentials
+ else
+ secretName=$domainUID-weblogic-credentials
+ fi
+fi
+
+if [ -z ${username} ]; then
+ echo "${script}: -u must be specified."
+ missingRequiredOption="true"
+fi
+
+if [ -z ${password} ]; then
+ echo "${script}: -p must be specified."
+ missingRequiredOption="true"
+fi
+
+if [ "${missingRequiredOption}" == "true" ]; then
+ usage 1
+fi
+
+# check and see if the secret already exists
+result=`kubectl get secret ${secretName} -n ${namespace} --ignore-not-found=true | grep ${secretName} | wc | awk ' { print $1; }'`
+if [ "${result:=Error}" != "0" ]; then
+ fail "The secret ${secretName} already exists in namespace ${namespace}."
+fi
+
+# create the secret
+kubectl -n $namespace create secret generic $secretName \
+ --from-literal=username=$username \
+ --from-literal=password=$password
+
+# label the secret with domainUID if needed
+if [ ! -z $domainUID ]; then
+ kubectl label secret ${secretName} -n $namespace weblogic.domainUID=$domainUID weblogic.domainName=$domainUID
+fi
+
+# Verify the secret exists
+SECRET=`kubectl get secret ${secretName} -n ${namespace} | grep ${secretName} | wc | awk ' { print $1; }'`
+if [ "${SECRET}" != "1" ]; then
+ fail "The secret ${secretName} was not found in namespace ${namespace}"
+fi
+
+echo "The secret ${secretName} has been successfully created in the ${namespace} namespace."
+
diff --git a/OracleWebCenterPortal/kubernetes/create-weblogic-domain-pv-pvc/README.md b/OracleWebCenterPortal/kubernetes/create-weblogic-domain-pv-pvc/README.md
old mode 100644
new mode 100755
index 1947691b3..dacee5f30
--- a/OracleWebCenterPortal/kubernetes/create-weblogic-domain-pv-pvc/README.md
+++ b/OracleWebCenterPortal/kubernetes/create-weblogic-domain-pv-pvc/README.md
@@ -1,222 +1,222 @@
-# Sample persistent volume and persistent volume claim
-
-The sample scripts demonstrate the creation of a Kubernetes persistent volume (PV) and persistent volume claim (PVC), which can then be used in a domain resource as a persistent storage for the WebLogic domain home or log files.
-
-A PV and PVC can be shared by multiple WebLogic domains or dedicated to a particular domain.
-
-## Prerequisites
-
-Please read the [Persistent Volumes](../../../../site/persistent-volumes.md) guide before proceeding.
-
-## Using the scripts to create a PV and PVC
-
-Prior to running the `create-pv-pvc.sh` script, make a copy of the `create-pv-pvc-inputs.yaml` file, and uncomment and explicitly configure the `weblogicDomainStoragePath` property in the inputs file.
-
-Run the create script, pointing it at your inputs file and an output directory:
-
-```
-$ ./create-pv-pvc.sh \
- -i create-pv-pvc-inputs.yaml \
- -o /path/to/output-directory
-```
-
-The `create-pv-pvc.sh` script will create a subdirectory `pv-pvcs` under the given `/path/to/output-directory` directory. By default, the script generates two YAML files, namely `weblogic-sample-pv.yaml` and `weblogic-sample-pvc.yaml`, in the `/path/to/output-directory/pv-pvcs`. These two YAML files can be used to create the Kubernetes resources using the `kubectl create -f` command.
-
-```
-$ kubectl create -f wcp-domain-domain-pv.yaml
-$ kubectl create -f wcp-domain-domain-pvc.yaml
-
-```
-
-As a convenience, the script can optionally create the PV and PVC resources using the `-e` option.
-
-The usage of the create script is as follows:
-
-```
-$ sh create-pv-pvc.sh -h
-usage: create-pv-pvc.sh -i file -o dir [-e] [-h]
- -i Parameter inputs file, must be specified.
- -o Output directory for the generated yaml files, must be specified.
- -e Also create the Kubernetes objects using the generated yaml files
- -h Help
-```
-
-If you copy the sample scripts to a different location, make sure that you copy everything in the `/kubernetes/samples/scripts` directory together into the target directory, maintaining the original directory hierarchy.
-
-## Configuration parameters
-
-The PV and PVC creation inputs can be customized by editing the `create-pv-pvc-inputs.yaml` file.
-
-| Parameter | Definition | Default |
-| --- | --- | --- |
-| `domainUID` | ID of the domain resource to which the generated PV and PVC will be dedicated. Leave it empty if the PV and PVC are going to be shared by multiple domains. | no default |
-| `namespace` | Kubernetes namespace to create the PVC. | `default` |
-| `baseName` | Base name of the PV and PVC. The generated PV and PVC will be `-pv` and `-pvc` respectively. | `weblogic-sample` |
-| `weblogicDomainStoragePath` | Physical path of the storage for the PV. When `weblogicDomainStorageType` is set to `HOST_PATH`, this value should be set the to path to the domain storage on the Kubernetes host. When `weblogicDomainStorageType` is set to NFS, then `weblogicDomainStorageNFSServer` should be set to the IP address or name of the DNS server, and this value should be set to the exported path on that server. Note that the path where the domain is mounted in the WebLogic containers is not affected by this setting, that is determined when you create your domain. | no default |
-| `weblogicDomainStorageReclaimPolicy` | Kubernetes PVC policy for the persistent storage. The valid values are: `Retain`, `Delete`, and `Recycle`. | `Retain` |
-| `weblogicDomainStorageSize` | Total storage allocated for the PVC. | `10Gi` |
-| `weblogicDomainStorageType` | Type of storage. Legal values are `NFS` and `HOST_PATH`. If using `NFS`, `weblogicDomainStorageNFSServer` must be specified. | `HOST_PATH` |
-| `weblogicDomainStorageNFSServer`| Name or IP address of the NFS server. This setting only applies if `weblogicDomainStorateType` is `NFS`. | no default |
-
-## Shared versus dedicated PVC
-
-By default, the `domainUID` is left empty in the inputs file, which means the generated PV and PVC will not be associated with a particular domain, but can be shared by multiple domain resources in the same Kubernetes namespaces as the PV and PVC.
-
-For the use cases where dedicated PV and PVC are desired for a particular domain, the `domainUID` needs to be set in the `create-pv-pvc-inputs.yaml` file. The presence of a non-empty `domainUID` in the inputs file will cause the generated PV and PVC to be associated with the specified `domainUID`. The association includes that the names of the generated YAML files and the Kubernetes PV and PVC objects are decorated with the `domainUID`, and the PV and PVC objects are also labeled with the `domainUID`.
-
-## Verify the results
-
-The create script will verify that the PV and PVC were created, and will report a failure if there was any error. However, it may be desirable to manually verify the PV and PVC, even if just to gain familiarity with the various Kubernetes objects that were created by the script.
-
-### Generated YAML files with the default inputs
-
-The content of the generated `wcp-domain-domain-pvc.yaml`:
-
-```
-# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-#
-kind: PersistentVolumeClaim
-apiVersion: v1
-metadata:
- name: wcp-domain-domain-pvc
- namespace: default
-
- storageClassName: wcp-domain-domain-storage-class
- accessModes:
- - ReadWriteMany
- resources:
- requests:
- storage: 10Gi
-```
-
-The content of the generated `wcp-domain-domain-pv.yaml`:
-```
-# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-#
-apiVersion: v1
-kind: PersistentVolume
-metadata:
- name: wcp-domain-domain-pv
- # labels:
- # weblogic.domainUID:
-spec:
- storageClassName: wcp-domain-domain-storage-class
- capacity:
- storage: 10Gi
- accessModes:
- - ReadWriteMany
- # Valid values are Retain, Delete or Recycle
- persistentVolumeReclaimPolicy: Retain
- hostPath:
- # nfs:
- # server: %SAMPLE_STORAGE_NFS_SERVER%
- path: "/scratch/k8s_dir"
-
-```
-
-### Generated YAML files for dedicated PV and PVC
-
-The content of the generated `wcp-domain-domain-pvc.yaml` when `domainUID` is set to `domain1`:
-
-```
-# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-#
-kind: PersistentVolumeClaim
-apiVersion: v1
-metadata:
- name: wcp-domain-domain-pvc
- namespace: default
- labels:
- weblogic.domainUID: wcp-domain
-spec:
- storageClassName: wcp-domain-domain-storage-class
- accessModes:
- - ReadWriteMany
- resources:
- requests:
- storage: 10Gi
-```
-
-The content of the generated `wcp-domain-domain-pv.yaml` when `domainUID` is set to `domain1`:
-```
-# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-#
-apiVersion: v1
-kind: PersistentVolume
-metadata:
- name: wcp-domain-domain-pv
- labels:
- weblogic.domainUID: wcp-domain
-spec:
- storageClassName: wcp-domain-domain-storage-class
- capacity:
- storage: 10Gi
- accessModes:
- - ReadWriteMany
- # Valid values are Retain, Delete or Recycle
- persistentVolumeReclaimPolicy: Retain
- hostPath:
- # nfs:
- # server: %SAMPLE_STORAGE_NFS_SERVER%
- path: "/scratch/k8s_dir"
-```
-
-### Verify the PV and PVC objects
-
-You can use this command to verify the persistent volume was created, note that the `Status` field
-should have the value `Bound`, indicating the that persistent volume has been claimed:
-
-```
-$ kubectl describe pv wcp-domain-domain-pv
-Name: wcp-domain-domain-pv
-Annotations: pv.kubernetes.io/bound-by-controller=yes
-StorageClass: wcp-domain-domain-storage-class
-Status: Bound
-Claim: default/wcp-domain-domain-pvc
-Reclaim Policy: Retain
-Access Modes: RWX
-Capacity: 10Gi
-Message:
-Source:
- Type: HostPath (bare host directory volume)
- Path: /scratch/k8s_dir
- HostPathType:
-Events:
-
-```
-
-You can use this command to verify the persistent volume claim was created:
-
-```
-$ kubectl describe pvc wcp-domain-domain-pvc
-Name: wcp-domain-domain-pvc
-Namespace: default
-StorageClass: wcp-domain-domain-storage-class
-Status: Bound
-Volume: wcp-domain-domain-pv
-Annotations: pv.kubernetes.io/bind-completed=yes
- pv.kubernetes.io/bound-by-controller=yes
-Finalizers: []
-Capacity: 10Gi
-Access Modes: RWX
-Events:
-
-```
-
-## Troubleshooting
-
-* Message: `[ERROR] The weblogicDomainStoragePath parameter in kubernetes/samples/scripts/create-weblogic-domain-pv-pvc/create-pv-pvc-inputs.yaml is missing, null or empty`
-Edit the file and set the value of the field. This value must be a directory that is world writable.
-Optionally, follow these steps to tighten permissions on the named directory after you run the sample the first time:
-
- * Become the root user.
- * `ls -nd $value-of-weblogicDomainStoragePath`
- * Note the values of the third and fourth field of the output.
- * `chown $third-field:$fourth-field $value-of-weblogicDomainStoragePath`
- * `chmod 755 $value-of-weblogicDomainStoragePath`
- * Return to your normal user ID.
-
+# Sample persistent volume and persistent volume claim
+
+The sample scripts demonstrate the creation of a Kubernetes persistent volume (PV) and persistent volume claim (PVC), which can then be used in a domain resource as a persistent storage for the WebLogic domain home or log files.
+
+A PV and PVC can be shared by multiple WebLogic domains or dedicated to a particular domain.
+
+## Prerequisites
+
+Please read the [Persistent Volumes](../../../../site/persistent-volumes.md) guide before proceeding.
+
+## Using the scripts to create a PV and PVC
+
+Prior to running the `create-pv-pvc.sh` script, make a copy of the `create-pv-pvc-inputs.yaml` file, and uncomment and explicitly configure the `weblogicDomainStoragePath` property in the inputs file.
+
+Run the create script, pointing it at your inputs file and an output directory:
+
+```
+$ ./create-pv-pvc.sh \
+ -i create-pv-pvc-inputs.yaml \
+ -o /path/to/output-directory
+```
+
+The `create-pv-pvc.sh` script will create a subdirectory `pv-pvcs` under the given `/path/to/output-directory` directory. By default, the script generates two YAML files, namely `weblogic-sample-pv.yaml` and `weblogic-sample-pvc.yaml`, in the `/path/to/output-directory/pv-pvcs`. These two YAML files can be used to create the Kubernetes resources using the `kubectl create -f` command.
+
+```
+$ kubectl create -f wcp-domain-domain-pv.yaml
+$ kubectl create -f wcp-domain-domain-pvc.yaml
+
+```
+
+As a convenience, the script can optionally create the PV and PVC resources using the `-e` option.
+
+The usage of the create script is as follows:
+
+```
+$ sh create-pv-pvc.sh -h
+usage: create-pv-pvc.sh -i file -o dir [-e] [-h]
+ -i Parameter inputs file, must be specified.
+ -o Output directory for the generated yaml files, must be specified.
+ -e Also create the Kubernetes objects using the generated yaml files
+ -h Help
+```
+
+If you copy the sample scripts to a different location, make sure that you copy everything in the `/kubernetes/samples/scripts` directory together into the target directory, maintaining the original directory hierarchy.
+
+## Configuration parameters
+
+The PV and PVC creation inputs can be customized by editing the `create-pv-pvc-inputs.yaml` file.
+
+| Parameter | Definition | Default |
+| --- | --- | --- |
+| `domainUID` | ID of the domain resource to which the generated PV and PVC will be dedicated. Leave it empty if the PV and PVC are going to be shared by multiple domains. | no default |
+| `namespace` | Kubernetes namespace to create the PVC. | `default` |
+| `baseName` | Base name of the PV and PVC. The generated PV and PVC will be `-pv` and `-pvc` respectively. | `weblogic-sample` |
+| `weblogicDomainStoragePath` | Physical path of the storage for the PV. When `weblogicDomainStorageType` is set to `HOST_PATH`, this value should be set the to path to the domain storage on the Kubernetes host. When `weblogicDomainStorageType` is set to NFS, then `weblogicDomainStorageNFSServer` should be set to the IP address or name of the DNS server, and this value should be set to the exported path on that server. Note that the path where the domain is mounted in the WebLogic containers is not affected by this setting, that is determined when you create your domain. | no default |
+| `weblogicDomainStorageReclaimPolicy` | Kubernetes PVC policy for the persistent storage. The valid values are: `Retain`, `Delete`, and `Recycle`. | `Retain` |
+| `weblogicDomainStorageSize` | Total storage allocated for the PVC. | `10Gi` |
+| `weblogicDomainStorageType` | Type of storage. Legal values are `NFS` and `HOST_PATH`. If using `NFS`, `weblogicDomainStorageNFSServer` must be specified. | `HOST_PATH` |
+| `weblogicDomainStorageNFSServer`| Name or IP address of the NFS server. This setting only applies if `weblogicDomainStorateType` is `NFS`. | no default |
+
+## Shared versus dedicated PVC
+
+By default, the `domainUID` is left empty in the inputs file, which means the generated PV and PVC will not be associated with a particular domain, but can be shared by multiple domain resources in the same Kubernetes namespaces as the PV and PVC.
+
+For the use cases where dedicated PV and PVC are desired for a particular domain, the `domainUID` needs to be set in the `create-pv-pvc-inputs.yaml` file. The presence of a non-empty `domainUID` in the inputs file will cause the generated PV and PVC to be associated with the specified `domainUID`. The association includes that the names of the generated YAML files and the Kubernetes PV and PVC objects are decorated with the `domainUID`, and the PV and PVC objects are also labeled with the `domainUID`.
+
+## Verify the results
+
+The create script will verify that the PV and PVC were created, and will report a failure if there was any error. However, it may be desirable to manually verify the PV and PVC, even if just to gain familiarity with the various Kubernetes objects that were created by the script.
+
+### Generated YAML files with the default inputs
+
+The content of the generated `wcp-domain-domain-pvc.yaml`:
+
+```
+# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+#
+kind: PersistentVolumeClaim
+apiVersion: v1
+metadata:
+ name: wcp-domain-domain-pvc
+ namespace: default
+
+ storageClassName: wcp-domain-domain-storage-class
+ accessModes:
+ - ReadWriteMany
+ resources:
+ requests:
+ storage: 10Gi
+```
+
+The content of the generated `wcp-domain-domain-pv.yaml`:
+```
+# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+#
+apiVersion: v1
+kind: PersistentVolume
+metadata:
+ name: wcp-domain-domain-pv
+ # labels:
+ # weblogic.domainUID:
+spec:
+ storageClassName: wcp-domain-domain-storage-class
+ capacity:
+ storage: 10Gi
+ accessModes:
+ - ReadWriteMany
+ # Valid values are Retain, Delete or Recycle
+ persistentVolumeReclaimPolicy: Retain
+ hostPath:
+ # nfs:
+ # server: %SAMPLE_STORAGE_NFS_SERVER%
+ path: "/scratch/k8s_dir"
+
+```
+
+### Generated YAML files for dedicated PV and PVC
+
+The content of the generated `wcp-domain-domain-pvc.yaml` when `domainUID` is set to `domain1`:
+
+```
+# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+#
+kind: PersistentVolumeClaim
+apiVersion: v1
+metadata:
+ name: wcp-domain-domain-pvc
+ namespace: default
+ labels:
+ weblogic.domainUID: wcp-domain
+spec:
+ storageClassName: wcp-domain-domain-storage-class
+ accessModes:
+ - ReadWriteMany
+ resources:
+ requests:
+ storage: 10Gi
+```
+
+The content of the generated `wcp-domain-domain-pv.yaml` when `domainUID` is set to `domain1`:
+```
+# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+#
+apiVersion: v1
+kind: PersistentVolume
+metadata:
+ name: wcp-domain-domain-pv
+ labels:
+ weblogic.domainUID: wcp-domain
+spec:
+ storageClassName: wcp-domain-domain-storage-class
+ capacity:
+ storage: 10Gi
+ accessModes:
+ - ReadWriteMany
+ # Valid values are Retain, Delete or Recycle
+ persistentVolumeReclaimPolicy: Retain
+ hostPath:
+ # nfs:
+ # server: %SAMPLE_STORAGE_NFS_SERVER%
+ path: "/scratch/k8s_dir"
+```
+
+### Verify the PV and PVC objects
+
+You can use this command to verify the persistent volume was created, note that the `Status` field
+should have the value `Bound`, indicating the that persistent volume has been claimed:
+
+```
+$ kubectl describe pv wcp-domain-domain-pv
+Name: wcp-domain-domain-pv
+Annotations: pv.kubernetes.io/bound-by-controller=yes
+StorageClass: wcp-domain-domain-storage-class
+Status: Bound
+Claim: default/wcp-domain-domain-pvc
+Reclaim Policy: Retain
+Access Modes: RWX
+Capacity: 10Gi
+Message:
+Source:
+ Type: HostPath (bare host directory volume)
+ Path: /scratch/k8s_dir
+ HostPathType:
+Events:
+
+```
+
+You can use this command to verify the persistent volume claim was created:
+
+```
+$ kubectl describe pvc wcp-domain-domain-pvc
+Name: wcp-domain-domain-pvc
+Namespace: default
+StorageClass: wcp-domain-domain-storage-class
+Status: Bound
+Volume: wcp-domain-domain-pv
+Annotations: pv.kubernetes.io/bind-completed=yes
+ pv.kubernetes.io/bound-by-controller=yes
+Finalizers: []
+Capacity: 10Gi
+Access Modes: RWX
+Events:
+
+```
+
+## Troubleshooting
+
+* Message: `[ERROR] The weblogicDomainStoragePath parameter in kubernetes/samples/scripts/create-weblogic-domain-pv-pvc/create-pv-pvc-inputs.yaml is missing, null or empty`
+Edit the file and set the value of the field. This value must be a directory that is world writable.
+Optionally, follow these steps to tighten permissions on the named directory after you run the sample the first time:
+
+ * Become the root user.
+ * `ls -nd $value-of-weblogicDomainStoragePath`
+ * Note the values of the third and fourth field of the output.
+ * `chown $third-field:$fourth-field $value-of-weblogicDomainStoragePath`
+ * `chmod 755 $value-of-weblogicDomainStoragePath`
+ * Return to your normal user ID.
+
diff --git a/OracleWebCenterPortal/kubernetes/create-weblogic-domain-pv-pvc/create-pv-pvc-inputs.yaml b/OracleWebCenterPortal/kubernetes/create-weblogic-domain-pv-pvc/create-pv-pvc-inputs.yaml
old mode 100644
new mode 100755
index d18959c27..2415aa997
--- a/OracleWebCenterPortal/kubernetes/create-weblogic-domain-pv-pvc/create-pv-pvc-inputs.yaml
+++ b/OracleWebCenterPortal/kubernetes/create-weblogic-domain-pv-pvc/create-pv-pvc-inputs.yaml
@@ -1,44 +1,44 @@
-# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-#
-# The version of this inputs file. Do not modify.
-version: create-wcp-domain-pv-pvc-inputs-v1
-
-# The base name of the pv and pvc
-baseName: domain
-
-# Unique ID identifying a domain.
-# If left empty, the generated pv can be shared by multiple domains
-# This ID must not contain an underscope ("_"), and must be lowercase and unique across all domains in a Kubernetes cluster.
-domainUID: wcp-domain
-
-# Name of the namespace for the persistent volume claim
-namespace: wcpns
-
-# Persistent volume type for the persistent storage.
-# The value must be 'HOST_PATH' or 'NFS'.
-# If using 'NFS', weblogicDomainStorageNFSServer must be specified.
-weblogicDomainStorageType: HOST_PATH
-
-# The server name or ip address of the NFS server to use for the persistent storage.
-# The following line must be uncomment and customized if weblogicDomainStorateType is NFS:
-#weblogicDomainStorageNFSServer: nfsServer
-
-# Physical path of the persistent storage.
-# When weblogicDomainStorageType is set to HOST_PATH, this value should be set the to path to the
-# domain storage on the Kubernetes host.
-# When weblogicDomainStorageType is set to NFS, then weblogicDomainStorageNFSServer should be set
-# to the IP address or name of the DNS server, and this value should be set to the exported path
-# on that server.
-# Note that the path where the domain is mounted in the WebLogic containers is not affected by this
-# setting, that is determined when you create your domain.
-# The following line must be uncomment and customized:
-weblogicDomainStoragePath: /scratch/k8s_dir
-
-# Reclaim policy of the persistent storage
-# The valid values are: 'Retain', 'Delete', and 'Recycle'
-weblogicDomainStorageReclaimPolicy: Retain
-
-# Total storage allocated to the persistent storage.
-weblogicDomainStorageSize: 10Gi
-
+# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+#
+# The version of this inputs file. Do not modify.
+version: create-wcp-domain-pv-pvc-inputs-v1
+
+# The base name of the pv and pvc
+baseName: domain
+
+# Unique ID identifying a domain.
+# If left empty, the generated pv can be shared by multiple domains
+# This ID must not contain an underscope ("_"), and must be lowercase and unique across all domains in a Kubernetes cluster.
+domainUID: wcp-domain
+
+# Name of the namespace for the persistent volume claim
+namespace: wcpns
+
+# Persistent volume type for the persistent storage.
+# The value must be 'HOST_PATH' or 'NFS'.
+# If using 'NFS', weblogicDomainStorageNFSServer must be specified.
+weblogicDomainStorageType: HOST_PATH
+
+# The server name or ip address of the NFS server to use for the persistent storage.
+# The following line must be uncomment and customized if weblogicDomainStorateType is NFS:
+#weblogicDomainStorageNFSServer: nfsServer
+
+# Physical path of the persistent storage.
+# When weblogicDomainStorageType is set to HOST_PATH, this value should be set the to path to the
+# domain storage on the Kubernetes host.
+# When weblogicDomainStorageType is set to NFS, then weblogicDomainStorageNFSServer should be set
+# to the IP address or name of the DNS server, and this value should be set to the exported path
+# on that server.
+# Note that the path where the domain is mounted in the WebLogic containers is not affected by this
+# setting, that is determined when you create your domain.
+# The following line must be uncomment and customized:
+weblogicDomainStoragePath: /scratch/k8s_dir
+
+# Reclaim policy of the persistent storage
+# The valid values are: 'Retain', 'Delete', and 'Recycle'
+weblogicDomainStorageReclaimPolicy: Retain
+
+# Total storage allocated to the persistent storage.
+weblogicDomainStorageSize: 10Gi
+
diff --git a/OracleWebCenterPortal/kubernetes/create-weblogic-domain-pv-pvc/create-pv-pvc.sh b/OracleWebCenterPortal/kubernetes/create-weblogic-domain-pv-pvc/create-pv-pvc.sh
old mode 100644
new mode 100755
index ba3de3459..59ddf1c9b
--- a/OracleWebCenterPortal/kubernetes/create-weblogic-domain-pv-pvc/create-pv-pvc.sh
+++ b/OracleWebCenterPortal/kubernetes/create-weblogic-domain-pv-pvc/create-pv-pvc.sh
@@ -1,267 +1,267 @@
-#!/usr/bin/env bash
-# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-#
-# Description
-# This sample script generates the Kubernetes yaml files for a persistent volume and persistent volume claim
-# that can be used by a domain custom resource.
-#
-# The creation inputs can be customized by editing create-pv-pvc-inputs.yaml
-#
-# The following pre-requisites must be handled prior to running this script:
-# * The Kubernetes namespace must already be created
-#
-
-# Initialize
-script="${BASH_SOURCE[0]}"
-scriptDir="$( cd "$( dirname "${script}" )" && pwd )"
-source ${scriptDir}/../common/utility.sh
-source ${scriptDir}/../common/validate.sh
-
-function usage {
- echo usage: ${script} -i file -o dir [-e] [-h]
- echo " -i Parameter inputs file, must be specified."
- echo " -o Output directory for the generated yaml files, must be specified."
- echo " -e Also create the Kubernetes objects using the generated yaml files"
- echo " -h Help"
- exit $1
-}
-
-#
-# Parse the command line options
-#
-executeIt=false
-while getopts "ehi:o:" opt; do
- case $opt in
- i) valuesInputFile="${OPTARG}"
- ;;
- o) outputDir="${OPTARG}"
- ;;
- e) executeIt=true
- ;;
- h) usage 0
- ;;
- *) usage 1
- ;;
- esac
-done
-
-if [ -z ${valuesInputFile} ]; then
- echo "${script}: -i must be specified."
- missingRequiredOption="true"
-fi
-
-if [ -z ${outputDir} ]; then
- echo "${script}: -o must be specified."
- missingRequiredOption="true"
-fi
-
-if [ "${missingRequiredOption}" == "true" ]; then
- usage 1
-fi
-
-#
-# Function to initialize and validate the output directory
-# for the generated yaml files for this domain.
-#
-function initOutputDir {
- pvOutputDir="$outputDir/pv-pvcs"
-
- if [ -z ${domainUID} ]; then
- pvOutput="${pvOutputDir}/${baseName}-pv.yaml"
- pvcOutput="${pvOutputDir}/${baseName}-pvc.yaml"
- persistentVolumeName=${baseName}-pv
- persistentVolumeClaimName=${baseName}-pvc
- else
- pvOutput="${pvOutputDir}/${domainUID}-${baseName}-pv.yaml"
- pvcOutput="${pvOutputDir}/${domainUID}-${baseName}-pvc.yaml"
- persistentVolumeName=${domainUID}-${baseName}-pv
- persistentVolumeClaimName=${domainUID}-${baseName}-pvc
- fi
- removeFileIfExists ${pvOutputDir}/{valuesInputFile}
- removeFileIfExists ${pvOutputDir}/{pvOutput}
- removeFileIfExists ${pvOutputDir}/{pvcOutput}
- removeFileIfExists ${pvOutputDir}/create-pv-pvc-inputs.yaml
-}
-
-#
-# Function to setup the environment to run the create domain job
-#
-function initialize {
-
- # Validate the required files exist
- validateErrors=false
-
- if [ -z "${valuesInputFile}" ]; then
- validationError "You must use the -i option to specify the name of the inputs parameter file (a modified copy of kubernetes/samples/scripts/create-weblogic-domain-pv-pvc/create-pv-pvc-inputs.yaml)."
- else
- if [ ! -f ${valuesInputFile} ]; then
- validationError "Unable to locate the input parameters file ${valuesInputFile}"
- fi
- fi
-
- if [ -z "${outputDir}" ]; then
- validationError "You must use the -o option to specify the name of an existing directory to store the generated yaml files in."
- fi
-
- domainPVInput="${scriptDir}/pv-template.yaml"
- if [ ! -f ${domainPVInput} ]; then
- validationError "The template file ${domainPVInput} for generating a persistent volume was not found"
- fi
-
- domainPVCInput="${scriptDir}/pvc-template.yaml"
- if [ ! -f ${domainPVCInput} ]; then
- validationError "The template file ${domainPVCInput} for generating a persistent volume claim was not found"
- fi
-
- failIfValidationErrors
-
- # Parse the commonn inputs file
- parseCommonInputs
- validateInputParamsSpecified \
- weblogicDomainStoragePath \
- weblogicDomainStorageSize \
- baseName \
- namespace \
- version
-
- export requiredInputsVersion="create-weblogic-sample-domain-pv-pvc-inputs-v1"
- validateDomainUid
- validateNamespace
- validateWeblogicDomainStorageType
- validateWeblogicDomainStorageReclaimPolicy
- initOutputDir
- failIfValidationErrors
-}
-
-
-#
-# Function to generate the yaml files for creating a domain
-#
-function createYamlFiles {
-
- # Create a directory for this domain's output files
- mkdir -p ${pvOutputDir}
-
- # Make sure the output directory has a copy of the inputs file.
- # The user can either pre-create the output directory, put the inputs
- # file there, and create the domain from it, or the user can put the
- # inputs file some place else and let this script create the output directory
- # (if needed) and copy the inputs file there.
- copyInputsFileToOutputDirectory ${valuesInputFile} "${pvOutputDir}/create-pv-pvc-inputs.yaml"
-
- enabledPrefix="" # uncomment the feature
- disabledPrefix="# " # comment out the feature
-
- echo Generating ${pvOutput}
-
- cp ${domainPVInput} ${pvOutput}
- if [ "${weblogicDomainStorageType}" == "NFS" ]; then
- hostPathPrefix="${disabledPrefix}"
- nfsPrefix="${enabledPrefix}"
- sed -i -e "s:%SAMPLE_STORAGE_NFS_SERVER%:${weblogicDomainStorageNFSServer}:g" ${pvOutput}
- else
- hostPathPrefix="${enabledPrefix}"
- nfsPrefix="${disabledPrefix}"
- fi
-
- sed -i -e "s:%NAMESPACE%:$namespace:g" ${pvOutput}
- if [ -z ${domainUID} ]; then
- domainUIDLabelPrefix="${disabledPrefix}"
- separator=""
- else
- domainUIDLabelPrefix="${enabledPrefix}"
- separator="-"
- fi
- sed -i -e "s:%DOMAIN_UID%:$domainUID:g" ${pvOutput}
- sed -i -e "s:%SEPARATOR%:$separator:g" ${pvOutput}
- sed -i -e "s:%DOMAIN_UID_LABEL_PREFIX%:${domainUIDLabelPrefix}:g" ${pvOutput}
-
- sed -i -e "s:%BASE_NAME%:$baseName:g" ${pvOutput}
- sed -i -e "s:%SAMPLE_STORAGE_PATH%:${weblogicDomainStoragePath}:g" ${pvOutput}
- sed -i -e "s:%SAMPLE_STORAGE_RECLAIM_POLICY%:${weblogicDomainStorageReclaimPolicy}:g" ${pvOutput}
- sed -i -e "s:%SAMPLE_STORAGE_SIZE%:${weblogicDomainStorageSize}:g" ${pvOutput}
- sed -i -e "s:%HOST_PATH_PREFIX%:${hostPathPrefix}:g" ${pvOutput}
- sed -i -e "s:%NFS_PREFIX%:${nfsPrefix}:g" ${pvOutput}
-
- # Generate the yaml to create the persistent volume claim
- echo Generating ${pvcOutput}
-
- cp ${domainPVCInput} ${pvcOutput}
- sed -i -e "s:%NAMESPACE%:$namespace:g" ${pvcOutput}
- sed -i -e "s:%BASE_NAME%:${baseName}:g" ${pvcOutput}
-
- sed -i -e "s:%DOMAIN_UID%:$domainUID:g" ${pvcOutput}
- sed -i -e "s:%SEPARATOR%:$separator:g" ${pvcOutput}
- sed -i -e "s:%DOMAIN_UID_LABEL_PREFIX%:${domainUIDLabelPrefix}:g" ${pvcOutput}
-
- sed -i -e "s:%SAMPLE_STORAGE_SIZE%:${weblogicDomainStorageSize}:g" ${pvcOutput}
-
- # Remove any "...yaml-e" files left over from running sed
- rm -f ${pvOutputDir}/*.yaml-e
-}
-
-#
-# Function to create the domain's persistent volume
-#
-function createDomainPV {
- # Check if the persistent volume is already available
- checkPvExists ${persistentVolumeName}
- if [ "${PV_EXISTS}" = "false" ]; then
- echo Creating the persistent volume ${persistentVolumeName}
- kubectl create -f ${pvOutput}
- checkPvState ${persistentVolumeName} Available
- fi
-}
-
-#
-# Function to create the domain's persistent volume claim
-# Must be called after createDomainPV since it relies on
-# createDomainPV defining persistentVolumeName
-#
-function createDomainPVC {
- # Check if the persistent volume claim is already available
- checkPvcExists ${persistentVolumeClaimName} ${namespace}
- if [ "${PVC_EXISTS}" = "false" ]; then
- echo Creating the persistent volume claim ${persistentVolumeClaimName}
- kubectl create -f ${pvcOutput}
- checkPvState ${persistentVolumeName} Bound
- fi
-}
-
-#
-# Function to output to the console a summary of the work completed
-#
-function printSummary {
- echo "The following files were generated:"
- echo " ${pvOutput}"
- echo " ${pvcOutput}"
-}
-
-#
-# Perform the following sequence of steps to create a domain
-#
-
-# Setup the environment for running this script and perform initial validation checks
-initialize
-
-# Generate the yaml files for creating the domain
-createYamlFiles
-
-# All done if the generate only option is true
-if [ "${executeIt}" = true ]; then
-
- # Create the domain's persistent volume
- createDomainPV
-
- # Create the domain's persistent volume claim
- createDomainPVC
-fi
-
-# Output a job summary
-printSummary
-
-echo
-echo Completed
-
-
+#!/usr/bin/env bash
+# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+#
+# Description
+# This sample script generates the Kubernetes yaml files for a persistent volume and persistent volume claim
+# that can be used by a domain custom resource.
+#
+# The creation inputs can be customized by editing create-pv-pvc-inputs.yaml
+#
+# The following pre-requisites must be handled prior to running this script:
+# * The Kubernetes namespace must already be created
+#
+
+# Initialize
+script="${BASH_SOURCE[0]}"
+scriptDir="$( cd "$( dirname "${script}" )" && pwd )"
+source ${scriptDir}/../common/utility.sh
+source ${scriptDir}/../common/validate.sh
+
+function usage {
+ echo usage: ${script} -i file -o dir [-e] [-h]
+ echo " -i Parameter inputs file, must be specified."
+ echo " -o Output directory for the generated yaml files, must be specified."
+ echo " -e Also create the Kubernetes objects using the generated yaml files"
+ echo " -h Help"
+ exit $1
+}
+
+#
+# Parse the command line options
+#
+executeIt=false
+while getopts "ehi:o:" opt; do
+ case $opt in
+ i) valuesInputFile="${OPTARG}"
+ ;;
+ o) outputDir="${OPTARG}"
+ ;;
+ e) executeIt=true
+ ;;
+ h) usage 0
+ ;;
+ *) usage 1
+ ;;
+ esac
+done
+
+if [ -z ${valuesInputFile} ]; then
+ echo "${script}: -i must be specified."
+ missingRequiredOption="true"
+fi
+
+if [ -z ${outputDir} ]; then
+ echo "${script}: -o must be specified."
+ missingRequiredOption="true"
+fi
+
+if [ "${missingRequiredOption}" == "true" ]; then
+ usage 1
+fi
+
+#
+# Function to initialize and validate the output directory
+# for the generated yaml files for this domain.
+#
+function initOutputDir {
+ pvOutputDir="$outputDir/pv-pvcs"
+
+ if [ -z ${domainUID} ]; then
+ pvOutput="${pvOutputDir}/${baseName}-pv.yaml"
+ pvcOutput="${pvOutputDir}/${baseName}-pvc.yaml"
+ persistentVolumeName=${baseName}-pv
+ persistentVolumeClaimName=${baseName}-pvc
+ else
+ pvOutput="${pvOutputDir}/${domainUID}-${baseName}-pv.yaml"
+ pvcOutput="${pvOutputDir}/${domainUID}-${baseName}-pvc.yaml"
+ persistentVolumeName=${domainUID}-${baseName}-pv
+ persistentVolumeClaimName=${domainUID}-${baseName}-pvc
+ fi
+ removeFileIfExists ${pvOutputDir}/{valuesInputFile}
+ removeFileIfExists ${pvOutputDir}/{pvOutput}
+ removeFileIfExists ${pvOutputDir}/{pvcOutput}
+ removeFileIfExists ${pvOutputDir}/create-pv-pvc-inputs.yaml
+}
+
+#
+# Function to setup the environment to run the create domain job
+#
+function initialize {
+
+ # Validate the required files exist
+ validateErrors=false
+
+ if [ -z "${valuesInputFile}" ]; then
+ validationError "You must use the -i option to specify the name of the inputs parameter file (a modified copy of kubernetes/samples/scripts/create-weblogic-domain-pv-pvc/create-pv-pvc-inputs.yaml)."
+ else
+ if [ ! -f ${valuesInputFile} ]; then
+ validationError "Unable to locate the input parameters file ${valuesInputFile}"
+ fi
+ fi
+
+ if [ -z "${outputDir}" ]; then
+ validationError "You must use the -o option to specify the name of an existing directory to store the generated yaml files in."
+ fi
+
+ domainPVInput="${scriptDir}/pv-template.yaml"
+ if [ ! -f ${domainPVInput} ]; then
+ validationError "The template file ${domainPVInput} for generating a persistent volume was not found"
+ fi
+
+ domainPVCInput="${scriptDir}/pvc-template.yaml"
+ if [ ! -f ${domainPVCInput} ]; then
+ validationError "The template file ${domainPVCInput} for generating a persistent volume claim was not found"
+ fi
+
+ failIfValidationErrors
+
+ # Parse the commonn inputs file
+ parseCommonInputs
+ validateInputParamsSpecified \
+ weblogicDomainStoragePath \
+ weblogicDomainStorageSize \
+ baseName \
+ namespace \
+ version
+
+ export requiredInputsVersion="create-weblogic-sample-domain-pv-pvc-inputs-v1"
+ validateDomainUid
+ validateNamespace
+ validateWeblogicDomainStorageType
+ validateWeblogicDomainStorageReclaimPolicy
+ initOutputDir
+ failIfValidationErrors
+}
+
+
+#
+# Function to generate the yaml files for creating a domain
+#
+function createYamlFiles {
+
+ # Create a directory for this domain's output files
+ mkdir -p ${pvOutputDir}
+
+ # Make sure the output directory has a copy of the inputs file.
+ # The user can either pre-create the output directory, put the inputs
+ # file there, and create the domain from it, or the user can put the
+ # inputs file some place else and let this script create the output directory
+ # (if needed) and copy the inputs file there.
+ copyInputsFileToOutputDirectory ${valuesInputFile} "${pvOutputDir}/create-pv-pvc-inputs.yaml"
+
+ enabledPrefix="" # uncomment the feature
+ disabledPrefix="# " # comment out the feature
+
+ echo Generating ${pvOutput}
+
+ cp ${domainPVInput} ${pvOutput}
+ if [ "${weblogicDomainStorageType}" == "NFS" ]; then
+ hostPathPrefix="${disabledPrefix}"
+ nfsPrefix="${enabledPrefix}"
+ sed -i -e "s:%SAMPLE_STORAGE_NFS_SERVER%:${weblogicDomainStorageNFSServer}:g" ${pvOutput}
+ else
+ hostPathPrefix="${enabledPrefix}"
+ nfsPrefix="${disabledPrefix}"
+ fi
+
+ sed -i -e "s:%NAMESPACE%:$namespace:g" ${pvOutput}
+ if [ -z ${domainUID} ]; then
+ domainUIDLabelPrefix="${disabledPrefix}"
+ separator=""
+ else
+ domainUIDLabelPrefix="${enabledPrefix}"
+ separator="-"
+ fi
+ sed -i -e "s:%DOMAIN_UID%:$domainUID:g" ${pvOutput}
+ sed -i -e "s:%SEPARATOR%:$separator:g" ${pvOutput}
+ sed -i -e "s:%DOMAIN_UID_LABEL_PREFIX%:${domainUIDLabelPrefix}:g" ${pvOutput}
+
+ sed -i -e "s:%BASE_NAME%:$baseName:g" ${pvOutput}
+ sed -i -e "s:%SAMPLE_STORAGE_PATH%:${weblogicDomainStoragePath}:g" ${pvOutput}
+ sed -i -e "s:%SAMPLE_STORAGE_RECLAIM_POLICY%:${weblogicDomainStorageReclaimPolicy}:g" ${pvOutput}
+ sed -i -e "s:%SAMPLE_STORAGE_SIZE%:${weblogicDomainStorageSize}:g" ${pvOutput}
+ sed -i -e "s:%HOST_PATH_PREFIX%:${hostPathPrefix}:g" ${pvOutput}
+ sed -i -e "s:%NFS_PREFIX%:${nfsPrefix}:g" ${pvOutput}
+
+ # Generate the yaml to create the persistent volume claim
+ echo Generating ${pvcOutput}
+
+ cp ${domainPVCInput} ${pvcOutput}
+ sed -i -e "s:%NAMESPACE%:$namespace:g" ${pvcOutput}
+ sed -i -e "s:%BASE_NAME%:${baseName}:g" ${pvcOutput}
+
+ sed -i -e "s:%DOMAIN_UID%:$domainUID:g" ${pvcOutput}
+ sed -i -e "s:%SEPARATOR%:$separator:g" ${pvcOutput}
+ sed -i -e "s:%DOMAIN_UID_LABEL_PREFIX%:${domainUIDLabelPrefix}:g" ${pvcOutput}
+
+ sed -i -e "s:%SAMPLE_STORAGE_SIZE%:${weblogicDomainStorageSize}:g" ${pvcOutput}
+
+ # Remove any "...yaml-e" files left over from running sed
+ rm -f ${pvOutputDir}/*.yaml-e
+}
+
+#
+# Function to create the domain's persistent volume
+#
+function createDomainPV {
+ # Check if the persistent volume is already available
+ checkPvExists ${persistentVolumeName}
+ if [ "${PV_EXISTS}" = "false" ]; then
+ echo Creating the persistent volume ${persistentVolumeName}
+ kubectl create -f ${pvOutput}
+ checkPvState ${persistentVolumeName} Available
+ fi
+}
+
+#
+# Function to create the domain's persistent volume claim
+# Must be called after createDomainPV since it relies on
+# createDomainPV defining persistentVolumeName
+#
+function createDomainPVC {
+ # Check if the persistent volume claim is already available
+ checkPvcExists ${persistentVolumeClaimName} ${namespace}
+ if [ "${PVC_EXISTS}" = "false" ]; then
+ echo Creating the persistent volume claim ${persistentVolumeClaimName}
+ kubectl create -f ${pvcOutput}
+ checkPvState ${persistentVolumeName} Bound
+ fi
+}
+
+#
+# Function to output to the console a summary of the work completed
+#
+function printSummary {
+ echo "The following files were generated:"
+ echo " ${pvOutput}"
+ echo " ${pvcOutput}"
+}
+
+#
+# Perform the following sequence of steps to create a domain
+#
+
+# Setup the environment for running this script and perform initial validation checks
+initialize
+
+# Generate the yaml files for creating the domain
+createYamlFiles
+
+# All done if the generate only option is true
+if [ "${executeIt}" = true ]; then
+
+ # Create the domain's persistent volume
+ createDomainPV
+
+ # Create the domain's persistent volume claim
+ createDomainPVC
+fi
+
+# Output a job summary
+printSummary
+
+echo
+echo Completed
+
+
diff --git a/OracleWebCenterPortal/kubernetes/create-weblogic-domain-pv-pvc/pv-template.yaml b/OracleWebCenterPortal/kubernetes/create-weblogic-domain-pv-pvc/pv-template.yaml
old mode 100644
new mode 100755
index 49e33a22f..0b9faec61
--- a/OracleWebCenterPortal/kubernetes/create-weblogic-domain-pv-pvc/pv-template.yaml
+++ b/OracleWebCenterPortal/kubernetes/create-weblogic-domain-pv-pvc/pv-template.yaml
@@ -1,21 +1,21 @@
-# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-#
-apiVersion: v1
-kind: PersistentVolume
-metadata:
- name: %DOMAIN_UID%%SEPARATOR%%BASE_NAME%-pv
- labels:
- %DOMAIN_UID_LABEL_PREFIX%weblogic.domainUID: %DOMAIN_UID%
-spec:
- storageClassName: %DOMAIN_UID%%SEPARATOR%%BASE_NAME%-storage-class
- capacity:
- storage: %SAMPLE_STORAGE_SIZE%
- accessModes:
- - ReadWriteMany
- # Valid values are Retain, Delete or Recycle
- persistentVolumeReclaimPolicy: %SAMPLE_STORAGE_RECLAIM_POLICY%
- %HOST_PATH_PREFIX%hostPath:
- %NFS_PREFIX%nfs:
- %NFS_PREFIX%server: %SAMPLE_STORAGE_NFS_SERVER%
- path: "%SAMPLE_STORAGE_PATH%"
+# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+#
+apiVersion: v1
+kind: PersistentVolume
+metadata:
+ name: %DOMAIN_UID%%SEPARATOR%%BASE_NAME%-pv
+ labels:
+ %DOMAIN_UID_LABEL_PREFIX%weblogic.domainUID: %DOMAIN_UID%
+spec:
+ storageClassName: %DOMAIN_UID%%SEPARATOR%%BASE_NAME%-storage-class
+ capacity:
+ storage: %SAMPLE_STORAGE_SIZE%
+ accessModes:
+ - ReadWriteMany
+ # Valid values are Retain, Delete or Recycle
+ persistentVolumeReclaimPolicy: %SAMPLE_STORAGE_RECLAIM_POLICY%
+ %HOST_PATH_PREFIX%hostPath:
+ %NFS_PREFIX%nfs:
+ %NFS_PREFIX%server: %SAMPLE_STORAGE_NFS_SERVER%
+ path: "%SAMPLE_STORAGE_PATH%"
diff --git a/OracleWebCenterPortal/kubernetes/create-weblogic-domain-pv-pvc/pvc-template.yaml b/OracleWebCenterPortal/kubernetes/create-weblogic-domain-pv-pvc/pvc-template.yaml
old mode 100644
new mode 100755
index 49e8d5afb..cf50389d5
--- a/OracleWebCenterPortal/kubernetes/create-weblogic-domain-pv-pvc/pvc-template.yaml
+++ b/OracleWebCenterPortal/kubernetes/create-weblogic-domain-pv-pvc/pvc-template.yaml
@@ -1,17 +1,17 @@
-# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-#
-kind: PersistentVolumeClaim
-apiVersion: v1
-metadata:
- name: %DOMAIN_UID%%SEPARATOR%%BASE_NAME%-pvc
- namespace: %NAMESPACE%
- labels:
- %DOMAIN_UID_LABEL_PREFIX%weblogic.domainUID: %DOMAIN_UID%
-spec:
- storageClassName: %DOMAIN_UID%%SEPARATOR%%BASE_NAME%-storage-class
- accessModes:
- - ReadWriteMany
- resources:
- requests:
- storage: %SAMPLE_STORAGE_SIZE%
+# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+#
+kind: PersistentVolumeClaim
+apiVersion: v1
+metadata:
+ name: %DOMAIN_UID%%SEPARATOR%%BASE_NAME%-pvc
+ namespace: %NAMESPACE%
+ labels:
+ %DOMAIN_UID_LABEL_PREFIX%weblogic.domainUID: %DOMAIN_UID%
+spec:
+ storageClassName: %DOMAIN_UID%%SEPARATOR%%BASE_NAME%-storage-class
+ accessModes:
+ - ReadWriteMany
+ resources:
+ requests:
+ storage: %SAMPLE_STORAGE_SIZE%
diff --git a/OracleWebCenterPortal/kubernetes/delete-domain/README.md b/OracleWebCenterPortal/kubernetes/delete-domain/README.md
old mode 100644
new mode 100755
index 800c7094a..2affb3de5
--- a/OracleWebCenterPortal/kubernetes/delete-domain/README.md
+++ b/OracleWebCenterPortal/kubernetes/delete-domain/README.md
@@ -1,27 +1,27 @@
-# Deleting domain resources created while executing the samples
-
-After running the sample, you will need to release domain resources that
-can then be used for other purposes. The script in this sample demonstrates one approach to releasing
-domain resources.
-
-## Using the script to delete domain resources
-
-```shell
-$ ./delete-weblogic-domain-resources.sh \
- -d domain-uid[,domain-uid...] \
- [-s max-seconds] \
- [-t]
-```
-The required option `-d` takes `domain-uid` values (separated
- by commas and no spaces) to identify the domain resources that should be deleted.
-
-To limit the amount of time spent on attempting to delete domain resources, use `-s`.
-The option must be followed by an integer that represents the total number of seconds
-that will be spent attempting to delete resources. The default number of seconds is 120.
-
-The optional option `-t` shows what the script will delete without executing the deletion.
-
-To see the help associated with the script:
-```shell
-$ ./delete-weblogic-domain-resources.sh -h
-```
+# Deleting domain resources created while executing the samples
+
+After running the sample, you will need to release domain resources that
+can then be used for other purposes. The script in this sample demonstrates one approach to releasing
+domain resources.
+
+## Using the script to delete domain resources
+
+```shell
+$ ./delete-weblogic-domain-resources.sh \
+ -d domain-uid[,domain-uid...] \
+ [-s max-seconds] \
+ [-t]
+```
+The required option `-d` takes `domain-uid` values (separated
+ by commas and no spaces) to identify the domain resources that should be deleted.
+
+To limit the amount of time spent on attempting to delete domain resources, use `-s`.
+The option must be followed by an integer that represents the total number of seconds
+that will be spent attempting to delete resources. The default number of seconds is 120.
+
+The optional option `-t` shows what the script will delete without executing the deletion.
+
+To see the help associated with the script:
+```shell
+$ ./delete-weblogic-domain-resources.sh -h
+```
diff --git a/OracleWebCenterPortal/kubernetes/delete-domain/delete-weblogic-domain-resources.sh b/OracleWebCenterPortal/kubernetes/delete-domain/delete-weblogic-domain-resources.sh
old mode 100644
new mode 100755
index fd54d1ea0..744ea56aa
--- a/OracleWebCenterPortal/kubernetes/delete-domain/delete-weblogic-domain-resources.sh
+++ b/OracleWebCenterPortal/kubernetes/delete-domain/delete-weblogic-domain-resources.sh
@@ -1,283 +1,283 @@
-#!/bin/bash
-# Copyright (c) 2019, 2021, Oracle and/or its affiliates.
-# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-#
-# Description:
-# Use this script to delete all kubernetes resources associated
-# with a set of given domains. Alternatively, run the script
-# in a test mode to show what would be deleted without actually
-# performing the deletes.
-#
-# Usage:
-# See "function usage" below or call this script with no parameters.
-#
-
-script="${BASH_SOURCE[0]}"
-
-function usage {
-cat << EOF
- Usage:
-
- $(basename $0) -d domain-uid,domain-uid,... [-s max-seconds] [-t]
- $(basename $0) -h
-
- Perform a best-effort delete of the kubernetes resources for
- the given domain(s), and retry until either max-seconds is reached
- or all resources were deleted (default $default_maxwaitsecs seconds).
-
- The domains can be specified as a comma-separated list of
- domain-uids (no spaces). The domains can be located in any
- kubernetes namespace.
-
- Specify '-t' to run the script in a test mode which will
- show kubernetes commands but not actually perform them.
-
- The script runs in phases:
-
- Phase 1: Set the serverStartPolicy of each domain to NEVER if
- it's not already NEVER. This should cause each
- domain's operator to initiate a controlled shutdown
- of the domain. Immediately proceed to phase 2.
-
- Phase 2: Wait up to half of max-seconds for WebLogic
- Server pods to exit normally, and then proceed
- to phase 3.
-
- Phase 3: Periodically delete any remaining kubernetes resources
- for the specified domains, including any pods
- leftover from previous phases. Exit and fail if
- max-seconds is exceeded and there are any leftover
- kubernetes resources.
-
- This script exits with a zero status on success, and a
- non-zero status on failure.
-EOF
-}
-
-#
-# getDomainResources domain(s) outfilename
-#
-# Usage:
-# getDomainResources domainA,domainB,... outfilename
-#
-# Internal helper function
-#
-# File output is all domain related resources for the given domain uids, one per line,
-# in the form: 'kind name [-n namespace]'. For example:
-# PersistentVolumeClaim domain1-pv-claim -n default
-# PersistentVolume domain1-pv
-#
-function getDomainResources {
- local domain_regex=''
- LABEL_SELECTOR="weblogic.domainUID in ($1)"
- IFS=',' read -ra UIDS <<< "$1"
- for i in "${!UIDS[@]}"; do
- if [ $i -gt 0 ]; then
- domain_regex="$domain_regex|"
- fi
- domain_regex="$domain_regex^Domain ${UIDS[$i]} "
- done
-
- # clean the output file
- if [ -e $2 ]; then
- rm $2
- fi
-
- # first, let's get all namespaced types with -l $LABEL_SELECTOR
- NAMESPACED_TYPES="pod,job,deploy,rs,service,pvc,ingress,cm,serviceaccount,role,rolebinding,secret"
-
- kubectl get $NAMESPACED_TYPES \
- -l "$LABEL_SELECTOR" \
- -o=jsonpath='{range .items[*]}{.kind}{" "}{.metadata.name}{" -n "}{.metadata.namespace}{"\n"}{end}' \
- --all-namespaces=true >> $2
-
- # if domain crd exists, look for domains too:
- kubectl get crd domains.weblogic.oracle > /dev/null 2>&1
- if [ $? -eq 0 ]; then
- kubectl get domain \
- -o=jsonpath='{range .items[*]}{.kind}{" "}{.metadata.name}{" -n "}{.metadata.namespace}{"\n"}{end}' \
- --all-namespaces=true | egrep "$domain_regex" >> $2
- fi
-
- # now, get all non-namespaced types with -l $LABEL_SELECTOR
-
- NOT_NAMESPACED_TYPES="pv,clusterroles,clusterrolebindings"
-
- kubectl get $NOT_NAMESPACED_TYPES \
- -l "$LABEL_SELECTOR" \
- -o=jsonpath='{range .items[*]}{.kind}{" "}{.metadata.name}{"\n"}{end}' \
- --all-namespaces=true >> $2
-}
-
-#
-# deleteDomains domain(s) maxwaitsecs
-#
-# Usage:
-# deleteDomains domainA,domainB,... maxwaitsecs
-#
-# Internal helper function
-# This function first sets the serverStartPolicy of each Domain to NEVER
-# and waits up to half of $2 for pods to 'self delete'. It then performs
-# a helm delete on $1, and finally it directly deletes
-# any remaining k8s resources for domain $1 (including any remaining pods)
-# and retries these direct deletes up to $2 seconds.
-#
-# If global $test_mode is true, it shows candidate actions but doesn't
-# actually perform them
-#
-function deleteDomains {
-
- if [ "$test_mode" = "true" ]; then
- echo @@ Test mode! Displaying commands for deleting kubernetes resources with label weblogic.domainUID \'$1\' without actually deleting them.
- else
- echo @@ Deleting kubernetes resources with label weblogic.domainUID \'$1\'.
- fi
-
- local maxwaitsecs=${2:-$default_maxwaitsecs}
- local tempfile="/tmp/$(basename $0).tmp.$$" # == /tmp/[script-file-name].tmp.[pid]
- local mstart=`date +%s`
- local phase=1
-
- while : ; do
- # get all k8s resources with matching domain-uid labels and put them in $tempfile
- getDomainResources $1 $tempfile
-
- # get a count of all k8s resources with matching domain-uid labels
- local allcount=`wc -l $tempfile | awk '{ print $1 }'`
-
- # get a count of all WLS pods (any pod with a matching domain-uid label that doesn't have 'traefik' or 'apache' embedded in its name)
- local podcount=`grep "^Pod" $tempfile | grep -v traefik | grep -v apache | wc -l | awk '{ print $1 }'`
-
- local mnow=`date +%s`
-
- echo @@ $allcount resources remaining after $((mnow - mstart)) seconds, including $podcount WebLogic Server pods. Max wait is $maxwaitsecs seconds.
-
- # Exit if all k8s resources deleted or max wait seconds exceeded.
-
- if [ $allcount -eq 0 ]; then
- echo @@ Success.
- rm -f $tempfile
- exit 0
- elif [ $((mnow - mstart)) -gt $maxwaitsecs ]; then
- echo @@ Error! Max wait of $maxwaitsecs seconds exceeded with $allcount resources remaining, including $podcount WebLogic Server pods. Giving up. Remaining resources:
- cat $tempfile
- rm -f $tempfile
- exit $allcount
- fi
-
- # In phase 1, set the serverStartPolicy of each domain to NEVER and then immediately
- # proceed to phase 2. If there are no domains or WLS pods, we also immediately go to phase 2.
-
- if [ $phase -eq 1 ]; then
- phase=2
- if [ $podcount -gt 0 ]; then
- echo @@ "Setting serverStartPolicy to NEVER on each domain (this should cause operator(s) to initiate a controlled shutdown of the domain's pods.)"
- cat $tempfile | grep "^Domain" | while read line; do
- local name="`echo $line | awk '{ print $2 }'`"
- local namespace="`echo $line | awk '{ print $4 }'`"
- if [ "$test_mode" = "true" ]; then
- echo "kubectl patch domain $name -n $namespace -p '{\"spec\":{\"serverStartPolicy\":\"NEVER\"}}' --type merge"
- else
- kubectl patch domain $name -n $namespace -p '{"spec":{"serverStartPolicy":"NEVER"}}' --type merge
- fi
- done
- fi
- fi
-
- # In phase 2, wait for the WLS pod count to go down to 0 for at most half
- # of 'maxwaitsecs'. Otherwise proceed immediately to phase 3.
-
- if [ $phase -eq 2 ]; then
- if [ $podcount -eq 0 ]; then
- echo @@ All pods shutdown, about to directly delete remaining resources.
- phase=3
- elif [ $((mnow - mstart)) -gt $((maxwaitsecs / 2)) ]; then
- echo @@ Warning! $podcount WebLogic Server pods remaining but wait time exceeds half of max wait seconds. About to directly delete all remaining resources, including the leftover pods.
- phase=3
- else
- echo @@ "Waiting for operator to shutdown pods (will wait for no more than half of max wait seconds before directly deleting them)."
- sleep 3
- continue
- fi
- fi
-
- # In phase 3, directly delete remaining k8s resources for the given domainUids
- # (including any leftover WLS pods from previous phases).
-
- # for each namespace with leftover resources, try delete them
- cat $tempfile | awk '{ print $4 }' | grep -v "^$" | sort -u | while read line; do
- if [ "$test_mode" = "true" ]; then
- echo kubectl -n $line delete $NAMESPACED_TYPES -l "$LABEL_SELECTOR"
- else
- kubectl -n $line delete $NAMESPACED_TYPES -l "$LABEL_SELECTOR"
- fi
- done
-
- # if there are any non-namespaced types left, try delete them
- local no_namespace_count=`grep -c -v " -n " $tempfile`
- if [ ! "$no_namespace_count" = "0" ]; then
- if [ "$test_mode" = "true" ]; then
- echo kubectl delete $NOT_NAMESPACED_TYPES -l "$LABEL_SELECTOR"
- else
- kubectl delete $NOT_NAMESPACED_TYPES -l "$LABEL_SELECTOR"
- fi
- fi
-
- # Delete domains, if any
- cat $tempfile | grep "^Domain " | while read line; do
- if [ "$test_mode" = "true" ]; then
- echo kubectl delete $line
- else
- kubectl delete $line
- fi
- done
-
- sleep 3
- done
-}
-
-# main entry point
-
-# default when to stop retrying (override via command line)
-default_maxwaitsecs=120
-
-# optional test mode that lists what would be deleted without
-# actually deleting (override via command line)
-test_mode=false
-
-domains=""
-
-# parse command line options
-while getopts ":d:s:th" opt; do
- case $opt in
- d) domains="${OPTARG}"
- ;;
-
- s) maxwaitsecs="${OPTARG}"
- ;;
-
- t) test_mode="true"
- ;;
-
- h) usage
- exit 0
- ;;
-
- *) usage
- exit 9999
- ;;
- esac
-done
-
-if [ "$domains" = "" ]; then
- usage
- exit 9999
-fi
-
-if [ ! -x "$(command -v kubectl)" ]; then
- echo "@@ Error! kubectl is not installed."
- exit 9999
-fi
-
-deleteDomains "${domains}" "${maxwaitsecs:-$default_maxwaitsecs}"
-
+#!/bin/bash
+# Copyright (c) 2019, 2021, Oracle and/or its affiliates.
+# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
+#
+# Description:
+# Use this script to delete all kubernetes resources associated
+# with a set of given domains. Alternatively, run the script
+# in a test mode to show what would be deleted without actually
+# performing the deletes.
+#
+# Usage:
+# See "function usage" below or call this script with no parameters.
+#
+
+script="${BASH_SOURCE[0]}"
+
+function usage {
+cat << EOF
+ Usage:
+
+ $(basename $0) -d domain-uid,domain-uid,... [-s max-seconds] [-t]
+ $(basename $0) -h
+
+ Perform a best-effort delete of the kubernetes resources for
+ the given domain(s), and retry until either max-seconds is reached
+ or all resources were deleted (default $default_maxwaitsecs seconds).
+
+ The domains can be specified as a comma-separated list of
+ domain-uids (no spaces). The domains can be located in any
+ kubernetes namespace.
+
+ Specify '-t' to run the script in a test mode which will
+ show kubernetes commands but not actually perform them.
+
+ The script runs in phases:
+
+ Phase 1: Set the serverStartPolicy of each domain to NEVER if
+ it's not already NEVER. This should cause each
+ domain's operator to initiate a controlled shutdown
+ of the domain. Immediately proceed to phase 2.
+
+ Phase 2: Wait up to half of max-seconds for WebLogic
+ Server pods to exit normally, and then proceed
+ to phase 3.
+
+ Phase 3: Periodically delete any remaining kubernetes resources
+ for the specified domains, including any pods
+ leftover from previous phases. Exit and fail if
+ max-seconds is exceeded and there are any leftover
+ kubernetes resources.
+
+ This script exits with a zero status on success, and a
+ non-zero status on failure.
+EOF
+}
+
+#
+# getDomainResources domain(s) outfilename
+#
+# Usage:
+# getDomainResources domainA,domainB,... outfilename
+#
+# Internal helper function
+#
+# File output is all domain related resources for the given domain uids, one per line,
+# in the form: 'kind name [-n namespace]'. For example:
+# PersistentVolumeClaim domain1-pv-claim -n default
+# PersistentVolume domain1-pv
+#
+function getDomainResources {
+ local domain_regex=''
+ LABEL_SELECTOR="weblogic.domainUID in ($1)"
+ IFS=',' read -ra UIDS <<< "$1"
+ for i in "${!UIDS[@]}"; do
+ if [ $i -gt 0 ]; then
+ domain_regex="$domain_regex|"
+ fi
+ domain_regex="$domain_regex^Domain ${UIDS[$i]} "
+ done
+
+ # clean the output file
+ if [ -e $2 ]; then
+ rm $2
+ fi
+
+ # first, let's get all namespaced types with -l $LABEL_SELECTOR
+ NAMESPACED_TYPES="pod,job,deploy,rs,service,pvc,ingress,cm,serviceaccount,role,rolebinding,secret"
+
+ kubectl get $NAMESPACED_TYPES \
+ -l "$LABEL_SELECTOR" \
+ -o=jsonpath='{range .items[*]}{.kind}{" "}{.metadata.name}{" -n "}{.metadata.namespace}{"\n"}{end}' \
+ --all-namespaces=true >> $2
+
+ # if domain crd exists, look for domains too:
+ kubectl get crd domains.weblogic.oracle > /dev/null 2>&1
+ if [ $? -eq 0 ]; then
+ kubectl get domain \
+ -o=jsonpath='{range .items[*]}{.kind}{" "}{.metadata.name}{" -n "}{.metadata.namespace}{"\n"}{end}' \
+ --all-namespaces=true | egrep "$domain_regex" >> $2
+ fi
+
+ # now, get all non-namespaced types with -l $LABEL_SELECTOR
+
+ NOT_NAMESPACED_TYPES="pv,clusterroles,clusterrolebindings"
+
+ kubectl get $NOT_NAMESPACED_TYPES \
+ -l "$LABEL_SELECTOR" \
+ -o=jsonpath='{range .items[*]}{.kind}{" "}{.metadata.name}{"\n"}{end}' \
+ --all-namespaces=true >> $2
+}
+
+#
+# deleteDomains domain(s) maxwaitsecs
+#
+# Usage:
+# deleteDomains domainA,domainB,... maxwaitsecs
+#
+# Internal helper function
+# This function first sets the serverStartPolicy of each Domain to NEVER
+# and waits up to half of $2 for pods to 'self delete'. It then performs
+# a helm delete on $1, and finally it directly deletes
+# any remaining k8s resources for domain $1 (including any remaining pods)
+# and retries these direct deletes up to $2 seconds.
+#
+# If global $test_mode is true, it shows candidate actions but doesn't
+# actually perform them
+#
+function deleteDomains {
+
+ if [ "$test_mode" = "true" ]; then
+ echo @@ Test mode! Displaying commands for deleting kubernetes resources with label weblogic.domainUID \'$1\' without actually deleting them.
+ else
+ echo @@ Deleting kubernetes resources with label weblogic.domainUID \'$1\'.
+ fi
+
+ local maxwaitsecs=${2:-$default_maxwaitsecs}
+ local tempfile="/tmp/$(basename $0).tmp.$$" # == /tmp/[script-file-name].tmp.[pid]
+ local mstart=`date +%s`
+ local phase=1
+
+ while : ; do
+ # get all k8s resources with matching domain-uid labels and put them in $tempfile
+ getDomainResources $1 $tempfile
+
+ # get a count of all k8s resources with matching domain-uid labels
+ local allcount=`wc -l $tempfile | awk '{ print $1 }'`
+
+ # get a count of all WLS pods (any pod with a matching domain-uid label that doesn't have 'traefik' or 'apache' embedded in its name)
+ local podcount=`grep "^Pod" $tempfile | grep -v traefik | grep -v apache | wc -l | awk '{ print $1 }'`
+
+ local mnow=`date +%s`
+
+ echo @@ $allcount resources remaining after $((mnow - mstart)) seconds, including $podcount WebLogic Server pods. Max wait is $maxwaitsecs seconds.
+
+ # Exit if all k8s resources deleted or max wait seconds exceeded.
+
+ if [ $allcount -eq 0 ]; then
+ echo @@ Success.
+ rm -f $tempfile
+ exit 0
+ elif [ $((mnow - mstart)) -gt $maxwaitsecs ]; then
+ echo @@ Error! Max wait of $maxwaitsecs seconds exceeded with $allcount resources remaining, including $podcount WebLogic Server pods. Giving up. Remaining resources:
+ cat $tempfile
+ rm -f $tempfile
+ exit $allcount
+ fi
+
+ # In phase 1, set the serverStartPolicy of each domain to NEVER and then immediately
+ # proceed to phase 2. If there are no domains or WLS pods, we also immediately go to phase 2.
+
+ if [ $phase -eq 1 ]; then
+ phase=2
+ if [ $podcount -gt 0 ]; then
+ echo @@ "Setting serverStartPolicy to NEVER on each domain (this should cause operator(s) to initiate a controlled shutdown of the domain's pods.)"
+ cat $tempfile | grep "^Domain" | while read line; do
+ local name="`echo $line | awk '{ print $2 }'`"
+ local namespace="`echo $line | awk '{ print $4 }'`"
+ if [ "$test_mode" = "true" ]; then
+ echo "kubectl patch domain $name -n $namespace -p '{\"spec\":{\"serverStartPolicy\":\"NEVER\"}}' --type merge"
+ else
+ kubectl patch domain $name -n $namespace -p '{"spec":{"serverStartPolicy":"NEVER"}}' --type merge
+ fi
+ done
+ fi
+ fi
+
+ # In phase 2, wait for the WLS pod count to go down to 0 for at most half
+ # of 'maxwaitsecs'. Otherwise proceed immediately to phase 3.
+
+ if [ $phase -eq 2 ]; then
+ if [ $podcount -eq 0 ]; then
+ echo @@ All pods shutdown, about to directly delete remaining resources.
+ phase=3
+ elif [ $((mnow - mstart)) -gt $((maxwaitsecs / 2)) ]; then
+ echo @@ Warning! $podcount WebLogic Server pods remaining but wait time exceeds half of max wait seconds. About to directly delete all remaining resources, including the leftover pods.
+ phase=3
+ else
+ echo @@ "Waiting for operator to shutdown pods (will wait for no more than half of max wait seconds before directly deleting them)."
+ sleep 3
+ continue
+ fi
+ fi
+
+ # In phase 3, directly delete remaining k8s resources for the given domainUids
+ # (including any leftover WLS pods from previous phases).
+
+ # for each namespace with leftover resources, try delete them
+ cat $tempfile | awk '{ print $4 }' | grep -v "^$" | sort -u | while read line; do
+ if [ "$test_mode" = "true" ]; then
+ echo kubectl -n $line delete $NAMESPACED_TYPES -l "$LABEL_SELECTOR"
+ else
+ kubectl -n $line delete $NAMESPACED_TYPES -l "$LABEL_SELECTOR"
+ fi
+ done
+
+ # if there are any non-namespaced types left, try delete them
+ local no_namespace_count=`grep -c -v " -n " $tempfile`
+ if [ ! "$no_namespace_count" = "0" ]; then
+ if [ "$test_mode" = "true" ]; then
+ echo kubectl delete $NOT_NAMESPACED_TYPES -l "$LABEL_SELECTOR"
+ else
+ kubectl delete $NOT_NAMESPACED_TYPES -l "$LABEL_SELECTOR"
+ fi
+ fi
+
+ # Delete domains, if any
+ cat $tempfile | grep "^Domain " | while read line; do
+ if [ "$test_mode" = "true" ]; then
+ echo kubectl delete $line
+ else
+ kubectl delete $line
+ fi
+ done
+
+ sleep 3
+ done
+}
+
+# main entry point
+
+# default when to stop retrying (override via command line)
+default_maxwaitsecs=120
+
+# optional test mode that lists what would be deleted without
+# actually deleting (override via command line)
+test_mode=false
+
+domains=""
+
+# parse command line options
+while getopts ":d:s:th" opt; do
+ case $opt in
+ d) domains="${OPTARG}"
+ ;;
+
+ s) maxwaitsecs="${OPTARG}"
+ ;;
+
+ t) test_mode="true"
+ ;;
+
+ h) usage
+ exit 0
+ ;;
+
+ *) usage
+ exit 9999
+ ;;
+ esac
+done
+
+if [ "$domains" = "" ]; then
+ usage
+ exit 9999
+fi
+
+if [ ! -x "$(command -v kubectl)" ]; then
+ echo "@@ Error! kubectl is not installed."
+ exit 9999
+fi
+
+deleteDomains "${domains}" "${maxwaitsecs:-$default_maxwaitsecs}"
+
diff --git a/OracleWebCenterPortal/kubernetes/domain-lifecycle/README.md b/OracleWebCenterPortal/kubernetes/domain-lifecycle/README.md
old mode 100644
new mode 100755
index 0eeab95d5..7ecd9495b
--- a/OracleWebCenterPortal/kubernetes/domain-lifecycle/README.md
+++ b/OracleWebCenterPortal/kubernetes/domain-lifecycle/README.md
@@ -1,186 +1,186 @@
-### Domain life cycle sample scripts
-
-The operator provides sample scripts to start up or shut down a specific Managed Server or cluster in a deployed domain, or the entire deployed domain.
-
-**Note**: Prior to running these scripts, you must have previously created and deployed the domain. These scripts make use of [jq](https://stedolan.github.io/jq/) for processing JSON. You must have `jq 1.5 or higher` installed in order to run these scripts. See the installation options on the [jq downlod](https://stedolan.github.io/jq/download/) page.
-
-These scripts can be helpful when scripting the life cycle of a WebLogic Server domain. For information on how to start, stop, restart, and scale WebLogic Server instances in your domain, see [Domain Life Cycle](https://oracle.github.io/weblogic-kubernetes-operator/userguide/managing-domains/domain-lifecycle).
-
-#### Scripts to start and stop a WebLogic Server
-The `startServer.sh` script starts a WebLogic Server in a domain. For clustered Managed Servers, either it increases the `spec.clusters[].replicas` value for the Managed Server's cluster by `1` or updates the `spec.managedServers[].serverStartPolicy` attribute of the domain resource or both as necessary. For the Administration Server, it updates the value of the `spec.adminServer.serverStartPolicy` attribute of the domain resource. For non-clustered Managed Servers, it updates the `spec.managedServers[].serverStartPolicy` attribute of the domain resource. The script provides an option to keep the `spec.clusters[].replicas` value constant for clustered servers. See the script `usage` information by using the `-h` option.
-
-Use the following command to start the server either by increasing the replica count or by updating the server start policy:
-```
-$ startServer.sh -d domain1 -n weblogic-domain-1 -s managed-server1
-[INFO] Updating replica count for cluster 'cluster-1' to 1.
-domain.weblogic.oracle/domain1 patched
-[INFO] Successfully updated replica count for cluster 'cluster-1' to 1.
-```
-
-Use the following command to start the server without increasing the replica count:
-```
-$ startServer.sh -d domain1 -n weblogic-domain-1 -s managed-server2 -k
-[INFO] Patching start policy for 'managed-server2' to 'ALWAYS'.
-domain.weblogic.oracle/domain1 patched
-[INFO] Successfully patched server 'managed-server2' with 'ALWAYS' start policy.
-```
-
-The `stopServer.sh` script shuts down a running WebLogic Server in a domain. For clustered Managed Servers, either it decreases the `spec.clusters[].replicas` value for the Managed Server's cluster by `1` or updates the `spec.managedServers[].serverStartPolicy` attribute of the domain resource or both as necessary. For the Administration Server, it updates the value of the `spec.adminServer.serverStartPolicy` attribute of the domain resource. For non-clustered Managed Servers, it updates the `spec.managedServers[].serverStartPolicy` attribute of the domain resource. The script provides an option to keep the `spec.clusters[].replicas` value constant for clustered servers. See the script `usage` information by using the `-h` option.
-
-Use the following command to stop the server either by decreasing the replica count or by updating the server start policy:
-```
-$ stopServer.sh -d domain1 -n weblogic-domain-1 -s managed-server1
-[INFO] Updating replica count for cluster cluster-1 to 0.
-domain.weblogic.oracle/domain1 patched
-[INFO] Successfully updated replica count for cluster 'cluster-1' to 0.
-```
-
-Use the following command to stop the server without decreasing the replica count:
-```
-$ stopServer.sh -d domain1 -n weblogic-domain-1 -s managed-server2 -k
-[INFO] Unsetting the current start policy 'ALWAYS' for 'managed-server2'.
-domain.weblogic.oracle/domain1 patched
-[INFO] Successfully unset policy 'ALWAYS'.
-```
-
-### Scripts to start and stop a cluster
-
-The `startCluster.sh` script starts a cluster by patching the `spec.clusters[].serverStartPolicy` attribute of the domain resource to `IF_NEEDED`. The operator will start the WebLogic Server instance Pods that are part of the cluster after the `serverStartPolicy` attribute is updated to `IF_NEEDED`. See the script `usage` information by using the `-h` option.
-```
-$ startCluster.sh -d domain1 -n weblogic-domain-1 -c cluster-1
-[INFO]Patching start policy of cluster 'cluster-1' from 'NEVER' to 'IF_NEEDED'.
-domain.weblogic.oracle/domain1 patched
-[INFO] Successfully patched cluster 'cluster-1' with 'IF_NEEDED' start policy!.
-```
-The `stopCluster.sh` script shuts down a cluster by patching the `spec.clusters[].serverStartPolicy` attribute of the domain resource to `NEVER`. The operator will shut down the WebLogic Server instance Pods that are part of the cluster after the `serverStartPolicy` attribute is updated to `NEVER`. See the script `usage` information by using the `-h` option.
-```
-$ stopCluster.sh -d domain1 -n weblogic-domain-1 -c cluster-1
-[INFO] Patching start policy of cluster 'cluster-1' from 'IF_NEEDED' to 'NEVER'.
-domain.weblogic.oracle/domain1 patched
-[INFO] Successfully patched cluster 'cluster-1' with 'NEVER' start policy!
-```
-### Scripts to start and stop a domain
-The `startDomain.sh` script starts a deployed domain by patching the `spec.serverStartPolicy` attribute of the domain resource to `IF_NEEDED`. The operator will start the WebLogic Server instance Pods that are part of the domain after the `spec.serverStartPolicy` attribute of the domain resource is updated to `IF_NEEDED`. See the script `usage` information by using the `-h` option.
-```
-$ startDomain.sh -d domain1 -n weblogic-domain-1
-[INFO] Patching domain 'domain1' from serverStartPolicy='NEVER' to 'IF_NEEDED'.
-domain.weblogic.oracle/domain1 patched
-[INFO] Successfully patched domain 'domain1' in namespace 'weblogic-domain-1' with 'IF_NEEDED' start policy!
-```
-
-The `stopDomain.sh` script shuts down a domain by patching the `spec.serverStartPolicy` attribute of the domain resource to `NEVER`. The operator will shut down the WebLogic Server instance Pods that are part of the domain after the `spec.serverStartPolicy` attribute is updated to `NEVER`. See the script `usage` information by using the `-h` option.
-```
-$ stopDomain.sh -d domain1 -n weblogic-domain-1
-[INFO] Patching domain 'domain1' in namespace 'weblogic-domain-1' from serverStartPolicy='IF_NEEDED' to 'NEVER'.
-domain.weblogic.oracle/domain1 patched
-[INFO] Successfully patched domain 'domain1' in namespace 'weblogic-domain-1' with 'NEVER' start policy!
-```
-
-### Script to scale a WebLogic cluster
-
-The `scaleCluster.sh` script scales a WebLogic cluster by patching the `spec.clusters[].replicas` attribute of the domain resource to the specified value. The operator will perform the scaling operation for the WebLogic cluster based on the specified value of the `replicas` attribute after its value is updated. See the script `usage` information by using the `-h` option.
-```
-$ scaleCluster.sh -d domain1 -n weblogic-domain-1 -c cluster-1 -r 3
-[2021-02-26T19:04:14.335000Z][INFO] Patching replicas for cluster 'cluster-1' to '3'.
-domain.weblogic.oracle/domain1 patched
-[2021-02-26T19:04:14.466000Z][INFO] Successfully patched replicas for cluster 'cluster-1'!
-```
-
-### Script to view the status of a WebLogic cluster
-
-The `clusterStatus.sh` script can be used to view the status of a WebLogic cluster in the WebLogic domain managed by the operator. The WebLogic Cluster Status contains information about the minimum, maximum, goal, current, and ready replica count for a WebLogic cluster. This script displays a table containing the status for WebLogic clusters in one or more domains across one or more namespaces. See the script `usage` information by using the `-h` option.
-
-Use the following command to view the status of all WebLogic clusters in all domains across all namespaces.
-```shell
-$ clusterStatus.sh
-
-WebLogic Cluster Status -n "" -d "" -c "":
-
-namespace domain cluster min max goal current ready
---------- ------ ------- --- --- ---- ------- -----
-ns-kvmt mii-domain1 cluster-1 1 5 5 5 5
-weblogic-domain-1 domain1 cluster-1 0 4 2 2 2
-weblogic-domain-1 domain1 cluster-2 0 4 0 0 0
-```
-
-Use the following command to view the status of all WebLogic clusters in 'domain1' in 'weblogic-domain-1' namespace.
-```
-$ clusterStatus.sh -d domain1 -n weblogic-domain-1
-
-WebLogic Cluster Status -n "weblogic-domain-1" -d "domain1" -c "":
-
-namespace domain cluster min max goal current ready
---------- ------ ------- --- --- ---- ------- -----
-weblogic-domain-1 domain1 cluster-1 0 4 2 2 2
-weblogic-domain-1 domain1 cluster-2 0 4 0 0 0
-```
-
-### Scripts to initiate a rolling restart of a WebLogic domain or cluster
-
-The `rollDomain.sh` script can be used to initiate a rolling restart of the WebLogic Server Pods in a domain managed by the operator. Similarly, the `rollCluster.sh` script can be used to initiate a rolling restart of the WebLogic Server Pods belonging to a WebLogic cluster in a domain managed by the operator.
-
-The `rollDomain.sh` script updates the value of the `spec.restartVersion` attribute of the domain resource. Then, the operator will do a rolling restart of the Server Pods in the WebLogic domain after the value of the `spec.restartVersion` is updated. You can provide the new value for `spec.restartVersion` as a parameter to the script or the script will automatically generate a new value to trigger the rolling restart. See the script `usage` information by using the `-h` option.
-
-```
-$ rollDomain.sh -d domain1 -n weblogic-domain-1
-[2021-03-24T04:01:19.733000Z][INFO] Patching restartVersion for domain 'domain1' to '1'.
-domain.weblogic.oracle/domain1 patched
-[2021-03-24T04:01:19.850000Z][INFO] Successfully patched restartVersion for domain 'domain1'!
-```
-
-Use the following command to roll the Server Pods in a WebLogic domain with a specific `restartVersion`:
-```
-$ rollDomain.sh -r v1 -d domain1 -n weblogic-domain-1
-[2021-03-24T13:43:47.586000Z][INFO] Patching restartVersion for domain 'domain1' to 'v1'.
-domain.weblogic.oracle/domain1 patched
-[2021-03-24T13:43:47.708000Z][INFO] Successfully patched restartVersion for domain 'domain1'!
-```
-
-The `rollCluster.sh` script updates the value of the `spec.clusters[].restartVersion` attribute of the domain resource. Then, the operator will do a rolling restart of the WebLogic cluster Server Pods after the value of the `spec.clusters[].restartVersion` is updated. You can provide the new value of the `restartVersion` as a parameter to the script or the script will automatically generate a new value to trigger the rolling restart. See the script `usage` information by using the `-h` option.
-
-```
-$ rollCluster.sh -c cluster-1 -d domain1 -n weblogic-domain-1
-[2021-03-24T04:03:27.521000Z][INFO] Patching restartVersion for cluster 'cluster-1' to '2'.
-domain.weblogic.oracle/domain1 patched
-[2021-03-24T04:03:27.669000Z][INFO] Successfully patched restartVersion for cluster 'cluster-1'!
-```
-
-Use the following command to roll the WebLogic Cluster Servers with a specific `restartVersion`:
-```
-$ rollCluster.sh -r v2 -c cluster-1 -d domain1 -n weblogic-domain-1
-[2021-03-24T13:46:16.833000Z][INFO] Patching restartVersion for cluster 'cluster-1' to 'v2'.
-domain.weblogic.oracle/domain1 patched
-[2021-03-24T13:46:16.975000Z][INFO] Successfully patched restartVersion for cluster 'cluster-1'!
-```
-
-### Scripts to restart a WebLogic Server in a domain
-The `restartServer.sh` script can be used to restart a WebLogic Server in a domain. This script restarts the Server by deleting the Server Pod for the WebLogic Server instance.
-```
-$ restartServer.sh -s managed-server1 -d domain1 -n weblogic-domain-1
-[2021-03-24T22:20:22.498000Z][INFO] Initiating restart of 'managed-server1' by deleting server pod 'domain1-managed-server1'.
-[2021-03-24T22:20:37.614000Z][INFO] Server restart succeeded !
-```
-
-### Scripts to explicitly initiate introspection of a WebLogic domain
-
-The `introspectDomain.sh` script can be used to rerun a WebLogic domain's introspect job by explicitly initiating the introspection. This script updates the value of the `spec.introspectVersion` attribute of the domain resource. The resulting behavior depends on your domain home source type and other factors, see [Initiating introspection](https://oracle.github.io/weblogic-kubernetes-operator/userguide/managing-domains/domain-lifecycle/introspection/#initiating-introspection) for details. You can provide the new value of the `introspectVersion` as a parameter to the script or the script will automatically generate a new value to trigger the introspection. See the script `usage` information by using the `-h` option.
-
-Use the following command to rerun a domain's introspect job with the `introspectVersion` value generated by the script.
-```
-$ introspectDomain.sh -d domain1 -n weblogic-domain-1
-[2021-03-24T21:37:55.989000Z][INFO] Patching introspectVersion for domain 'domain1' to '1'.
-domain.weblogic.oracle/domain1 patched
-[2021-03-24T21:37:56.110000Z][INFO] Successfully patched introspectVersion for domain 'domain1'!
-```
-
-Use the following command to rerun a domain's introspect job with a specific `introspectVersion` value.
-```
-$ introspectDomain.sh -i v1 -d domain1 -n weblogic-domain-1
-[2021-03-24T21:38:34.369000Z][INFO] Patching introspectVersion for domain 'domain1' to 'v1'.
-domain.weblogic.oracle/domain1 patched
-[2021-03-24T21:38:34.488000Z][INFO] Successfully patched introspectVersion for domain 'domain1'!
-```
-
-### Watching the Pods after executing life cycle scripts
-
-After executing the lifecycle scripts described above for a domain or a cluster or a Server, you can manually run the `kubectl -n MYNS get pods --watch=true --show-labels` command to watch the effect of running the scripts and monitor the status and labels of various Pods. You will need to do 'Ctrl-C' to stop watching the Pods and exit.
+### Domain life cycle sample scripts
+
+The operator provides sample scripts to start up or shut down a specific Managed Server or cluster in a deployed domain, or the entire deployed domain.
+
+**Note**: Prior to running these scripts, you must have previously created and deployed the domain. These scripts make use of [jq](https://stedolan.github.io/jq/) for processing JSON. You must have `jq 1.5 or higher` installed in order to run these scripts. See the installation options on the [jq downlod](https://stedolan.github.io/jq/download/) page.
+
+These scripts can be helpful when scripting the life cycle of a WebLogic Server domain. For information on how to start, stop, restart, and scale WebLogic Server instances in your domain, see [Domain Life Cycle](https://oracle.github.io/weblogic-kubernetes-operator/userguide/managing-domains/domain-lifecycle).
+
+#### Scripts to start and stop a WebLogic Server
+The `startServer.sh` script starts a WebLogic Server in a domain. For clustered Managed Servers, either it increases the `spec.clusters[].replicas` value for the Managed Server's cluster by `1` or updates the `spec.managedServers[].serverStartPolicy` attribute of the domain resource or both as necessary. For the Administration Server, it updates the value of the `spec.adminServer.serverStartPolicy` attribute of the domain resource. For non-clustered Managed Servers, it updates the `spec.managedServers[].serverStartPolicy` attribute of the domain resource. The script provides an option to keep the `spec.clusters[].replicas` value constant for clustered servers. See the script `usage` information by using the `-h` option.
+
+Use the following command to start the server either by increasing the replica count or by updating the server start policy:
+```
+$ startServer.sh -d domain1 -n weblogic-domain-1 -s managed-server1
+[INFO] Updating replica count for cluster 'cluster-1' to 1.
+domain.weblogic.oracle/domain1 patched
+[INFO] Successfully updated replica count for cluster 'cluster-1' to 1.
+```
+
+Use the following command to start the server without increasing the replica count:
+```
+$ startServer.sh -d domain1 -n weblogic-domain-1 -s managed-server2 -k
+[INFO] Patching start policy for 'managed-server2' to 'ALWAYS'.
+domain.weblogic.oracle/domain1 patched
+[INFO] Successfully patched server 'managed-server2' with 'ALWAYS' start policy.
+```
+
+The `stopServer.sh` script shuts down a running WebLogic Server in a domain. For clustered Managed Servers, either it decreases the `spec.clusters[].replicas` value for the Managed Server's cluster by `1` or updates the `spec.managedServers[].serverStartPolicy` attribute of the domain resource or both as necessary. For the Administration Server, it updates the value of the `spec.adminServer.serverStartPolicy` attribute of the domain resource. For non-clustered Managed Servers, it updates the `spec.managedServers[].serverStartPolicy` attribute of the domain resource. The script provides an option to keep the `spec.clusters[].replicas` value constant for clustered servers. See the script `usage` information by using the `-h` option.
+
+Use the following command to stop the server either by decreasing the replica count or by updating the server start policy:
+```
+$ stopServer.sh -d domain1 -n weblogic-domain-1 -s managed-server1
+[INFO] Updating replica count for cluster cluster-1 to 0.
+domain.weblogic.oracle/domain1 patched
+[INFO] Successfully updated replica count for cluster 'cluster-1' to 0.
+```
+
+Use the following command to stop the server without decreasing the replica count:
+```
+$ stopServer.sh -d domain1 -n weblogic-domain-1 -s managed-server2 -k
+[INFO] Unsetting the current start policy 'ALWAYS' for 'managed-server2'.
+domain.weblogic.oracle/domain1 patched
+[INFO] Successfully unset policy 'ALWAYS'.
+```
+
+### Scripts to start and stop a cluster
+
+The `startCluster.sh` script starts a cluster by patching the `spec.clusters[].serverStartPolicy` attribute of the domain resource to `IF_NEEDED`. The operator will start the WebLogic Server instance Pods that are part of the cluster after the `serverStartPolicy` attribute is updated to `IF_NEEDED`. See the script `usage` information by using the `-h` option.
+```
+$ startCluster.sh -d domain1 -n weblogic-domain-1 -c cluster-1
+[INFO]Patching start policy of cluster 'cluster-1' from 'NEVER' to 'IF_NEEDED'.
+domain.weblogic.oracle/domain1 patched
+[INFO] Successfully patched cluster 'cluster-1' with 'IF_NEEDED' start policy!.
+```
+The `stopCluster.sh` script shuts down a cluster by patching the `spec.clusters[