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[].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. diff --git a/OracleWebCenterPortal/kubernetes/domain-lifecycle/clusterStatus.sh b/OracleWebCenterPortal/kubernetes/domain-lifecycle/clusterStatus.sh old mode 100644 new mode 100755 index 8bfeb45f3..84a5a0cc2 --- a/OracleWebCenterPortal/kubernetes/domain-lifecycle/clusterStatus.sh +++ b/OracleWebCenterPortal/kubernetes/domain-lifecycle/clusterStatus.sh @@ -1,130 +1,130 @@ -# !/bin/sh -# 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. - -set -eu -set -o pipefail - -function usage() { -cat< ${kubernetesCli} patch domain ${domainUid} \ - -n ${domainNamespace} --type=merge --patch \"${patchJson}\"" - fi - ${kubernetesCli} patch domain ${domainUid} -n ${domainNamespace} --type=merge --patch "${patchJson}" -} - -# timestamp -# purpose: echo timestamp in the form yyyy-mm-ddThh:mm:ss.nnnnnnZ -# example: 2018-10-01T14:00:00.000001Z -function timestamp() { - local timestamp="`date --utc '+%Y-%m-%dT%H:%M:%S.%NZ' 2>&1`" - if [ ! "${timestamp/illegal/xyz}" = "${timestamp}" ]; then - # old shell versions don't support %N or --utc - timestamp="`date -u '+%Y-%m-%dT%H:%M:%S.000000Z' 2>&1`" - fi - echo "${timestamp}" -} - -# -# 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 - printError 'The errors listed above must be resolved before the script can continue. Please see usage information below.' - usage 1 - fi -} - -# -# Function to lowercase a value and make it a legal DNS1123 name -# $1 - value to convert to DNS legal name -# $2 - return value containing DNS legal name. -function toDNS1123Legal { - local name=$1 - local __result=$2 - local val=`echo "${name}" | tr "[:upper:]" "[:lower:]"` - val=${val//"_"/"-"} - eval $__result="'$val'" -} - +# !/bin/sh +# 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. +# + +# +# Function to get server start policy at cluster level +# $1 - Domain resource in json format +# $2 - Name of cluster +# $3 - Return value for cluster level server start policy. +# Legal return values are "NEVER" or "IF_NEEDED" or "". +# +function getClusterPolicy { + local domainJson=$1 + local clusterName=$2 + local __clusterPolicy=$3 + local effectivePolicy="" + + clusterPolicyCmd="(.spec.clusters // empty | .[] \ + | select (.clusterName == \"${clusterName}\")).serverStartPolicy" + effectivePolicy=$(echo ${domainJson} | jq "${clusterPolicyCmd}") + if [ "${effectivePolicy}" == "null" ]; then + effectivePolicy="" + fi + eval $__clusterPolicy=${effectivePolicy} +} + +# +# Function to get server start policy at domain level +# $1 - Domain resource in json format +# $2 - Return value containing domain level server start policy. +# Legal retrun values are "NEVER" or "IF_NEEDED" or "ADMIN_ONLY". +# +function getDomainPolicy { + local domainJson=$1 + local __domainPolicy=$2 + local effectivePolicy="" + + eval $__domainPolicy="IF_NEEDED" + domainPolicyCommand=".spec.serverStartPolicy" + effectivePolicy=$(echo ${domainJson} | jq "${domainPolicyCommand}") + if [[ "${effectivePolicy}" == "null" || "${effectivePolicy}" == "" ]]; then + effectivePolicy="IF_NEEDED" + fi + eval $__domainPolicy=${effectivePolicy} +} + +# +# Function to get effective start policy of server +# $1 - Domain resource in json format +# $2 - Name of server +# $3 - Name of cluster +# $4 - Return value containing effective server start policy +# Legal retrun values are "NEVER" or "IF_NEEDED" or "ALWAYS". +# +function getEffectivePolicy { + local domainJson=$1 + local serverName=$2 + local clusterName=$3 + local __currentPolicy=$4 + local currentPolicy="" + + getServerPolicy "${domainJson}" "${serverName}" currentPolicy + if [ -z "${currentPolicy}" ]; then + getClusterPolicy "${domainJson}" "${clusterName}" currentPolicy + if [ -z "${currentPolicy}" ]; then + # Start policy is not set at cluster level, check at domain level + getDomainPolicy "${domainJson}" currentPolicy + fi + fi + eval $__currentPolicy=${currentPolicy} +} + +# +# Function to get effective start policy of admin server +# $1 - Domain resource in json format +# $2 - Return value containing effective server start policy +# Legal retrun values are "NEVER" or "IF_NEEDED" or "ALWAYS". +# +function getEffectiveAdminPolicy { + local domainJson=$1 + local __effectivePolicy=$2 + local __adminStartPolicy="" + local __domainStartPolicy="" + + __adminStartPolicy=$(echo ${domainJson} | jq -cr '(.spec.adminServer.serverStartPolicy)') + getDomainPolicy "${domainJson}" __domainStartPolicy + if [[ "${__adminStartPolicy}" == "null" || "${__domainStartPolicy}" == "NEVER" ]]; then + __adminStartPolicy="${__domainStartPolicy}" + fi + eval $__effectivePolicy="'${__adminStartPolicy}'" +} + +# +# Function to get current start policy of server +# $1 - Domain resource in json format +# $2 - Name of server +# $3 - Return value containing current server start policy +# Legal retrun values are "NEVER" or "IF_NEEDED", "ALWAYS" or "". +# +function getServerPolicy { + local domainJson=$1 + local serverName=$2 + local __currentPolicy=$3 + local currentServerStartPolicy="" + + # Get server start policy for this server + eval $__currentPolicy="" + managedServers=$(echo ${domainJson} | jq -cr '(.spec.managedServers)') + if [ "${managedServers}" != "null" ]; then + extractPolicyCmd="(.spec.managedServers[] \ + | select (.serverName == \"${serverName}\") | .serverStartPolicy)" + currentServerStartPolicy=$(echo ${domainJson} | jq "${extractPolicyCmd}") + if [ "${currentServerStartPolicy}" == "null" ]; then + currentServerStartPolicy="" + fi + fi + eval $__currentPolicy=${currentServerStartPolicy} +} + +# +# Function to create server start policy patch string +# $1 - Domain resource in json format +# $2 - Name of server whose policy will be patched +# $3 - Policy value +# $4 - Return value containing server start policy patch string +# +function createServerStartPolicyPatch { + local domainJson=$1 + local serverName=$2 + local policy=$3 + local __result=$4 + local currentStartPolicy="" + local serverStartPolicyPatch="" + + # Get server start policy for this server + getServerPolicy "${domainJson}" "${serverName}" currentStartPolicy + managedServers=$(echo ${domainJson} | jq -cr '(.spec.managedServers)') + if [[ -z "${currentStartPolicy}" && "${managedServers}" == "null" ]]; then + # Server start policy doesn't exist, add a new policy + addPolicyCmd=".[.| length] |= . + {\"serverName\":\"${serverName}\", \ + \"serverStartPolicy\":\"${policy}\"}" + serverStartPolicyPatch=$(echo ${domainJson} | jq .spec.managedServers | jq -c "${addPolicyCmd}") + elif [ "${managedServers}" != "null" ]; then + extractSpecCmd="(.spec.managedServers)" + mapCmd="\ + . |= (map(.serverName) | index (\"${serverName}\")) as \$idx | \ + if \$idx then \ + .[\$idx][\"serverStartPolicy\"] = \"${policy}\" \ + else .+ [{serverName: \"${serverName}\" , serverStartPolicy: \"${policy}\"}] end" + serverStartPolicyPatch=$(echo ${domainJson} | jq "${extractSpecCmd}" | jq "${mapCmd}") + else + # Server start policy exists, replace policy value + replacePolicyCmd="(.spec.managedServers[] \ + | select (.serverName == \"${serverName}\") | .serverStartPolicy) |= \"${policy}\"" + servers="(.spec.managedServers)" + serverStartPolicyPatch=$(echo ${domainJson} | jq "${replacePolicyCmd}" | jq -cr "${servers}") + fi + eval $__result="'${serverStartPolicyPatch}'" +} + +# +# Function to create patch json string to unset policy and update replica +# $1 - Domain resource in json format +# $2 - Name of server whose policy will be patched +# $3 - String containing replica patch string +# $4 - Return value containing patch json string +# +function createPatchJsonToUnsetPolicyAndUpdateReplica { + local domainJson=$1 + local serverName=$2 + local replicaPatch=$3 + local __result=$4 + + unsetServerStartPolicy "${domainJson}" "${serverName}" serverStartPolicyPatch + patchJson="{\"spec\": {\"clusters\": "${replicaPatch}",\"managedServers\": "${serverStartPolicyPatch}"}}" + eval $__result="'${patchJson}'" +} + +# +# Function to create patch json string to update policy +# $1 - String containing start policy info +# $2 - String containing json to patch domain resource +# +function createPatchJsonToUpdatePolicy { + local startPolicy=$1 + local __result=$2 + patchJson="{\"spec\": {\"managedServers\": "${startPolicy}"}}" + eval $__result="'${patchJson}'" +} + +# +# Function to create patch json string to update admin server start policy +# $1 - Domain resource in json format +# $2 - Policy value +# $3 - Return value containing server start policy patch string +# +function createPatchJsonToUpdateAdminPolicy { + local domainJson=$1 + local policy=$2 + local __result=$3 + local __adminServer="" + local __patchJson="" + local __serverStartPolicyPatch="" + + eval $__result="" + __adminServer=$(echo ${domainJson} | jq -cr '(.spec.adminServer)') + if [ "${__adminServer}" == "null" ]; then + # admin server specs does not exist, add new spec with server start policy + addPolicyCmd="{\"serverStartPolicy\":\"${policy}\"}" + __serverStartPolicyPatch=$(echo ${domainJson} | jq .spec.amdinServer | jq -c "${addPolicyCmd}") + else + addOrReplaceCmd="(.spec.adminServer) | .+ {\"serverStartPolicy\": \"${policy}\"}" + __serverStartPolicyPatch=$(echo ${domainJson} | jq "${addOrReplaceCmd}") + fi + __patchJson="{\"spec\": {\"adminServer\": "${__serverStartPolicyPatch}"}}" + eval $__result="'${__patchJson}'" +} + +# +# Function to create patch json string to update replica +# $1 - String containing replica +# $2 - String containing json to patch domain resource +# +function createPatchJsonToUpdateReplica { + local replicaInfo=$1 + local __result=$2 + patchJson="{\"spec\": {\"clusters\": "${replicaInfo}"}}" + eval $__result="'${patchJson}'" +} + +# +# Function to create patch json string to update replica and policy +# $1 - Domain resource in json format +# $2 - Name of server whose policy will be patched +# $3 - Return value containing patch json string +# +function createPatchJsonToUpdateReplicaAndPolicy { + local replicaInfo=$1 + local startPolicy=$2 + local __result=$3 + + patchJson="{\"spec\": {\"clusters\": "${replicaInfo}",\"managedServers\": "${startPolicy}"}}" + eval $__result="'${patchJson}'" +} + +# +# Function to create patch json string to unset policy +# $1 - Domain resource in json format +# $2 - Name of server whose policy will be patched +# $3 - Return value containing patch json string +# +function createPatchJsonToUnsetPolicy { + local domainJson=$1 + local serverName=$2 + local __result=$3 + + unsetServerStartPolicy "${domainJson}" "${serverName}" serverStartPolicyPatch + patchJson="{\"spec\": {\"managedServers\": "${serverStartPolicyPatch}"}}" + eval $__result="'${patchJson}'" +} + +# +# Function to create patch string with server start policy unset +# $1 - Domain resource in json format +# $2 - Name of server whose policy will be unset +# $3 - Return value containing patch string with server start policy unset +# +function unsetServerStartPolicy { + local domainJson=$1 + local serverName=$2 + local __result=$3 + local unsetStartPolicyPatch="" + local mapCmd="" + + unsetCmd="(.spec.managedServers[] | select (.serverName == \"${serverName}\") | del (.serverStartPolicy))" + replacePolicyCmd=$(echo ${domainJson} | jq -cr "${unsetCmd}") + replacePolicyCmdLen=$(echo "${replacePolicyCmd}" | jq -e keys_unsorted | jq length) + if [ ${replacePolicyCmdLen} == 1 ]; then + mapCmd=". |= map(if .serverName == \"${serverName}\" then del(.) else . end)" + else + mapCmd=". |= map(if .serverName == \"${serverName}\" then . = ${replacePolicyCmd} else . end)" + fi + unsetStartPolicyPatch=$(echo ${domainJson} | jq "(.spec.managedServers)" | jq "${mapCmd}") + eval $__result="'${unsetStartPolicyPatch}'" +} + +# +# Function to create patch json to update cluster server start policy +# $1 - Domain resource in json format +# $2 - Name of cluster whose policy will be patched +# $3 - policy value of "IF_NEEDED" or "NEVER" +# $4 - Return value containing patch json string +# +function createPatchJsonToUpdateClusterPolicy { + local domainJson=$1 + local clusterName=$2 + local policy=$3 + local __result=$4 + local addClusterStartPolicyCmd="" + local mapCmd="" + local existingClusters="" + local patchJsonVal="" + local startPolicyPatch="" + + existingClusters=$(echo ${domainJson} | jq -cr '(.spec.clusters)') + if [ "${existingClusters}" == "null" ]; then + # cluster doesn't exist, add cluster with server start policy + addClusterStartPolicyCmd=".[.| length] |= . + {\"clusterName\":\"${clusterName}\", \ + \"serverStartPolicy\":\"${policy}\"}" + startPolicyPatch=$(echo ${existingClusters} | jq -c "${addClusterStartPolicyCmd}") + else + mapCmd="\ + . |= (map(.clusterName) | index (\"${clusterName}\")) as \$idx | \ + if \$idx then \ + .[\$idx][\"serverStartPolicy\"] = \"${policy}\" \ + else .+ [{clusterName: \"${clusterName}\" , serverStartPolicy: \"${policy}\"}] end" + startPolicyPatch=$(echo ${existingClusters} | jq "${mapCmd}") + fi + + patchJsonVal="{\"spec\": {\"clusters\": "${startPolicyPatch}"}}" + eval $__result="'${patchJsonVal}'" +} + +# +# Function to create patch json to update cluster replicas +# $1 - Domain resource in json format +# $2 - Name of cluster whose replicas will be patched +# $3 - replica count +# $4 - Return value containing patch json string +# +function createPatchJsonToUpdateReplicas { + local domainJson=$1 + local clusterName=$2 + local replicas=$3 + local __result=$4 + local existingClusters="" + local addClusterReplicasCmd="" + local replicasPatch="" + local mapCmd="" + local patchJsonVal="" + + existingClusters=$(echo ${domainJson} | jq -cr '(.spec.clusters)') + if [ "${existingClusters}" == "null" ]; then + # cluster doesn't exist, add cluster with replicas + addClusterReplicasCmd=".[.| length] |= . + {\"clusterName\":\"${clusterName}\", \ + \"replicas\":${replicas}}" + replicasPatch=$(echo ${existingClusters} | jq -c "${addClusterReplicasCmd}") + else + mapCmd="\ + . |= (map(.clusterName) | index (\"${clusterName}\")) as \$idx | \ + if \$idx then \ + .[\$idx][\"replicas\"] = ${replicas} \ + else .+ [{clusterName: \"${clusterName}\" , replicas: ${replicas}}] end" + replicasPatch=$(echo ${existingClusters} | jq "${mapCmd}") + fi + patchJsonVal="{\"spec\": {\"clusters\": "${replicasPatch}"}}" + eval $__result="'${patchJsonVal}'" +} + +# +# Function to create patch json to update domain server start policy +# $1 - policy value of "IF_NEEDED" or "NEVER" +# $2 - Return value containing patch json string +# +function createPatchJsonToUpdateDomainPolicy { + local policy=$1 + local __result=$2 + + patchServerStartPolicy="{\"spec\": {\"serverStartPolicy\": \"${policy}\"}}" + eval $__result="'${patchServerStartPolicy}'" +} + +# +# Function to get sorted list of servers in a cluster. +# The sorted list is created in 'sortedByAlwaysServers' array. +# $1 - Domain resource in json format +# $2 - Name of server +# $3 - Name of cluster +# $4 - Indicates if policy of current server would be unset. +# valid values are "UNSET" and "CONSTANT" +# +function getSortedListOfServers { + local domainJson=$1 + local serverName=$2 + local clusterName=$3 + local withPolicy=$4 + local policy="" + local sortedServers=() + local otherServers=() + + getTopology "${domainUid}" "${domainNamespace}" jsonTopology + clusterTopology=$(echo ${jsonTopology} | jq -r '.domain | .configuredClusters[] | select (.name == '\"${clusterName}\"')') + dynaCluster=$(echo ${clusterTopology} | jq .dynamicServersConfig) + if [ "${dynaCluster}" == "null" ]; then + # Cluster is a configured cluster, get server names + servers=($(echo ${clusterTopology} | jq -r .servers[].name)) + # Sort server names in numero lexi order + IFS=$'\n' sortedServers=($(sort --version-sort <<<"${servers[*]}" )) + unset IFS + clusterSize=${#sortedServers[@]} + else + # Cluster is a dynamic cluster, calculate server names + prefix=$(echo ${dynaCluster} | jq -r .serverNamePrefix) + clusterSize=$(echo ${dynaCluster} | jq .dynamicClusterSize) + for (( i=1; i<=$clusterSize; i++ )); do + localServerName=${prefix}$i + sortedServers+=(${localServerName}) + done + fi + # Create arrays of ALWAYS policy servers and other servers + for localServerName in ${sortedServers[@]:-}; do + getEffectivePolicy "${domainJson}" "${localServerName}" "${clusterName}" policy + # Update policy when server name matches current server and unsetting + if [[ "${withPolicy}" == "UNSET" && "${serverName}" == "${localServerName}" ]]; then + policy=UNSET + fi + if [ "${policy}" == "ALWAYS" ]; then + sortedByAlwaysServers+=(${localServerName}) + else + otherServers+=(${localServerName}) + fi + done + + # append other servers to the list of servers with always policy + for otherServer in ${otherServers[@]:-}; do + sortedByAlwaysServers+=($otherServer) + done +} + +# +# Get replica count for a cluster +# $1 - Domain resource in json format +# $2 - Name of cluster +# $3 - Return value containing replica count +# +function getReplicaCount { + local domainJson=$1 + local clusterName=$2 + local __replicaCount=$3 + + replicasCmd="(.spec.clusters[] \ + | select (.clusterName == \"${clusterName}\")).replicas" + replicaCount=$(echo ${domainJson} | jq "${replicasCmd}") + if [[ -z "${replicaCount}" || "${replicaCount}" == "null" ]]; then + replicaCount=$(echo ${domainJson} | jq .spec.replicas) + fi + if [[ -z "${replicaCount}" || "${replicaCount}" == "null" ]]; then + replicaCount=0 + fi + # check if replica count is less than minimum replicas + getMinReplicas "${domainJson}" "${clusterName}" minReplicas + if [ "${replicaCount}" -lt "${minReplicas}" ]; then + # Reset current replica count to minimum replicas + replicaCount=${minReplicas} + fi + eval $__replicaCount="'${replicaCount}'" + +} + +# +# Function to generate the domain restartVersion by incrementing the +# existing value. If the restartVersion doesn't exist or the restartVersion +# value is non-numeric, then return '1'. +# $1 - Domain resource in json format +# $2 - Return value containing the restart version. +# +function generateDomainRestartVersion { + local domainJson=$1 + local __result=$2 + local __restartVersion="" + + eval $__result="" + __restartVersion=$(echo ${domainJson} | jq -cr .spec.restartVersion) + if ! [[ "$__restartVersion" =~ ^[0-9]+$ ]] ; then + __restartVersion=0 + fi + __restartVersion=$((__restartVersion+1)) + eval $__result=${__restartVersion} +} + +# +# Function to generate the domain introspectVersion by incrementing the +# existing value. If the introspectVersion doesn't exist or the introspectVersion +# value is non-numeric, then return '1'. +# $1 - Domain resource in json format +# $2 - Return value containing the introspect version. +# +function generateDomainIntrospectVersion { + local domainJson=$1 + local __result=$2 + local __introspectVersion="" + + eval $__result="" + __introspectVersion=$(echo ${domainJson} | jq -cr .spec.introspectVersion) + if ! [[ "$__introspectVersion" =~ ^[0-9]+$ ]] ; then + __introspectVersion=0 + fi + __introspectVersion=$((__introspectVersion+1)) + eval $__result=${__introspectVersion} +} + +# +# Function to generate the cluster restartVersion by incrementing the +# existing value of cluster restartVersion. If the restartVersion +# value at the cluster level is non-numeric, then it returns 1. +# If the restartVersion doesn't exist at the cluster level, then it +# returns the incremented value of the domain level restartVersion. +# In this case, if the restartVersion value at the domain level is +# non-numeric, then it returns 1. +# $1 - Domain resource in json format +# $2 - Name of cluster +# $3 - Return value containing the restart version. +# +function generateClusterRestartVersion { + local domainJson=$1 + local clusterName=$2 + local __result=$3 + local __restartVersionCmd="" + local __restartVersion="" + + eval $__result="" + __restartVersionCmd="(.spec.clusters // empty | .[] \ + | select (.clusterName == \"${clusterName}\")).restartVersion" + __restartVersion=$(echo ${domainJson} | jq -cr "${__restartVersionCmd}") + if [ "${__restartVersion}" == "null" ]; then + __restartVersion=$(echo ${domainJson} | jq -cr .spec.restartVersion) + fi + if ! [[ "${__restartVersion}" =~ ^[0-9]+$ ]] ; then + __restartVersion=0 + fi + __restartVersion=$((__restartVersion+1)) + eval $__result=${__restartVersion} + +} + +# +# Function to create patch json to update domain restart version +# $1 - domain restart version +# $2 - Return value containing patch json string +# +function createPatchJsonToUpdateDomainRestartVersion { + local restartVersion=$1 + local __result=$2 + local __restartVersionPatch="" + + __restartVersionPatch="{\"spec\": {\"restartVersion\": \"${restartVersion}\"}}" + eval $__result="'${__restartVersionPatch}'" +} + +# +# Function to create patch json to update domain introspect version +# $1 - domain introspect version +# $2 - Return value containing patch json string +# +function createPatchJsonToUpdateDomainIntrospectVersion { + local introspectVersion=$1 + local __result=$2 + local __introspectVersionPatch="" + + __introspectVersionPatch="{\"spec\": {\"introspectVersion\": \"${introspectVersion}\"}}" + eval $__result="'${__introspectVersionPatch}'" +} + +# +# Function to create patch json to update cluster restartVersion +# $1 - Domain resource in json format +# $2 - Name of the cluster whose restartVersion will be patched +# $3 - restart version +# $4 - Return value containing patch json string +# +function createPatchJsonToUpdateClusterRestartVersion { + local domainJson=$1 + local clusterName=$2 + local restartVersion=$3 + local __result=$4 + local __existingClusters="" + local __addClusterReplicasCmd="" + local __restartVersionPatch="" + local __mapCmd="" + local __patchJsonVal="" + + __existingClusters=$(echo ${domainJson} | jq -cr '(.spec.clusters)') + if [ "${__existingClusters}" == "null" ]; then + # cluster doesn't exist, add cluster with replicas + __addClusterReplicasCmd=".[.| length] |= . + {\"clusterName\":\"${clusterName}\", \ + \"restartVersion\":\"${restartVersion}\"}" + __restartVersionPatch=$(echo ${__existingClusters} | jq -c "${__addClusterReplicasCmd}") + else + __mapCmd="\ + . |= (map(.clusterName) | index (\"${clusterName}\")) as \$idx | \ + if \$idx then \ + .[\$idx][\"restartVersion\"] = \"${restartVersion}\" \ + else .+ [{clusterName: \"${clusterName}\" , restartVersion: \"${restartVersion}\"}] end" + __restartVersionPatch=$(echo ${__existingClusters} | jq "${__mapCmd}") + fi + __patchJsonVal="{\"spec\": {\"clusters\": "${__restartVersionPatch}"}}" + eval $__result="'${__patchJsonVal}'" +} + +# +# Check servers started in a cluster based on server start policy and +# replica count. +# $1 - Domain resource in json format +# $2 - Name of server +# $3 - Name of cluster +# $4 - Indicates if replicas will stay constant, incremented or decremented. +# Valid values are "CONSTANT", "INCREMENT" and "DECREMENT" +# $5 - Indicates if policy of current server will stay constant or unset. +# Valid values are "CONSTANT" and "UNSET" +# $6 - Return value of "true" or "false" indicating if current server will be started +# +function checkStartedServers { + local domainJson=$1 + local serverName=$2 + local clusterName=$3 + local withReplicas=$4 + local withPolicy=$5 + local __started=$6 + local localServerName="" + local policy="" + local replicaCount=0 + local currentReplicas=0 + local startedServers=() + local sortedByAlwaysServers=() + + # Get sorted list of servers in 'sortedByAlwaysServers' array + getSortedListOfServers "${domainJson}" "${serverName}" "${clusterName}" "${withPolicy}" + getReplicaCount "${domainJson}" "${clusterName}" replicaCount + # Increment or decrement the replica count based on 'withReplicas' input parameter + if [ "${withReplicas}" == "INCREASED" ]; then + replicaCount=$((replicaCount+1)) + elif [ "${withReplicas}" == "DECREASED" ]; then + replicaCount=$((replicaCount-1)) + fi + for localServerName in ${sortedByAlwaysServers[@]:-}; do + getEffectivePolicy "${domainJson}" "${localServerName}" "${clusterName}" policy + # Update policy when server name matches current server and unsetting + if [[ "${serverName}" == "${localServerName}" && "${withPolicy}" == "UNSET" ]]; then + policy=UNSET + fi + # check if server should start based on replica count, policy and current replicas + shouldStart "${currentReplicas}" "${policy}" "${replicaCount}" result + if [ "${result}" == 'true' ]; then + # server should start, increment current replicas and add server to list of started servers + currentReplicas=$((currentReplicas+1)) + startedServers+=(${localServerName}) + fi + done + startedSize=${#startedServers[@]} + if [ ${startedSize} -gt 0 ]; then + # check if current server is in the list of started servers + if checkStringInArray ${serverName} ${startedServers[@]}; then + eval $__started="true" + return + fi + fi + eval $__started="false" +} + +# +# Function to check if server should start based on policy and current replicas +# $1 - Current number of replicas +# $2 - Server start policy +# $3 - Replica count +# $4 - Returns "true" or "false" indicating if server should start. +# +function shouldStart { + local currentReplicas=$1 + local policy=$2 + local replicaCount=$3 + local __result=$4 + + if [ "$policy" == "ALWAYS" ]; then + eval $__result=true + elif [ "$policy" == "NEVER" ]; then + eval $__result=false + elif [ "${currentReplicas}" -lt "${replicaCount}" ]; then + eval $__result=true + else + eval $__result=false + fi +} + +# +# Function to check if cluster's replica count is same as min replicas +# $1 - Domain resource in json format +# $2 - Name of the cluster +# $3 - Returns "true" or "false" indicating if replica count is equal to +# or greater than min replicas. +# +function isReplicaCountEqualToMinReplicas { + local domainJson=$1 + local clusterName=$2 + local __result=$3 + + eval $__result=false + getMinReplicas "${domainJson}" "${clusterName}" minReplicas + getReplicaCount "${domainJson}" "${clusterName}" replica + if [ ${replica} -eq ${minReplicas} ]; then + eval $__result=true + fi +} + +# +# Function to check if provided replica count is in the allowed range +# $1 - Domain resource in json format +# $2 - Name of the cluster +# $3 - Replica count +# $4 - Returns "true" or "false" indicating if replica count is in +# the allowed range +# $5 - Returns allowed range for replica count for the given cluster +# +function isReplicasInAllowedRange { + local domainJson=$1 + local clusterName=$2 + local replicas=$3 + local __result=$4 + local __range=$5 + local rangeVal="" + + eval $__result=true + getMinReplicas "${domainJson}" "${clusterName}" minReplicas + getMaxReplicas "${domainJson}" "${clusterName}" maxReplicas + rangeVal="${minReplicas} to ${maxReplicas}" + eval $__range="'${rangeVal}'" + if [ ${replicas} -lt ${minReplicas} ] || [ ${replicas} -gt ${maxReplicas} ]; then + eval $__result=false + fi +} + +# +# Function to get minimum replica count for cluster +# $1 - Domain resource in json format +# $2 - Name of the cluster +# $3 - Return value containing minimum replica count +# +function getMinReplicas { + local domainJson=$1 + local clusterName=$2 + local __result=$3 + local minReplicaCmd="" + local minReplicasVal="" + + eval $__result=0 + minReplicaCmd="(.status.clusters[] | select (.clusterName == \"${clusterName}\")) \ + | .minimumReplicas" + minReplicasVal=$(echo ${domainJson} | jq "${minReplicaCmd}") + eval $__result=${minReplicasVal:-0} +} + +# +# Function to get maximum replica count for cluster +# $1 - Domain resource in json format +# $2 - Name of the cluster +# $3 - Return value containing maximum replica count +# +function getMaxReplicas { + local domainJson=$1 + local clusterName=$2 + local __result=$3 + local maxReplicaCmd="" + local maxReplicasVal="" + + maxReplicaCmd="(.status.clusters[] | select (.clusterName == \"${clusterName}\")) \ + | .maximumReplicas" + maxReplicasVal=$(echo ${domainJson} | jq "${maxReplicaCmd}") + eval $__result=${maxReplicasVal:-0} +} + +# +# Function to create patch string for updating replica count +# $1 - Domain resource in json format +# $2 - Name of cluster whose replica count will be patched +# $3 - operation string indicating whether to increment or decrement replica count. +# Valid values are "INCREMENT" and "DECREMENT" +# $4 - Return value containing replica update patch string +# $5 - Return value containing updated replica count +# +function createReplicaPatch { + local domainJson=$1 + local clusterName=$2 + local operation=$3 + local __result=$4 + local __replicaCount=$5 + local maxReplicas="" + local infoMessage="Current replica count value is same as or greater than maximum number of replica count. \ +Not increasing replica count value." + + getReplicaCount "${domainJson}" "${clusterName}" replica + if [ "${operation}" == "DECREMENT" ]; then + replica=$((replica-1)) + elif [ "${operation}" == "INCREMENT" ]; then + getMaxReplicas "${domainJson}" "${clusterName}" maxReplicas + if [ ${replica} -ge ${maxReplicas} ]; then + printInfo "${infoMessage}" + else + replica=$((replica+1)) + fi + fi + + cmd="(.spec.clusters[] | select (.clusterName == \"${clusterName}\") \ + | .replicas) |= ${replica}" + replicaPatch=$(echo ${domainJson} | jq "${cmd}" | jq -cr '(.spec.clusters)') + eval $__result="'${replicaPatch}'" + eval $__replicaCount="'${replica}'" +} + +# +# Function to validate whether a server belongs to a cluster or is an independent managed server +# $1 - Domain unique id. +# $2 - Domain namespace. +# $3 - Server name. +# $4 - Return value of "true" or "false" indicating if server is valid (i.e. if it's part of a cluster or independent server). +# $5 - Retrun value containting cluster name to which this server belongs. +# +function validateServerAndFindCluster { + local domainUid=$1 + local domainNamespace=$2 + local serverName=$3 + local __isValidServer=$4 + local __clusterName=$5 + local __isAdminServer=$6 + local serverCount="" + + eval $__isValidServer=false + eval $__isAdminServer=false + eval $__clusterName=UNKNOWN + getTopology "${domainUid}" "${domainNamespace}" jsonTopology + adminServer=$(echo $jsonTopology | jq -r .domain.adminServerName) + if [ "${serverName}" == "${adminServer}" ]; then + eval $__isAdminServer=true + fi + servers=($(echo $jsonTopology | jq -r '.domain.servers[].name')) + if checkStringInArray "${serverName}" "${servers[@]}" ; then + eval $__clusterName="" + eval $__isValidServer=true + else + dynamicClause=".domain.configuredClusters[] | select (.dynamicServersConfig != null)" + namePrefixSize=". | {name: .name, prefix:.dynamicServersConfig.serverNamePrefix, \ + max:.dynamicServersConfig.maxDynamicClusterSize}" + dynamicClusters=($(echo $jsonTopology | jq "${dynamicClause}" | jq -cr "${namePrefixSize}")) + dynamicClustersSize=${#dynamicClusters[@]} + for dynaClusterNamePrefix in ${dynamicClusters[@]:-}; do + prefix=$(echo ${dynaClusterNamePrefix} | jq -r .prefix) + if [[ "${serverName}" == "${prefix}"* ]]; then + maxSize=$(echo ${dynaClusterNamePrefix} | jq -r .max) + number='^[0-9]+$' + serverCount=$(echo "${serverName:${#prefix}}") + if ! [[ $serverCount =~ $number ]] ; then + printError "Server name ${serverName} is not valid for dynamic cluster." + exit 1 + fi + if [ "${serverCount}" -lt 1 ] || [ "${serverCount}" -gt "${maxSize}" ]; then + printError "Index of server name ${serverName} for dynamic cluster is outside \ + the allowed range of 1 to ${maxSize}. \ + Please make sure server name is correct." + exit 1 + fi + eval $__clusterName="'$(echo ${dynaClusterNamePrefix} | jq -r .name)'" + eval $__isValidServer=true + break + fi + done + staticClause=".domain.configuredClusters[] | select (.dynamicServersConfig == null)" + nameCmd=" . | {name: .name, serverName: .servers[].name}" + configuredClusters=($(echo $jsonTopology | jq "${staticClause}" | jq -cr "${nameCmd}")) + configuredClusterSize=${#configuredClusters[@]} + for configuredClusterName in ${configuredClusters[@]:-}; do + name=$(echo ${configuredClusterName} | jq -r .serverName) + if [ "${serverName}" == "${name}" ]; then + eval $__clusterName="'$(echo ${configuredClusterName} | jq -r .name)'" + eval $__isValidServer=true + break + fi + done + fi +} + +# +# Function to validate whether a cluster is valid and part of the domain +# $1 - Domain unique id. +# $2 - Domain namespace. +# $3 - cluster name +# $4 - Retrun value "true" or "false" indicating whether cluster name is valid +# +function validateClusterName { + local domainUid=$1 + local domainNamespace=$2 + local clusterName=$3 + local __isValidCluster=$4 + + getTopology "${domainUid}" "${domainNamespace}" jsonTopology + clusters=($(echo $jsonTopology | jq -cr .domain.configuredClusters[].name)) + if checkStringInArray "${clusterName}" "${clusters[@]}" ; then + eval $__isValidCluster=true + else + eval $__isValidCluster=false + fi +} + +function getTopology { + local domainUid=$1 + local domainNamespace=$2 + local __result=$3 + local __jsonTopology="" + local __topology="" + + if [[ "$OSTYPE" == "darwin"* ]]; then + configMap=$(${kubernetesCli} get cm ${domainUid}-weblogic-domain-introspect-cm \ + -n ${domainNamespace} -o yaml --ignore-not-found) + else + configMap=$(${kubernetesCli} get cm ${domainUid}-weblogic-domain-introspect-cm \ + -n ${domainNamespace} -o json --ignore-not-found) + fi + if [ -z "${configMap}" ]; then + printError "Domain config map '${domainUid}-weblogic-domain-introspect-cm' not found. \ + This script requires that the introspector job for the specified domain ran \ + successfully and generated this config map. Exiting." + exit 1 + else + __jsonTopology=$(echo "${configMap}" | jq -r '.data["topology.json"]') + fi + if [ ${__jsonTopology} == null ]; then + if [[ "$OSTYPE" == "darwin"* ]]; then + if ! [ -x "$(command -v yq)" ]; then + validationError "MacOS detected, the domain is hosted on a pre-3.2.0 version of \ + the Operator, and 'yq' is not installed locally. To fix this, install 'yq', \ + call the script from Linux instead of MacOS, or upgrade the Operator version." + exit 1 + fi + __jsonTopology=$(echo "${configMap}" | yq r - data.[topology.yaml] | yq r - -j) + else + if ! [ -x "$(command -v python)" ]; then + validationError "Linux OS detected, the domain is hosted on a pre-3.2.0 version of \ + the Operator, and 'python' is not installed locally. To fix this, install 'python' \ + or upgrade the Operator version." + exit 1 + fi + __topology=$(echo "${configMap}" | jq '.data["topology.yaml"]') + __jsonTopology=$(python -c \ + 'import sys, yaml, json; print json.dumps(yaml.safe_load('"${__topology}"'), indent=4)') + fi + fi + eval $__result="'${__jsonTopology}'" +} + + +# +# check if string passed as first argument is present in array passed as second argument +# $1 - string to check +# $2 - array +checkStringInArray() { + local str=$1 arr + shift + for arr; do + [[ $str = "$arr" ]] && return + done + return 1 +} + +# try to execute jq to see whether jq is available +function validateJqAvailable { + if ! [ -x "$(command -v jq)" ]; then + validationError "jq is not installed" + fi +} + +# try to execute kubernetes cli to see whether cli is available +function validateKubernetesCliAvailable { + if ! [ -x "$(command -v ${kubernetesCli})" ]; then + validationError "${kubernetesCli} is not installed" + fi +} + +# Function to print an error message +function printError { + echo [`timestamp`][ERROR] $* +} + +# Function to print an error message +function printInfo { + echo [`timestamp`][INFO] $* +} + +# +# Function to execute patch command and print verbose information +# $1 - Kubernetes command line interface +# $2 - Domain unique id +# $2 - Domain namespace +# $4 - Json string to be used in 'patch' command +# $5 - Verbose mode. Legal values are "true" or "false" +# +function executePatchCommand { + local kubernetesCli=$1 + local domainUid=$2 + local domainNamespace=$3 + local patchJson=$4 + local verboseMode=$5 + + if [ "${verboseMode}" == "true" ]; then + printInfo "Executing command --> ${kubernetesCli} patch domain ${domainUid} \ + -n ${domainNamespace} --type=merge --patch \"${patchJson}\"" + fi + ${kubernetesCli} patch domain ${domainUid} -n ${domainNamespace} --type=merge --patch "${patchJson}" +} + +# timestamp +# purpose: echo timestamp in the form yyyy-mm-ddThh:mm:ss.nnnnnnZ +# example: 2018-10-01T14:00:00.000001Z +function timestamp() { + local timestamp="`date --utc '+%Y-%m-%dT%H:%M:%S.%NZ' 2>&1`" + if [ ! "${timestamp/illegal/xyz}" = "${timestamp}" ]; then + # old shell versions don't support %N or --utc + timestamp="`date -u '+%Y-%m-%dT%H:%M:%S.000000Z' 2>&1`" + fi + echo "${timestamp}" +} + +# +# 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 + printError 'The errors listed above must be resolved before the script can continue. Please see usage information below.' + usage 1 + fi +} + +# +# Function to lowercase a value and make it a legal DNS1123 name +# $1 - value to convert to DNS legal name +# $2 - return value containing DNS legal name. +function toDNS1123Legal { + local name=$1 + local __result=$2 + local val=`echo "${name}" | tr "[:upper:]" "[:lower:]"` + val=${val//"_"/"-"} + eval $__result="'$val'" +} + diff --git a/OracleWebCenterPortal/kubernetes/domain-lifecycle/introspectDomain.sh b/OracleWebCenterPortal/kubernetes/domain-lifecycle/introspectDomain.sh old mode 100644 new mode 100755 index 120eccec7..24cbcc39b --- a/OracleWebCenterPortal/kubernetes/domain-lifecycle/introspectDomain.sh +++ b/OracleWebCenterPortal/kubernetes/domain-lifecycle/introspectDomain.sh @@ -1,105 +1,105 @@ -# !/bin/sh -# 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. -# - -script="${BASH_SOURCE[0]}" -scriptDir="$( cd "$( dirname "${script}" )" && pwd )" -source ${scriptDir}/helper.sh -if [ "${debug}" == "true" ]; then set -x; fi; - -function usage() { - - cat << EOF - - This script initiates introspection of a WebLogic domain by updating - the value of 'spec.introspectVersion' attribute of the domain resource. - - Usage: - - $(basename $0) [-n mynamespace] [-d mydomainuid] [-i introspectVersion] [-m kubecli] - - -d : Domain unique-id. Default is 'sample-domain1'. - - -n : Domain namespace. Default is 'sample-domain1-ns'. - - -i : Introspect version. If this parameter is not provided, - then the script will generate the 'introspectVersion' by - incrementing the existing value. If the 'spec.introspectVersion' - doesn't exist or its value is non-numeric, then the script - will set the 'spec.introspectVersion' value to '1'. - - -m : Kubernetes command line interface. Default is 'kubectl' - if KUBERNETES_CLI env variable is not set. Otherwise - the default is the value of KUBERNETES_CLI env variable. - - -v : Enables verbose mode. Default is 'false'. - - -h : This help. - -EOF -exit $1 -} - -kubernetesCli=${KUBERNETES_CLI:-kubectl} -clusterName="" -domainUid="sample-domain1" -domainNamespace="sample-domain1-ns" -verboseMode=false -patchJson="" -introspectVersion="" - -while getopts "vc:n:m:d:i:h" opt; do - case $opt in - n) domainNamespace="${OPTARG}" - ;; - d) domainUid="${OPTARG}" - ;; - i) introspectVersion="${OPTARG}" - ;; - m) kubernetesCli="${OPTARG}" - ;; - v) verboseMode=true; - ;; - h) usage 0 - ;; - *) usage 1 - ;; - esac -done - -set -eu - -# -# Function to perform validations, read files and initialize workspace -# -function initialize { - - validateErrors=false - - validateKubernetesCliAvailable - validateJqAvailable - - failIfValidationErrors -} - -initialize - -# Get the domain in json format -domainJson=$(${kubernetesCli} get domain ${domainUid} -n ${domainNamespace} -o json --ignore-not-found) -if [ -z "${domainJson}" ]; then - printError "Unable to get domain resource for domain '${domainUid}' in namespace '${domainNamespace}'. Please make sure the 'domain_uid' and 'namespace' specified by the '-d' and '-n' arguments are correct. Exiting." - exit 1 -fi - -# if the introspectVersion is not provided, generate the value of introspectVersion -if [ -z "${introspectVersion}" ]; then - generateDomainIntrospectVersion "${domainJson}" introspectVersion -fi - -printInfo "Patching introspectVersion for domain '${domainUid}' to '${introspectVersion}'." -createPatchJsonToUpdateDomainIntrospectVersion "${introspectVersion}" patchJson - -executePatchCommand "${kubernetesCli}" "${domainUid}" "${domainNamespace}" "${patchJson}" "${verboseMode}" - -printInfo "Successfully patched introspectVersion for domain '${domainUid}'!" +# !/bin/sh +# 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. +# + +script="${BASH_SOURCE[0]}" +scriptDir="$( cd "$( dirname "${script}" )" && pwd )" +source ${scriptDir}/helper.sh +if [ "${debug}" == "true" ]; then set -x; fi; + +function usage() { + + cat << EOF + + This script initiates introspection of a WebLogic domain by updating + the value of 'spec.introspectVersion' attribute of the domain resource. + + Usage: + + $(basename $0) [-n mynamespace] [-d mydomainuid] [-i introspectVersion] [-m kubecli] + + -d : Domain unique-id. Default is 'sample-domain1'. + + -n : Domain namespace. Default is 'sample-domain1-ns'. + + -i : Introspect version. If this parameter is not provided, + then the script will generate the 'introspectVersion' by + incrementing the existing value. If the 'spec.introspectVersion' + doesn't exist or its value is non-numeric, then the script + will set the 'spec.introspectVersion' value to '1'. + + -m : Kubernetes command line interface. Default is 'kubectl' + if KUBERNETES_CLI env variable is not set. Otherwise + the default is the value of KUBERNETES_CLI env variable. + + -v : Enables verbose mode. Default is 'false'. + + -h : This help. + +EOF +exit $1 +} + +kubernetesCli=${KUBERNETES_CLI:-kubectl} +clusterName="" +domainUid="sample-domain1" +domainNamespace="sample-domain1-ns" +verboseMode=false +patchJson="" +introspectVersion="" + +while getopts "vc:n:m:d:i:h" opt; do + case $opt in + n) domainNamespace="${OPTARG}" + ;; + d) domainUid="${OPTARG}" + ;; + i) introspectVersion="${OPTARG}" + ;; + m) kubernetesCli="${OPTARG}" + ;; + v) verboseMode=true; + ;; + h) usage 0 + ;; + *) usage 1 + ;; + esac +done + +set -eu + +# +# Function to perform validations, read files and initialize workspace +# +function initialize { + + validateErrors=false + + validateKubernetesCliAvailable + validateJqAvailable + + failIfValidationErrors +} + +initialize + +# Get the domain in json format +domainJson=$(${kubernetesCli} get domain ${domainUid} -n ${domainNamespace} -o json --ignore-not-found) +if [ -z "${domainJson}" ]; then + printError "Unable to get domain resource for domain '${domainUid}' in namespace '${domainNamespace}'. Please make sure the 'domain_uid' and 'namespace' specified by the '-d' and '-n' arguments are correct. Exiting." + exit 1 +fi + +# if the introspectVersion is not provided, generate the value of introspectVersion +if [ -z "${introspectVersion}" ]; then + generateDomainIntrospectVersion "${domainJson}" introspectVersion +fi + +printInfo "Patching introspectVersion for domain '${domainUid}' to '${introspectVersion}'." +createPatchJsonToUpdateDomainIntrospectVersion "${introspectVersion}" patchJson + +executePatchCommand "${kubernetesCli}" "${domainUid}" "${domainNamespace}" "${patchJson}" "${verboseMode}" + +printInfo "Successfully patched introspectVersion for domain '${domainUid}'!" diff --git a/OracleWebCenterPortal/kubernetes/domain-lifecycle/restartServer.sh b/OracleWebCenterPortal/kubernetes/domain-lifecycle/restartServer.sh old mode 100644 new mode 100755 index 0c7405aba..2c14687a3 --- a/OracleWebCenterPortal/kubernetes/domain-lifecycle/restartServer.sh +++ b/OracleWebCenterPortal/kubernetes/domain-lifecycle/restartServer.sh @@ -1,106 +1,106 @@ -# !/bin/sh -# 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. -# - -script="${BASH_SOURCE[0]}" -scriptDir="$( cd "$( dirname "${script}" )" && pwd )" -source ${scriptDir}/helper.sh -if [ "${debug}" == "true" ]; then set -x; fi; -set -eu - -function usage() { - - cat << EOF - - This script restarts a running WebLogic server in a domain by deleting the server pod. - - Usage: - - $(basename $0) -s myserver [-n mynamespace] [-d mydomainuid] [-m kubecli] - - -s : The WebLogic server name (not the pod name). - This parameter is required. - - -d : Domain unique-id. Default is 'sample-domain1'. - - -n : Domain namespace. Default is 'sample-domain1-ns'. - - -m : Kubernetes command line interface. Default is 'kubectl' - if KUBERNETES_CLI env variable is not set. Otherwise the - default is the value of KUBERNETES_CLI env variable. - - -h : This help. - -EOF -exit $1 -} - -kubernetesCli=${KUBERNETES_CLI:-kubectl} -serverName="" -clusterName="" -domainUid="sample-domain1" -domainNamespace="sample-domain1-ns" -podName="" -legalDNSPodName="" - -while getopts "s:m:n:d:h" opt; do - case $opt in - s) serverName="${OPTARG}" - ;; - n) domainNamespace="${OPTARG}" - ;; - m) kubernetesCli="${OPTARG}" - ;; - d) domainUid="${OPTARG}" - ;; - h) usage 0 - ;; - *) usage 1 - ;; - esac -done - -# -# Function to perform validations, read files and initialize workspace -# -function initialize { - - validateErrors=false - - validateKubernetesCliAvailable - validateJqAvailable - - # Validate that server name parameter is specified. - if [ -z "${serverName}" ]; then - validationError "Please specify the server name using '-s' parameter e.g. '-s managed-server1'." - fi - - failIfValidationErrors -} - -initialize - -# Get the domain in json format -domainJson=$(${kubernetesCli} get domain ${domainUid} -n ${domainNamespace} -o json --ignore-not-found) -if [ -z "${domainJson}" ]; then - printError "Unable to get domain resource for domain '${domainUid}' in namespace '${domainNamespace}'. Please make sure the 'domain_uid' and 'namespace' specified by the '-d' and '-n' arguments are correct. Exiting." - exit 1 -fi - -# Validate that specified server is either part of a cluster or is an independent managed server -validateServerAndFindCluster "${domainUid}" "${domainNamespace}" "${serverName}" isValidServer clusterName isAdminServer -if [ "${isValidServer}" != 'true' ]; then - printError "Server ${serverName} is not part of any cluster and it's not an independent managed server. Please make sure that server name specified is correct." - exit 1 -fi - -podName=${domainUid}-${serverName} -toDNS1123Legal ${podName} legalDNSPodName -printInfo "Initiating restart of '${serverName}' by deleting server pod '${legalDNSPodName}'." -result=$(${kubernetesCli} -n ${domainNamespace} delete pod ${legalDNSPodName} --ignore-not-found) -if [ -z "${result}" ]; then - printError "Server '${serverName}' is not running." -else - printInfo "Server restart succeeded !" -fi +# !/bin/sh +# 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. +# + +script="${BASH_SOURCE[0]}" +scriptDir="$( cd "$( dirname "${script}" )" && pwd )" +source ${scriptDir}/helper.sh +if [ "${debug}" == "true" ]; then set -x; fi; +set -eu + +function usage() { + + cat << EOF + + This script restarts a running WebLogic server in a domain by deleting the server pod. + + Usage: + + $(basename $0) -s myserver [-n mynamespace] [-d mydomainuid] [-m kubecli] + + -s : The WebLogic server name (not the pod name). + This parameter is required. + + -d : Domain unique-id. Default is 'sample-domain1'. + + -n : Domain namespace. Default is 'sample-domain1-ns'. + + -m : Kubernetes command line interface. Default is 'kubectl' + if KUBERNETES_CLI env variable is not set. Otherwise the + default is the value of KUBERNETES_CLI env variable. + + -h : This help. + +EOF +exit $1 +} + +kubernetesCli=${KUBERNETES_CLI:-kubectl} +serverName="" +clusterName="" +domainUid="sample-domain1" +domainNamespace="sample-domain1-ns" +podName="" +legalDNSPodName="" + +while getopts "s:m:n:d:h" opt; do + case $opt in + s) serverName="${OPTARG}" + ;; + n) domainNamespace="${OPTARG}" + ;; + m) kubernetesCli="${OPTARG}" + ;; + d) domainUid="${OPTARG}" + ;; + h) usage 0 + ;; + *) usage 1 + ;; + esac +done + +# +# Function to perform validations, read files and initialize workspace +# +function initialize { + + validateErrors=false + + validateKubernetesCliAvailable + validateJqAvailable + + # Validate that server name parameter is specified. + if [ -z "${serverName}" ]; then + validationError "Please specify the server name using '-s' parameter e.g. '-s managed-server1'." + fi + + failIfValidationErrors +} + +initialize + +# Get the domain in json format +domainJson=$(${kubernetesCli} get domain ${domainUid} -n ${domainNamespace} -o json --ignore-not-found) +if [ -z "${domainJson}" ]; then + printError "Unable to get domain resource for domain '${domainUid}' in namespace '${domainNamespace}'. Please make sure the 'domain_uid' and 'namespace' specified by the '-d' and '-n' arguments are correct. Exiting." + exit 1 +fi + +# Validate that specified server is either part of a cluster or is an independent managed server +validateServerAndFindCluster "${domainUid}" "${domainNamespace}" "${serverName}" isValidServer clusterName isAdminServer +if [ "${isValidServer}" != 'true' ]; then + printError "Server ${serverName} is not part of any cluster and it's not an independent managed server. Please make sure that server name specified is correct." + exit 1 +fi + +podName=${domainUid}-${serverName} +toDNS1123Legal ${podName} legalDNSPodName +printInfo "Initiating restart of '${serverName}' by deleting server pod '${legalDNSPodName}'." +result=$(${kubernetesCli} -n ${domainNamespace} delete pod ${legalDNSPodName} --ignore-not-found) +if [ -z "${result}" ]; then + printError "Server '${serverName}' is not running." +else + printInfo "Server restart succeeded !" +fi diff --git a/OracleWebCenterPortal/kubernetes/domain-lifecycle/rollCluster.sh b/OracleWebCenterPortal/kubernetes/domain-lifecycle/rollCluster.sh old mode 100644 new mode 100755 index 858e41706..cf3c66f82 --- a/OracleWebCenterPortal/kubernetes/domain-lifecycle/rollCluster.sh +++ b/OracleWebCenterPortal/kubernetes/domain-lifecycle/rollCluster.sh @@ -1,123 +1,123 @@ -# !/bin/sh -# 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. -# - -script="${BASH_SOURCE[0]}" -scriptDir="$( cd "$( dirname "${script}" )" && pwd )" -source ${scriptDir}/helper.sh -if [ "${debug}" == "true" ]; then set -x; fi; - -function usage() { - - cat << EOF - - This script initiates a rolling restart of the WebLogic cluster server pods in a domain by updating - the value of the 'spec.clusters[].restartVersion' attribute of the domain resource. - - Usage: - - $(basename $0) -c mycluster [-n mynamespace] [-d mydomainuid] [-r restartVersion] [-m kubecli] - - -c : Cluster name (required parameter). - - -d : Domain unique-id. Default is 'sample-domain1'. - - -n : Domain namespace. Default is 'sample-domain1-ns'. - - -r : Restart version. If this parameter is not provided, - then the script will generate the 'restartVersion' - value of the cluster by incrementing the existing - value. If the 'restartVersion' value doesn't exist - for the cluster then it will use the incremented value of - domain 'restartVersion'. If the domain 'restartVersion' also - doesn't exist or effective value is non-numeric, then - the script will set the 'restartVersion' value to '1'. - - -m : Kubernetes command line interface. Default is 'kubectl' - if KUBERNETES_CLI env variable is not set. Otherwise - the default is the value of the KUBERNETES_CLI env variable. - - -v : Enables verbose mode. Default is 'false'. - - -h : This help. - -EOF -exit $1 -} - -kubernetesCli=${KUBERNETES_CLI:-kubectl} -clusterName="" -domainUid="sample-domain1" -domainNamespace="sample-domain1-ns" -verboseMode=false -patchJson="" -restartVersion="" - -while getopts "vc:n:m:d:r:h" opt; do - case $opt in - c) clusterName="${OPTARG}" - ;; - n) domainNamespace="${OPTARG}" - ;; - d) domainUid="${OPTARG}" - ;; - r) restartVersion="${OPTARG}" - ;; - m) kubernetesCli="${OPTARG}" - ;; - v) verboseMode=true; - ;; - h) usage 0 - ;; - *) usage 1 - ;; - esac -done - -set -eu - -# -# Function to perform validations, read files and initialize workspace -# -function initialize { - - validateErrors=false - - validateKubernetesCliAvailable - validateJqAvailable - - if [ -z "${clusterName}" ]; then - validationError "Please specify cluster name using '-c' parameter e.g. '-c cluster-1'." - fi - - failIfValidationErrors -} - -initialize - -# Get the domain in json format -domainJson=$(${kubernetesCli} get domain ${domainUid} -n ${domainNamespace} -o json --ignore-not-found) -if [ -z "${domainJson}" ]; then - printError "Unable to get domain resource for domain '${domainUid}' in namespace '${domainNamespace}'. Please make sure the 'domain_uid' and 'namespace' specified by the '-d' and '-n' arguments are correct. Exiting." - exit 1 -fi - -isValidCluster="" -validateClusterName "${domainUid}" "${domainNamespace}" "${clusterName}" isValidCluster -if [ "${isValidCluster}" != 'true' ]; then - printError "cluster ${clusterName} is not part of domain ${domainUid} in namespace ${domainNamespace}. Please make sure that cluster name is correct." - exit 1 -fi - -# if the restartVersion is not provided, generate the value of restartVersion -if [ -z "${restartVersion}" ]; then - generateClusterRestartVersion "${domainJson}" "${clusterName}" restartVersion -fi - -printInfo "Patching restartVersion for cluster '${clusterName}' to '${restartVersion}'." -createPatchJsonToUpdateClusterRestartVersion "${domainJson}" "${clusterName}" "${restartVersion}" patchJson - -executePatchCommand "${kubernetesCli}" "${domainUid}" "${domainNamespace}" "${patchJson}" "${verboseMode}" - -printInfo "Successfully patched restartVersion for cluster '${clusterName}'!" +# !/bin/sh +# 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. +# + +script="${BASH_SOURCE[0]}" +scriptDir="$( cd "$( dirname "${script}" )" && pwd )" +source ${scriptDir}/helper.sh +if [ "${debug}" == "true" ]; then set -x; fi; + +function usage() { + + cat << EOF + + This script initiates a rolling restart of the WebLogic cluster server pods in a domain by updating + the value of the 'spec.clusters[].restartVersion' attribute of the domain resource. + + Usage: + + $(basename $0) -c mycluster [-n mynamespace] [-d mydomainuid] [-r restartVersion] [-m kubecli] + + -c : Cluster name (required parameter). + + -d : Domain unique-id. Default is 'sample-domain1'. + + -n : Domain namespace. Default is 'sample-domain1-ns'. + + -r : Restart version. If this parameter is not provided, + then the script will generate the 'restartVersion' + value of the cluster by incrementing the existing + value. If the 'restartVersion' value doesn't exist + for the cluster then it will use the incremented value of + domain 'restartVersion'. If the domain 'restartVersion' also + doesn't exist or effective value is non-numeric, then + the script will set the 'restartVersion' value to '1'. + + -m : Kubernetes command line interface. Default is 'kubectl' + if KUBERNETES_CLI env variable is not set. Otherwise + the default is the value of the KUBERNETES_CLI env variable. + + -v : Enables verbose mode. Default is 'false'. + + -h : This help. + +EOF +exit $1 +} + +kubernetesCli=${KUBERNETES_CLI:-kubectl} +clusterName="" +domainUid="sample-domain1" +domainNamespace="sample-domain1-ns" +verboseMode=false +patchJson="" +restartVersion="" + +while getopts "vc:n:m:d:r:h" opt; do + case $opt in + c) clusterName="${OPTARG}" + ;; + n) domainNamespace="${OPTARG}" + ;; + d) domainUid="${OPTARG}" + ;; + r) restartVersion="${OPTARG}" + ;; + m) kubernetesCli="${OPTARG}" + ;; + v) verboseMode=true; + ;; + h) usage 0 + ;; + *) usage 1 + ;; + esac +done + +set -eu + +# +# Function to perform validations, read files and initialize workspace +# +function initialize { + + validateErrors=false + + validateKubernetesCliAvailable + validateJqAvailable + + if [ -z "${clusterName}" ]; then + validationError "Please specify cluster name using '-c' parameter e.g. '-c cluster-1'." + fi + + failIfValidationErrors +} + +initialize + +# Get the domain in json format +domainJson=$(${kubernetesCli} get domain ${domainUid} -n ${domainNamespace} -o json --ignore-not-found) +if [ -z "${domainJson}" ]; then + printError "Unable to get domain resource for domain '${domainUid}' in namespace '${domainNamespace}'. Please make sure the 'domain_uid' and 'namespace' specified by the '-d' and '-n' arguments are correct. Exiting." + exit 1 +fi + +isValidCluster="" +validateClusterName "${domainUid}" "${domainNamespace}" "${clusterName}" isValidCluster +if [ "${isValidCluster}" != 'true' ]; then + printError "cluster ${clusterName} is not part of domain ${domainUid} in namespace ${domainNamespace}. Please make sure that cluster name is correct." + exit 1 +fi + +# if the restartVersion is not provided, generate the value of restartVersion +if [ -z "${restartVersion}" ]; then + generateClusterRestartVersion "${domainJson}" "${clusterName}" restartVersion +fi + +printInfo "Patching restartVersion for cluster '${clusterName}' to '${restartVersion}'." +createPatchJsonToUpdateClusterRestartVersion "${domainJson}" "${clusterName}" "${restartVersion}" patchJson + +executePatchCommand "${kubernetesCli}" "${domainUid}" "${domainNamespace}" "${patchJson}" "${verboseMode}" + +printInfo "Successfully patched restartVersion for cluster '${clusterName}'!" diff --git a/OracleWebCenterPortal/kubernetes/domain-lifecycle/rollDomain.sh b/OracleWebCenterPortal/kubernetes/domain-lifecycle/rollDomain.sh old mode 100644 new mode 100755 index 4c821d8c8..4bae4773c --- a/OracleWebCenterPortal/kubernetes/domain-lifecycle/rollDomain.sh +++ b/OracleWebCenterPortal/kubernetes/domain-lifecycle/rollDomain.sh @@ -1,105 +1,105 @@ -# !/bin/sh -# 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. -# - -script="${BASH_SOURCE[0]}" -scriptDir="$( cd "$( dirname "${script}" )" && pwd )" -source ${scriptDir}/helper.sh -if [ "${debug}" == "true" ]; then set -x; fi; - -function usage() { - - cat << EOF - - This script initiates a rolling restart of pods in a WebLogic domain by updating - the value of the 'spec.restartVersion' attribute of the domain resource. - - Usage: - - $(basename $0) [-n mynamespace] [-d mydomainuid] [-r restartVersion] [-m kubecli] - - -d : Domain unique-id. Default is 'sample-domain1'. - - -n : Domain namespace. Default is 'sample-domain1-ns'. - - -r : Restart version. If this parameter is not provided, - then the script will generate the 'restartVersion' by - incrementing the existing value. If the 'spec.restartVersion' - doesn't exist or its value is non-numeric, then the script - will set the 'spec.restartVersion' value to '1'. - - -m : Kubernetes command line interface. Default is 'kubectl' - if KUBERNETES_CLI env variable is not set. Otherwise - the default is the value of the KUBERNETES_CLI env variable. - - -v : Enables verbose mode. Default is 'false'. - - -h : This help. - -EOF -exit $1 -} - -kubernetesCli=${KUBERNETES_CLI:-kubectl} -clusterName="" -domainUid="sample-domain1" -domainNamespace="sample-domain1-ns" -verboseMode=false -patchJson="" -restartVersion="" - -while getopts "vc:n:m:d:r:h" opt; do - case $opt in - n) domainNamespace="${OPTARG}" - ;; - d) domainUid="${OPTARG}" - ;; - r) restartVersion="${OPTARG}" - ;; - m) kubernetesCli="${OPTARG}" - ;; - v) verboseMode=true; - ;; - h) usage 0 - ;; - *) usage 1 - ;; - esac -done - -set -eu - -# -# Function to perform validations, read files and initialize workspace -# -function initialize { - - validateErrors=false - - validateKubernetesCliAvailable - validateJqAvailable - - failIfValidationErrors -} - -initialize - -# Get the domain in json format -domainJson=$(${kubernetesCli} get domain ${domainUid} -n ${domainNamespace} -o json --ignore-not-found) -if [ -z "${domainJson}" ]; then - printError "Unable to get domain resource for domain '${domainUid}' in namespace '${domainNamespace}'. Please make sure the 'domain_uid' and 'namespace' specified by the '-d' and '-n' arguments are correct. Exiting." - exit 1 -fi - -# if the restartVersion is not provided, generate the value of restartVersion -if [ -z "${restartVersion}" ]; then - generateDomainRestartVersion "${domainJson}" restartVersion -fi - -printInfo "Patching restartVersion for domain '${domainUid}' to '${restartVersion}'." -createPatchJsonToUpdateDomainRestartVersion "${restartVersion}" patchJson - -executePatchCommand "${kubernetesCli}" "${domainUid}" "${domainNamespace}" "${patchJson}" "${verboseMode}" - -printInfo "Successfully patched restartVersion for domain '${domainUid}'!" +# !/bin/sh +# 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. +# + +script="${BASH_SOURCE[0]}" +scriptDir="$( cd "$( dirname "${script}" )" && pwd )" +source ${scriptDir}/helper.sh +if [ "${debug}" == "true" ]; then set -x; fi; + +function usage() { + + cat << EOF + + This script initiates a rolling restart of pods in a WebLogic domain by updating + the value of the 'spec.restartVersion' attribute of the domain resource. + + Usage: + + $(basename $0) [-n mynamespace] [-d mydomainuid] [-r restartVersion] [-m kubecli] + + -d : Domain unique-id. Default is 'sample-domain1'. + + -n : Domain namespace. Default is 'sample-domain1-ns'. + + -r : Restart version. If this parameter is not provided, + then the script will generate the 'restartVersion' by + incrementing the existing value. If the 'spec.restartVersion' + doesn't exist or its value is non-numeric, then the script + will set the 'spec.restartVersion' value to '1'. + + -m : Kubernetes command line interface. Default is 'kubectl' + if KUBERNETES_CLI env variable is not set. Otherwise + the default is the value of the KUBERNETES_CLI env variable. + + -v : Enables verbose mode. Default is 'false'. + + -h : This help. + +EOF +exit $1 +} + +kubernetesCli=${KUBERNETES_CLI:-kubectl} +clusterName="" +domainUid="sample-domain1" +domainNamespace="sample-domain1-ns" +verboseMode=false +patchJson="" +restartVersion="" + +while getopts "vc:n:m:d:r:h" opt; do + case $opt in + n) domainNamespace="${OPTARG}" + ;; + d) domainUid="${OPTARG}" + ;; + r) restartVersion="${OPTARG}" + ;; + m) kubernetesCli="${OPTARG}" + ;; + v) verboseMode=true; + ;; + h) usage 0 + ;; + *) usage 1 + ;; + esac +done + +set -eu + +# +# Function to perform validations, read files and initialize workspace +# +function initialize { + + validateErrors=false + + validateKubernetesCliAvailable + validateJqAvailable + + failIfValidationErrors +} + +initialize + +# Get the domain in json format +domainJson=$(${kubernetesCli} get domain ${domainUid} -n ${domainNamespace} -o json --ignore-not-found) +if [ -z "${domainJson}" ]; then + printError "Unable to get domain resource for domain '${domainUid}' in namespace '${domainNamespace}'. Please make sure the 'domain_uid' and 'namespace' specified by the '-d' and '-n' arguments are correct. Exiting." + exit 1 +fi + +# if the restartVersion is not provided, generate the value of restartVersion +if [ -z "${restartVersion}" ]; then + generateDomainRestartVersion "${domainJson}" restartVersion +fi + +printInfo "Patching restartVersion for domain '${domainUid}' to '${restartVersion}'." +createPatchJsonToUpdateDomainRestartVersion "${restartVersion}" patchJson + +executePatchCommand "${kubernetesCli}" "${domainUid}" "${domainNamespace}" "${patchJson}" "${verboseMode}" + +printInfo "Successfully patched restartVersion for domain '${domainUid}'!" diff --git a/OracleWebCenterPortal/kubernetes/domain-lifecycle/scaleCluster.sh b/OracleWebCenterPortal/kubernetes/domain-lifecycle/scaleCluster.sh old mode 100644 new mode 100755 index 947dd871c..6f6eb8db5 --- a/OracleWebCenterPortal/kubernetes/domain-lifecycle/scaleCluster.sh +++ b/OracleWebCenterPortal/kubernetes/domain-lifecycle/scaleCluster.sh @@ -1,122 +1,122 @@ -# !/bin/sh -# 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. -# - -script="${BASH_SOURCE[0]}" -scriptDir="$( cd "$( dirname "${script}" )" && pwd )" -source ${scriptDir}/helper.sh -if [ "${debug}" == "true" ]; then set -x; fi; - -function usage() { - - cat << EOF - - This script scales a WebLogic cluster in a domain by patching the - 'spec.clusters[].replicas' attribute of the domain - resource. This change will cause the operator to perform a scaling - operation for the WebLogic cluster based on the value of replica count. - - Usage: - - $(basename $0) -c mycluster -r replicas [-n mynamespace] [-d mydomainuid] [-m kubecli] - - -c : Cluster name parameter is required. - - -r : Replica count, parameter is required. - - -d : Domain unique-id. Default is 'sample-domain1'. - - -n : Domain namespace. Default is 'sample-domain1-ns'. - - -m : Kubernetes command line interface. Default is 'kubectl' if KUBERNETES_CLI env - variable is not set. Otherwise default is the value of KUBERNETES_CLI env variable. - - -v : Enables verbose mode. Default is 'false'. - - -h : This help. - -EOF -exit $1 -} - -kubernetesCli=${KUBERNETES_CLI:-kubectl} -clusterName="" -domainUid="sample-domain1" -domainNamespace="sample-domain1-ns" -verboseMode=false -patchJson="" -replicas="" - -while getopts "vc:n:m:d:r:h" opt; do - case $opt in - c) clusterName="${OPTARG}" - ;; - n) domainNamespace="${OPTARG}" - ;; - d) domainUid="${OPTARG}" - ;; - r) replicas="${OPTARG}" - ;; - m) kubernetesCli="${OPTARG}" - ;; - v) verboseMode=true; - ;; - h) usage 0 - ;; - *) usage 1 - ;; - esac -done - -set -eu - -# -# Function to perform validations, read files and initialize workspace -# -function initialize { - - validateErrors=false - - validateKubernetesCliAvailable - validateJqAvailable - - if [ -z "${clusterName}" ]; then - validationError "Please specify cluster name using '-c' parameter e.g. '-c cluster-1'." - fi - - if [ -z "${replicas}" ]; then - validationError "Please specify replica count using '-r' parameter e.g. '-r 3'." - fi - - failIfValidationErrors -} - -initialize - -# Get the domain in json format -domainJson=$(${kubernetesCli} get domain ${domainUid} -n ${domainNamespace} -o json --ignore-not-found) -if [ -z "${domainJson}" ]; then - printError "Unable to get domain resource for domain '${domainUid}' in namespace '${domainNamespace}'. Please make sure the 'domain_uid' and 'namespace' specified by the '-d' and '-n' arguments are correct. Exiting." - exit 1 -fi - -isValidCluster="" -validateClusterName "${domainUid}" "${domainNamespace}" "${clusterName}" isValidCluster -if [ "${isValidCluster}" != 'true' ]; then - printError "cluster ${clusterName} is not part of domain ${domainUid} in namespace ${domainNamespace}. Please make sure that cluster name is correct." - exit 1 -fi - -isReplicasInAllowedRange "${domainJson}" "${clusterName}" "${replicas}" replicasInAllowedRange range -if [ "${replicasInAllowedRange}" == 'false' ]; then - printError "Replicas value is not in the allowed range of ${range}. Exiting." - exit 1 -fi - -printInfo "Patching replicas for cluster '${clusterName}' to '${replicas}'." -createPatchJsonToUpdateReplicas "${domainJson}" "${clusterName}" "${replicas}" patchJson - -executePatchCommand "${kubernetesCli}" "${domainUid}" "${domainNamespace}" "${patchJson}" "${verboseMode}" - -printInfo "Successfully patched replicas for cluster '${clusterName}'!" +# !/bin/sh +# 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. +# + +script="${BASH_SOURCE[0]}" +scriptDir="$( cd "$( dirname "${script}" )" && pwd )" +source ${scriptDir}/helper.sh +if [ "${debug}" == "true" ]; then set -x; fi; + +function usage() { + + cat << EOF + + This script scales a WebLogic cluster in a domain by patching the + 'spec.clusters[].replicas' attribute of the domain + resource. This change will cause the operator to perform a scaling + operation for the WebLogic cluster based on the value of replica count. + + Usage: + + $(basename $0) -c mycluster -r replicas [-n mynamespace] [-d mydomainuid] [-m kubecli] + + -c : Cluster name parameter is required. + + -r : Replica count, parameter is required. + + -d : Domain unique-id. Default is 'sample-domain1'. + + -n : Domain namespace. Default is 'sample-domain1-ns'. + + -m : Kubernetes command line interface. Default is 'kubectl' if KUBERNETES_CLI env + variable is not set. Otherwise default is the value of KUBERNETES_CLI env variable. + + -v : Enables verbose mode. Default is 'false'. + + -h : This help. + +EOF +exit $1 +} + +kubernetesCli=${KUBERNETES_CLI:-kubectl} +clusterName="" +domainUid="sample-domain1" +domainNamespace="sample-domain1-ns" +verboseMode=false +patchJson="" +replicas="" + +while getopts "vc:n:m:d:r:h" opt; do + case $opt in + c) clusterName="${OPTARG}" + ;; + n) domainNamespace="${OPTARG}" + ;; + d) domainUid="${OPTARG}" + ;; + r) replicas="${OPTARG}" + ;; + m) kubernetesCli="${OPTARG}" + ;; + v) verboseMode=true; + ;; + h) usage 0 + ;; + *) usage 1 + ;; + esac +done + +set -eu + +# +# Function to perform validations, read files and initialize workspace +# +function initialize { + + validateErrors=false + + validateKubernetesCliAvailable + validateJqAvailable + + if [ -z "${clusterName}" ]; then + validationError "Please specify cluster name using '-c' parameter e.g. '-c cluster-1'." + fi + + if [ -z "${replicas}" ]; then + validationError "Please specify replica count using '-r' parameter e.g. '-r 3'." + fi + + failIfValidationErrors +} + +initialize + +# Get the domain in json format +domainJson=$(${kubernetesCli} get domain ${domainUid} -n ${domainNamespace} -o json --ignore-not-found) +if [ -z "${domainJson}" ]; then + printError "Unable to get domain resource for domain '${domainUid}' in namespace '${domainNamespace}'. Please make sure the 'domain_uid' and 'namespace' specified by the '-d' and '-n' arguments are correct. Exiting." + exit 1 +fi + +isValidCluster="" +validateClusterName "${domainUid}" "${domainNamespace}" "${clusterName}" isValidCluster +if [ "${isValidCluster}" != 'true' ]; then + printError "cluster ${clusterName} is not part of domain ${domainUid} in namespace ${domainNamespace}. Please make sure that cluster name is correct." + exit 1 +fi + +isReplicasInAllowedRange "${domainJson}" "${clusterName}" "${replicas}" replicasInAllowedRange range +if [ "${replicasInAllowedRange}" == 'false' ]; then + printError "Replicas value is not in the allowed range of ${range}. Exiting." + exit 1 +fi + +printInfo "Patching replicas for cluster '${clusterName}' to '${replicas}'." +createPatchJsonToUpdateReplicas "${domainJson}" "${clusterName}" "${replicas}" patchJson + +executePatchCommand "${kubernetesCli}" "${domainUid}" "${domainNamespace}" "${patchJson}" "${verboseMode}" + +printInfo "Successfully patched replicas for cluster '${clusterName}'!" diff --git a/OracleWebCenterPortal/kubernetes/domain-lifecycle/startCluster.sh b/OracleWebCenterPortal/kubernetes/domain-lifecycle/startCluster.sh old mode 100644 new mode 100755 index 5c8bf034c..7e22f9e0a --- a/OracleWebCenterPortal/kubernetes/domain-lifecycle/startCluster.sh +++ b/OracleWebCenterPortal/kubernetes/domain-lifecycle/startCluster.sh @@ -1,129 +1,129 @@ -# !/bin/sh -# 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. -# - -script="${BASH_SOURCE[0]}" -scriptDir="$( cd "$( dirname "${script}" )" && pwd )" -source ${scriptDir}/helper.sh -if [ "${debug}" == "true" ]; then set -x; fi; - -function usage() { - - cat << EOF - - This script starts a WebLogic cluster in a domain by patching - 'spec.clusters[].serverStartPolicy' attribute of the domain - resource to 'IF_NEEDED'. This change will cause the operator to initiate - startup of cluster's WebLogic server instance pods if the pods are not - already running and the spec.replicas or - 'spec.clusters[].serverStartPolicy' is set higher than zero. - - Usage: - - $(basename $0) -c mycluster [-n mynamespace] [-d mydomainuid] [-m kubecli] - - -c : Cluster name (required parameter). - - -d : Domain unique-id. Default is 'sample-domain1'. - - -n : Domain namespace. Default is 'sample-domain1-ns'. - - -m : Kubernetes command line interface. Default is 'kubectl' if KUBERNETES_CLI env - variable is not set. Otherwise default is the value of KUBERNETES_CLI env variable. - - -v : Enables verbose mode. Default is 'false'. - - -h : This help. - -EOF -exit $1 -} - -set -eu - -kubernetesCli=${KUBERNETES_CLI:-kubectl} -clusterName="" -domainUid="sample-domain1" -domainNamespace="sample-domain1-ns" -verboseMode=false -patchJson="" - -while getopts "vc:n:m:d:h" opt; do - case $opt in - c) clusterName="${OPTARG}" - ;; - n) domainNamespace="${OPTARG}" - ;; - d) domainUid="${OPTARG}" - ;; - m) kubernetesCli="${OPTARG}" - ;; - v) verboseMode=true; - ;; - h) usage 0 - ;; - *) usage 1 - ;; - esac -done - -# -# Function to perform validations, read files and initialize workspace -# -function initialize { - - validateErrors=false - - validateKubernetesCliAvailable - validateJqAvailable - - if [ -z "${clusterName}" ]; then - validationError "Please specify cluster name using '-c' parameter e.g. '-c cluster-1'." - fi - - failIfValidationErrors - -} - -initialize - -# Get the domain in json format -domainJson=$(${kubernetesCli} get domain ${domainUid} -n ${domainNamespace} -o json --ignore-not-found) -if [ -z "${domainJson}" ]; then - printError "Unable to get domain resource for domain '${domainUid}' in namespace '${domainNamespace}'. Please make sure the 'domain_uid' and 'namespace' specified by the '-d' and '-n' arguments are correct. Exiting." - exit 1 -fi - -isValidCluster="" -validateClusterName "${domainUid}" "${domainNamespace}" "${clusterName}" isValidCluster -if [ "${isValidCluster}" != 'true' ]; then - printError "cluster ${clusterName} is not part of domain ${domainUid} in namespace ${domainNamespace}. Please make sure that cluster name is correct." - exit 1 -fi - -getDomainPolicy "${domainJson}" domainStartPolicy -# Fail if effective start policy of domain is NEVER or ADMIN_ONLY -if [[ "${domainStartPolicy}" == 'NEVER' || "${domainStartPolicy}" == 'ADMIN_ONLY' ]]; then - printError "Cannot start cluster '${clusterName}', the domain is configured with a 'spec.serverStartPolicy' attribute on the domain resource of 'NEVER' or 'ADMIN_ONLY'." - exit 1 -fi - -# Get server start policy for this cluster -getClusterPolicy "${domainJson}" "${clusterName}" startPolicy -if [ -z "${startPolicy}" ]; then - startPolicy=${domainStartPolicy} -fi - -if [ "${startPolicy}" == 'IF_NEEDED' ]; then - printInfo "No changes needed, exiting. The cluster '${clusterName}' is already started or starting. The effective value of 'spec.clusters[?(clusterName=\"${clusterName}\"].serverStartPolicy' attribute on the domain resource is 'IF_NEEDED'." - exit 0 -fi - -# Set policy value to IF_NEEDED -printInfo "Patching start policy of cluster '${clusterName}' from '${startPolicy}' to 'IF_NEEDED'." -createPatchJsonToUpdateClusterPolicy "${domainJson}" "${clusterName}" "IF_NEEDED" patchJson - -executePatchCommand "${kubernetesCli}" "${domainUid}" "${domainNamespace}" "${patchJson}" "${verboseMode}" - -printInfo "Successfully patched cluster '${clusterName}' with 'IF_NEEDED' start policy!." +# !/bin/sh +# 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. +# + +script="${BASH_SOURCE[0]}" +scriptDir="$( cd "$( dirname "${script}" )" && pwd )" +source ${scriptDir}/helper.sh +if [ "${debug}" == "true" ]; then set -x; fi; + +function usage() { + + cat << EOF + + This script starts a WebLogic cluster in a domain by patching + 'spec.clusters[].serverStartPolicy' attribute of the domain + resource to 'IF_NEEDED'. This change will cause the operator to initiate + startup of cluster's WebLogic server instance pods if the pods are not + already running and the spec.replicas or + 'spec.clusters[].serverStartPolicy' is set higher than zero. + + Usage: + + $(basename $0) -c mycluster [-n mynamespace] [-d mydomainuid] [-m kubecli] + + -c : Cluster name (required parameter). + + -d : Domain unique-id. Default is 'sample-domain1'. + + -n : Domain namespace. Default is 'sample-domain1-ns'. + + -m : Kubernetes command line interface. Default is 'kubectl' if KUBERNETES_CLI env + variable is not set. Otherwise default is the value of KUBERNETES_CLI env variable. + + -v : Enables verbose mode. Default is 'false'. + + -h : This help. + +EOF +exit $1 +} + +set -eu + +kubernetesCli=${KUBERNETES_CLI:-kubectl} +clusterName="" +domainUid="sample-domain1" +domainNamespace="sample-domain1-ns" +verboseMode=false +patchJson="" + +while getopts "vc:n:m:d:h" opt; do + case $opt in + c) clusterName="${OPTARG}" + ;; + n) domainNamespace="${OPTARG}" + ;; + d) domainUid="${OPTARG}" + ;; + m) kubernetesCli="${OPTARG}" + ;; + v) verboseMode=true; + ;; + h) usage 0 + ;; + *) usage 1 + ;; + esac +done + +# +# Function to perform validations, read files and initialize workspace +# +function initialize { + + validateErrors=false + + validateKubernetesCliAvailable + validateJqAvailable + + if [ -z "${clusterName}" ]; then + validationError "Please specify cluster name using '-c' parameter e.g. '-c cluster-1'." + fi + + failIfValidationErrors + +} + +initialize + +# Get the domain in json format +domainJson=$(${kubernetesCli} get domain ${domainUid} -n ${domainNamespace} -o json --ignore-not-found) +if [ -z "${domainJson}" ]; then + printError "Unable to get domain resource for domain '${domainUid}' in namespace '${domainNamespace}'. Please make sure the 'domain_uid' and 'namespace' specified by the '-d' and '-n' arguments are correct. Exiting." + exit 1 +fi + +isValidCluster="" +validateClusterName "${domainUid}" "${domainNamespace}" "${clusterName}" isValidCluster +if [ "${isValidCluster}" != 'true' ]; then + printError "cluster ${clusterName} is not part of domain ${domainUid} in namespace ${domainNamespace}. Please make sure that cluster name is correct." + exit 1 +fi + +getDomainPolicy "${domainJson}" domainStartPolicy +# Fail if effective start policy of domain is NEVER or ADMIN_ONLY +if [[ "${domainStartPolicy}" == 'NEVER' || "${domainStartPolicy}" == 'ADMIN_ONLY' ]]; then + printError "Cannot start cluster '${clusterName}', the domain is configured with a 'spec.serverStartPolicy' attribute on the domain resource of 'NEVER' or 'ADMIN_ONLY'." + exit 1 +fi + +# Get server start policy for this cluster +getClusterPolicy "${domainJson}" "${clusterName}" startPolicy +if [ -z "${startPolicy}" ]; then + startPolicy=${domainStartPolicy} +fi + +if [ "${startPolicy}" == 'IF_NEEDED' ]; then + printInfo "No changes needed, exiting. The cluster '${clusterName}' is already started or starting. The effective value of 'spec.clusters[?(clusterName=\"${clusterName}\"].serverStartPolicy' attribute on the domain resource is 'IF_NEEDED'." + exit 0 +fi + +# Set policy value to IF_NEEDED +printInfo "Patching start policy of cluster '${clusterName}' from '${startPolicy}' to 'IF_NEEDED'." +createPatchJsonToUpdateClusterPolicy "${domainJson}" "${clusterName}" "IF_NEEDED" patchJson + +executePatchCommand "${kubernetesCli}" "${domainUid}" "${domainNamespace}" "${patchJson}" "${verboseMode}" + +printInfo "Successfully patched cluster '${clusterName}' with 'IF_NEEDED' start policy!." diff --git a/OracleWebCenterPortal/kubernetes/domain-lifecycle/startDomain.sh b/OracleWebCenterPortal/kubernetes/domain-lifecycle/startDomain.sh old mode 100644 new mode 100755 index fea9cbbe5..33b8180e3 --- a/OracleWebCenterPortal/kubernetes/domain-lifecycle/startDomain.sh +++ b/OracleWebCenterPortal/kubernetes/domain-lifecycle/startDomain.sh @@ -1,97 +1,97 @@ -# !/bin/sh -# 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. -# - -script="${BASH_SOURCE[0]}" -scriptDir="$( cd "$( dirname "${script}" )" && pwd )" -source ${scriptDir}/helper.sh - -function usage() { - - cat << EOF - - This script starts a deployed WebLogic domain by patching 'spec.serverStartPolicy' - attribute of the domain resource to 'IF_NEEDED'. This change will cause the operator - to initiate startup of domain's WebLogic server instance pods if the pods are not - already running. - - Usage: - - $(basename $0) [-n mynamespace] [-d mydomainuid] [-m kubecli] - - -d : Domain unique-id. Default is 'sample-domain1'. - - -n : Domain namespace. Default is 'sample-domain1-ns'. - - -m : Kubernetes command line interface. Default is 'kubectl' if KUBERNETES_CLI env - variable is not set. Otherwise default is the value of KUBERNETES_CLI env variable. - - -v : Enables verbose mode. Default is 'false'. - - -h : This help. - -EOF -exit $1 -} - -kubernetesCli=${KUBERNETES_CLI:-kubectl} -domainUid="sample-domain1" -domainNamespace="sample-domain1-ns" -verboseMode=false - -while getopts "vn:d:m:h" opt; do - case $opt in - n) domainNamespace="${OPTARG}" - ;; - d) domainUid="${OPTARG}" - ;; - m) kubernetesCli="${OPTARG}" - ;; - v) verboseMode=true; - ;; - h) usage 0 - ;; - *) usage 1 - ;; - esac -done - - -set -eu -set -o pipefail - -function initialize { - - validateErrors=false - - validateKubernetesCliAvailable - validateJqAvailable - - failIfValidationErrors -} - -initialize - -# Get the domain in json format -domainJson=$(${kubernetesCli} get domain ${domainUid} -n ${domainNamespace} -o json --ignore-not-found) - -if [ -z "${domainJson}" ]; then - printError "Domain resource for domain '${domainUid}' not found in namespace '${domainNamespace}'. Exiting." - exit 1 -fi - -getDomainPolicy "${domainJson}" serverStartPolicy - -if [ "${serverStartPolicy}" == 'IF_NEEDED' ]; then - printInfo "No changes needed, exiting. The domain '${domainUid}' is already started or starting. The effective value of 'spec.serverStartPolicy' attribute on the domain resource is 'IF_NEEDED'." - exit 0 -fi - -printInfo "Patching domain '${domainUid}' from serverStartPolicy='${serverStartPolicy}' to 'IF_NEEDED'." - -createPatchJsonToUpdateDomainPolicy "IF_NEEDED" patchJson - -executePatchCommand "${kubernetesCli}" "${domainUid}" "${domainNamespace}" "${patchJson}" "${verboseMode}" - -printInfo "Successfully patched domain '${domainUid}' in namespace '${domainNamespace}' with 'IF_NEEDED' start policy!" +# !/bin/sh +# 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. +# + +script="${BASH_SOURCE[0]}" +scriptDir="$( cd "$( dirname "${script}" )" && pwd )" +source ${scriptDir}/helper.sh + +function usage() { + + cat << EOF + + This script starts a deployed WebLogic domain by patching 'spec.serverStartPolicy' + attribute of the domain resource to 'IF_NEEDED'. This change will cause the operator + to initiate startup of domain's WebLogic server instance pods if the pods are not + already running. + + Usage: + + $(basename $0) [-n mynamespace] [-d mydomainuid] [-m kubecli] + + -d : Domain unique-id. Default is 'sample-domain1'. + + -n : Domain namespace. Default is 'sample-domain1-ns'. + + -m : Kubernetes command line interface. Default is 'kubectl' if KUBERNETES_CLI env + variable is not set. Otherwise default is the value of KUBERNETES_CLI env variable. + + -v : Enables verbose mode. Default is 'false'. + + -h : This help. + +EOF +exit $1 +} + +kubernetesCli=${KUBERNETES_CLI:-kubectl} +domainUid="sample-domain1" +domainNamespace="sample-domain1-ns" +verboseMode=false + +while getopts "vn:d:m:h" opt; do + case $opt in + n) domainNamespace="${OPTARG}" + ;; + d) domainUid="${OPTARG}" + ;; + m) kubernetesCli="${OPTARG}" + ;; + v) verboseMode=true; + ;; + h) usage 0 + ;; + *) usage 1 + ;; + esac +done + + +set -eu +set -o pipefail + +function initialize { + + validateErrors=false + + validateKubernetesCliAvailable + validateJqAvailable + + failIfValidationErrors +} + +initialize + +# Get the domain in json format +domainJson=$(${kubernetesCli} get domain ${domainUid} -n ${domainNamespace} -o json --ignore-not-found) + +if [ -z "${domainJson}" ]; then + printError "Domain resource for domain '${domainUid}' not found in namespace '${domainNamespace}'. Exiting." + exit 1 +fi + +getDomainPolicy "${domainJson}" serverStartPolicy + +if [ "${serverStartPolicy}" == 'IF_NEEDED' ]; then + printInfo "No changes needed, exiting. The domain '${domainUid}' is already started or starting. The effective value of 'spec.serverStartPolicy' attribute on the domain resource is 'IF_NEEDED'." + exit 0 +fi + +printInfo "Patching domain '${domainUid}' from serverStartPolicy='${serverStartPolicy}' to 'IF_NEEDED'." + +createPatchJsonToUpdateDomainPolicy "IF_NEEDED" patchJson + +executePatchCommand "${kubernetesCli}" "${domainUid}" "${domainNamespace}" "${patchJson}" "${verboseMode}" + +printInfo "Successfully patched domain '${domainUid}' in namespace '${domainNamespace}' with 'IF_NEEDED' start policy!" diff --git a/OracleWebCenterPortal/kubernetes/domain-lifecycle/startServer.sh b/OracleWebCenterPortal/kubernetes/domain-lifecycle/startServer.sh old mode 100644 new mode 100755 index 37b120d71..f56f936b9 --- a/OracleWebCenterPortal/kubernetes/domain-lifecycle/startServer.sh +++ b/OracleWebCenterPortal/kubernetes/domain-lifecycle/startServer.sh @@ -1,242 +1,242 @@ -# !/bin/sh -# 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 script starts a WebLogic managed server in a domain. -# Internal code notes :- -# - If server start policy is ALWAYS or policy is IF_NEEDED and the server is selected -# to start based on the replica count, it means that server is already started or is -# in the process of starting. In this case, script exits without making any changes. -# -# - If start policy of servers parent cluster or domain is 'NEVER', script -# fails as server can't be started. -# -# - If server is part of a cluster and keep_replica_constant option is false (the default) -# and the effective start policy of the server is IF_NEEDED and increasing replica count -# will naturally start the server, the script increases the replica count. -# -# - If server is part of a cluster and keep_replica_constant option is false (the default) -# and unsetting policy and increasing the replica count will start this server, script -# unsets the policy and increases replica count. For e.g. if replica count is 1 and -# start policy of server2 is NEVER, unsetting policy and increasing replica count will -# start server2. -# -# - If option to keep replica count constant ('-k') is selected and unsetting start policy -# will naturally start the server, script will unset the policy. For e.g. if replica count -# is 2 and start policy of server2 is NEVER, unsetting policy will start server2. -# -# - If above conditions are not true, it implies that either start policy is NEVER or policy -# is IF_NEEDED but server is not next in the order to start. In this case, script sets start -# policy to ALWAYS. For e.g. replica count is 3 and server10 needs to start. The script also -# increments the replica count by default. If option to keep replica count constant ('-k') -# is selected, it only sets the start policy to ALWAYS. -# - -script="${BASH_SOURCE[0]}" -scriptDir="$( cd "$( dirname "${script}" )" && pwd )" -source ${scriptDir}/helper.sh -if [ "${debug}" == "true" ]; then set -x; fi; -set -eu - -function usage() { - - cat << EOF - - This script starts a WebLogic server in a domain. For the managed servers, it either - increases the value of 'spec.clusters[].replicas' by '1' or updates the - 'spec.managedServers[].serverStartPolicy' attribute of the domain - resource or both as necessary for starting the server. For the administration server, it - updates the value of 'spec.adminServer.serverStartPolicy' attribute of the domain resource. - The 'spec.clusters[].replicas' value can be kept constant by using '-k' option. - Please see README.md for more details. - - Usage: - - $(basename $0) -s myserver [-n mynamespace] [-d mydomainuid] [-k] [-m kubecli] [-v] - - -s : The WebLogic server name (not the pod name). - This parameter is required. - - -d : Domain unique-id. Default is 'sample-domain1'. - - -n : Domain namespace. Default is 'sample-domain1-ns'. - - -k : Keep replica count constant for the clustered servers. The default behavior - is to increment the replica count for the clustered servers. This parameter - is ignored for the administration and non-clustered managed servers. - - -m : Kubernetes command line interface. Default is 'kubectl' if KUBERNETES_CLI env - variable is not set. Otherwise default is the value of KUBERNETES_CLI env variable. - - -v : Enables verbose mode. Default is 'false'. - - -h : This help. - -EOF -exit $1 -} - -kubernetesCli=${KUBERNETES_CLI:-kubectl} -serverName="" -clusterName="" -domainUid="sample-domain1" -domainNamespace="sample-domain1-ns" -keepReplicaConstant=false -verboseMode=false -withReplicas="CONSTANT" -withPolicy="CONSTANT" -managedServerPolicy="" -effectivePolicy="" -isValidServer="" -patchJson="" -serverStarted="" -startsByPolicyUnset="" -startsByReplicaIncreaseAndPolicyUnset="" -isAdminServer=false - -while getopts "vkd:n:m:s:h" opt; do - case $opt in - s) serverName="${OPTARG}" - ;; - n) domainNamespace="${OPTARG}" - ;; - d) domainUid="${OPTARG}" - ;; - k) keepReplicaConstant=true; - ;; - m) kubernetesCli="${OPTARG}" - ;; - v) verboseMode=true; - ;; - h) usage 0 - ;; - *) usage 1 - ;; - esac -done - -# -# Function to perform validations, read files and initialize workspace -# -function initialize { - - # Validate the required files exist - validateErrors=false - - validateKubernetesCliAvailable - validateJqAvailable - - # Validate that server name parameter is specified. - if [ -z "${serverName}" ]; then - validationError "Please specify a server name using '-s' parameter e.g. '-s managed-server1'." - fi - - failIfValidationErrors -} - -initialize - -# Get the domain in json format -domainJson=$(${kubernetesCli} get domain ${domainUid} -n ${domainNamespace} -o json --ignore-not-found) -if [ -z "${domainJson}" ]; then - printError "Unable to get domain resource for domain '${domainUid}' in namespace '${domainNamespace}'. Please make sure the 'domain_uid' and 'namespace' specified by the '-d' and '-n' arguments are correct. Exiting." - exit 1 -fi - -# Validate that specified server is either part of a cluster or is an independent managed server -validateServerAndFindCluster "${domainUid}" "${domainNamespace}" "${serverName}" isValidServer clusterName isAdminServer -if [ "${isValidServer}" != 'true' ]; then - printError "Server ${serverName} is not part of any cluster and it's not an independent managed server. Please make sure that server name specified is correct." - exit 1 -fi - -getClusterPolicy "${domainJson}" "${clusterName}" clusterPolicy -if [ "${clusterPolicy}" == 'NEVER' ]; then - printError "Cannot start server '${serverName}', the server's parent cluster '.spec.clusters[?(clusterName=\"${clusterName}\"].serverStartPolicy' in the domain resource is set to 'NEVER'." - exit 1 -fi - -getDomainPolicy "${domainJson}" domainPolicy -if [ "${domainPolicy}" == 'NEVER' ] || [[ "${domainPolicy}" == 'ADMIN_ONLY' && "${isAdminServer}" != 'true' ]]; then - printError "Cannot start server '${serverName}', the .spec.serverStartPolicy in the domain resource is set to 'NEVER' or 'ADMIN_ONLY'." - exit 1 -fi - -getEffectivePolicy "${domainJson}" "${serverName}" "${clusterName}" effectivePolicy -if [ "${isAdminServer}" == 'true' ]; then - getEffectiveAdminPolicy "${domainJson}" effectivePolicy - if [[ "${effectivePolicy}" == "IF_NEEDED" || "${effectivePolicy}" == "ALWAYS" ]]; then - printInfo "No changes needed, exiting. Server should be already starting or started because effective sever start policy is '${effectivePolicy}'." - exit 0 - fi -fi - -if [ -n "${clusterName}" ]; then - # Server is part of a cluster, check currently started servers - checkStartedServers "${domainJson}" "${serverName}" "${clusterName}" "${withReplicas}" "${withPolicy}" serverStarted - if [[ ${effectivePolicy} == "IF_NEEDED" && ${serverStarted} == "true" ]]; then - printInfo "No changes needed, exiting. The server should be already started or it's in the process of starting. The start policy for server ${serverName} is ${effectivePolicy} and server is chosen to be started based on current replica count." - exit 0 - elif [[ "${effectivePolicy}" == "ALWAYS" && ${serverStarted} == "true" ]]; then - printInfo "No changes needed, exiting. The server should be already started or it's in the process of starting. The start policy for server ${serverName} is ${effectivePolicy}." - exit 0 - fi -else - # Server is an independent managed server. - if [[ "${effectivePolicy}" == "ALWAYS" || "${effectivePolicy}" == "IF_NEEDED" ]]; then - printInfo "No changes needed, exiting. The server should be already started or it's in the process of starting. The start policy for server ${serverName} is ${effectivePolicy}." - exit 0 - fi -fi - -getServerPolicy "${domainJson}" "${serverName}" managedServerPolicy -createServerStartPolicyPatch "${domainJson}" "${serverName}" "ALWAYS" alwaysStartPolicyPatch - -# if server is part of a cluster and replica count will increase -if [[ -n ${clusterName} && "${keepReplicaConstant}" != 'true' ]]; then - #check if server starts by increasing replicas and unsetting policy - withReplicas="INCREASED" - withPolicy="UNSET" - checkStartedServers "${domainJson}" "${serverName}" "${clusterName}" "${withReplicas}" "${withPolicy}" startsByReplicaIncreaseAndPolicyUnset - createReplicaPatch "${domainJson}" "${clusterName}" "INCREMENT" incrementReplicaPatch replicaCount - if [[ -n ${managedServerPolicy} && ${startsByReplicaIncreaseAndPolicyUnset} == "true" ]]; then - # Server starts by increasing replicas and policy unset, increment and unset - printInfo "Unsetting the current start policy '${managedServerPolicy}' for '${serverName}' and incrementing replica count ${replicaCount}." - createPatchJsonToUnsetPolicyAndUpdateReplica "${domainJson}" "${serverName}" "${incrementReplicaPatch}" patchJson - elif [[ -z ${managedServerPolicy} && ${startsByReplicaIncreaseAndPolicyUnset} == "true" ]]; then - # Start policy is not set, server starts by increasing replicas based on effective policy, increment replicas - printInfo "Updating replica count for cluster '${clusterName}' to ${replicaCount}." - createPatchJsonToUpdateReplica "${incrementReplicaPatch}" patchJson - else - # Patch server policy to always and increment replicas - printInfo "Patching start policy of server '${serverName}' from '${effectivePolicy}' to 'ALWAYS' and \ -incrementing replica count for cluster '${clusterName}' to ${replicaCount}." - createPatchJsonToUpdateReplicaAndPolicy "${incrementReplicaPatch}" "${alwaysStartPolicyPatch}" patchJson - fi -elif [[ -n ${clusterName} && "${keepReplicaConstant}" == 'true' ]]; then - # Replica count needs to stay constant, check if server starts by unsetting policy - withReplicas="CONSTANT" - withPolicy="UNSET" - checkStartedServers "${domainJson}" "${serverName}" "${clusterName}" "${withReplicas}" "${withPolicy}" startsByPolicyUnset - if [[ "${effectivePolicy}" == "NEVER" && ${startsByPolicyUnset} == "true" ]]; then - # Server starts by unsetting policy, unset policy - printInfo "Unsetting the current start policy '${effectivePolicy}' for '${serverName}'." - createPatchJsonToUnsetPolicy "${domainJson}" "${serverName}" patchJson - else - # Patch server policy to always - printInfo "Patching start policy for '${serverName}' to 'ALWAYS'." - createPatchJsonToUpdatePolicy "${alwaysStartPolicyPatch}" patchJson - fi -elif [ "${isAdminServer}" == 'true' ]; then - printInfo "Patching start policy of '${serverName}' from '${effectivePolicy}' to 'IF_NEEDED'." - createPatchJsonToUpdateAdminPolicy "${domainJson}" "IF_NEEDED" patchJson -else - # Server is an independent managed server - printInfo "Unsetting the current start policy '${effectivePolicy}' for '${serverName}'." - createPatchJsonToUnsetPolicy "${domainJson}" "${serverName}" patchJson -fi - -executePatchCommand "${kubernetesCli}" "${domainUid}" "${domainNamespace}" "${patchJson}" "${verboseMode}" - -printInfo "Patch command succeeded !" +# !/bin/sh +# 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 script starts a WebLogic managed server in a domain. +# Internal code notes :- +# - If server start policy is ALWAYS or policy is IF_NEEDED and the server is selected +# to start based on the replica count, it means that server is already started or is +# in the process of starting. In this case, script exits without making any changes. +# +# - If start policy of servers parent cluster or domain is 'NEVER', script +# fails as server can't be started. +# +# - If server is part of a cluster and keep_replica_constant option is false (the default) +# and the effective start policy of the server is IF_NEEDED and increasing replica count +# will naturally start the server, the script increases the replica count. +# +# - If server is part of a cluster and keep_replica_constant option is false (the default) +# and unsetting policy and increasing the replica count will start this server, script +# unsets the policy and increases replica count. For e.g. if replica count is 1 and +# start policy of server2 is NEVER, unsetting policy and increasing replica count will +# start server2. +# +# - If option to keep replica count constant ('-k') is selected and unsetting start policy +# will naturally start the server, script will unset the policy. For e.g. if replica count +# is 2 and start policy of server2 is NEVER, unsetting policy will start server2. +# +# - If above conditions are not true, it implies that either start policy is NEVER or policy +# is IF_NEEDED but server is not next in the order to start. In this case, script sets start +# policy to ALWAYS. For e.g. replica count is 3 and server10 needs to start. The script also +# increments the replica count by default. If option to keep replica count constant ('-k') +# is selected, it only sets the start policy to ALWAYS. +# + +script="${BASH_SOURCE[0]}" +scriptDir="$( cd "$( dirname "${script}" )" && pwd )" +source ${scriptDir}/helper.sh +if [ "${debug}" == "true" ]; then set -x; fi; +set -eu + +function usage() { + + cat << EOF + + This script starts a WebLogic server in a domain. For the managed servers, it either + increases the value of 'spec.clusters[].replicas' by '1' or updates the + 'spec.managedServers[].serverStartPolicy' attribute of the domain + resource or both as necessary for starting the server. For the administration server, it + updates the value of 'spec.adminServer.serverStartPolicy' attribute of the domain resource. + The 'spec.clusters[].replicas' value can be kept constant by using '-k' option. + Please see README.md for more details. + + Usage: + + $(basename $0) -s myserver [-n mynamespace] [-d mydomainuid] [-k] [-m kubecli] [-v] + + -s : The WebLogic server name (not the pod name). + This parameter is required. + + -d : Domain unique-id. Default is 'sample-domain1'. + + -n : Domain namespace. Default is 'sample-domain1-ns'. + + -k : Keep replica count constant for the clustered servers. The default behavior + is to increment the replica count for the clustered servers. This parameter + is ignored for the administration and non-clustered managed servers. + + -m : Kubernetes command line interface. Default is 'kubectl' if KUBERNETES_CLI env + variable is not set. Otherwise default is the value of KUBERNETES_CLI env variable. + + -v : Enables verbose mode. Default is 'false'. + + -h : This help. + +EOF +exit $1 +} + +kubernetesCli=${KUBERNETES_CLI:-kubectl} +serverName="" +clusterName="" +domainUid="sample-domain1" +domainNamespace="sample-domain1-ns" +keepReplicaConstant=false +verboseMode=false +withReplicas="CONSTANT" +withPolicy="CONSTANT" +managedServerPolicy="" +effectivePolicy="" +isValidServer="" +patchJson="" +serverStarted="" +startsByPolicyUnset="" +startsByReplicaIncreaseAndPolicyUnset="" +isAdminServer=false + +while getopts "vkd:n:m:s:h" opt; do + case $opt in + s) serverName="${OPTARG}" + ;; + n) domainNamespace="${OPTARG}" + ;; + d) domainUid="${OPTARG}" + ;; + k) keepReplicaConstant=true; + ;; + m) kubernetesCli="${OPTARG}" + ;; + v) verboseMode=true; + ;; + h) usage 0 + ;; + *) usage 1 + ;; + esac +done + +# +# Function to perform validations, read files and initialize workspace +# +function initialize { + + # Validate the required files exist + validateErrors=false + + validateKubernetesCliAvailable + validateJqAvailable + + # Validate that server name parameter is specified. + if [ -z "${serverName}" ]; then + validationError "Please specify a server name using '-s' parameter e.g. '-s managed-server1'." + fi + + failIfValidationErrors +} + +initialize + +# Get the domain in json format +domainJson=$(${kubernetesCli} get domain ${domainUid} -n ${domainNamespace} -o json --ignore-not-found) +if [ -z "${domainJson}" ]; then + printError "Unable to get domain resource for domain '${domainUid}' in namespace '${domainNamespace}'. Please make sure the 'domain_uid' and 'namespace' specified by the '-d' and '-n' arguments are correct. Exiting." + exit 1 +fi + +# Validate that specified server is either part of a cluster or is an independent managed server +validateServerAndFindCluster "${domainUid}" "${domainNamespace}" "${serverName}" isValidServer clusterName isAdminServer +if [ "${isValidServer}" != 'true' ]; then + printError "Server ${serverName} is not part of any cluster and it's not an independent managed server. Please make sure that server name specified is correct." + exit 1 +fi + +getClusterPolicy "${domainJson}" "${clusterName}" clusterPolicy +if [ "${clusterPolicy}" == 'NEVER' ]; then + printError "Cannot start server '${serverName}', the server's parent cluster '.spec.clusters[?(clusterName=\"${clusterName}\"].serverStartPolicy' in the domain resource is set to 'NEVER'." + exit 1 +fi + +getDomainPolicy "${domainJson}" domainPolicy +if [ "${domainPolicy}" == 'NEVER' ] || [[ "${domainPolicy}" == 'ADMIN_ONLY' && "${isAdminServer}" != 'true' ]]; then + printError "Cannot start server '${serverName}', the .spec.serverStartPolicy in the domain resource is set to 'NEVER' or 'ADMIN_ONLY'." + exit 1 +fi + +getEffectivePolicy "${domainJson}" "${serverName}" "${clusterName}" effectivePolicy +if [ "${isAdminServer}" == 'true' ]; then + getEffectiveAdminPolicy "${domainJson}" effectivePolicy + if [[ "${effectivePolicy}" == "IF_NEEDED" || "${effectivePolicy}" == "ALWAYS" ]]; then + printInfo "No changes needed, exiting. Server should be already starting or started because effective sever start policy is '${effectivePolicy}'." + exit 0 + fi +fi + +if [ -n "${clusterName}" ]; then + # Server is part of a cluster, check currently started servers + checkStartedServers "${domainJson}" "${serverName}" "${clusterName}" "${withReplicas}" "${withPolicy}" serverStarted + if [[ ${effectivePolicy} == "IF_NEEDED" && ${serverStarted} == "true" ]]; then + printInfo "No changes needed, exiting. The server should be already started or it's in the process of starting. The start policy for server ${serverName} is ${effectivePolicy} and server is chosen to be started based on current replica count." + exit 0 + elif [[ "${effectivePolicy}" == "ALWAYS" && ${serverStarted} == "true" ]]; then + printInfo "No changes needed, exiting. The server should be already started or it's in the process of starting. The start policy for server ${serverName} is ${effectivePolicy}." + exit 0 + fi +else + # Server is an independent managed server. + if [[ "${effectivePolicy}" == "ALWAYS" || "${effectivePolicy}" == "IF_NEEDED" ]]; then + printInfo "No changes needed, exiting. The server should be already started or it's in the process of starting. The start policy for server ${serverName} is ${effectivePolicy}." + exit 0 + fi +fi + +getServerPolicy "${domainJson}" "${serverName}" managedServerPolicy +createServerStartPolicyPatch "${domainJson}" "${serverName}" "ALWAYS" alwaysStartPolicyPatch + +# if server is part of a cluster and replica count will increase +if [[ -n ${clusterName} && "${keepReplicaConstant}" != 'true' ]]; then + #check if server starts by increasing replicas and unsetting policy + withReplicas="INCREASED" + withPolicy="UNSET" + checkStartedServers "${domainJson}" "${serverName}" "${clusterName}" "${withReplicas}" "${withPolicy}" startsByReplicaIncreaseAndPolicyUnset + createReplicaPatch "${domainJson}" "${clusterName}" "INCREMENT" incrementReplicaPatch replicaCount + if [[ -n ${managedServerPolicy} && ${startsByReplicaIncreaseAndPolicyUnset} == "true" ]]; then + # Server starts by increasing replicas and policy unset, increment and unset + printInfo "Unsetting the current start policy '${managedServerPolicy}' for '${serverName}' and incrementing replica count ${replicaCount}." + createPatchJsonToUnsetPolicyAndUpdateReplica "${domainJson}" "${serverName}" "${incrementReplicaPatch}" patchJson + elif [[ -z ${managedServerPolicy} && ${startsByReplicaIncreaseAndPolicyUnset} == "true" ]]; then + # Start policy is not set, server starts by increasing replicas based on effective policy, increment replicas + printInfo "Updating replica count for cluster '${clusterName}' to ${replicaCount}." + createPatchJsonToUpdateReplica "${incrementReplicaPatch}" patchJson + else + # Patch server policy to always and increment replicas + printInfo "Patching start policy of server '${serverName}' from '${effectivePolicy}' to 'ALWAYS' and \ +incrementing replica count for cluster '${clusterName}' to ${replicaCount}." + createPatchJsonToUpdateReplicaAndPolicy "${incrementReplicaPatch}" "${alwaysStartPolicyPatch}" patchJson + fi +elif [[ -n ${clusterName} && "${keepReplicaConstant}" == 'true' ]]; then + # Replica count needs to stay constant, check if server starts by unsetting policy + withReplicas="CONSTANT" + withPolicy="UNSET" + checkStartedServers "${domainJson}" "${serverName}" "${clusterName}" "${withReplicas}" "${withPolicy}" startsByPolicyUnset + if [[ "${effectivePolicy}" == "NEVER" && ${startsByPolicyUnset} == "true" ]]; then + # Server starts by unsetting policy, unset policy + printInfo "Unsetting the current start policy '${effectivePolicy}' for '${serverName}'." + createPatchJsonToUnsetPolicy "${domainJson}" "${serverName}" patchJson + else + # Patch server policy to always + printInfo "Patching start policy for '${serverName}' to 'ALWAYS'." + createPatchJsonToUpdatePolicy "${alwaysStartPolicyPatch}" patchJson + fi +elif [ "${isAdminServer}" == 'true' ]; then + printInfo "Patching start policy of '${serverName}' from '${effectivePolicy}' to 'IF_NEEDED'." + createPatchJsonToUpdateAdminPolicy "${domainJson}" "IF_NEEDED" patchJson +else + # Server is an independent managed server + printInfo "Unsetting the current start policy '${effectivePolicy}' for '${serverName}'." + createPatchJsonToUnsetPolicy "${domainJson}" "${serverName}" patchJson +fi + +executePatchCommand "${kubernetesCli}" "${domainUid}" "${domainNamespace}" "${patchJson}" "${verboseMode}" + +printInfo "Patch command succeeded !" diff --git a/OracleWebCenterPortal/kubernetes/domain-lifecycle/stopCluster.sh b/OracleWebCenterPortal/kubernetes/domain-lifecycle/stopCluster.sh old mode 100644 new mode 100755 index 6e0410932..c391f8b4d --- a/OracleWebCenterPortal/kubernetes/domain-lifecycle/stopCluster.sh +++ b/OracleWebCenterPortal/kubernetes/domain-lifecycle/stopCluster.sh @@ -1,119 +1,119 @@ -# !/bin/sh -# 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. -# - -script="${BASH_SOURCE[0]}" -scriptDir="$( cd "$( dirname "${script}" )" && pwd )" -source ${scriptDir}/helper.sh -if [ "${debug}" == "true" ]; then set -x; fi; - -function usage() { - - cat << EOF - - This script stops a WebLogic cluster in a domain by patching - 'spec.clusters[].serverStartPolicy' attribute of the domain - resource to 'NEVER'. This change will cause the operator to initiate shutdown - of cluster's WebLogic server instance pods if the pods are running. - - Usage: - - $(basename $0) -c mycluster [-n mynamespace] [-d mydomainuid] [-m kubecli] - - -c : Cluster name (required parameter). - - -d : Domain unique-id. Default is 'sample-domain1'. - - -n : Domain namespace. Default is 'sample-domain1-ns'. - - -m : Kubernetes command line interface. Default is 'kubectl' if KUBERNETES_CLI env - variable is not set. Otherwise default is the value of KUBERNETES_CLI env variable. - - -v : Enables verbose mode. Default is 'false'. - - -h : This help. - -EOF -exit $1 -} - -kubernetesCli=${KUBERNETES_CLI:-kubectl} -clusterName="" -domainUid="sample-domain1" -domainNamespace="sample-domain1-ns" -verboseMode=false -patchJson="" - -while getopts "vc:n:m:d:h" opt; do - case $opt in - c) clusterName="${OPTARG}" - ;; - n) domainNamespace="${OPTARG}" - ;; - d) domainUid="${OPTARG}" - ;; - m) kubernetesCli="${OPTARG}" - ;; - v) verboseMode=true; - ;; - h) usage 0 - ;; - *) usage 1 - ;; - esac -done - -set -eu - -# -# Function to perform validations, read files and initialize workspace -# -function initialize { - - validateErrors=false - - validateKubernetesCliAvailable - validateJqAvailable - - if [ -z "${clusterName}" ]; then - validationError "Please specify cluster name using '-c' parameter e.g. '-c cluster-1'." - fi - - failIfValidationErrors -} - -initialize - -# Get the domain in json format -domainJson=$(${kubernetesCli} get domain ${domainUid} -n ${domainNamespace} -o json --ignore-not-found) -if [ -z "${domainJson}" ]; then - printError "Unable to get domain resource for domain '${domainUid}' in namespace '${domainNamespace}'. Please make sure the 'domain_uid' and 'namespace' specified by the '-d' and '-n' arguments are correct. Exiting." - exit 1 -fi - -isValidCluster="" -validateClusterName "${domainUid}" "${domainNamespace}" "${clusterName}" isValidCluster -if [ "${isValidCluster}" != 'true' ]; then - printError "cluster ${clusterName} is not part of domain ${domainUid} in namespace ${domainNamespace}. Please make sure that cluster name is correct." - exit 1 -fi - -# Get server start policy for this server -getClusterPolicy "${domainJson}" "${clusterName}" startPolicy -if [ -z "${startPolicy}" ]; then - getDomainPolicy "${domainJson}" startPolicy -fi - -if [[ "${startPolicy}" == 'NEVER' || "${startPolicy}" == 'ADMIN_ONLY' ]]; then - printInfo "No changes needed, exiting. The cluster '${clusterName}' is already stopped or stopping. The effective value of spec.clusters[?(clusterName="${clusterName}"].serverStartPolicy attribute on the domain resource is 'NEVER' or 'ADMIN_ONLY'." - exit 0 -fi - -# Set policy value to NEVER -printInfo "Patching start policy of cluster '${clusterName}' from '${startPolicy}' to 'NEVER'." -createPatchJsonToUpdateClusterPolicy "${domainJson}" "${clusterName}" "NEVER" patchJson - -executePatchCommand "${kubernetesCli}" "${domainUid}" "${domainNamespace}" "${patchJson}" "${verboseMode}" - -printInfo "Successfully patched cluster '${clusterName}' with 'NEVER' start policy!" +# !/bin/sh +# 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. +# + +script="${BASH_SOURCE[0]}" +scriptDir="$( cd "$( dirname "${script}" )" && pwd )" +source ${scriptDir}/helper.sh +if [ "${debug}" == "true" ]; then set -x; fi; + +function usage() { + + cat << EOF + + This script stops a WebLogic cluster in a domain by patching + 'spec.clusters[].serverStartPolicy' attribute of the domain + resource to 'NEVER'. This change will cause the operator to initiate shutdown + of cluster's WebLogic server instance pods if the pods are running. + + Usage: + + $(basename $0) -c mycluster [-n mynamespace] [-d mydomainuid] [-m kubecli] + + -c : Cluster name (required parameter). + + -d : Domain unique-id. Default is 'sample-domain1'. + + -n : Domain namespace. Default is 'sample-domain1-ns'. + + -m : Kubernetes command line interface. Default is 'kubectl' if KUBERNETES_CLI env + variable is not set. Otherwise default is the value of KUBERNETES_CLI env variable. + + -v : Enables verbose mode. Default is 'false'. + + -h : This help. + +EOF +exit $1 +} + +kubernetesCli=${KUBERNETES_CLI:-kubectl} +clusterName="" +domainUid="sample-domain1" +domainNamespace="sample-domain1-ns" +verboseMode=false +patchJson="" + +while getopts "vc:n:m:d:h" opt; do + case $opt in + c) clusterName="${OPTARG}" + ;; + n) domainNamespace="${OPTARG}" + ;; + d) domainUid="${OPTARG}" + ;; + m) kubernetesCli="${OPTARG}" + ;; + v) verboseMode=true; + ;; + h) usage 0 + ;; + *) usage 1 + ;; + esac +done + +set -eu + +# +# Function to perform validations, read files and initialize workspace +# +function initialize { + + validateErrors=false + + validateKubernetesCliAvailable + validateJqAvailable + + if [ -z "${clusterName}" ]; then + validationError "Please specify cluster name using '-c' parameter e.g. '-c cluster-1'." + fi + + failIfValidationErrors +} + +initialize + +# Get the domain in json format +domainJson=$(${kubernetesCli} get domain ${domainUid} -n ${domainNamespace} -o json --ignore-not-found) +if [ -z "${domainJson}" ]; then + printError "Unable to get domain resource for domain '${domainUid}' in namespace '${domainNamespace}'. Please make sure the 'domain_uid' and 'namespace' specified by the '-d' and '-n' arguments are correct. Exiting." + exit 1 +fi + +isValidCluster="" +validateClusterName "${domainUid}" "${domainNamespace}" "${clusterName}" isValidCluster +if [ "${isValidCluster}" != 'true' ]; then + printError "cluster ${clusterName} is not part of domain ${domainUid} in namespace ${domainNamespace}. Please make sure that cluster name is correct." + exit 1 +fi + +# Get server start policy for this server +getClusterPolicy "${domainJson}" "${clusterName}" startPolicy +if [ -z "${startPolicy}" ]; then + getDomainPolicy "${domainJson}" startPolicy +fi + +if [[ "${startPolicy}" == 'NEVER' || "${startPolicy}" == 'ADMIN_ONLY' ]]; then + printInfo "No changes needed, exiting. The cluster '${clusterName}' is already stopped or stopping. The effective value of spec.clusters[?(clusterName="${clusterName}"].serverStartPolicy attribute on the domain resource is 'NEVER' or 'ADMIN_ONLY'." + exit 0 +fi + +# Set policy value to NEVER +printInfo "Patching start policy of cluster '${clusterName}' from '${startPolicy}' to 'NEVER'." +createPatchJsonToUpdateClusterPolicy "${domainJson}" "${clusterName}" "NEVER" patchJson + +executePatchCommand "${kubernetesCli}" "${domainUid}" "${domainNamespace}" "${patchJson}" "${verboseMode}" + +printInfo "Successfully patched cluster '${clusterName}' with 'NEVER' start policy!" diff --git a/OracleWebCenterPortal/kubernetes/domain-lifecycle/stopDomain.sh b/OracleWebCenterPortal/kubernetes/domain-lifecycle/stopDomain.sh old mode 100644 new mode 100755 index d62f6b280..7cc7a570b --- a/OracleWebCenterPortal/kubernetes/domain-lifecycle/stopDomain.sh +++ b/OracleWebCenterPortal/kubernetes/domain-lifecycle/stopDomain.sh @@ -1,95 +1,95 @@ -# !/bin/sh -# 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. -# - -script="${BASH_SOURCE[0]}" -scriptDir="$( cd "$( dirname "${script}" )" && pwd )" -source ${scriptDir}/helper.sh - -function usage() { - - cat << EOF - - This script stops a deployed WebLogic domain by patching - 'spec.serverStartPolicy' attribute of domain resource to 'NEVER'. - This change will cause the operator to initiate shutdown of the - domain's WebLogic server instance pods if the pods are running. - - Usage: - - $(basename $0) [-n mynamespace] [-d mydomainuid] [-m kubecli] - - -d : Domain unique-id. Default is 'sample-domain1'. - - -n : Domain namespace. Default is 'sample-domain1-ns'. - - -m : Kubernetes command line interface. Default is 'kubectl' if KUBERNETES_CLI env - variable is not set. Otherwise default is the value of KUBERNETES_CLI env variable. - - -v : Enables verbose mode. Default is 'false'. - - -h : This help. - -EOF -exit $1 -} - -kubernetesCli=${KUBERNETES_CLI:-kubectl} -domainUid="sample-domain1" -domainNamespace="sample-domain1-ns" -verboseMode=false - -while getopts "vn:d:m:h" opt; do - case $opt in - n) domainNamespace="${OPTARG}" - ;; - d) domainUid="${OPTARG}" - ;; - m) kubernetesCli="${OPTARG}" - ;; - v) verboseMode=true; - ;; - h) usage 0 - ;; - *) usage 1 - ;; - esac -done - -set -eu -set -o pipefail - -function initialize { - - validateErrors=false - - validateKubernetesCliAvailable - validateJqAvailable - failIfValidationErrors -} - -initialize - -# Get the domain in json format -domainJson=$(${kubernetesCli} get domain ${domainUid} -n ${domainNamespace} -o json --ignore-not-found) - -if [ -z "${domainJson}" ]; then - printError "Domain resource for domain '${domainUid}' not found in namespace '${domainNamespace}'. Exiting." - exit 1 -fi - -getDomainPolicy "${domainJson}" serverStartPolicy - -if [ "${serverStartPolicy}" == 'NEVER' ]; then - printInfo "No changes needed, exiting. The domain '${domainUid}' is already stopped or stopping. The value of 'spec.serverStartPolicy' attribute on the domain resource is 'NEVER'." - exit 0 -fi - -printInfo "Patching domain '${domainUid}' in namespace '${domainNamespace}' from serverStartPolicy='${serverStartPolicy}' to 'NEVER'." - -createPatchJsonToUpdateDomainPolicy "NEVER" patchJson - -executePatchCommand "${kubernetesCli}" "${domainUid}" "${domainNamespace}" "${patchJson}" "${verboseMode}" - -printInfo "Successfully patched domain '${domainUid}' in namespace '${domainNamespace}' with 'NEVER' start policy!" +# !/bin/sh +# 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. +# + +script="${BASH_SOURCE[0]}" +scriptDir="$( cd "$( dirname "${script}" )" && pwd )" +source ${scriptDir}/helper.sh + +function usage() { + + cat << EOF + + This script stops a deployed WebLogic domain by patching + 'spec.serverStartPolicy' attribute of domain resource to 'NEVER'. + This change will cause the operator to initiate shutdown of the + domain's WebLogic server instance pods if the pods are running. + + Usage: + + $(basename $0) [-n mynamespace] [-d mydomainuid] [-m kubecli] + + -d : Domain unique-id. Default is 'sample-domain1'. + + -n : Domain namespace. Default is 'sample-domain1-ns'. + + -m : Kubernetes command line interface. Default is 'kubectl' if KUBERNETES_CLI env + variable is not set. Otherwise default is the value of KUBERNETES_CLI env variable. + + -v : Enables verbose mode. Default is 'false'. + + -h : This help. + +EOF +exit $1 +} + +kubernetesCli=${KUBERNETES_CLI:-kubectl} +domainUid="sample-domain1" +domainNamespace="sample-domain1-ns" +verboseMode=false + +while getopts "vn:d:m:h" opt; do + case $opt in + n) domainNamespace="${OPTARG}" + ;; + d) domainUid="${OPTARG}" + ;; + m) kubernetesCli="${OPTARG}" + ;; + v) verboseMode=true; + ;; + h) usage 0 + ;; + *) usage 1 + ;; + esac +done + +set -eu +set -o pipefail + +function initialize { + + validateErrors=false + + validateKubernetesCliAvailable + validateJqAvailable + failIfValidationErrors +} + +initialize + +# Get the domain in json format +domainJson=$(${kubernetesCli} get domain ${domainUid} -n ${domainNamespace} -o json --ignore-not-found) + +if [ -z "${domainJson}" ]; then + printError "Domain resource for domain '${domainUid}' not found in namespace '${domainNamespace}'. Exiting." + exit 1 +fi + +getDomainPolicy "${domainJson}" serverStartPolicy + +if [ "${serverStartPolicy}" == 'NEVER' ]; then + printInfo "No changes needed, exiting. The domain '${domainUid}' is already stopped or stopping. The value of 'spec.serverStartPolicy' attribute on the domain resource is 'NEVER'." + exit 0 +fi + +printInfo "Patching domain '${domainUid}' in namespace '${domainNamespace}' from serverStartPolicy='${serverStartPolicy}' to 'NEVER'." + +createPatchJsonToUpdateDomainPolicy "NEVER" patchJson + +executePatchCommand "${kubernetesCli}" "${domainUid}" "${domainNamespace}" "${patchJson}" "${verboseMode}" + +printInfo "Successfully patched domain '${domainUid}' in namespace '${domainNamespace}' with 'NEVER' start policy!" diff --git a/OracleWebCenterPortal/kubernetes/domain-lifecycle/stopServer.sh b/OracleWebCenterPortal/kubernetes/domain-lifecycle/stopServer.sh old mode 100644 new mode 100755 index ec35b4d97..2f2619c7e --- a/OracleWebCenterPortal/kubernetes/domain-lifecycle/stopServer.sh +++ b/OracleWebCenterPortal/kubernetes/domain-lifecycle/stopServer.sh @@ -1,248 +1,248 @@ -# !/bin/sh -# 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 script stops a WebLogic managed server in a domain. -# Internal code notes :- -# - If server start policy is NEVER or policy is IF_NEEDED and the server is not -# selected to start based on the replica count, it means that server is already -# stopped or is in the process of stopping. In this case, script exits without -# making any changes. -# -# - If server is part of a cluster and keep_replica_constant option is false (the default) -# and the effective start policy of the server is IF_NEEDED and decreasing replica count -# will naturally stop the server, the script decreases the replica count. -# -# - If server is part of a cluster and keep_replica_constant option is false (the default) -# and unsetting policy and decreasing the replica count will stop the server, script -# unsets the policy and decreases replica count. For e.g. if replica count is 2 and -# start policy of server2 is ALWAYS, unsetting policy and decreasing replica count will -# stop server2. -# -# - If option to keep replica count constant ('-k') is selected and unsetting start policy -# will naturally stop the server, script will unset the policy. For e.g. if replica count -# is 1 and start policy of server2 is ALWAYS, unsetting policy will stop server2. -# -# - If above conditions are not true, it implies that server policy is IF_NEEDED and server -# is selected to start. In this case, script sets start policy to NEVER. For e.g. replica -# count is 2 and server1 needs to be stopped. The script also decrements the replica count -# by default. If option to keep replica count constant ('-k') is selected, it only sets the -# start policy to NEVER. -# - -script="${BASH_SOURCE[0]}" -scriptDir="$( cd "$( dirname "${script}" )" && pwd )" -source ${scriptDir}/helper.sh -if [ "${debug}" == "true" ]; then set -x; fi; -set -eu - -function usage() { - - cat << EOF - - This script stops a running WebLogic server in a domain. For managed servers, it either - decreases the value of 'spec.clusters[].replicas' or updates the - 'spec.managedServers[].serverStartPolicy' attribute of the domain - resource or both as necessary to stop the server. For the administration server, it updates - the value of 'spec.adminServer.serverStartPolicy' attribute of the domain resource. The - 'spec.clusters[].replicas' value can be kept constant by using '-k' option. - Please see README.md for more details. - - Usage: - - $(basename $0) -s myserver [-n mynamespace] [-d mydomainuid] [-k] [-m kubecli] [-v] - - -s : The WebLogic server name (not the pod name). - This parameter is required. - - -d : Domain unique-id. Default is 'sample-domain1'. - - -n : Domain namespace. Default is 'sample-domain1-ns'. - - -k : Keep replica count constant for the clustered servers. The default behavior - is to decrement the replica count for the clustered servers. This parameter - is ignored for the administration and non-clustered managed servers. - - -m : Kubernetes command line interface. Default is 'kubectl' if KUBERNETES_CLI env - variable is not set. Otherwise default is the value of KUBERNETES_CLI env variable. - - -v : Enables verbose mode. Default is 'false'. - - -h : This help. - -EOF -exit $1 -} - -kubernetesCli=${KUBERNETES_CLI:-kubectl} -serverName="" -clusterName="" -domainUid="sample-domain1" -domainNamespace="sample-domain1-ns" -keepReplicaConstant=false -verboseMode=false -serverStartPolicy=NEVER -serverStarted="" -effectivePolicy="" -managedServerPolicy="" -stoppedWhenAlwaysPolicyReset="" -replicasEqualsMinReplicas="" -withReplicas="CONSTANT" -withPolicy="CONSTANT" -patchJson="" -isAdminServer=false - -while getopts "vks:m:n:d:h" opt; do - case $opt in - s) serverName="${OPTARG}" - ;; - n) domainNamespace="${OPTARG}" - ;; - m) kubernetesCli="${OPTARG}" - ;; - d) domainUid="${OPTARG}" - ;; - k) keepReplicaConstant=true; - ;; - v) verboseMode=true; - ;; - h) usage 0 - ;; - *) usage 1 - ;; - esac -done - -# -# Function to perform validations, read files and initialize workspace -# -function initialize { - - validateErrors=false - - validateKubernetesCliAvailable - validateJqAvailable - - # Validate that server name parameter is specified. - if [ -z "${serverName}" ]; then - validationError "Please specify the server name using '-s' parameter e.g. '-s managed-server1'." - fi - - failIfValidationErrors -} - -initialize - -# Get the domain in json format -domainJson=$(${kubernetesCli} get domain ${domainUid} -n ${domainNamespace} -o json --ignore-not-found) -if [ -z "${domainJson}" ]; then - printError "Unable to get domain resource for domain '${domainUid}' in namespace '${domainNamespace}'. Please make sure the 'domain_uid' and 'namespace' specified by the '-d' and '-n' arguments are correct. Exiting." - exit 1 -fi - -# Validate that specified server is either part of a cluster or is an independent managed server -validateServerAndFindCluster "${domainUid}" "${domainNamespace}" "${serverName}" isValidServer clusterName isAdminServer -if [ "${isValidServer}" != 'true' ]; then - printError "Server ${serverName} is not part of any cluster and it's not an independent managed server. Please make sure that server name specified is correct." - exit 1 -fi - -getEffectivePolicy "${domainJson}" "${serverName}" "${clusterName}" effectivePolicy -if [ "${isAdminServer}" == 'true' ]; then - getEffectiveAdminPolicy "${domainJson}" effectivePolicy - if [ "${effectivePolicy}" == "NEVER" ]; then - printInfo "No changes needed, exiting. Server should be already stopping or stopped because effective sever start policy is 'NEVER'." - exit 0 - fi -fi - -if [ -n "${clusterName}" ]; then - # Server is part of a cluster, check currently started servers - checkStartedServers "${domainJson}" "${serverName}" "${clusterName}" "${withReplicas}" "${withPolicy}" serverStarted - if [[ "${effectivePolicy}" == "NEVER" || "${effectivePolicy}" == "ADMIN_ONLY" || "${serverStarted}" != "true" ]]; then - printInfo "No changes needed, exiting. Server should be already stopping or stopped. This is either because of the sever start policy or server is chosen to be stopped based on current replica count." - exit 0 - fi -else - # Server is an independent managed server. - if [ "${effectivePolicy}" == "NEVER" ] || [[ "${effectivePolicy}" == "ADMIN_ONLY" && "${isAdminServer}" != 'true' ]]; then - printInfo "No changes needed, exiting. Server should be already stopping or stopped because effective sever start policy is 'NEVER' or 'ADMIN_ONLY'." - exit 0 - fi -fi - -if [[ -n "${clusterName}" && "${keepReplicaConstant}" == 'false' ]]; then - # check if replica count can decrease below current value - isReplicaCountEqualToMinReplicas "${domainJson}" "${clusterName}" replicasEqualsMinReplicas - if [ "${replicasEqualsMinReplicas}" == 'true' ]; then - printInfo "Not decreasing the replica count value: it is at its minimum. \ - (See 'domain.spec.allowReplicasBelowMinDynClusterSize' and \ - 'domain.status.clusters[].minimumReplicas' for details)." - keepReplicaConstant=true - fi -fi - -# Create server start policy patch with NEVER value -createServerStartPolicyPatch "${domainJson}" "${serverName}" "${serverStartPolicy}" neverStartPolicyPatch -getServerPolicy "${domainJson}" "${serverName}" managedServerPolicy -if [ -n "${managedServerPolicy}" ]; then - effectivePolicy=${managedServerPolicy} -fi -if [[ -n "${clusterName}" && "${effectivePolicy}" == "ALWAYS" ]]; then - # Server is part of a cluster and start policy is ALWAYS. - withReplicas="CONSTANT" - withPolicy="UNSET" - checkStartedServers "${domainJson}" "${serverName}" "${clusterName}" "${withReplicas}" "${withPolicy}" startedWhenAlwaysPolicyReset -fi - -if [[ -n "${clusterName}" && "${keepReplicaConstant}" != 'true' ]]; then - # server is part of a cluster and replica count will decrease - withReplicas="DECREASED" - withPolicy="UNSET" - checkStartedServers "${domainJson}" "${serverName}" "${clusterName}" "${withReplicas}" "${withPolicy}" startedWhenRelicaReducedAndPolicyReset - createReplicaPatch "${domainJson}" "${clusterName}" "DECREMENT" replicaPatch replicaCount - - if [[ -n ${managedServerPolicy} && "${startedWhenRelicaReducedAndPolicyReset}" != "true" ]]; then - # Server shuts down by unsetting start policy and decrementing replica count, unset and decrement - printInfo "Unsetting the current start policy '${managedServerPolicy}' for '${serverName}' \ - and decrementing replica count to ${replicaCount}." - createPatchJsonToUnsetPolicyAndUpdateReplica "${domainJson}" "${serverName}" "${replicaPatch}" patchJson - elif [[ -z ${managedServerPolicy} && "${startedWhenRelicaReducedAndPolicyReset}" != "true" ]]; then - # Start policy is not set, server shuts down by decrementing replica count, decrement replicas - printInfo "Updating replica count for cluster ${clusterName} to ${replicaCount}." - createPatchJsonToUpdateReplica "${replicaPatch}" patchJson - elif [[ ${managedServerPolicy} == "ALWAYS" && "${startedWhenAlwaysPolicyReset}" != "true" ]]; then - # Server shuts down by unsetting the start policy, unset and decrement replicas - printInfo "Unsetting the current start policy '${managedServerPolicy}' for '${serverName}' \ - and decrementing replica count to ${replicaCount}." - createPatchJsonToUnsetPolicyAndUpdateReplica "${domainJson}" "${serverName}" "${replicaPatch}" patchJson - else - # Patch server start policy to NEVER and decrement replica count - printInfo "Patching start policy of server '${serverName}' from '${effectivePolicy}' to 'NEVER' \ - and decrementing replica count for cluster '${clusterName}' to ${replicaCount}." - createPatchJsonToUpdateReplicaAndPolicy "${replicaPatch}" "${neverStartPolicyPatch}" patchJson - fi -elif [[ -n ${clusterName} && "${keepReplicaConstant}" == 'true' ]]; then - # Server is part of a cluster and replica count needs to stay constant - if [[ ${managedServerPolicy} == "ALWAYS" && "${startedWhenAlwaysPolicyReset}" != "true" ]]; then - # Server start policy is AlWAYS and server shuts down by unsetting the policy, unset policy - printInfo "Unsetting the current start policy '${effectivePolicy}' for '${serverName}'." - createPatchJsonToUnsetPolicy "${domainJson}" "${serverName}" patchJson - else - # Patch server start policy to NEVER - printInfo "Patching start policy of '${serverName}' from '${effectivePolicy}' to 'NEVER'." - createPatchJsonToUpdatePolicy "${neverStartPolicyPatch}" patchJson - fi -elif [ "${isAdminServer}" == 'true' ]; then - printInfo "Patching start policy of '${serverName}' from '${effectivePolicy}' to 'NEVER'." - createPatchJsonToUpdateAdminPolicy "${domainJson}" "${serverStartPolicy}" patchJson -else - # Server is an independent managed server, patch server start policy to NEVER - printInfo "Patching start policy of '${serverName}' from '${effectivePolicy}' to 'NEVER'." - createPatchJsonToUpdatePolicy "${neverStartPolicyPatch}" patchJson -fi - -executePatchCommand "${kubernetesCli}" "${domainUid}" "${domainNamespace}" "${patchJson}" "${verboseMode}" - -printInfo "Patch command succeeded !" +# !/bin/sh +# 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 script stops a WebLogic managed server in a domain. +# Internal code notes :- +# - If server start policy is NEVER or policy is IF_NEEDED and the server is not +# selected to start based on the replica count, it means that server is already +# stopped or is in the process of stopping. In this case, script exits without +# making any changes. +# +# - If server is part of a cluster and keep_replica_constant option is false (the default) +# and the effective start policy of the server is IF_NEEDED and decreasing replica count +# will naturally stop the server, the script decreases the replica count. +# +# - If server is part of a cluster and keep_replica_constant option is false (the default) +# and unsetting policy and decreasing the replica count will stop the server, script +# unsets the policy and decreases replica count. For e.g. if replica count is 2 and +# start policy of server2 is ALWAYS, unsetting policy and decreasing replica count will +# stop server2. +# +# - If option to keep replica count constant ('-k') is selected and unsetting start policy +# will naturally stop the server, script will unset the policy. For e.g. if replica count +# is 1 and start policy of server2 is ALWAYS, unsetting policy will stop server2. +# +# - If above conditions are not true, it implies that server policy is IF_NEEDED and server +# is selected to start. In this case, script sets start policy to NEVER. For e.g. replica +# count is 2 and server1 needs to be stopped. The script also decrements the replica count +# by default. If option to keep replica count constant ('-k') is selected, it only sets the +# start policy to NEVER. +# + +script="${BASH_SOURCE[0]}" +scriptDir="$( cd "$( dirname "${script}" )" && pwd )" +source ${scriptDir}/helper.sh +if [ "${debug}" == "true" ]; then set -x; fi; +set -eu + +function usage() { + + cat << EOF + + This script stops a running WebLogic server in a domain. For managed servers, it either + decreases the value of 'spec.clusters[].replicas' or updates the + 'spec.managedServers[].serverStartPolicy' attribute of the domain + resource or both as necessary to stop the server. For the administration server, it updates + the value of 'spec.adminServer.serverStartPolicy' attribute of the domain resource. The + 'spec.clusters[].replicas' value can be kept constant by using '-k' option. + Please see README.md for more details. + + Usage: + + $(basename $0) -s myserver [-n mynamespace] [-d mydomainuid] [-k] [-m kubecli] [-v] + + -s : The WebLogic server name (not the pod name). + This parameter is required. + + -d : Domain unique-id. Default is 'sample-domain1'. + + -n : Domain namespace. Default is 'sample-domain1-ns'. + + -k : Keep replica count constant for the clustered servers. The default behavior + is to decrement the replica count for the clustered servers. This parameter + is ignored for the administration and non-clustered managed servers. + + -m : Kubernetes command line interface. Default is 'kubectl' if KUBERNETES_CLI env + variable is not set. Otherwise default is the value of KUBERNETES_CLI env variable. + + -v : Enables verbose mode. Default is 'false'. + + -h : This help. + +EOF +exit $1 +} + +kubernetesCli=${KUBERNETES_CLI:-kubectl} +serverName="" +clusterName="" +domainUid="sample-domain1" +domainNamespace="sample-domain1-ns" +keepReplicaConstant=false +verboseMode=false +serverStartPolicy=NEVER +serverStarted="" +effectivePolicy="" +managedServerPolicy="" +stoppedWhenAlwaysPolicyReset="" +replicasEqualsMinReplicas="" +withReplicas="CONSTANT" +withPolicy="CONSTANT" +patchJson="" +isAdminServer=false + +while getopts "vks:m:n:d:h" opt; do + case $opt in + s) serverName="${OPTARG}" + ;; + n) domainNamespace="${OPTARG}" + ;; + m) kubernetesCli="${OPTARG}" + ;; + d) domainUid="${OPTARG}" + ;; + k) keepReplicaConstant=true; + ;; + v) verboseMode=true; + ;; + h) usage 0 + ;; + *) usage 1 + ;; + esac +done + +# +# Function to perform validations, read files and initialize workspace +# +function initialize { + + validateErrors=false + + validateKubernetesCliAvailable + validateJqAvailable + + # Validate that server name parameter is specified. + if [ -z "${serverName}" ]; then + validationError "Please specify the server name using '-s' parameter e.g. '-s managed-server1'." + fi + + failIfValidationErrors +} + +initialize + +# Get the domain in json format +domainJson=$(${kubernetesCli} get domain ${domainUid} -n ${domainNamespace} -o json --ignore-not-found) +if [ -z "${domainJson}" ]; then + printError "Unable to get domain resource for domain '${domainUid}' in namespace '${domainNamespace}'. Please make sure the 'domain_uid' and 'namespace' specified by the '-d' and '-n' arguments are correct. Exiting." + exit 1 +fi + +# Validate that specified server is either part of a cluster or is an independent managed server +validateServerAndFindCluster "${domainUid}" "${domainNamespace}" "${serverName}" isValidServer clusterName isAdminServer +if [ "${isValidServer}" != 'true' ]; then + printError "Server ${serverName} is not part of any cluster and it's not an independent managed server. Please make sure that server name specified is correct." + exit 1 +fi + +getEffectivePolicy "${domainJson}" "${serverName}" "${clusterName}" effectivePolicy +if [ "${isAdminServer}" == 'true' ]; then + getEffectiveAdminPolicy "${domainJson}" effectivePolicy + if [ "${effectivePolicy}" == "NEVER" ]; then + printInfo "No changes needed, exiting. Server should be already stopping or stopped because effective sever start policy is 'NEVER'." + exit 0 + fi +fi + +if [ -n "${clusterName}" ]; then + # Server is part of a cluster, check currently started servers + checkStartedServers "${domainJson}" "${serverName}" "${clusterName}" "${withReplicas}" "${withPolicy}" serverStarted + if [[ "${effectivePolicy}" == "NEVER" || "${effectivePolicy}" == "ADMIN_ONLY" || "${serverStarted}" != "true" ]]; then + printInfo "No changes needed, exiting. Server should be already stopping or stopped. This is either because of the sever start policy or server is chosen to be stopped based on current replica count." + exit 0 + fi +else + # Server is an independent managed server. + if [ "${effectivePolicy}" == "NEVER" ] || [[ "${effectivePolicy}" == "ADMIN_ONLY" && "${isAdminServer}" != 'true' ]]; then + printInfo "No changes needed, exiting. Server should be already stopping or stopped because effective sever start policy is 'NEVER' or 'ADMIN_ONLY'." + exit 0 + fi +fi + +if [[ -n "${clusterName}" && "${keepReplicaConstant}" == 'false' ]]; then + # check if replica count can decrease below current value + isReplicaCountEqualToMinReplicas "${domainJson}" "${clusterName}" replicasEqualsMinReplicas + if [ "${replicasEqualsMinReplicas}" == 'true' ]; then + printInfo "Not decreasing the replica count value: it is at its minimum. \ + (See 'domain.spec.allowReplicasBelowMinDynClusterSize' and \ + 'domain.status.clusters[].minimumReplicas' for details)." + keepReplicaConstant=true + fi +fi + +# Create server start policy patch with NEVER value +createServerStartPolicyPatch "${domainJson}" "${serverName}" "${serverStartPolicy}" neverStartPolicyPatch +getServerPolicy "${domainJson}" "${serverName}" managedServerPolicy +if [ -n "${managedServerPolicy}" ]; then + effectivePolicy=${managedServerPolicy} +fi +if [[ -n "${clusterName}" && "${effectivePolicy}" == "ALWAYS" ]]; then + # Server is part of a cluster and start policy is ALWAYS. + withReplicas="CONSTANT" + withPolicy="UNSET" + checkStartedServers "${domainJson}" "${serverName}" "${clusterName}" "${withReplicas}" "${withPolicy}" startedWhenAlwaysPolicyReset +fi + +if [[ -n "${clusterName}" && "${keepReplicaConstant}" != 'true' ]]; then + # server is part of a cluster and replica count will decrease + withReplicas="DECREASED" + withPolicy="UNSET" + checkStartedServers "${domainJson}" "${serverName}" "${clusterName}" "${withReplicas}" "${withPolicy}" startedWhenRelicaReducedAndPolicyReset + createReplicaPatch "${domainJson}" "${clusterName}" "DECREMENT" replicaPatch replicaCount + + if [[ -n ${managedServerPolicy} && "${startedWhenRelicaReducedAndPolicyReset}" != "true" ]]; then + # Server shuts down by unsetting start policy and decrementing replica count, unset and decrement + printInfo "Unsetting the current start policy '${managedServerPolicy}' for '${serverName}' \ + and decrementing replica count to ${replicaCount}." + createPatchJsonToUnsetPolicyAndUpdateReplica "${domainJson}" "${serverName}" "${replicaPatch}" patchJson + elif [[ -z ${managedServerPolicy} && "${startedWhenRelicaReducedAndPolicyReset}" != "true" ]]; then + # Start policy is not set, server shuts down by decrementing replica count, decrement replicas + printInfo "Updating replica count for cluster ${clusterName} to ${replicaCount}." + createPatchJsonToUpdateReplica "${replicaPatch}" patchJson + elif [[ ${managedServerPolicy} == "ALWAYS" && "${startedWhenAlwaysPolicyReset}" != "true" ]]; then + # Server shuts down by unsetting the start policy, unset and decrement replicas + printInfo "Unsetting the current start policy '${managedServerPolicy}' for '${serverName}' \ + and decrementing replica count to ${replicaCount}." + createPatchJsonToUnsetPolicyAndUpdateReplica "${domainJson}" "${serverName}" "${replicaPatch}" patchJson + else + # Patch server start policy to NEVER and decrement replica count + printInfo "Patching start policy of server '${serverName}' from '${effectivePolicy}' to 'NEVER' \ + and decrementing replica count for cluster '${clusterName}' to ${replicaCount}." + createPatchJsonToUpdateReplicaAndPolicy "${replicaPatch}" "${neverStartPolicyPatch}" patchJson + fi +elif [[ -n ${clusterName} && "${keepReplicaConstant}" == 'true' ]]; then + # Server is part of a cluster and replica count needs to stay constant + if [[ ${managedServerPolicy} == "ALWAYS" && "${startedWhenAlwaysPolicyReset}" != "true" ]]; then + # Server start policy is AlWAYS and server shuts down by unsetting the policy, unset policy + printInfo "Unsetting the current start policy '${effectivePolicy}' for '${serverName}'." + createPatchJsonToUnsetPolicy "${domainJson}" "${serverName}" patchJson + else + # Patch server start policy to NEVER + printInfo "Patching start policy of '${serverName}' from '${effectivePolicy}' to 'NEVER'." + createPatchJsonToUpdatePolicy "${neverStartPolicyPatch}" patchJson + fi +elif [ "${isAdminServer}" == 'true' ]; then + printInfo "Patching start policy of '${serverName}' from '${effectivePolicy}' to 'NEVER'." + createPatchJsonToUpdateAdminPolicy "${domainJson}" "${serverStartPolicy}" patchJson +else + # Server is an independent managed server, patch server start policy to NEVER + printInfo "Patching start policy of '${serverName}' from '${effectivePolicy}' to 'NEVER'." + createPatchJsonToUpdatePolicy "${neverStartPolicyPatch}" patchJson +fi + +executePatchCommand "${kubernetesCli}" "${domainUid}" "${domainNamespace}" "${patchJson}" "${verboseMode}" + +printInfo "Patch command succeeded !" diff --git a/OracleWebCenterPortal/kubernetes/elasticsearch-and-kibana/README.md b/OracleWebCenterPortal/kubernetes/elasticsearch-and-kibana/README.md old mode 100644 new mode 100755 index bd62bcc56..4f5953de0 --- a/OracleWebCenterPortal/kubernetes/elasticsearch-and-kibana/README.md +++ b/OracleWebCenterPortal/kubernetes/elasticsearch-and-kibana/README.md @@ -1,31 +1,31 @@ -# Sample to deploy Elasticsearch and Kibana - - -When you install the WebLogic operator Helm chart, you can set -`elkIntegrationEnabled` to `true` in your `values.yaml` file to tell the operator to send the contents of the operator's logs to Elasticsearch. - -Typically, you would have already configured Elasticsearch and Kibana in the -Kubernetes cluster, and also would have specified `elasticSearchHost` and `elasticSearchPort` in your `values.yaml` file to point to where Elasticsearch is already running. - -This sample configures the Elasticsearch and Kibana deployments and services. -It's useful for trying out the operator in a Kubernetes cluster that doesn't already -have them configured. - -It runs the Elastic Stack on the same host and port that the operator's Helm chart defaults -to, therefore, you only need to set `elkIntegrationEnabled` to `true` in your -`values.yaml` file. - -To control Elasticsearch memory parameters (Heap allocation and Enabling/Disabling swapping) please open the file `elasticsearch_and_kibana.yaml`, search for env variables of the elasticsearch container and change the values of the following. - -* ES_JAVA_OPTS: value may contain for example -Xms512m -Xmx512m to lower the default memory usage (please be aware that this value is only applicable for demo purpose and it is not the one recommended by Elasticsearch itself) -* bootstrap.memory_lock: value may contain true (enables the usage of mlockall to try to lock the process address space into RAM, preventing any Elasticsearch memory from being swapped out) or false (disables the usage of mlockall to try to lock the process address space into RAM, preventing any Elasticsearch memory from being swapped out). - -To install Elasticsearch and Kibana, use: -```shell -$ kubectl apply -f kubernetes/samples/scripts/elasticsearch-and-kibana/elasticsearch_and_kibana.yaml -``` - -To remove them, use: -```shell -$ kubectl delete -f kubernetes/samples/scripts/elasticsearch-and-kibana/elasticsearch_and_kibana.yaml -``` +# Sample to deploy Elasticsearch and Kibana + + +When you install the WebLogic operator Helm chart, you can set +`elkIntegrationEnabled` to `true` in your `values.yaml` file to tell the operator to send the contents of the operator's logs to Elasticsearch. + +Typically, you would have already configured Elasticsearch and Kibana in the +Kubernetes cluster, and also would have specified `elasticSearchHost` and `elasticSearchPort` in your `values.yaml` file to point to where Elasticsearch is already running. + +This sample configures the Elasticsearch and Kibana deployments and services. +It's useful for trying out the operator in a Kubernetes cluster that doesn't already +have them configured. + +It runs the Elastic Stack on the same host and port that the operator's Helm chart defaults +to, therefore, you only need to set `elkIntegrationEnabled` to `true` in your +`values.yaml` file. + +To control Elasticsearch memory parameters (Heap allocation and Enabling/Disabling swapping) please open the file `elasticsearch_and_kibana.yaml`, search for env variables of the elasticsearch container and change the values of the following. + +* ES_JAVA_OPTS: value may contain for example -Xms512m -Xmx512m to lower the default memory usage (please be aware that this value is only applicable for demo purpose and it is not the one recommended by Elasticsearch itself) +* bootstrap.memory_lock: value may contain true (enables the usage of mlockall to try to lock the process address space into RAM, preventing any Elasticsearch memory from being swapped out) or false (disables the usage of mlockall to try to lock the process address space into RAM, preventing any Elasticsearch memory from being swapped out). + +To install Elasticsearch and Kibana, use: +```shell +$ kubectl apply -f kubernetes/samples/scripts/elasticsearch-and-kibana/elasticsearch_and_kibana.yaml +``` + +To remove them, use: +```shell +$ kubectl delete -f kubernetes/samples/scripts/elasticsearch-and-kibana/elasticsearch_and_kibana.yaml +``` diff --git a/OracleWebCenterPortal/kubernetes/elasticsearch-and-kibana/elasticsearch_and_kibana.yaml b/OracleWebCenterPortal/kubernetes/elasticsearch-and-kibana/elasticsearch_and_kibana.yaml old mode 100644 new mode 100755 index 97b0b9186..bf3d276da --- a/OracleWebCenterPortal/kubernetes/elasticsearch-and-kibana/elasticsearch_and_kibana.yaml +++ b/OracleWebCenterPortal/kubernetes/elasticsearch-and-kibana/elasticsearch_and_kibana.yaml @@ -1,117 +1,117 @@ -# 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. - -# When a user installs the WebLogic operator Helm chart, the user can set -# elkIntegrationEnabled to true in their values.yaml to tell the operator to send the -# contents of the operator's log to Elasticsearch. -# -# Typically, a user would have already configured Elasticsearch and Kibana in the -# Kubernetes cluster, and also would specify elasticSearchHost and elasticSearchPort -# in their values.yaml file to point to where Elasticsearch is already running. -# -# This sample configures the Elasticsearch and Kibana deployments and services. -# It's useful for trying out the operator in a Kubernetes cluster that doesn't already -# have them configured. -# -# It runs Elasticstack on the same host and port that the operator's Helm chart defaults -# to, therefore, the customer only needs to set elkIntegrationEnabled to true in their -# values.yaml file. -# -# To configure them, use: -# kubectl apply -f kubernetes/samples/scripts/elasticsearch_and_kibana.yaml -# -# To remove them, use: -# kubectl delete -f kubernetes/samples/scripts/elasticsearch_and_kibana.yaml - ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - namespace: "default" - name: "elasticsearch" - labels: - app: "elasticsearch" -spec: - replicas: 1 - selector: - matchLabels: - app: "elasticsearch" - template: - metadata: - labels: - app: "elasticsearch" - spec: - initContainers: - - name: set-vm-max-map-count - image: busybox - imagePullPolicy: IfNotPresent - command: ['sysctl', '-w', 'vm.max_map_count=262144'] - securityContext: - privileged: true - containers: - - name: "elasticsearch" - image: "elasticsearch:6.8.0" - ports: - - containerPort: 9200 - - containerPort: 9300 - env: - - name: ES_JAVA_OPTS - value: -Xms1024m -Xmx1024m - ---- -kind: "Service" -apiVersion: "v1" -metadata: - namespace: "default" - name: "elasticsearch" -spec: - ports: - - name: "http" - protocol: "TCP" - port: 9200 - targetPort: 9200 - - name: "https" - protocol: "TCP" - port: 9300 - targetPort: 9300 - selector: - app: "elasticsearch" - ---- -apiVersion: "apps/v1" -kind: "Deployment" -metadata: - namespace: "default" - name: "kibana" - labels: - app: "kibana" -spec: - replicas: 1 - selector: - matchLabels: - app: "kibana" - template: - metadata: - labels: - app: "kibana" - spec: - containers: - - name: "kibana" - image: "kibana:6.8.0" - ports: - - containerPort: 5601 - ---- -apiVersion: "v1" -kind: "Service" -metadata: - namespace: "default" - name: "kibana" - labels: - app: "kibana" -spec: - type: "NodePort" - ports: - - port: 5601 - selector: - app: "kibana" +# 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. + +# When a user installs the WebLogic operator Helm chart, the user can set +# elkIntegrationEnabled to true in their values.yaml to tell the operator to send the +# contents of the operator's log to Elasticsearch. +# +# Typically, a user would have already configured Elasticsearch and Kibana in the +# Kubernetes cluster, and also would specify elasticSearchHost and elasticSearchPort +# in their values.yaml file to point to where Elasticsearch is already running. +# +# This sample configures the Elasticsearch and Kibana deployments and services. +# It's useful for trying out the operator in a Kubernetes cluster that doesn't already +# have them configured. +# +# It runs Elasticstack on the same host and port that the operator's Helm chart defaults +# to, therefore, the customer only needs to set elkIntegrationEnabled to true in their +# values.yaml file. +# +# To configure them, use: +# kubectl apply -f kubernetes/samples/scripts/elasticsearch_and_kibana.yaml +# +# To remove them, use: +# kubectl delete -f kubernetes/samples/scripts/elasticsearch_and_kibana.yaml + +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + namespace: "default" + name: "elasticsearch" + labels: + app: "elasticsearch" +spec: + replicas: 1 + selector: + matchLabels: + app: "elasticsearch" + template: + metadata: + labels: + app: "elasticsearch" + spec: + initContainers: + - name: set-vm-max-map-count + image: busybox + imagePullPolicy: IfNotPresent + command: ['sysctl', '-w', 'vm.max_map_count=262144'] + securityContext: + privileged: true + containers: + - name: "elasticsearch" + image: "elasticsearch:6.8.0" + ports: + - containerPort: 9200 + - containerPort: 9300 + env: + - name: ES_JAVA_OPTS + value: -Xms1024m -Xmx1024m + +--- +kind: "Service" +apiVersion: "v1" +metadata: + namespace: "default" + name: "elasticsearch" +spec: + ports: + - name: "http" + protocol: "TCP" + port: 9200 + targetPort: 9200 + - name: "https" + protocol: "TCP" + port: 9300 + targetPort: 9300 + selector: + app: "elasticsearch" + +--- +apiVersion: "apps/v1" +kind: "Deployment" +metadata: + namespace: "default" + name: "kibana" + labels: + app: "kibana" +spec: + replicas: 1 + selector: + matchLabels: + app: "kibana" + template: + metadata: + labels: + app: "kibana" + spec: + containers: + - name: "kibana" + image: "kibana:6.8.0" + ports: + - containerPort: 5601 + +--- +apiVersion: "v1" +kind: "Service" +metadata: + namespace: "default" + name: "kibana" + labels: + app: "kibana" +spec: + type: "NodePort" + ports: + - port: 5601 + selector: + app: "kibana" diff --git a/OracleWebCenterPortal/kubernetes/logging-services/logstash/README.md b/OracleWebCenterPortal/kubernetes/logging-services/logstash/README.md old mode 100644 new mode 100755 index fb55c56df..373eeacf5 --- a/OracleWebCenterPortal/kubernetes/logging-services/logstash/README.md +++ b/OracleWebCenterPortal/kubernetes/logging-services/logstash/README.md @@ -1,59 +1,59 @@ -## Publish OracleWebCenterPortal server and diagnostics logs into Elasticsearch - -## Prerequisites -See [here](https://oracle.github.io/weblogic-kubernetes-operator/samples/simple/elastic-stack/) for the steps to integrate Elasticsearch for the WebLogic Kubernetes operator. - -Before deploying the WebLogic Kubernetes operator edit `values.yaml` in weblogic-kubernetes-operator/kubernetes/charts/weblogic-operator/ to enable elastic search integration. -Configure the following variables: -```bash -# elkIntegrationEnabled specifies whether or not ELK integration is enabled. -elkIntegrationEnabled: true -# logStashImage specifies the docker 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 -``` -Deployment of WebLogic Kubernetes operator with above changes, will create an additional logstash container as sidecar. This logstash container will push the operator logs to the configured Elasticsearch server. - -### WebLogic Server logs - -The WebLogic server logs or diagnostics logs can be pushed to Elasticsearch server using logstash pod. The logstash pod should have access to the shared domain home or the log location. The persistent volume of the domain home can be used in the logstash pod. - -### Create the logstash pod - -1. Get Domain home persistence volume claim details -Get the persistent volume details of the domain home of the WebLogic server(s). - - ```bash - $ kubectl get pvc -n wcpns - ``` - -1. Create logstash configuration. -Create logstash configuration file. The logstash configuration file can be loaded from a volume. - ```bash - $ kubectl cp logstash.conf wcpns/wcp-domain-adminserver:/u01/oracle/user_projects/domains --namespace wcpns - ``` - - You can use sample logstash configuration file generated to push server and diagnostic logs of all servers available at DOMAIN_HOME/servers//logs/-diagnostic.log - -1. Copy the logstash.conf into say /u01/oracle/user_projects/domains so that it can be used for logstash deployment, using Administration Server pod - -1. Create deployment YAML for logstash pod. -You can use sample logstash.yaml file generated to create deployment for logstash pod. The mounted persistent volume of the domain home will provide access to the WebLogic server logs to logstash pod. -Make sure to point the logstash configuration file to correct location and also correct domain home persistence volume claim. - -1. Deploy logstash to start publish logs to Elasticsearch: - - ```bash - $ kubectl create -f logstash.yaml - ``` - -1. Now, you can view the diagnostics logs using Kibana with index pattern `logstash-*`. - +## Publish OracleWebCenterPortal server and diagnostics logs into Elasticsearch + +## Prerequisites +See [here](https://oracle.github.io/weblogic-kubernetes-operator/samples/simple/elastic-stack/) for the steps to integrate Elasticsearch for the WebLogic Kubernetes operator. + +Before deploying the WebLogic Kubernetes operator edit `values.yaml` in weblogic-kubernetes-operator/kubernetes/charts/weblogic-operator/ to enable elastic search integration. +Configure the following variables: +```bash +# elkIntegrationEnabled specifies whether or not ELK integration is enabled. +elkIntegrationEnabled: true +# logStashImage specifies the docker 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 +``` +Deployment of WebLogic Kubernetes operator with above changes, will create an additional logstash container as sidecar. This logstash container will push the operator logs to the configured Elasticsearch server. + +### WebLogic Server logs + +The WebLogic server logs or diagnostics logs can be pushed to Elasticsearch server using logstash pod. The logstash pod should have access to the shared domain home or the log location. The persistent volume of the domain home can be used in the logstash pod. + +### Create the logstash pod + +1. Get Domain home persistence volume claim details +Get the persistent volume details of the domain home of the WebLogic server(s). + + ```bash + $ kubectl get pvc -n wcpns + ``` + +1. Create logstash configuration. +Create logstash configuration file. The logstash configuration file can be loaded from a volume. + ```bash + $ kubectl cp logstash.conf wcpns/wcp-domain-adminserver:/u01/oracle/user_projects/domains --namespace wcpns + ``` + + You can use sample logstash configuration file generated to push server and diagnostic logs of all servers available at DOMAIN_HOME/servers//logs/-diagnostic.log + +1. Copy the logstash.conf into say /u01/oracle/user_projects/domains so that it can be used for logstash deployment, using Administration Server pod + +1. Create deployment YAML for logstash pod. +You can use sample logstash.yaml file generated to create deployment for logstash pod. The mounted persistent volume of the domain home will provide access to the WebLogic server logs to logstash pod. +Make sure to point the logstash configuration file to correct location and also correct domain home persistence volume claim. + +1. Deploy logstash to start publish logs to Elasticsearch: + + ```bash + $ kubectl create -f logstash.yaml + ``` + +1. Now, you can view the diagnostics logs using Kibana with index pattern `logstash-*`. + diff --git a/OracleWebCenterPortal/kubernetes/logging-services/logstash/logstash.conf b/OracleWebCenterPortal/kubernetes/logging-services/logstash/logstash.conf old mode 100644 new mode 100755 index ea9487e11..a3565f5ca --- a/OracleWebCenterPortal/kubernetes/logging-services/logstash/logstash.conf +++ b/OracleWebCenterPortal/kubernetes/logging-services/logstash/logstash.conf @@ -1,25 +1,25 @@ -# 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. -# - -input { - file { - path => "/u01/oracle/user_projects/domains/wcp-domain/servers/**/logs/*-diagnostic.log" - start_position => beginning - } - file { - path => "/u01/oracle/user_projects/domains/logs/wcp-domain/*.log" - start_position => beginning - } -} - -filter { - grok { - match => [ "message", "<%{DATA:log_timestamp}> <%{WORD:log_level}> <%{WORD:thread}> <%{HOSTNAME:hostname}> <%{HOSTNAME:servername}> <%{DATA:timer}> <<%{DATA:kernel}>> <> <%{DATA:uuid}> <%{NUMBER:timestamp}> <%{DATA:misc}> <%{DATA:log_number}> <%{DATA:log_message}>" ] - } -} -output { - elasticsearch { - hosts => ["elasticsearch.default.svc.cluster.local:9200"] - } -} +# 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. +# + +input { + file { + path => "/u01/oracle/user_projects/domains/wcp-domain/servers/**/logs/*-diagnostic.log" + start_position => beginning + } + file { + path => "/u01/oracle/user_projects/domains/logs/wcp-domain/*.log" + start_position => beginning + } +} + +filter { + grok { + match => [ "message", "<%{DATA:log_timestamp}> <%{WORD:log_level}> <%{WORD:thread}> <%{HOSTNAME:hostname}> <%{HOSTNAME:servername}> <%{DATA:timer}> <<%{DATA:kernel}>> <> <%{DATA:uuid}> <%{NUMBER:timestamp}> <%{DATA:misc}> <%{DATA:log_number}> <%{DATA:log_message}>" ] + } +} +output { + elasticsearch { + hosts => ["elasticsearch.default.svc.cluster.local:9200"] + } +} diff --git a/OracleWebCenterPortal/kubernetes/logging-services/logstash/logstash.yaml b/OracleWebCenterPortal/kubernetes/logging-services/logstash/logstash.yaml old mode 100644 new mode 100755 index c1938a090..596536c41 --- a/OracleWebCenterPortal/kubernetes/logging-services/logstash/logstash.yaml +++ b/OracleWebCenterPortal/kubernetes/logging-services/logstash/logstash.yaml @@ -1,39 +1,39 @@ -# 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. -# - -apiVersion: apps/v1 -kind: Deployment -metadata: - name: logstash - namespace: wcpns -spec: - selector: - matchLabels: - app: logstash - template: # create pods using pod definition in this template - metadata: - labels: - app: logstash - spec: - volumes: - - name: domain-storage-volume - persistentVolumeClaim: - claimName: wcp-domain-domain-pvc - - name: shared-logs - emptyDir: {} - containers: - - name: logstash - image: logstash:6.6.0 - command: ["/bin/sh"] - args: ["/usr/share/logstash/bin/logstash", "-f", "/u01/oracle/user_projects/domains/logstash.conf"] - imagePullPolicy: IfNotPresent - volumeMounts: - - mountPath: /u01/oracle/user_projects/domains - name: domain-storage-volume - - name: shared-logs - mountPath: /shared-logs - ports: - - containerPort: 5044 - name: logstash - +# 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. +# + +apiVersion: apps/v1 +kind: Deployment +metadata: + name: logstash + namespace: wcpns +spec: + selector: + matchLabels: + app: logstash + template: # create pods using pod definition in this template + metadata: + labels: + app: logstash + spec: + volumes: + - name: domain-storage-volume + persistentVolumeClaim: + claimName: wcp-domain-domain-pvc + - name: shared-logs + emptyDir: {} + containers: + - name: logstash + image: logstash:6.6.0 + command: ["/bin/sh"] + args: ["/usr/share/logstash/bin/logstash", "-f", "/u01/oracle/user_projects/domains/logstash.conf"] + imagePullPolicy: IfNotPresent + volumeMounts: + - mountPath: /u01/oracle/user_projects/domains + name: domain-storage-volume + - name: shared-logs + mountPath: /shared-logs + ports: + - containerPort: 5044 + name: logstash + diff --git a/OracleWebCenterPortal/kubernetes/logging-services/weblogic-logging-exporter/README.md b/OracleWebCenterPortal/kubernetes/logging-services/weblogic-logging-exporter/README.md old mode 100644 new mode 100755 index 2de15b340..3c8165352 --- a/OracleWebCenterPortal/kubernetes/logging-services/weblogic-logging-exporter/README.md +++ b/OracleWebCenterPortal/kubernetes/logging-services/weblogic-logging-exporter/README.md @@ -1,131 +1,131 @@ -## Publish WebLogic Server logs into Elasticsearch - -The WebLogic Logging Exporter adds a log event handler to WebLogic Server, such that WebLogic Server logs can be integrated into Elastic Stack in Kubernetes directly, by using the Elasticsearch REST API. - -## Prerequisite - -This document assumes that you have already deployed Elasticsearch/Kibana environment. If you have not, please use a sample/demo deployment of Elasticsearch/Kibana from WebLogic Kubernetes operator. - -To deploy Elasticsearch and Kibana on the Kubernetes cluster: -```bash -$ kubectl create -f https://raw.githubusercontent.com/oracle/weblogic-kubernetes-operator/master/kubernetes/samples/scripts/elasticsearch-and-kibana/elasticsearch_and_kibana.yaml -``` - -Follow these steps to setup WebLogic Logging Exporter in a WebLogic operator environment and push the WebLogic server logs to Elasticsearch/Kibana - -1. Download WebLogic logging exporter binaries - - The WebLogic logging exporter pre-built binaries are available in the github releases page: [Release 1.0.1](https://github.com/oracle/weblogic-logging-exporter/releases) - - ```bash - $ wget https://github.com/oracle/weblogic-logging-exporter/releases/download/v1.0.1/weblogic-logging-exporter.jar - ``` - - Download weblogic-logging-exporter.jar from the github release link above. Also download dependency jar - snakeyaml-1.27.jar from Maven Central. - - ```bash - $ wget -O snakeyaml-1.27.jar https://search.maven.org/remotecontent?filepath=org/yaml/snakeyaml/1.27/snakeyaml-1.27.jar - ``` -1. Copy JAR files into the Kubernetes WebLogic Administration Server Pod - - Copy weblogic-logging-exporter.jar and snakeyaml-1.27.jar to the domain home folder in the Administration server pod. - - ```bash - $ kubectl cp weblogic-logging-exporter.jar wcpns/wcp-domain-adminserver:/u01/oracle/user_projects/domains/wcp-domain/ - $ kubectl cp snakeyaml-1.27.jar wcpns/wcp-domain-adminserver:/u01/oracle/user_projects/domains/wcp-domain/ - ``` - -1. Add a startup class to the domain configuration - - In this step, we configure weblogic-logging-exporter JAR as a startup class in the WebLogic servers where we intend to collect the logs. - - a) In the Administration Console, navigate to `Environment` then `Startup and Shutdown classes` in the main menu. - - b) Add a new Startup class. You may choose any descriptive name and the class name must be `weblogic.logging.exporter.Startup`. - - c) Target the startup class to each server that you want to export logs from. - - You can verify this by checking for the update in your config.xml which should be similar to this example: - - ```bash - - LoggingExporterStartupClass - AdminServer - weblogic.logging.exporter.Startup - - ``` - -1. Update WebLogic Server CLASS Path. - - In this step, we set the class path for weblogic-logging-exporter and its dependencies. - - a) Copy setDomainEnv.sh from the pod to local folder. - ```bash - $ kubectl cp wcpns/wcp-domain-adminserver:/u01/oracle/user_projects/domains/wcp-domain/bin/setDomainEnv.sh setDomainEnv.sh - ``` - b) Modify setDomainEnv.sh to update the Server Class path. - ```bash - CLASSPATH=/u01/oracle/user_projects/domains/wcp-domain/weblogic-logging-exporter.jar:/u01/oracle/user_projects/domains/wcp-domain/snakeyaml-1.27.jar:${CLASSPATH} - export CLASSPATH - ``` - - c) Copy back the modified setDomainEnv.sh to the pod. - ```bash - $ kubectl cp setDomainEnv.sh wcpns/wcp-domain-adminserver:/u01/oracle/user_projects/domains/wcp-domain/bin/setDomainEnv.sh - ``` - -1. Create configuration file for the WebLogic Logging Exporter. -Copy WebLogicLoggingExporter.yaml to the domain folder in the WebLogic server pod. YAML specifies the elasticsearch server host and port number. - ```bash - $ kubectl cp WebLogicLoggingExporter.yaml wcpns/wcp-domain-adminserver:/u01/oracle/user_projects/domains/wcp-domain/config/ - ``` - -1. Restart WebLogic Servers - - Now we can restart the WebLogic servers for the weblogic-logging-exporter to get loaded in the servers. - - To restart the servers, use stopDomain.sh and startDomain.sh scripts from https://github.com/oracle/weblogic-kubernetes-operator/tree/master/kubernetes/samples/scripts/domain-lifecycle - - 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. - - ```bash - $ stopDomain.sh -d wcp-domain -n wcpns - ``` - Sample output: - ```bash - [INFO] Patching domain 'wcp-domain' in namespace 'wcpns' from serverStartPolicy='IF_NEEDED' to 'NEVER'. - domain.weblogic.oracle/wcp-domain patched - [INFO] Successfully patched domain 'wcp-domain' in namespace 'wcpns' with 'NEVER' start policy! - ``` - - Verify servers by checking the pod status. - ```bash - $ kubectl get pods -n wcpns - ``` - - After all the servers are shutdown, run startDomain.sh script to start again. - - 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. - - ```bash - $ startDomain.sh -d wcp-domain -n wcpns - ``` - Sample output: - ```bash - [INFO] Patching domain 'wcp-domain' from serverStartPolicy='NEVER' to 'IF_NEEDED'. - domain.weblogic.oracle/wcp-domain patched - [INFO] Successfully patched domain 'wcp-domain' in namespace 'wcpns' with 'IF_NEEDED' start policy! - ``` - - Verify servers by checking the pod status. Pod status will be RUNNING. - ```bash - $ kubectl get pods -n wcpns - ``` - In the server logs, you will be able to see the weblogic-logging-exporter class being called. - -1. Create an index pattern in Kibana - - We need to create an index pattern in Kibana for the logs to be available in the dashboard. - - Create an index pattern `wls*` in `Kibana` > `Management`. After the server starts, you will be able to see the log data from the WebLogic servers in the Kibana dashboard, - +## Publish WebLogic Server logs into Elasticsearch + +The WebLogic Logging Exporter adds a log event handler to WebLogic Server, such that WebLogic Server logs can be integrated into Elastic Stack in Kubernetes directly, by using the Elasticsearch REST API. + +## Prerequisite + +This document assumes that you have already deployed Elasticsearch/Kibana environment. If you have not, please use a sample/demo deployment of Elasticsearch/Kibana from WebLogic Kubernetes operator. + +To deploy Elasticsearch and Kibana on the Kubernetes cluster: +```bash +$ kubectl create -f https://raw.githubusercontent.com/oracle/weblogic-kubernetes-operator/master/kubernetes/samples/scripts/elasticsearch-and-kibana/elasticsearch_and_kibana.yaml +``` + +Follow these steps to setup WebLogic Logging Exporter in a WebLogic operator environment and push the WebLogic server logs to Elasticsearch/Kibana + +1. Download WebLogic logging exporter binaries + + The WebLogic logging exporter pre-built binaries are available in the github releases page: [Release 1.0.1](https://github.com/oracle/weblogic-logging-exporter/releases) + + ```bash + $ wget https://github.com/oracle/weblogic-logging-exporter/releases/download/v1.0.1/weblogic-logging-exporter.jar + ``` + + Download weblogic-logging-exporter.jar from the github release link above. Also download dependency jar - snakeyaml-1.27.jar from Maven Central. + + ```bash + $ wget -O snakeyaml-1.27.jar https://search.maven.org/remotecontent?filepath=org/yaml/snakeyaml/1.27/snakeyaml-1.27.jar + ``` +1. Copy JAR files into the Kubernetes WebLogic Administration Server Pod + + Copy weblogic-logging-exporter.jar and snakeyaml-1.27.jar to the domain home folder in the Administration server pod. + + ```bash + $ kubectl cp weblogic-logging-exporter.jar wcpns/wcp-domain-adminserver:/u01/oracle/user_projects/domains/wcp-domain/ + $ kubectl cp snakeyaml-1.27.jar wcpns/wcp-domain-adminserver:/u01/oracle/user_projects/domains/wcp-domain/ + ``` + +1. Add a startup class to the domain configuration + + In this step, we configure weblogic-logging-exporter JAR as a startup class in the WebLogic servers where we intend to collect the logs. + + a) In the Administration Console, navigate to `Environment` then `Startup and Shutdown classes` in the main menu. + + b) Add a new Startup class. You may choose any descriptive name and the class name must be `weblogic.logging.exporter.Startup`. + + c) Target the startup class to each server that you want to export logs from. + + You can verify this by checking for the update in your config.xml which should be similar to this example: + + ```bash + + LoggingExporterStartupClass + AdminServer + weblogic.logging.exporter.Startup + + ``` + +1. Update WebLogic Server CLASS Path. + + In this step, we set the class path for weblogic-logging-exporter and its dependencies. + + a) Copy setDomainEnv.sh from the pod to local folder. + ```bash + $ kubectl cp wcpns/wcp-domain-adminserver:/u01/oracle/user_projects/domains/wcp-domain/bin/setDomainEnv.sh setDomainEnv.sh + ``` + b) Modify setDomainEnv.sh to update the Server Class path. + ```bash + CLASSPATH=/u01/oracle/user_projects/domains/wcp-domain/weblogic-logging-exporter.jar:/u01/oracle/user_projects/domains/wcp-domain/snakeyaml-1.27.jar:${CLASSPATH} + export CLASSPATH + ``` + + c) Copy back the modified setDomainEnv.sh to the pod. + ```bash + $ kubectl cp setDomainEnv.sh wcpns/wcp-domain-adminserver:/u01/oracle/user_projects/domains/wcp-domain/bin/setDomainEnv.sh + ``` + +1. Create configuration file for the WebLogic Logging Exporter. +Copy WebLogicLoggingExporter.yaml to the domain folder in the WebLogic server pod. YAML specifies the elasticsearch server host and port number. + ```bash + $ kubectl cp WebLogicLoggingExporter.yaml wcpns/wcp-domain-adminserver:/u01/oracle/user_projects/domains/wcp-domain/config/ + ``` + +1. Restart WebLogic Servers + + Now we can restart the WebLogic servers for the weblogic-logging-exporter to get loaded in the servers. + + To restart the servers, use stopDomain.sh and startDomain.sh scripts from https://github.com/oracle/weblogic-kubernetes-operator/tree/master/kubernetes/samples/scripts/domain-lifecycle + + 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. + + ```bash + $ stopDomain.sh -d wcp-domain -n wcpns + ``` + Sample output: + ```bash + [INFO] Patching domain 'wcp-domain' in namespace 'wcpns' from serverStartPolicy='IF_NEEDED' to 'NEVER'. + domain.weblogic.oracle/wcp-domain patched + [INFO] Successfully patched domain 'wcp-domain' in namespace 'wcpns' with 'NEVER' start policy! + ``` + + Verify servers by checking the pod status. + ```bash + $ kubectl get pods -n wcpns + ``` + + After all the servers are shutdown, run startDomain.sh script to start again. + + 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. + + ```bash + $ startDomain.sh -d wcp-domain -n wcpns + ``` + Sample output: + ```bash + [INFO] Patching domain 'wcp-domain' from serverStartPolicy='NEVER' to 'IF_NEEDED'. + domain.weblogic.oracle/wcp-domain patched + [INFO] Successfully patched domain 'wcp-domain' in namespace 'wcpns' with 'IF_NEEDED' start policy! + ``` + + Verify servers by checking the pod status. Pod status will be RUNNING. + ```bash + $ kubectl get pods -n wcpns + ``` + In the server logs, you will be able to see the weblogic-logging-exporter class being called. + +1. Create an index pattern in Kibana + + We need to create an index pattern in Kibana for the logs to be available in the dashboard. + + Create an index pattern `wls*` in `Kibana` > `Management`. After the server starts, you will be able to see the log data from the WebLogic servers in the Kibana dashboard, + diff --git a/OracleWebCenterPortal/kubernetes/logging-services/weblogic-logging-exporter/WebLogicLoggingExporter.yaml b/OracleWebCenterPortal/kubernetes/logging-services/weblogic-logging-exporter/WebLogicLoggingExporter.yaml old mode 100644 new mode 100755 diff --git a/OracleWebCenterPortal/kubernetes/monitoring-service/README.md b/OracleWebCenterPortal/kubernetes/monitoring-service/README.md old mode 100644 new mode 100755 index 23a1c20c9..f69cf9664 --- a/OracleWebCenterPortal/kubernetes/monitoring-service/README.md +++ b/OracleWebCenterPortal/kubernetes/monitoring-service/README.md @@ -1,276 +1,276 @@ -# Monitor the OracleWebCenterPortal instance using Prometheus and Grafana -Using the `WebLogic Monitoring Exporter` you can scrape runtime information from a running OracleWebCenterPortal instance and monitor them using Prometheus and Grafana. - -## Prerequisites - -- Have Docker and a Kubernetes cluster running and have `kubectl` installed and configured. -- Have Helm installed. -- An OracleWebCenterPortal domain deployed by `weblogic-operator` is running in the Kubernetes cluster. - -## Set up monitoring for OracleWebCenterPortal domain - -Set up the WebLogic Monitoring Exporter that will collect WebLogic Server metrics and monitor OracleWebCenterPortal domain. - -**Note**: Either of the following methods can be used to set up monitoring for OracleWebCenterPortal domain. Using `setup-monitoring.sh` does the set up in an automated way. - -1. [Set up manually](#set-up-manually) -1. [Set up using `setup-monitoring.sh`](#set-up-using-setup-monitoringsh) - -## Set up manually - -### Deploy Prometheus and Grafana - -Refer to the compatibility matrix of [Kube Prometheus](https://github.com/coreos/kube-prometheus#kubernetes-compatibility-matrix) and clone the [release](https://github.com/coreos/kube-prometheus/releases) version of the `kube-prometheus` repository according to the Kubernetes version of your cluster. - -1. Clone the `kube-prometheus` repository: - ``` - $ git clone https://github.com/coreos/kube-prometheus.git - ``` - -1. Change to folder `kube-prometheus` and enter the following commands to create the namespace and CRDs, and then wait for their availability before creating the remaining resources: - - ``` - $ cd kube-prometheus - $ kubectl create -f manifests/setup - $ until kubectl get servicemonitors --all-namespaces ; do date; sleep 1; echo ""; done - $ kubectl create -f manifests/ - ``` - -1. `kube-prometheus` requires all nodes in the Kubernetes cluster to be labeled with `kubernetes.io/os=linux`. If any node is not labeled with this, then you need to label it using the following command: - - ``` - $ kubectl label nodes --all kubernetes.io/os=linux - ``` - -1. Enter the following commands to provide external access for Grafana, Prometheus, and Alertmanager: - - ``` - $ kubectl patch svc grafana -n monitoring --type=json -p '[{"op": "replace", "path": "/spec/type", "value": "NodePort" },{"op": "replace", "path": "/spec/ports/0/nodePort", "value": 32100 }]' - - $ kubectl patch svc prometheus-k8s -n monitoring --type=json -p '[{"op": "replace", "path": "/spec/type", "value": "NodePort" },{"op": "replace", "path": "/spec/ports/0/nodePort", "value": 32101 }]' - - $ kubectl patch svc alertmanager-main -n monitoring --type=json -p '[{"op": "replace", "path": "/spec/type", "value": "NodePort" },{"op": "replace", "path": "/spec/ports/0/nodePort", "value": 32102 }]' - ``` - - Note: - * `32100` is the external port for Grafana - * `32101` is the external port for Prometheus - * `32102` is the external port for Alertmanager - -### Generate the WebLogic Monitoring Exporter Deployment Package - -The `wls-exporter.war` package need to be updated and created for each listening ports (Administration Server and Managed Servers) in the domain. -Set the below environment values based on your environment and run the script `get-wls-exporter.sh` to generate the required WAR files at `${WORKDIR}/monitoring-service/scripts/wls-exporter-deploy`: -- adminServerPort -- wlsMonitoringExporterTowcpCluster -- wcpManagedServerPort -- wlsMonitoringExporterTowcpPortletCluster -- wcpPortletManagedServerPort - -For example: - -``` -$ cd ${WORKDIR}/monitoring-service/scripts -$ export adminServerPort=7001 -$ export wlsMonitoringExporterTowcpCluster=true -$ export wcpManagedServerPort=8888 -$ export wlsMonitoringExporterTowcpPortletCluster=true -$ export wcpPortletManagedServerPort=8889 -$ sh get-wls-exporter.sh -``` - -Verify whether the required WAR files are generated at `${WORKDIR}/monitoring-service/scripts/wls-exporter-deploy`. - -``` -$ ls ${WORKDIR}/monitoring-service/scripts/wls-exporter-deploy -``` - -### Deploy the WebLogic Monitoring Exporter into the OracleWebCenterPortal domain - -Follow these steps to copy and deploy the WebLogic Monitoring Exporter WAR files into the OracleWebCenterPortal Domain. - -**Note**: Replace the `` with appropriate values based on your environment: - -``` -$ cd ${WORKDIR}/monitoring-service/scripts -$ kubectl cp wls-exporter-deploy /:/u01/oracle -$ kubectl cp deploy-weblogic-monitoring-exporter.py /:/u01/oracle/wls-exporter-deploy -$ kubectl exec -it -n -- /u01/oracle/oracle_common/common/bin/wlst.sh /u01/oracle/wls-exporter-deploy/deploy-weblogic-monitoring-exporter.py \ --domainName -adminServerName -adminURL \ --wcpClusterName -wlsMonitoringExporterTowcpCluster \ --wcpPortletClusterName -wlsMonitoringExporterTowcpPortletCluster \ --username -password -``` - -For example: - -``` -$ cd ${WORKDIR}/monitoring-service/scripts -$ kubectl cp wls-exporter-deploy wcpns/wcp-domain-adminserver:/u01/oracle -$ kubectl cp deploy-weblogic-monitoring-exporter.py wcpns/wcp-domain-adminserver:/u01/oracle/wls-exporter-deploy -$ kubectl exec -it -n wcpns wcp-domain-adminserver -- /u01/oracle/oracle_common/common/bin/wlst.sh /u01/oracle/wls-exporter-deploy/deploy-weblogic-monitoring-exporter.py \ --domainName wcp-domain -adminServerName -adminserver:7001 \ --wcpClusterName wcp-cluster -wlsMonitoringExporterTowcpCluster true \ --wcpPortletClusterName wcportlet-cluster -wlsMonitoringExporterTowcpPortletCluster true \ --username weblogic -password Welcome1 -``` - -### Configure Prometheus Operator - -Prometheus enables you to collect metrics from the WebLogic Monitoring Exporter. The Prometheus Operator identifies the targets using service discovery. To get the WebLogic Monitoring Exporter end point discovered as a target, you must create a service monitor pointing to the service. - -The service monitor deployment YAML configuration file is available at `${WORKDIR}/monitoring-service/manifests/wls-exporter-ServiceMonitor.yaml.template`. Copy the file as `wls-exporter-ServiceMonitor.yaml` to update with appropriate values as detailed below. - -The exporting of metrics from `wls-exporter` requires `basicAuth`, so a Kubernetes `Secret` is created with the user name and password that are base64 encoded. This `Secret` is used in the `ServiceMonitor` deployment. The `wls-exporter-ServiceMonitor.yaml` has namespace as `wcpns` and has `basicAuth` with credentials as `username: %USERNAME%` and `password: %PASSWORD%`. Update `%USERNAME%` and `%PASSWORD% ` in base64 encoded and all occurences of `wcpns` based on your environment. - -Use the following example for base64 encoded: - -``` -$ echo -n "Welcome1" | base64 -V2VsY29tZTE= -``` - -You need to add `RoleBinding` and `Role` for the namespace (wcpns) under which the WebLogic Servers pods are running in the Kubernetes cluster. These are required for Prometheus to access the endpoints provided by the WebLogic Monitoring Exporters. The YAML configuration files for wcpns namespace are provided in "${WORKDIR}/monitoring-service/manifests/". - -If you are using namespace other than `wcpns`, update the namespace details in `prometheus-roleBinding-domain-namespace.yaml` and `prometheus-roleSpecific-domain-namespace.yaml`. - -Perform the below steps for enabling Prometheus to collect the metrics from the WebLogic Monitoring Exporter: - -``` -$ cd ${WORKDIR}/monitoring-service/manifests -$ kubectl apply -f . -``` - -### Verify the service discovery of WebLogic Monitoring Exporter - -After the deployment of the service monitor, Prometheus should be able to discover wls-exporter and collect the metrics. - -1. Access the Prometheus dashboard at `http://mycompany.com:32101/` - -1. Navigate to **Status** to see the **Service Discovery** details. - -1. Verify that `wls-exporter` is listed in the discovered Services. - - -### Deploy Grafana Dashboard - -You can access the Grafana dashboard at `http://mycompany.com:32100/`. - -1. Log in to Grafana dashboard with username: admin and password: admin`. - -1. Navigate to + (Create) -> Import -> Upload the `weblogic-server-dashboard-import.json` file (provided at `${WORKDIR}/monitoring-service/config/weblogic-server-dashboard-import.json`). - - -## Set up using `setup-monitoring.sh` - -Alternatively, you can run the helper script `setup-monitoring.sh` available at `${WORKDIR}/monitoring-service` to setup the monitoring for OracleWebCenterPortal domain. - -This script creates kube-prometheus-stack(Prometheus, Grafana and Alertmanager), WebLogic Monitoring Exporter and imports `weblogic-server-dashboard.json` into Grafana for WebLogic Server Dashboard. - -### Prepare to use the setup monitoring script - -The sample scripts for setup monitoring for OracleWebCenterPortal domain are available at `${WORKDIR}/monitoring-service`. - -You must edit `monitoring-inputs.yaml`(or a copy of it) to provide the details of your domain. Refer to the configuration parameters below to understand the information that you must provide in this file. - -#### Configuration parameters - -The following parameters can be provided in the inputs file. - -| Parameter | Description | Default | -| --- | --- | --- | -| `domainUID` | domainUID of the OracleWebCenterPortal domain. | `wcp-domain` | -| `domainNamespace` | Kubernetes namespace of the OracleWebCenterPortal domain. | `wcpns` | -| `setupKubePrometheusStack` | Boolean value indicating whether kube-prometheus-stack (Prometheus, Grafana and Alertmanager) to be installed | `true` | -| `additionalParamForKubePrometheusStack` | The script install's kube-prometheus-stack with `service.type` as NodePort and values for `service.nodePort` as per the parameters defined in `monitoring-inputs.yaml`. Use `additionalParamForKubePrometheusStack` parameter to further configure with additional parameters as per [values.yaml](https://github.com/prometheus-community/helm-charts/blob/main/charts/kube-prometheus-stack/values.yaml). Sample value to disable NodeExporter, Prometheus-Operator TLS support and Admission webhook support for PrometheusRules resources is `--set nodeExporter.enabled=false --set prometheusOperator.tls.enabled=false --set prometheusOperator.admissionWebhooks.enabled=false`| | -| `monitoringNamespace` | Kubernetes namespace for monitoring setup. | `monitoring` | -| `adminServerName` | Name of the Administration Server. | `AdminServer` | -| `adminServerPort` | Port number for the Administration Server inside the Kubernetes cluster. | `7001` | -| `wcpClusterName` | Name of the wcpCluster. | `wcp-cluster` | -| `wcpManagedServerPort` | Port number of the managed servers in the wcpCluster. | `8888` | -| `wlsMonitoringExporterTowcpCluster` | Boolean value indicating whether to deploy WebLogic Monitoring Exporter to wcpCluster. | `false` | -| `wcpPortletClusterName` | Name of the wcpPortletCluster. | `wcportlet-cluster` | -| `wcpPortletManagedServerPort` | Port number of the managed servers in the wcpPortletCluster. | `8889` | -| `wlsMonitoringExporterTowcpPortletCluster` | Boolean value indicating whether to deploy WebLogic Monitoring Exporter to wcpPortletCluster. | `false` | -| `exposeMonitoringNodePort` | Boolean value indicating if the Monitoring Services (Prometheus, Grafana and Alertmanager) is exposed outside of the Kubernetes cluster. | `false` | -| `prometheusNodePort` | Port number of the Prometheus outside the Kubernetes cluster. | `32101` | -| `grafanaNodePort` | Port number of the Grafana outside the Kubernetes cluster. | `32100` | -| `alertmanagerNodePort` | Port number of the Alertmanager outside the Kubernetes cluster. | `32102` | -| `weblogicCredentialsSecretName` | Name of the Kubernetes secret which has Administration Server’s user name and password. | `wcp-domain-domain-credentials` | - -Note that the values specified in the `monitoring-inputs.yaml` file will be used to install kube-prometheus-stack (Prometheus, Grafana and Alertmanager) and deploying WebLogic Monitoring Exporter into the OracleWebCenterPortal domain. Hence make the domain specific values to be same as that used during domain creation. - -### Run the setup monitoring script - -Update the values in `monitoring-inputs.yaml` as per your requirement and run the `setup-monitoring.sh` script, specifying your inputs file: - -```bash -$ cd ${WORKDIR}/monitoring-service -$ ./setup-monitoring.sh \ - -i monitoring-inputs.yaml -``` -The script will perform the following steps: - -- Helm install `prometheus-community/kube-prometheus-stack` of version "16.5.0" if `setupKubePrometheusStack` is set to `true`. -- Deploys WebLogic Monitoring Exporter to Administration Server. -- Deploys WebLogic Monitoring Exporter to `wcpCluster` if `wlsMonitoringExporterTowcpCluster` is set to `true`. -- Deploys WebLogic Monitoring Exporter to `wcpPortletCluster` if `wlsMonitoringExporterTowcpPortletCluster` is set to `true`. -- Exposes the Monitoring Services (Prometheus at `32101`, Grafana at `32100` and Alertmanager at `32102`) outside of the Kubernetes cluster if `exposeMonitoringNodePort` is set to `true`. -- Imports the WebLogic Server Grafana Dashboard if `setupKubePrometheusStack` is set to `true`. - -### Verify the results -The setup monitoring script will report failure if there was any error. However, verify that required resources were created by the script. - -#### Verify the kube-prometheus-stack - -To confirm that `prometheus-community/kube-prometheus-stack` was installed when `setupKubePrometheusStack` is set to `true`, run the following command: - -```bash -$ helm ls -n -``` -Replace with value for Kubernetes namespace used for monitoring. - -Sample output: -```bash -$ helm ls -n monitoring -NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION -monitoring monitoring 1 2021-06-18 12:58:35.177221969 +0000 UTC deployed kube-prometheus-stack-16.5.0 0.48.0 -$ -``` - -#### Verify the Prometheus, Grafana and Alertmanager setup - -When `exposeMonitoringNodePort` was set to `true`, verify that monitoring services are accessible outside of the Kubernetes cluster: - -- `32100` is the external port for Grafana and with credentials `admin:admin` -- `32101` is the external port for Prometheus -- `32102` is the external port for Alertmanager - -#### Verify the service discovery of WebLogic Monitoring Exporter - -Verify whether prometheus is able to discover wls-exporter and collect the metrics: - -1. Access the Prometheus dashboard at http://mycompany.com:32101/ - -1. Navigate to Status to see the Service Discovery details. - -1. Verify that wls-exporter is listed in the discovered services. - -#### Verify the WebLogic Server dashoard - -You can access the Grafana dashboard at http://mycompany.com:32100/. - -1. Log in to Grafana dashboard with username: `admin` and password: `admin`. - -1. Navigate to "WebLogic Server Dashboard" under General and verify. - -### Delete the monitoring setup - -To delete the monitoring setup created by [Run the setup monitoring script](#run-the-setup-monitoring-script), run the below command: - -```bash -$ cd ${WORKDIR}/monitoring-service -$ ./delete-monitoring.sh \ - -i monitoring-inputs.yaml -``` - +# Monitor the OracleWebCenterPortal instance using Prometheus and Grafana +Using the `WebLogic Monitoring Exporter` you can scrape runtime information from a running OracleWebCenterPortal instance and monitor them using Prometheus and Grafana. + +## Prerequisites + +- Have Docker and a Kubernetes cluster running and have `kubectl` installed and configured. +- Have Helm installed. +- An OracleWebCenterPortal domain deployed by `weblogic-operator` is running in the Kubernetes cluster. + +## Set up monitoring for OracleWebCenterPortal domain + +Set up the WebLogic Monitoring Exporter that will collect WebLogic Server metrics and monitor OracleWebCenterPortal domain. + +**Note**: Either of the following methods can be used to set up monitoring for OracleWebCenterPortal domain. Using `setup-monitoring.sh` does the set up in an automated way. + +1. [Set up manually](#set-up-manually) +1. [Set up using `setup-monitoring.sh`](#set-up-using-setup-monitoringsh) + +## Set up manually + +### Deploy Prometheus and Grafana + +Refer to the compatibility matrix of [Kube Prometheus](https://github.com/coreos/kube-prometheus#kubernetes-compatibility-matrix) and clone the [release](https://github.com/coreos/kube-prometheus/releases) version of the `kube-prometheus` repository according to the Kubernetes version of your cluster. + +1. Clone the `kube-prometheus` repository: + ``` + $ git clone https://github.com/coreos/kube-prometheus.git + ``` + +1. Change to folder `kube-prometheus` and enter the following commands to create the namespace and CRDs, and then wait for their availability before creating the remaining resources: + + ``` + $ cd kube-prometheus + $ kubectl create -f manifests/setup + $ until kubectl get servicemonitors --all-namespaces ; do date; sleep 1; echo ""; done + $ kubectl create -f manifests/ + ``` + +1. `kube-prometheus` requires all nodes in the Kubernetes cluster to be labeled with `kubernetes.io/os=linux`. If any node is not labeled with this, then you need to label it using the following command: + + ``` + $ kubectl label nodes --all kubernetes.io/os=linux + ``` + +1. Enter the following commands to provide external access for Grafana, Prometheus, and Alertmanager: + + ``` + $ kubectl patch svc grafana -n monitoring --type=json -p '[{"op": "replace", "path": "/spec/type", "value": "NodePort" },{"op": "replace", "path": "/spec/ports/0/nodePort", "value": 32100 }]' + + $ kubectl patch svc prometheus-k8s -n monitoring --type=json -p '[{"op": "replace", "path": "/spec/type", "value": "NodePort" },{"op": "replace", "path": "/spec/ports/0/nodePort", "value": 32101 }]' + + $ kubectl patch svc alertmanager-main -n monitoring --type=json -p '[{"op": "replace", "path": "/spec/type", "value": "NodePort" },{"op": "replace", "path": "/spec/ports/0/nodePort", "value": 32102 }]' + ``` + + Note: + * `32100` is the external port for Grafana + * `32101` is the external port for Prometheus + * `32102` is the external port for Alertmanager + +### Generate the WebLogic Monitoring Exporter Deployment Package + +The `wls-exporter.war` package need to be updated and created for each listening ports (Administration Server and Managed Servers) in the domain. +Set the below environment values based on your environment and run the script `get-wls-exporter.sh` to generate the required WAR files at `${WORKDIR}/monitoring-service/scripts/wls-exporter-deploy`: +- adminServerPort +- wlsMonitoringExporterTowcpCluster +- wcpManagedServerPort +- wlsMonitoringExporterTowcpPortletCluster +- wcpPortletManagedServerPort + +For example: + +``` +$ cd ${WORKDIR}/monitoring-service/scripts +$ export adminServerPort=7001 +$ export wlsMonitoringExporterTowcpCluster=true +$ export wcpManagedServerPort=8888 +$ export wlsMonitoringExporterTowcpPortletCluster=true +$ export wcpPortletManagedServerPort=8889 +$ sh get-wls-exporter.sh +``` + +Verify whether the required WAR files are generated at `${WORKDIR}/monitoring-service/scripts/wls-exporter-deploy`. + +``` +$ ls ${WORKDIR}/monitoring-service/scripts/wls-exporter-deploy +``` + +### Deploy the WebLogic Monitoring Exporter into the OracleWebCenterPortal domain + +Follow these steps to copy and deploy the WebLogic Monitoring Exporter WAR files into the OracleWebCenterPortal Domain. + +**Note**: Replace the `` with appropriate values based on your environment: + +``` +$ cd ${WORKDIR}/monitoring-service/scripts +$ kubectl cp wls-exporter-deploy /:/u01/oracle +$ kubectl cp deploy-weblogic-monitoring-exporter.py /:/u01/oracle/wls-exporter-deploy +$ kubectl exec -it -n -- /u01/oracle/oracle_common/common/bin/wlst.sh /u01/oracle/wls-exporter-deploy/deploy-weblogic-monitoring-exporter.py \ +-domainName -adminServerName -adminURL \ +-wcpClusterName -wlsMonitoringExporterTowcpCluster \ +-wcpPortletClusterName -wlsMonitoringExporterTowcpPortletCluster \ +-username -password +``` + +For example: + +``` +$ cd ${WORKDIR}/monitoring-service/scripts +$ kubectl cp wls-exporter-deploy wcpns/wcp-domain-adminserver:/u01/oracle +$ kubectl cp deploy-weblogic-monitoring-exporter.py wcpns/wcp-domain-adminserver:/u01/oracle/wls-exporter-deploy +$ kubectl exec -it -n wcpns wcp-domain-adminserver -- /u01/oracle/oracle_common/common/bin/wlst.sh /u01/oracle/wls-exporter-deploy/deploy-weblogic-monitoring-exporter.py \ +-domainName wcp-domain -adminServerName -adminserver:7001 \ +-wcpClusterName wcp-cluster -wlsMonitoringExporterTowcpCluster true \ +-wcpPortletClusterName wcportlet-cluster -wlsMonitoringExporterTowcpPortletCluster true \ +-username weblogic -password Welcome1 +``` + +### Configure Prometheus Operator + +Prometheus enables you to collect metrics from the WebLogic Monitoring Exporter. The Prometheus Operator identifies the targets using service discovery. To get the WebLogic Monitoring Exporter end point discovered as a target, you must create a service monitor pointing to the service. + +The service monitor deployment YAML configuration file is available at `${WORKDIR}/monitoring-service/manifests/wls-exporter-ServiceMonitor.yaml.template`. Copy the file as `wls-exporter-ServiceMonitor.yaml` to update with appropriate values as detailed below. + +The exporting of metrics from `wls-exporter` requires `basicAuth`, so a Kubernetes `Secret` is created with the user name and password that are base64 encoded. This `Secret` is used in the `ServiceMonitor` deployment. The `wls-exporter-ServiceMonitor.yaml` has namespace as `wcpns` and has `basicAuth` with credentials as `username: %USERNAME%` and `password: %PASSWORD%`. Update `%USERNAME%` and `%PASSWORD% ` in base64 encoded and all occurences of `wcpns` based on your environment. + +Use the following example for base64 encoded: + +``` +$ echo -n "Welcome1" | base64 +V2VsY29tZTE= +``` + +You need to add `RoleBinding` and `Role` for the namespace (wcpns) under which the WebLogic Servers pods are running in the Kubernetes cluster. These are required for Prometheus to access the endpoints provided by the WebLogic Monitoring Exporters. The YAML configuration files for wcpns namespace are provided in "${WORKDIR}/monitoring-service/manifests/". + +If you are using namespace other than `wcpns`, update the namespace details in `prometheus-roleBinding-domain-namespace.yaml` and `prometheus-roleSpecific-domain-namespace.yaml`. + +Perform the below steps for enabling Prometheus to collect the metrics from the WebLogic Monitoring Exporter: + +``` +$ cd ${WORKDIR}/monitoring-service/manifests +$ kubectl apply -f . +``` + +### Verify the service discovery of WebLogic Monitoring Exporter + +After the deployment of the service monitor, Prometheus should be able to discover wls-exporter and collect the metrics. + +1. Access the Prometheus dashboard at `http://mycompany.com:32101/` + +1. Navigate to **Status** to see the **Service Discovery** details. + +1. Verify that `wls-exporter` is listed in the discovered Services. + + +### Deploy Grafana Dashboard + +You can access the Grafana dashboard at `http://mycompany.com:32100/`. + +1. Log in to Grafana dashboard with username: admin and password: admin`. + +1. Navigate to + (Create) -> Import -> Upload the `weblogic-server-dashboard-import.json` file (provided at `${WORKDIR}/monitoring-service/config/weblogic-server-dashboard-import.json`). + + +## Set up using `setup-monitoring.sh` + +Alternatively, you can run the helper script `setup-monitoring.sh` available at `${WORKDIR}/monitoring-service` to setup the monitoring for OracleWebCenterPortal domain. + +This script creates kube-prometheus-stack(Prometheus, Grafana and Alertmanager), WebLogic Monitoring Exporter and imports `weblogic-server-dashboard.json` into Grafana for WebLogic Server Dashboard. + +### Prepare to use the setup monitoring script + +The sample scripts for setup monitoring for OracleWebCenterPortal domain are available at `${WORKDIR}/monitoring-service`. + +You must edit `monitoring-inputs.yaml`(or a copy of it) to provide the details of your domain. Refer to the configuration parameters below to understand the information that you must provide in this file. + +#### Configuration parameters + +The following parameters can be provided in the inputs file. + +| Parameter | Description | Default | +| --- | --- | --- | +| `domainUID` | domainUID of the OracleWebCenterPortal domain. | `wcp-domain` | +| `domainNamespace` | Kubernetes namespace of the OracleWebCenterPortal domain. | `wcpns` | +| `setupKubePrometheusStack` | Boolean value indicating whether kube-prometheus-stack (Prometheus, Grafana and Alertmanager) to be installed | `true` | +| `additionalParamForKubePrometheusStack` | The script install's kube-prometheus-stack with `service.type` as NodePort and values for `service.nodePort` as per the parameters defined in `monitoring-inputs.yaml`. Use `additionalParamForKubePrometheusStack` parameter to further configure with additional parameters as per [values.yaml](https://github.com/prometheus-community/helm-charts/blob/main/charts/kube-prometheus-stack/values.yaml). Sample value to disable NodeExporter, Prometheus-Operator TLS support and Admission webhook support for PrometheusRules resources is `--set nodeExporter.enabled=false --set prometheusOperator.tls.enabled=false --set prometheusOperator.admissionWebhooks.enabled=false`| | +| `monitoringNamespace` | Kubernetes namespace for monitoring setup. | `monitoring` | +| `adminServerName` | Name of the Administration Server. | `AdminServer` | +| `adminServerPort` | Port number for the Administration Server inside the Kubernetes cluster. | `7001` | +| `wcpClusterName` | Name of the wcpCluster. | `wcp-cluster` | +| `wcpManagedServerPort` | Port number of the managed servers in the wcpCluster. | `8888` | +| `wlsMonitoringExporterTowcpCluster` | Boolean value indicating whether to deploy WebLogic Monitoring Exporter to wcpCluster. | `false` | +| `wcpPortletClusterName` | Name of the wcpPortletCluster. | `wcportlet-cluster` | +| `wcpPortletManagedServerPort` | Port number of the managed servers in the wcpPortletCluster. | `8889` | +| `wlsMonitoringExporterTowcpPortletCluster` | Boolean value indicating whether to deploy WebLogic Monitoring Exporter to wcpPortletCluster. | `false` | +| `exposeMonitoringNodePort` | Boolean value indicating if the Monitoring Services (Prometheus, Grafana and Alertmanager) is exposed outside of the Kubernetes cluster. | `false` | +| `prometheusNodePort` | Port number of the Prometheus outside the Kubernetes cluster. | `32101` | +| `grafanaNodePort` | Port number of the Grafana outside the Kubernetes cluster. | `32100` | +| `alertmanagerNodePort` | Port number of the Alertmanager outside the Kubernetes cluster. | `32102` | +| `weblogicCredentialsSecretName` | Name of the Kubernetes secret which has Administration Server’s user name and password. | `wcp-domain-domain-credentials` | + +Note that the values specified in the `monitoring-inputs.yaml` file will be used to install kube-prometheus-stack (Prometheus, Grafana and Alertmanager) and deploying WebLogic Monitoring Exporter into the OracleWebCenterPortal domain. Hence make the domain specific values to be same as that used during domain creation. + +### Run the setup monitoring script + +Update the values in `monitoring-inputs.yaml` as per your requirement and run the `setup-monitoring.sh` script, specifying your inputs file: + +```bash +$ cd ${WORKDIR}/monitoring-service +$ ./setup-monitoring.sh \ + -i monitoring-inputs.yaml +``` +The script will perform the following steps: + +- Helm install `prometheus-community/kube-prometheus-stack` of version "16.5.0" if `setupKubePrometheusStack` is set to `true`. +- Deploys WebLogic Monitoring Exporter to Administration Server. +- Deploys WebLogic Monitoring Exporter to `wcpCluster` if `wlsMonitoringExporterTowcpCluster` is set to `true`. +- Deploys WebLogic Monitoring Exporter to `wcpPortletCluster` if `wlsMonitoringExporterTowcpPortletCluster` is set to `true`. +- Exposes the Monitoring Services (Prometheus at `32101`, Grafana at `32100` and Alertmanager at `32102`) outside of the Kubernetes cluster if `exposeMonitoringNodePort` is set to `true`. +- Imports the WebLogic Server Grafana Dashboard if `setupKubePrometheusStack` is set to `true`. + +### Verify the results +The setup monitoring script will report failure if there was any error. However, verify that required resources were created by the script. + +#### Verify the kube-prometheus-stack + +To confirm that `prometheus-community/kube-prometheus-stack` was installed when `setupKubePrometheusStack` is set to `true`, run the following command: + +```bash +$ helm ls -n +``` +Replace with value for Kubernetes namespace used for monitoring. + +Sample output: +```bash +$ helm ls -n monitoring +NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION +monitoring monitoring 1 2021-06-18 12:58:35.177221969 +0000 UTC deployed kube-prometheus-stack-16.5.0 0.48.0 +$ +``` + +#### Verify the Prometheus, Grafana and Alertmanager setup + +When `exposeMonitoringNodePort` was set to `true`, verify that monitoring services are accessible outside of the Kubernetes cluster: + +- `32100` is the external port for Grafana and with credentials `admin:admin` +- `32101` is the external port for Prometheus +- `32102` is the external port for Alertmanager + +#### Verify the service discovery of WebLogic Monitoring Exporter + +Verify whether prometheus is able to discover wls-exporter and collect the metrics: + +1. Access the Prometheus dashboard at http://mycompany.com:32101/ + +1. Navigate to Status to see the Service Discovery details. + +1. Verify that wls-exporter is listed in the discovered services. + +#### Verify the WebLogic Server dashoard + +You can access the Grafana dashboard at http://mycompany.com:32100/. + +1. Log in to Grafana dashboard with username: `admin` and password: `admin`. + +1. Navigate to "WebLogic Server Dashboard" under General and verify. + +### Delete the monitoring setup + +To delete the monitoring setup created by [Run the setup monitoring script](#run-the-setup-monitoring-script), run the below command: + +```bash +$ cd ${WORKDIR}/monitoring-service +$ ./delete-monitoring.sh \ + -i monitoring-inputs.yaml +``` + diff --git a/OracleWebCenterPortal/kubernetes/monitoring-service/config/config.yml.template b/OracleWebCenterPortal/kubernetes/monitoring-service/config/config.yml.template old mode 100644 new mode 100755 diff --git a/OracleWebCenterPortal/kubernetes/monitoring-service/config/weblogic-server-dashboard-import.json b/OracleWebCenterPortal/kubernetes/monitoring-service/config/weblogic-server-dashboard-import.json old mode 100644 new mode 100755 index c2fa9e2eb..59adc65fe --- a/OracleWebCenterPortal/kubernetes/monitoring-service/config/weblogic-server-dashboard-import.json +++ b/OracleWebCenterPortal/kubernetes/monitoring-service/config/weblogic-server-dashboard-import.json @@ -1,3312 +1,3312 @@ -{ - "__inputs": [], - "__requires": [ - { - "type": "grafana", - "id": "grafana", - "name": "Grafana", - "version": "5.2.4" - }, - { - "type": "panel", - "id": "graph", - "name": "Graph", - "version": "5.0.0" - }, - { - "type": "panel", - "id": "singlestat", - "name": "Singlestat", - "version": "5.0.0" - }, - { - "type": "panel", - "id": "table", - "name": "Table", - "version": "5.0.0" - } - ], - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": "-- Grafana --", - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "editable": true, - "gnetId": null, - "graphTooltip": 0, - "id": null, - "iteration": 1563266678971, - "links": [], - "panels": [ - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 0 - }, - "id": 32, - "panels": [], - "title": "Servers", - "type": "row" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": "$datasource", - "decimals": 0, - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 3, - "w": 13, - "x": 0, - "y": 1 - }, - "hideTimeOverride": true, - "id": 16, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "count(count (wls_jvm_uptime{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\"}) by (name))", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "", - "refId": "A" - } - ], - "thresholds": "", - "timeFrom": null, - "timeShift": null, - "title": "Running Servers", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": "$datasource", - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 3, - "w": 11, - "x": 13, - "y": 1 - }, - "id": 23, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "count(count(wls_webapp_config_deployment_state{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\"}) by (app))", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "", - "refId": "A" - } - ], - "thresholds": "", - "timeFrom": null, - "timeShift": null, - "title": "Deployed Applications", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": true, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": "$datasource", - "decimals": 1, - "description": "", - "format": "percent", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 3, - "w": 6, - "x": 0, - "y": 4 - }, - "hideTimeOverride": true, - "id": 104, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "repeat": "serverName", - "repeatDirection": "v", - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "weblogic_serverName", - "targets": [ - { - "expr": "wls_server_activation_time{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\",weblogic_serverName=\"$serverName\"}", - "format": "table", - "hide": false, - "instant": true, - "interval": "10s", - "intervalFactor": 2, - "legendFormat": "", - "refId": "A" - } - ], - "thresholds": "50,80", - "timeFrom": null, - "timeShift": null, - "title": "Server Name", - "type": "singlestat", - "valueFontSize": "50%", - "valueMaps": [ - { - "op": "=", - "text": "", - "value": "" - } - ], - "valueName": "current" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": true, - "colors": [ - "#56A64B", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": "$datasource", - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 3, - "w": 4, - "x": 6, - "y": 4 - }, - "id": 84, - "interval": "", - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "repeat": "serverName", - "repeatDirection": "v", - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "wls_server_state_val{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=\"$serverName\"}", - "format": "time_series", - "intervalFactor": 1, - "refId": "A" - } - ], - "thresholds": "", - "timeFrom": null, - "timeShift": null, - "title": "Server Status", - "type": "singlestat", - "valueFontSize": "50%", - "valueMaps": [ - { - "op": "=", - "text": "SHUTDOWN", - "value": "0" - }, - { - "op": "=", - "text": "STARTING", - "value": "1" - }, - { - "op": "=", - "text": "RUNNING", - "value": "2" - }, - { - "op": "=", - "text": "STANDBY", - "value": "3" - }, - { - "op": "=", - "text": "FAILED", - "value": "8" - }, - { - "op": "=", - "text": "FAILED", - "value": "17" - } - ], - "valueName": "current" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": true, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": "$datasource", - "decimals": 1, - "description": "", - "format": "percent", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": true, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 3, - "w": 4, - "x": 10, - "y": 4 - }, - "hideTimeOverride": true, - "id": 27, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "repeat": "serverName", - "repeatDirection": "v", - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": true - }, - "tableColumn": "instance", - "targets": [ - { - "expr": "100 - wls_jvm_heap_free_percent{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=\"$serverName\"}", - "format": "time_series", - "hide": false, - "instant": true, - "interval": "10s", - "intervalFactor": 2, - "legendFormat": "", - "refId": "A" - } - ], - "thresholds": "50,80", - "timeFrom": null, - "timeShift": null, - "title": "Heap Usage", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "", - "value": "" - } - ], - "valueName": "current" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorPostfix": false, - "colorValue": true, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": "$datasource", - "decimals": 1, - "description": "", - "format": "ms", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 3, - "w": 5, - "x": 14, - "y": 4 - }, - "hideTimeOverride": true, - "id": 91, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "repeat": "serverName", - "repeatDirection": "v", - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "instance", - "targets": [ - { - "expr": "wls_jvm_uptime{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=\"$serverName\"}", - "format": "time_series", - "hide": false, - "instant": true, - "interval": "10s", - "intervalFactor": 2, - "legendFormat": "", - "refId": "A" - } - ], - "thresholds": "50,80", - "timeFrom": null, - "timeShift": null, - "title": "Running Time", - "type": "singlestat", - "valueFontSize": "50%", - "valueMaps": [ - { - "op": "=", - "text": "", - "value": "" - } - ], - "valueName": "current" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorPostfix": false, - "colorValue": true, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": "$datasource", - "decimals": 0, - "description": "", - "format": "short", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 3, - "w": 5, - "x": 19, - "y": 4 - }, - "hideTimeOverride": true, - "id": 96, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "repeat": "serverName", - "repeatDirection": "v", - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "instance", - "targets": [ - { - "expr": "wls_server_open_sockets_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=\"$serverName\"}", - "format": "time_series", - "hide": false, - "instant": true, - "interval": "10s", - "intervalFactor": 2, - "legendFormat": "", - "refId": "A" - } - ], - "thresholds": "50,80", - "timeFrom": null, - "timeShift": null, - "title": "Open Sockets", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "", - "value": "" - } - ], - "valueName": "current" - }, - { - "aliasColors": { - " heap free managed-server-1": "super-light-green", - " heap free managed-server-2": "dark-green", - "heap size managed-server-1 ": "super-light-red", - "heap size managed-server-2 ": "dark-red" - }, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "fill": 1, - "gridPos": { - "h": 10, - "w": 24, - "x": 0, - "y": 7 - }, - "id": 12, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "max": true, - "min": false, - "rightSide": false, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "wls_jvm_heap_free_current{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": " Heap Free ()", - "refId": "B" - }, - { - "expr": "wls_jvm_heap_size_current{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}", - "format": "time_series", - "instant": false, - "intervalFactor": 1, - "legendFormat": "Heap Size ()", - "refId": "A" - }, - { - "expr": "wls_jvm_heap_size_max{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}", - "format": "time_series", - "hide": true, - "intervalFactor": 1, - "legendFormat": "Heap Max ()", - "refId": "C" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "JVM Heap", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "decbytes", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": { - " heap free managed-server-1": "super-light-green", - " heap free managed-server-2": "dark-green", - "heap size managed-server-1 ": "super-light-red", - "heap size managed-server-2 ": "dark-red" - }, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "fill": 1, - "gridPos": { - "h": 7, - "w": 12, - "x": 0, - "y": 17 - }, - "id": 21, - "legend": { - "alignAsTable": false, - "avg": false, - "current": true, - "max": false, - "min": false, - "rightSide": false, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "wls_jvm_process_cpu_load{weblogic_domainUID=~\"$domainName\", weblogic_clusterName=~\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"} * 100", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": " ", - "refId": "B" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "CPU Load", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "percent", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "fill": 1, - "gridPos": { - "h": 7, - "w": 12, - "x": 12, - "y": 17 - }, - "id": 10, - "legend": { - "alignAsTable": false, - "avg": false, - "current": true, - "max": false, - "min": false, - "rightSide": false, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "wls_threadpool_execute_thread_total_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "Total Threads ()", - "refId": "A" - }, - { - "expr": "wls_threadpool_stuck_thread_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "Stuck Threads ()", - "refId": "D" - }, - { - "expr": "wls_threadpool_queue_length{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}", - "format": "time_series", - "hide": true, - "intervalFactor": 1, - "legendFormat": "queue", - "refId": "C" - }, - { - "expr": "wls_threadpool_hogging_thread_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}", - "format": "time_series", - "hide": true, - "intervalFactor": 1, - "legendFormat": "hogging", - "refId": "B" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Thread Pool", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "collapsed": true, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 24 - }, - "id": 35, - "panels": [ - { - "columns": [], - "datasource": "$datasource", - "fontSize": "100%", - "gridPos": { - "h": 7, - "w": 8, - "x": 0, - "y": 28 - }, - "hideTimeOverride": true, - "id": 126, - "links": [], - "pageSize": null, - "scroll": true, - "showHeader": true, - "sort": { - "col": 13, - "desc": true - }, - "styles": [ - { - "alias": "Time", - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "pattern": "Time", - "type": "hidden" - }, - { - "alias": "Webapp", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 2, - "mappingType": 1, - "pattern": "app", - "thresholds": [], - "type": "string", - "unit": "short" - }, - { - "alias": "Total Sessions", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 0, - "mappingType": 1, - "pattern": "Value", - "thresholds": [], - "type": "number", - "unit": "short" - }, - { - "alias": "", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "decimals": 2, - "pattern": "/.*/", - "thresholds": [], - "type": "hidden", - "unit": "short" - } - ], - "targets": [ - { - "expr": "topk($topN,sum(wls_webapp_config_sessions_opened_total_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (app))", - "format": "table", - "instant": true, - "intervalFactor": 1, - "refId": "B" - } - ], - "timeFrom": null, - "timeShift": null, - "title": "Total Sessions (top $topN)", - "transform": "table", - "type": "table" - }, - { - "columns": [], - "datasource": "$datasource", - "fontSize": "100%", - "gridPos": { - "h": 7, - "w": 8, - "x": 8, - "y": 28 - }, - "hideTimeOverride": true, - "id": 136, - "links": [], - "pageSize": null, - "scroll": true, - "showHeader": true, - "sort": { - "col": 13, - "desc": true - }, - "styles": [ - { - "alias": "Time", - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "pattern": "Time", - "type": "hidden" - }, - { - "alias": "Webapp", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 2, - "mappingType": 1, - "pattern": "app", - "thresholds": [], - "type": "string", - "unit": "short" - }, - { - "alias": "Total Requests", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 0, - "mappingType": 1, - "pattern": "Value", - "thresholds": [], - "type": "number", - "unit": "short" - }, - { - "alias": "", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "decimals": 2, - "pattern": "/.*/", - "thresholds": [], - "type": "hidden", - "unit": "short" - } - ], - "targets": [ - { - "expr": "topk($topN,sum(wls_servlet_invocation_total_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (app))", - "format": "table", - "instant": true, - "intervalFactor": 1, - "refId": "B" - } - ], - "timeFrom": null, - "timeShift": null, - "title": "Total Requests (top $topN)", - "transform": "table", - "type": "table" - }, - { - "columns": [], - "datasource": "$datasource", - "fontSize": "100%", - "gridPos": { - "h": 7, - "w": 8, - "x": 16, - "y": 28 - }, - "hideTimeOverride": true, - "id": 134, - "links": [], - "pageSize": null, - "scroll": true, - "showHeader": true, - "sort": { - "col": 13, - "desc": true - }, - "styles": [ - { - "alias": "Time", - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "pattern": "Time", - "type": "hidden" - }, - { - "alias": "Webapp", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 2, - "mappingType": 1, - "pattern": "app", - "thresholds": [], - "type": "string", - "unit": "short" - }, - { - "alias": "Total Time", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 0, - "mappingType": 1, - "pattern": "Value", - "thresholds": [], - "type": "number", - "unit": "ms" - }, - { - "alias": "", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "decimals": 2, - "pattern": "/.*/", - "thresholds": [], - "type": "hidden", - "unit": "short" - } - ], - "targets": [ - { - "expr": "topk($topN,sum(wls_servlet_execution_time_total{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (app))", - "format": "table", - "instant": true, - "intervalFactor": 1, - "refId": "B" - } - ], - "timeFrom": null, - "timeShift": null, - "title": "Total Execution Time (top $topN)", - "transform": "table", - "type": "table" - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "fill": 1, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 35 - }, - "id": 14, - "legend": { - "alignAsTable": false, - "avg": false, - "current": false, - "max": false, - "min": false, - "rightSide": false, - "show": true, - "sort": "current", - "sortDesc": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(wls_webapp_config_open_sessions_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (app)", - "format": "time_series", - "interval": "", - "intervalFactor": 1, - "legendFormat": "", - "refId": "A" - }, - { - "expr": "", - "format": "time_series", - "intervalFactor": 1, - "refId": "B" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Current Sessions ", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": "", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": true, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "fill": 1, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 35 - }, - "id": 128, - "legend": { - "alignAsTable": false, - "avg": false, - "current": false, - "max": false, - "min": false, - "rightSide": false, - "show": true, - "sort": "current", - "sortDesc": true, - "total": false, - "values": false - }, - "lines": false, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": " sum(irate(wls_webapp_config_sessions_opened_total_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}[5m])) by (app)", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Session Rate ", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": 0, - "format": "short", - "label": "per second", - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "fill": 1, - "gridPos": { - "h": 7, - "w": 12, - "x": 0, - "y": 43 - }, - "id": 132, - "legend": { - "alignAsTable": false, - "avg": false, - "current": false, - "max": false, - "min": false, - "rightSide": false, - "show": true, - "sort": "current", - "sortDesc": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "(sum(wls_servlet_execution_time_average{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (app)) / (count(wls_servlet_execution_time_average{weblogic_domainUID=\"domain1\", weblogic_clusterName=\"cluster-1\"}) by (app))", - "format": "time_series", - "interval": "", - "intervalFactor": 1, - "legendFormat": "", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Execution Time per Request ", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "ms", - "label": "", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": true, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "fill": 1, - "gridPos": { - "h": 7, - "w": 12, - "x": 12, - "y": 43 - }, - "id": 138, - "legend": { - "alignAsTable": false, - "avg": false, - "current": false, - "max": false, - "min": false, - "rightSide": false, - "show": true, - "sort": "current", - "sortDesc": true, - "total": false, - "values": false - }, - "lines": false, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(irate(wls_servlet_invocation_total_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}[5m])) by (app)", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Request Rate ", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": 0, - "format": "short", - "label": "per second", - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - } - ], - "title": "Web Applications", - "type": "row" - }, - { - "collapsed": true, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 25 - }, - "id": 43, - "panels": [ - { - "columns": [], - "datasource": "$datasource", - "fontSize": "100%", - "gridPos": { - "h": 4, - "w": 24, - "x": 0, - "y": 29 - }, - "hideTimeOverride": true, - "id": 111, - "links": [], - "pageSize": null, - "scroll": true, - "showHeader": true, - "sort": { - "col": 0, - "desc": true - }, - "styles": [ - { - "alias": "Time", - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "pattern": "Time", - "type": "hidden" - }, - { - "alias": "Server", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 2, - "mappingType": 1, - "pattern": "weblogic_serverName", - "thresholds": [], - "type": "string", - "unit": "short" - }, - { - "alias": "Name", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 2, - "mappingType": 1, - "pattern": "name", - "thresholds": [], - "type": "string", - "unit": "short" - }, - { - "alias": "Active Connections", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 0, - "mappingType": 1, - "pattern": "Value #A", - "thresholds": [], - "type": "number", - "unit": "short" - }, - { - "alias": "Current Capacity", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 0, - "mappingType": 1, - "pattern": "Value #C", - "thresholds": [], - "type": "number", - "unit": "short" - }, - { - "alias": "Total Connections", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 0, - "mappingType": 1, - "pattern": "Value #D", - "thresholds": [], - "type": "number", - "unit": "short" - }, - { - "alias": "Total Connections", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 0, - "mappingType": 1, - "pattern": "Value #D", - "thresholds": [], - "type": "number", - "unit": "short" - }, - { - "alias": "", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "decimals": 2, - "pattern": "/.*/", - "thresholds": [], - "type": "hidden", - "unit": "short" - } - ], - "targets": [ - { - "expr": "sum(wls_datasource_curr_capacity{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (weblogic_serverName,name)", - "format": "table", - "instant": true, - "intervalFactor": 1, - "refId": "C" - }, - { - "expr": "sum(wls_datasource_active_connections_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (weblogic_serverName,name)", - "format": "table", - "instant": true, - "intervalFactor": 1, - "refId": "A" - }, - { - "expr": "sum(wls_datasource_connections_total_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (weblogic_serverName,name)", - "format": "table", - "instant": true, - "intervalFactor": 1, - "refId": "D" - } - ], - "timeFrom": null, - "timeShift": null, - "title": "Overview", - "transform": "table", - "type": "table" - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "fill": 1, - "gridPos": { - "h": 8, - "w": 13, - "x": 0, - "y": 33 - }, - "id": 50, - "legend": { - "alignAsTable": false, - "avg": false, - "current": false, - "max": false, - "min": false, - "rightSide": false, - "show": true, - "sort": "current", - "sortDesc": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "wls_datasource_active_connections_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": " @ ", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Active Connections", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": 0, - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": true, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "fill": 1, - "gridPos": { - "h": 8, - "w": 11, - "x": 13, - "y": 33 - }, - "id": 71, - "legend": { - "alignAsTable": false, - "avg": false, - "current": false, - "max": false, - "min": false, - "rightSide": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "irate(wls_datasource_connections_total_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}[5m])", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": " @ ", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Connection Rate", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": 0, - "format": "short", - "label": "per second", - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "fill": 1, - "gridPos": { - "h": 9, - "w": 11, - "x": 0, - "y": 41 - }, - "id": 46, - "legend": { - "alignAsTable": false, - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "wls_datasource_waiting_for_connection_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": " @ ", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Pending Connection Requests", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": 0, - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "fill": 1, - "gridPos": { - "h": 9, - "w": 13, - "x": 11, - "y": 41 - }, - "id": 73, - "legend": { - "alignAsTable": false, - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "wls_datasource_connection_delay_time{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": " @ ", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Average Connection Delay Time", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": 0, - "format": "ms", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - } - ], - "title": "Data Sources", - "type": "row" - }, - { - "collapsed": true, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 26 - }, - "id": 40, - "panels": [ - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "fill": 1, - "gridPos": { - "h": 6, - "w": 12, - "x": 0, - "y": 30 - }, - "id": 145, - "legend": { - "alignAsTable": false, - "avg": false, - "current": false, - "max": false, - "min": false, - "rightSide": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(wls_jmsruntime_connections_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (weblogic_serverName)", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "JMS Connections", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": 0, - "format": "short", - "label": "", - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "fill": 1, - "gridPos": { - "h": 6, - "w": 12, - "x": 12, - "y": 30 - }, - "id": 147, - "legend": { - "alignAsTable": false, - "avg": false, - "current": false, - "max": false, - "min": false, - "rightSide": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(irate(wls_jmsruntime_connections_total_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}[5m])) by (weblogic_serverName)", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "JMS Connection Rate", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": null, - "format": "short", - "label": "", - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "columns": [], - "datasource": "$datasource", - "fontSize": "100%", - "gridPos": { - "h": 4, - "w": 24, - "x": 0, - "y": 36 - }, - "hideTimeOverride": true, - "id": 113, - "links": [], - "pageSize": null, - "scroll": true, - "showHeader": true, - "sort": { - "col": 0, - "desc": true - }, - "styles": [ - { - "alias": "Time", - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "pattern": "Time", - "type": "hidden" - }, - { - "alias": "Name", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 2, - "mappingType": 1, - "pattern": "jmsserver", - "thresholds": [], - "type": "string", - "unit": "short" - }, - { - "alias": "Current Dests", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 0, - "mappingType": 1, - "pattern": "Value #B", - "thresholds": [], - "type": "number", - "unit": "short" - }, - { - "alias": "Total Msgs", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 0, - "mappingType": 1, - "pattern": "Value #A", - "thresholds": [], - "type": "number", - "unit": "short" - }, - { - "alias": "Total Bytes", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 0, - "mappingType": 1, - "pattern": "Value #D", - "thresholds": [], - "type": "number", - "unit": "bytes" - }, - { - "alias": "Total Dests", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 0, - "mappingType": 1, - "pattern": "Value #E", - "thresholds": [], - "type": "number", - "unit": "short" - }, - { - "alias": "", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "decimals": 2, - "pattern": "/.*/", - "thresholds": [], - "type": "hidden", - "unit": "short" - } - ], - "targets": [ - { - "expr": "sum(wls_jms_destinations_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (jmsserver)", - "format": "table", - "instant": true, - "intervalFactor": 1, - "refId": "B" - }, - { - "expr": "sum(wls_jms_messages_received_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (jmsserver)", - "format": "table", - "instant": true, - "intervalFactor": 1, - "refId": "A" - }, - { - "expr": "sum(wls_jms_bytes_received_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (jmsserver)", - "format": "table", - "instant": true, - "intervalFactor": 1, - "refId": "D" - }, - { - "expr": "sum(wls_jms_destinations_total_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (jmsserver)", - "format": "table", - "instant": true, - "intervalFactor": 1, - "refId": "E" - }, - { - "expr": "sum(wls_jms_destinations_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (jmsserver)", - "format": "table", - "instant": true, - "intervalFactor": 1, - "refId": "F" - } - ], - "timeFrom": null, - "timeShift": null, - "title": "JMSServer Overview", - "transform": "table", - "type": "table" - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "fill": 1, - "gridPos": { - "h": 7, - "w": 12, - "x": 0, - "y": 40 - }, - "id": 54, - "legend": { - "alignAsTable": false, - "avg": false, - "current": true, - "max": false, - "min": false, - "rightSide": false, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(wls_jms_messages_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (jmsserver)", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "Current ()", - "refId": "A" - }, - { - "expr": "sum(wls_jms_messages_pending_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (jmsserver)", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "Pending ()", - "refId": "B" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Messages", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": 0, - "format": "short", - "label": "", - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "fill": 1, - "gridPos": { - "h": 7, - "w": 12, - "x": 12, - "y": 40 - }, - "id": 56, - "legend": { - "alignAsTable": false, - "avg": false, - "current": true, - "max": false, - "min": false, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(wls_jms_bytes_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (jmsserver)", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "Current ()", - "refId": "A" - }, - { - "expr": "sum(wls_jms_bytes_pending_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (jmsserver)", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "Pending ()", - "refId": "B" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Bytes", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": 0, - "format": "short", - "label": "", - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": true, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "fill": 1, - "gridPos": { - "h": 7, - "w": 12, - "x": 0, - "y": 47 - }, - "id": 58, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(irate(wls_jms_messages_received_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}[5m])) by (jmsserver)", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Received Message Rate ", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": null, - "format": "short", - "label": "", - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": true, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "fill": 1, - "gridPos": { - "h": 7, - "w": 12, - "x": 12, - "y": 47 - }, - "id": 117, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(irate(wls_jms_bytes_received_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}[5m])) by (jmsserver)", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Received Byte Rate", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": null, - "format": "short", - "label": "", - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "columns": [], - "datasource": "$datasource", - "fontSize": "100%", - "gridPos": { - "h": 5, - "w": 24, - "x": 0, - "y": 54 - }, - "hideTimeOverride": true, - "id": 119, - "links": [], - "pageSize": null, - "scroll": true, - "showHeader": true, - "sort": { - "col": 3, - "desc": false - }, - "styles": [ - { - "alias": "Time", - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "pattern": "Time", - "type": "hidden" - }, - { - "alias": "Destination", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 2, - "mappingType": 1, - "pattern": "destination", - "thresholds": [], - "type": "string", - "unit": "short" - }, - { - "alias": "Current Consumers", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 0, - "mappingType": 1, - "pattern": "Value #A", - "thresholds": [], - "type": "number", - "unit": "short" - }, - { - "alias": "Current Msgs", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 0, - "mappingType": 1, - "pattern": "Value #B", - "thresholds": [], - "type": "number", - "unit": "short" - }, - { - "alias": "Pending Msgs", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 0, - "mappingType": 1, - "pattern": "Value #C", - "thresholds": [], - "type": "number", - "unit": "short" - }, - { - "alias": "Currrent Bytes", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 0, - "mappingType": 1, - "pattern": "Value #D", - "thresholds": [], - "type": "number", - "unit": "bytes" - }, - { - "alias": "Pending Bytes", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 0, - "mappingType": 1, - "pattern": "Value #E", - "thresholds": [], - "type": "number", - "unit": "short" - }, - { - "alias": "Total Msgs", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 0, - "mappingType": 1, - "pattern": "Value #F", - "thresholds": [], - "type": "number", - "unit": "short" - }, - { - "alias": "Total Bytes", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 0, - "mappingType": 1, - "pattern": "Value #G", - "thresholds": [], - "type": "number", - "unit": "short" - }, - { - "alias": "", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "decimals": 2, - "pattern": "/.*/", - "thresholds": [], - "type": "hidden", - "unit": "short" - } - ], - "targets": [ - { - "expr": "sum(wls_jms_dest_consumers_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (destination)", - "format": "table", - "instant": true, - "intervalFactor": 1, - "refId": "A" - }, - { - "expr": "sum(wls_jms_dest_messages_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (destination)", - "format": "table", - "instant": true, - "intervalFactor": 1, - "refId": "B" - }, - { - "expr": "sum(wls_jms_dest_messages_pending_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (destination)", - "format": "table", - "instant": true, - "intervalFactor": 1, - "refId": "C" - }, - { - "expr": "sum(wls_jms_dest_bytes_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (destination)", - "format": "table", - "instant": true, - "intervalFactor": 1, - "refId": "D" - }, - { - "expr": "sum(wls_jms_dest_bytes_pending_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (destination)", - "format": "table", - "instant": true, - "intervalFactor": 1, - "refId": "E" - }, - { - "expr": "sum(wls_jms_dest_messages_received_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (destination)", - "format": "table", - "instant": true, - "interval": "", - "intervalFactor": 1, - "refId": "F" - }, - { - "expr": "sum(wls_jms_dest_bytes_received_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (destination)", - "format": "table", - "instant": true, - "intervalFactor": 1, - "refId": "G" - } - ], - "timeFrom": null, - "timeShift": null, - "title": "Destinations Overview", - "transform": "table", - "type": "table" - } - ], - "title": "JMS Services", - "type": "row" - } - ], - "refresh": false, - "schemaVersion": 16, - "style": "dark", - "tags": [], - "templating": { - "list": [ - { - "current": { - "text": "prometheus", - "value": "prometheus" - }, - "hide": 0, - "label": null, - "name": "datasource", - "options": [], - "query": "prometheus", - "refresh": 1, - "regex": "", - "type": "datasource" - }, - { - "allValue": null, - "current": {}, - "datasource": "$datasource", - "hide": 0, - "includeAll": false, - "label": "Domain", - "multi": false, - "name": "domainName", - "options": [], - "query": "label_values(weblogic_domainUID)", - "refresh": 1, - "regex": "", - "sort": 2, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "allValue": null, - "current": {}, - "datasource": "$datasource", - "hide": 0, - "includeAll": false, - "label": "Cluster", - "multi": false, - "name": "clusterName", - "options": [], - "query": "label_values(wls_jvm_uptime{weblogic_domainUID=\"$domainName\"},weblogic_clusterName)", - "refresh": 1, - "regex": "", - "sort": 2, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "allValue": null, - "current": {}, - "datasource": "$datasource", - "hide": 0, - "includeAll": true, - "label": "Server", - "multi": true, - "name": "serverName", - "options": [], - "query": "label_values(wls_jvm_uptime{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\"},weblogic_serverName)", - "refresh": 1, - "regex": "", - "sort": 2, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "allValue": null, - "current": { - "selected": false, - "tags": [], - "text": "5", - "value": "5" - }, - "hide": 0, - "includeAll": false, - "label": "Top N", - "multi": false, - "name": "topN", - "options": [ - { - "selected": false, - "text": "3", - "value": "3" - }, - { - "selected": true, - "text": "5", - "value": "5" - }, - { - "selected": false, - "text": "7", - "value": "7" - }, - { - "selected": false, - "text": "10", - "value": "10" - } - ], - "query": "3, 5, 7, 10", - "skipUrlSync": false, - "type": "custom" - } - ] - }, - "time": { - "from": "now-30m", - "to": "now" - }, - "timepicker": { - "hidden": false, - "refresh_intervals": [ - "5s", - "10s", - "30s", - "1m", - "5m", - "15m", - "30m", - "1h", - "2h", - "1d" - ], - "time_options": [ - "5m", - "15m", - "1h", - "6h", - "12h", - "24h", - "2d", - "7d", - "30d" - ] - }, - "timezone": "", - "title": "WebLogic Server Dashboard", - "uid": "5yUwzbZWz", - "version": 6 -} +{ + "__inputs": [], + "__requires": [ + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "5.2.4" + }, + { + "type": "panel", + "id": "graph", + "name": "Graph", + "version": "5.0.0" + }, + { + "type": "panel", + "id": "singlestat", + "name": "Singlestat", + "version": "5.0.0" + }, + { + "type": "panel", + "id": "table", + "name": "Table", + "version": "5.0.0" + } + ], + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "id": null, + "iteration": 1563266678971, + "links": [], + "panels": [ + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 32, + "panels": [], + "title": "Servers", + "type": "row" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "datasource": "$datasource", + "decimals": 0, + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 13, + "x": 0, + "y": 1 + }, + "hideTimeOverride": true, + "id": 16, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "expr": "count(count (wls_jvm_uptime{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\"}) by (name))", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": "", + "timeFrom": null, + "timeShift": null, + "title": "Running Servers", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "datasource": "$datasource", + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 11, + "x": 13, + "y": 1 + }, + "id": 23, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "expr": "count(count(wls_webapp_config_deployment_state{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\"}) by (app))", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": "", + "timeFrom": null, + "timeShift": null, + "title": "Deployed Applications", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "datasource": "$datasource", + "decimals": 1, + "description": "", + "format": "percent", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 6, + "x": 0, + "y": 4 + }, + "hideTimeOverride": true, + "id": 104, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "repeat": "serverName", + "repeatDirection": "v", + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "weblogic_serverName", + "targets": [ + { + "expr": "wls_server_activation_time{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\",weblogic_serverName=\"$serverName\"}", + "format": "table", + "hide": false, + "instant": true, + "interval": "10s", + "intervalFactor": 2, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": "50,80", + "timeFrom": null, + "timeShift": null, + "title": "Server Name", + "type": "singlestat", + "valueFontSize": "50%", + "valueMaps": [ + { + "op": "=", + "text": "", + "value": "" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "#56A64B", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "datasource": "$datasource", + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 4, + "x": 6, + "y": 4 + }, + "id": 84, + "interval": "", + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "repeat": "serverName", + "repeatDirection": "v", + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "expr": "wls_server_state_val{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=\"$serverName\"}", + "format": "time_series", + "intervalFactor": 1, + "refId": "A" + } + ], + "thresholds": "", + "timeFrom": null, + "timeShift": null, + "title": "Server Status", + "type": "singlestat", + "valueFontSize": "50%", + "valueMaps": [ + { + "op": "=", + "text": "SHUTDOWN", + "value": "0" + }, + { + "op": "=", + "text": "STARTING", + "value": "1" + }, + { + "op": "=", + "text": "RUNNING", + "value": "2" + }, + { + "op": "=", + "text": "STANDBY", + "value": "3" + }, + { + "op": "=", + "text": "FAILED", + "value": "8" + }, + { + "op": "=", + "text": "FAILED", + "value": "17" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "datasource": "$datasource", + "decimals": 1, + "description": "", + "format": "percent", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": true, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 4, + "x": 10, + "y": 4 + }, + "hideTimeOverride": true, + "id": 27, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "repeat": "serverName", + "repeatDirection": "v", + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "instance", + "targets": [ + { + "expr": "100 - wls_jvm_heap_free_percent{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=\"$serverName\"}", + "format": "time_series", + "hide": false, + "instant": true, + "interval": "10s", + "intervalFactor": 2, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": "50,80", + "timeFrom": null, + "timeShift": null, + "title": "Heap Usage", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "", + "value": "" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorPostfix": false, + "colorValue": true, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "datasource": "$datasource", + "decimals": 1, + "description": "", + "format": "ms", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 5, + "x": 14, + "y": 4 + }, + "hideTimeOverride": true, + "id": 91, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "repeat": "serverName", + "repeatDirection": "v", + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "instance", + "targets": [ + { + "expr": "wls_jvm_uptime{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=\"$serverName\"}", + "format": "time_series", + "hide": false, + "instant": true, + "interval": "10s", + "intervalFactor": 2, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": "50,80", + "timeFrom": null, + "timeShift": null, + "title": "Running Time", + "type": "singlestat", + "valueFontSize": "50%", + "valueMaps": [ + { + "op": "=", + "text": "", + "value": "" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorPostfix": false, + "colorValue": true, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "datasource": "$datasource", + "decimals": 0, + "description": "", + "format": "short", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 5, + "x": 19, + "y": 4 + }, + "hideTimeOverride": true, + "id": 96, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "repeat": "serverName", + "repeatDirection": "v", + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "instance", + "targets": [ + { + "expr": "wls_server_open_sockets_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=\"$serverName\"}", + "format": "time_series", + "hide": false, + "instant": true, + "interval": "10s", + "intervalFactor": 2, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": "50,80", + "timeFrom": null, + "timeShift": null, + "title": "Open Sockets", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "", + "value": "" + } + ], + "valueName": "current" + }, + { + "aliasColors": { + " heap free managed-server-1": "super-light-green", + " heap free managed-server-2": "dark-green", + "heap size managed-server-1 ": "super-light-red", + "heap size managed-server-2 ": "dark-red" + }, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$datasource", + "fill": 1, + "gridPos": { + "h": 10, + "w": 24, + "x": 0, + "y": 7 + }, + "id": 12, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": true, + "min": false, + "rightSide": false, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "wls_jvm_heap_free_current{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": " Heap Free ()", + "refId": "B" + }, + { + "expr": "wls_jvm_heap_size_current{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}", + "format": "time_series", + "instant": false, + "intervalFactor": 1, + "legendFormat": "Heap Size ()", + "refId": "A" + }, + { + "expr": "wls_jvm_heap_size_max{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}", + "format": "time_series", + "hide": true, + "intervalFactor": 1, + "legendFormat": "Heap Max ()", + "refId": "C" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "JVM Heap", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "decbytes", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": { + " heap free managed-server-1": "super-light-green", + " heap free managed-server-2": "dark-green", + "heap size managed-server-1 ": "super-light-red", + "heap size managed-server-2 ": "dark-red" + }, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$datasource", + "fill": 1, + "gridPos": { + "h": 7, + "w": 12, + "x": 0, + "y": 17 + }, + "id": 21, + "legend": { + "alignAsTable": false, + "avg": false, + "current": true, + "max": false, + "min": false, + "rightSide": false, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "wls_jvm_process_cpu_load{weblogic_domainUID=~\"$domainName\", weblogic_clusterName=~\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"} * 100", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": " ", + "refId": "B" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "CPU Load", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "percent", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$datasource", + "fill": 1, + "gridPos": { + "h": 7, + "w": 12, + "x": 12, + "y": 17 + }, + "id": 10, + "legend": { + "alignAsTable": false, + "avg": false, + "current": true, + "max": false, + "min": false, + "rightSide": false, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "wls_threadpool_execute_thread_total_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Total Threads ()", + "refId": "A" + }, + { + "expr": "wls_threadpool_stuck_thread_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Stuck Threads ()", + "refId": "D" + }, + { + "expr": "wls_threadpool_queue_length{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}", + "format": "time_series", + "hide": true, + "intervalFactor": 1, + "legendFormat": "queue", + "refId": "C" + }, + { + "expr": "wls_threadpool_hogging_thread_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}", + "format": "time_series", + "hide": true, + "intervalFactor": 1, + "legendFormat": "hogging", + "refId": "B" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Thread Pool", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "collapsed": true, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 24 + }, + "id": 35, + "panels": [ + { + "columns": [], + "datasource": "$datasource", + "fontSize": "100%", + "gridPos": { + "h": 7, + "w": 8, + "x": 0, + "y": 28 + }, + "hideTimeOverride": true, + "id": 126, + "links": [], + "pageSize": null, + "scroll": true, + "showHeader": true, + "sort": { + "col": 13, + "desc": true + }, + "styles": [ + { + "alias": "Time", + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "pattern": "Time", + "type": "hidden" + }, + { + "alias": "Webapp", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "app", + "thresholds": [], + "type": "string", + "unit": "short" + }, + { + "alias": "Total Sessions", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "Value", + "thresholds": [], + "type": "number", + "unit": "short" + }, + { + "alias": "", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "decimals": 2, + "pattern": "/.*/", + "thresholds": [], + "type": "hidden", + "unit": "short" + } + ], + "targets": [ + { + "expr": "topk($topN,sum(wls_webapp_config_sessions_opened_total_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (app))", + "format": "table", + "instant": true, + "intervalFactor": 1, + "refId": "B" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Total Sessions (top $topN)", + "transform": "table", + "type": "table" + }, + { + "columns": [], + "datasource": "$datasource", + "fontSize": "100%", + "gridPos": { + "h": 7, + "w": 8, + "x": 8, + "y": 28 + }, + "hideTimeOverride": true, + "id": 136, + "links": [], + "pageSize": null, + "scroll": true, + "showHeader": true, + "sort": { + "col": 13, + "desc": true + }, + "styles": [ + { + "alias": "Time", + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "pattern": "Time", + "type": "hidden" + }, + { + "alias": "Webapp", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "app", + "thresholds": [], + "type": "string", + "unit": "short" + }, + { + "alias": "Total Requests", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "Value", + "thresholds": [], + "type": "number", + "unit": "short" + }, + { + "alias": "", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "decimals": 2, + "pattern": "/.*/", + "thresholds": [], + "type": "hidden", + "unit": "short" + } + ], + "targets": [ + { + "expr": "topk($topN,sum(wls_servlet_invocation_total_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (app))", + "format": "table", + "instant": true, + "intervalFactor": 1, + "refId": "B" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Total Requests (top $topN)", + "transform": "table", + "type": "table" + }, + { + "columns": [], + "datasource": "$datasource", + "fontSize": "100%", + "gridPos": { + "h": 7, + "w": 8, + "x": 16, + "y": 28 + }, + "hideTimeOverride": true, + "id": 134, + "links": [], + "pageSize": null, + "scroll": true, + "showHeader": true, + "sort": { + "col": 13, + "desc": true + }, + "styles": [ + { + "alias": "Time", + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "pattern": "Time", + "type": "hidden" + }, + { + "alias": "Webapp", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "app", + "thresholds": [], + "type": "string", + "unit": "short" + }, + { + "alias": "Total Time", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "Value", + "thresholds": [], + "type": "number", + "unit": "ms" + }, + { + "alias": "", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "decimals": 2, + "pattern": "/.*/", + "thresholds": [], + "type": "hidden", + "unit": "short" + } + ], + "targets": [ + { + "expr": "topk($topN,sum(wls_servlet_execution_time_total{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (app))", + "format": "table", + "instant": true, + "intervalFactor": 1, + "refId": "B" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Total Execution Time (top $topN)", + "transform": "table", + "type": "table" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$datasource", + "fill": 1, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 35 + }, + "id": 14, + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": false, + "show": true, + "sort": "current", + "sortDesc": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(wls_webapp_config_open_sessions_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (app)", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + }, + { + "expr": "", + "format": "time_series", + "intervalFactor": 1, + "refId": "B" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Current Sessions ", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": "", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": true, + "dashLength": 10, + "dashes": false, + "datasource": "$datasource", + "fill": 1, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 35 + }, + "id": 128, + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": false, + "show": true, + "sort": "current", + "sortDesc": true, + "total": false, + "values": false + }, + "lines": false, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": " sum(irate(wls_webapp_config_sessions_opened_total_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}[5m])) by (app)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Session Rate ", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": 0, + "format": "short", + "label": "per second", + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$datasource", + "fill": 1, + "gridPos": { + "h": 7, + "w": 12, + "x": 0, + "y": 43 + }, + "id": 132, + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": false, + "show": true, + "sort": "current", + "sortDesc": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "(sum(wls_servlet_execution_time_average{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (app)) / (count(wls_servlet_execution_time_average{weblogic_domainUID=\"domain1\", weblogic_clusterName=\"cluster-1\"}) by (app))", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Execution Time per Request ", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "ms", + "label": "", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": true, + "dashLength": 10, + "dashes": false, + "datasource": "$datasource", + "fill": 1, + "gridPos": { + "h": 7, + "w": 12, + "x": 12, + "y": 43 + }, + "id": 138, + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": false, + "show": true, + "sort": "current", + "sortDesc": true, + "total": false, + "values": false + }, + "lines": false, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(irate(wls_servlet_invocation_total_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}[5m])) by (app)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Request Rate ", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": 0, + "format": "short", + "label": "per second", + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + } + ], + "title": "Web Applications", + "type": "row" + }, + { + "collapsed": true, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 25 + }, + "id": 43, + "panels": [ + { + "columns": [], + "datasource": "$datasource", + "fontSize": "100%", + "gridPos": { + "h": 4, + "w": 24, + "x": 0, + "y": 29 + }, + "hideTimeOverride": true, + "id": 111, + "links": [], + "pageSize": null, + "scroll": true, + "showHeader": true, + "sort": { + "col": 0, + "desc": true + }, + "styles": [ + { + "alias": "Time", + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "pattern": "Time", + "type": "hidden" + }, + { + "alias": "Server", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "weblogic_serverName", + "thresholds": [], + "type": "string", + "unit": "short" + }, + { + "alias": "Name", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "name", + "thresholds": [], + "type": "string", + "unit": "short" + }, + { + "alias": "Active Connections", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "Value #A", + "thresholds": [], + "type": "number", + "unit": "short" + }, + { + "alias": "Current Capacity", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "Value #C", + "thresholds": [], + "type": "number", + "unit": "short" + }, + { + "alias": "Total Connections", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "Value #D", + "thresholds": [], + "type": "number", + "unit": "short" + }, + { + "alias": "Total Connections", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "Value #D", + "thresholds": [], + "type": "number", + "unit": "short" + }, + { + "alias": "", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "decimals": 2, + "pattern": "/.*/", + "thresholds": [], + "type": "hidden", + "unit": "short" + } + ], + "targets": [ + { + "expr": "sum(wls_datasource_curr_capacity{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (weblogic_serverName,name)", + "format": "table", + "instant": true, + "intervalFactor": 1, + "refId": "C" + }, + { + "expr": "sum(wls_datasource_active_connections_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (weblogic_serverName,name)", + "format": "table", + "instant": true, + "intervalFactor": 1, + "refId": "A" + }, + { + "expr": "sum(wls_datasource_connections_total_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (weblogic_serverName,name)", + "format": "table", + "instant": true, + "intervalFactor": 1, + "refId": "D" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Overview", + "transform": "table", + "type": "table" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$datasource", + "fill": 1, + "gridPos": { + "h": 8, + "w": 13, + "x": 0, + "y": 33 + }, + "id": 50, + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": false, + "show": true, + "sort": "current", + "sortDesc": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "wls_datasource_active_connections_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": " @ ", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Active Connections", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": 0, + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": true, + "dashLength": 10, + "dashes": false, + "datasource": "$datasource", + "fill": 1, + "gridPos": { + "h": 8, + "w": 11, + "x": 13, + "y": 33 + }, + "id": 71, + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "irate(wls_datasource_connections_total_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}[5m])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": " @ ", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Connection Rate", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": 0, + "format": "short", + "label": "per second", + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$datasource", + "fill": 1, + "gridPos": { + "h": 9, + "w": 11, + "x": 0, + "y": 41 + }, + "id": 46, + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "wls_datasource_waiting_for_connection_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": " @ ", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Pending Connection Requests", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": 0, + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$datasource", + "fill": 1, + "gridPos": { + "h": 9, + "w": 13, + "x": 11, + "y": 41 + }, + "id": 73, + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "wls_datasource_connection_delay_time{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": " @ ", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Average Connection Delay Time", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": 0, + "format": "ms", + "label": null, + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + } + ], + "title": "Data Sources", + "type": "row" + }, + { + "collapsed": true, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 26 + }, + "id": 40, + "panels": [ + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$datasource", + "fill": 1, + "gridPos": { + "h": 6, + "w": 12, + "x": 0, + "y": 30 + }, + "id": 145, + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(wls_jmsruntime_connections_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (weblogic_serverName)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "JMS Connections", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": 0, + "format": "short", + "label": "", + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$datasource", + "fill": 1, + "gridPos": { + "h": 6, + "w": 12, + "x": 12, + "y": 30 + }, + "id": 147, + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(irate(wls_jmsruntime_connections_total_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}[5m])) by (weblogic_serverName)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "JMS Connection Rate", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": null, + "format": "short", + "label": "", + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "columns": [], + "datasource": "$datasource", + "fontSize": "100%", + "gridPos": { + "h": 4, + "w": 24, + "x": 0, + "y": 36 + }, + "hideTimeOverride": true, + "id": 113, + "links": [], + "pageSize": null, + "scroll": true, + "showHeader": true, + "sort": { + "col": 0, + "desc": true + }, + "styles": [ + { + "alias": "Time", + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "pattern": "Time", + "type": "hidden" + }, + { + "alias": "Name", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "jmsserver", + "thresholds": [], + "type": "string", + "unit": "short" + }, + { + "alias": "Current Dests", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "Value #B", + "thresholds": [], + "type": "number", + "unit": "short" + }, + { + "alias": "Total Msgs", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "Value #A", + "thresholds": [], + "type": "number", + "unit": "short" + }, + { + "alias": "Total Bytes", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "Value #D", + "thresholds": [], + "type": "number", + "unit": "bytes" + }, + { + "alias": "Total Dests", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "Value #E", + "thresholds": [], + "type": "number", + "unit": "short" + }, + { + "alias": "", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "decimals": 2, + "pattern": "/.*/", + "thresholds": [], + "type": "hidden", + "unit": "short" + } + ], + "targets": [ + { + "expr": "sum(wls_jms_destinations_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (jmsserver)", + "format": "table", + "instant": true, + "intervalFactor": 1, + "refId": "B" + }, + { + "expr": "sum(wls_jms_messages_received_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (jmsserver)", + "format": "table", + "instant": true, + "intervalFactor": 1, + "refId": "A" + }, + { + "expr": "sum(wls_jms_bytes_received_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (jmsserver)", + "format": "table", + "instant": true, + "intervalFactor": 1, + "refId": "D" + }, + { + "expr": "sum(wls_jms_destinations_total_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (jmsserver)", + "format": "table", + "instant": true, + "intervalFactor": 1, + "refId": "E" + }, + { + "expr": "sum(wls_jms_destinations_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (jmsserver)", + "format": "table", + "instant": true, + "intervalFactor": 1, + "refId": "F" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "JMSServer Overview", + "transform": "table", + "type": "table" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$datasource", + "fill": 1, + "gridPos": { + "h": 7, + "w": 12, + "x": 0, + "y": 40 + }, + "id": 54, + "legend": { + "alignAsTable": false, + "avg": false, + "current": true, + "max": false, + "min": false, + "rightSide": false, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(wls_jms_messages_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (jmsserver)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Current ()", + "refId": "A" + }, + { + "expr": "sum(wls_jms_messages_pending_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (jmsserver)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Pending ()", + "refId": "B" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Messages", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": 0, + "format": "short", + "label": "", + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$datasource", + "fill": 1, + "gridPos": { + "h": 7, + "w": 12, + "x": 12, + "y": 40 + }, + "id": 56, + "legend": { + "alignAsTable": false, + "avg": false, + "current": true, + "max": false, + "min": false, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(wls_jms_bytes_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (jmsserver)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Current ()", + "refId": "A" + }, + { + "expr": "sum(wls_jms_bytes_pending_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (jmsserver)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Pending ()", + "refId": "B" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Bytes", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": 0, + "format": "short", + "label": "", + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": true, + "dashLength": 10, + "dashes": false, + "datasource": "$datasource", + "fill": 1, + "gridPos": { + "h": 7, + "w": 12, + "x": 0, + "y": 47 + }, + "id": 58, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(irate(wls_jms_messages_received_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}[5m])) by (jmsserver)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Received Message Rate ", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": null, + "format": "short", + "label": "", + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": true, + "dashLength": 10, + "dashes": false, + "datasource": "$datasource", + "fill": 1, + "gridPos": { + "h": 7, + "w": 12, + "x": 12, + "y": 47 + }, + "id": 117, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(irate(wls_jms_bytes_received_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}[5m])) by (jmsserver)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Received Byte Rate", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": null, + "format": "short", + "label": "", + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "columns": [], + "datasource": "$datasource", + "fontSize": "100%", + "gridPos": { + "h": 5, + "w": 24, + "x": 0, + "y": 54 + }, + "hideTimeOverride": true, + "id": 119, + "links": [], + "pageSize": null, + "scroll": true, + "showHeader": true, + "sort": { + "col": 3, + "desc": false + }, + "styles": [ + { + "alias": "Time", + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "pattern": "Time", + "type": "hidden" + }, + { + "alias": "Destination", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "destination", + "thresholds": [], + "type": "string", + "unit": "short" + }, + { + "alias": "Current Consumers", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "Value #A", + "thresholds": [], + "type": "number", + "unit": "short" + }, + { + "alias": "Current Msgs", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "Value #B", + "thresholds": [], + "type": "number", + "unit": "short" + }, + { + "alias": "Pending Msgs", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "Value #C", + "thresholds": [], + "type": "number", + "unit": "short" + }, + { + "alias": "Currrent Bytes", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "Value #D", + "thresholds": [], + "type": "number", + "unit": "bytes" + }, + { + "alias": "Pending Bytes", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "Value #E", + "thresholds": [], + "type": "number", + "unit": "short" + }, + { + "alias": "Total Msgs", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "Value #F", + "thresholds": [], + "type": "number", + "unit": "short" + }, + { + "alias": "Total Bytes", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "Value #G", + "thresholds": [], + "type": "number", + "unit": "short" + }, + { + "alias": "", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "decimals": 2, + "pattern": "/.*/", + "thresholds": [], + "type": "hidden", + "unit": "short" + } + ], + "targets": [ + { + "expr": "sum(wls_jms_dest_consumers_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (destination)", + "format": "table", + "instant": true, + "intervalFactor": 1, + "refId": "A" + }, + { + "expr": "sum(wls_jms_dest_messages_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (destination)", + "format": "table", + "instant": true, + "intervalFactor": 1, + "refId": "B" + }, + { + "expr": "sum(wls_jms_dest_messages_pending_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (destination)", + "format": "table", + "instant": true, + "intervalFactor": 1, + "refId": "C" + }, + { + "expr": "sum(wls_jms_dest_bytes_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (destination)", + "format": "table", + "instant": true, + "intervalFactor": 1, + "refId": "D" + }, + { + "expr": "sum(wls_jms_dest_bytes_pending_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (destination)", + "format": "table", + "instant": true, + "intervalFactor": 1, + "refId": "E" + }, + { + "expr": "sum(wls_jms_dest_messages_received_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (destination)", + "format": "table", + "instant": true, + "interval": "", + "intervalFactor": 1, + "refId": "F" + }, + { + "expr": "sum(wls_jms_dest_bytes_received_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (destination)", + "format": "table", + "instant": true, + "intervalFactor": 1, + "refId": "G" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Destinations Overview", + "transform": "table", + "type": "table" + } + ], + "title": "JMS Services", + "type": "row" + } + ], + "refresh": false, + "schemaVersion": 16, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "current": { + "text": "prometheus", + "value": "prometheus" + }, + "hide": 0, + "label": null, + "name": "datasource", + "options": [], + "query": "prometheus", + "refresh": 1, + "regex": "", + "type": "datasource" + }, + { + "allValue": null, + "current": {}, + "datasource": "$datasource", + "hide": 0, + "includeAll": false, + "label": "Domain", + "multi": false, + "name": "domainName", + "options": [], + "query": "label_values(weblogic_domainUID)", + "refresh": 1, + "regex": "", + "sort": 2, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": null, + "current": {}, + "datasource": "$datasource", + "hide": 0, + "includeAll": false, + "label": "Cluster", + "multi": false, + "name": "clusterName", + "options": [], + "query": "label_values(wls_jvm_uptime{weblogic_domainUID=\"$domainName\"},weblogic_clusterName)", + "refresh": 1, + "regex": "", + "sort": 2, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": null, + "current": {}, + "datasource": "$datasource", + "hide": 0, + "includeAll": true, + "label": "Server", + "multi": true, + "name": "serverName", + "options": [], + "query": "label_values(wls_jvm_uptime{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\"},weblogic_serverName)", + "refresh": 1, + "regex": "", + "sort": 2, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": null, + "current": { + "selected": false, + "tags": [], + "text": "5", + "value": "5" + }, + "hide": 0, + "includeAll": false, + "label": "Top N", + "multi": false, + "name": "topN", + "options": [ + { + "selected": false, + "text": "3", + "value": "3" + }, + { + "selected": true, + "text": "5", + "value": "5" + }, + { + "selected": false, + "text": "7", + "value": "7" + }, + { + "selected": false, + "text": "10", + "value": "10" + } + ], + "query": "3, 5, 7, 10", + "skipUrlSync": false, + "type": "custom" + } + ] + }, + "time": { + "from": "now-30m", + "to": "now" + }, + "timepicker": { + "hidden": false, + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "timezone": "", + "title": "WebLogic Server Dashboard", + "uid": "5yUwzbZWz", + "version": 6 +} diff --git a/OracleWebCenterPortal/kubernetes/monitoring-service/config/weblogic-server-dashboard.json b/OracleWebCenterPortal/kubernetes/monitoring-service/config/weblogic-server-dashboard.json old mode 100644 new mode 100755 index cf6d5f776..797b23746 --- a/OracleWebCenterPortal/kubernetes/monitoring-service/config/weblogic-server-dashboard.json +++ b/OracleWebCenterPortal/kubernetes/monitoring-service/config/weblogic-server-dashboard.json @@ -1,3315 +1,3315 @@ -{ - "dashboard": { - "__inputs": [], - "__requires": [ - { - "type": "grafana", - "id": "grafana", - "name": "Grafana", - "version": "5.2.4" - }, - { - "type": "panel", - "id": "graph", - "name": "Graph", - "version": "5.0.0" - }, - { - "type": "panel", - "id": "singlestat", - "name": "Singlestat", - "version": "5.0.0" - }, - { - "type": "panel", - "id": "table", - "name": "Table", - "version": "5.0.0" - } - ], - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": "-- Grafana --", - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "editable": true, - "gnetId": null, - "graphTooltip": 0, - "id": null, - "iteration": 1563266678971, - "links": [], - "panels": [ - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 0 - }, - "id": 32, - "panels": [], - "title": "Servers", - "type": "row" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": "$datasource", - "decimals": 0, - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 3, - "w": 13, - "x": 0, - "y": 1 - }, - "hideTimeOverride": true, - "id": 16, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "count(count (wls_jvm_uptime{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\"}) by (name))", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "", - "refId": "A" - } - ], - "thresholds": "", - "timeFrom": null, - "timeShift": null, - "title": "Running Servers", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": "$datasource", - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 3, - "w": 11, - "x": 13, - "y": 1 - }, - "id": 23, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "count(count(wls_webapp_config_deployment_state{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\"}) by (app))", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "", - "refId": "A" - } - ], - "thresholds": "", - "timeFrom": null, - "timeShift": null, - "title": "Deployed Applications", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": true, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": "$datasource", - "decimals": 1, - "description": "", - "format": "percent", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 3, - "w": 6, - "x": 0, - "y": 4 - }, - "hideTimeOverride": true, - "id": 104, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "repeat": "serverName", - "repeatDirection": "v", - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "weblogic_serverName", - "targets": [ - { - "expr": "wls_server_activation_time{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\",weblogic_serverName=\"$serverName\"}", - "format": "table", - "hide": false, - "instant": true, - "interval": "10s", - "intervalFactor": 2, - "legendFormat": "", - "refId": "A" - } - ], - "thresholds": "50,80", - "timeFrom": null, - "timeShift": null, - "title": "Server Name", - "type": "singlestat", - "valueFontSize": "50%", - "valueMaps": [ - { - "op": "=", - "text": "", - "value": "" - } - ], - "valueName": "current" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": true, - "colors": [ - "#56A64B", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": "$datasource", - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 3, - "w": 4, - "x": 6, - "y": 4 - }, - "id": 84, - "interval": "", - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "repeat": "serverName", - "repeatDirection": "v", - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "wls_server_state_val{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=\"$serverName\"}", - "format": "time_series", - "intervalFactor": 1, - "refId": "A" - } - ], - "thresholds": "", - "timeFrom": null, - "timeShift": null, - "title": "Server Status", - "type": "singlestat", - "valueFontSize": "50%", - "valueMaps": [ - { - "op": "=", - "text": "SHUTDOWN", - "value": "0" - }, - { - "op": "=", - "text": "STARTING", - "value": "1" - }, - { - "op": "=", - "text": "RUNNING", - "value": "2" - }, - { - "op": "=", - "text": "STANDBY", - "value": "3" - }, - { - "op": "=", - "text": "FAILED", - "value": "8" - }, - { - "op": "=", - "text": "FAILED", - "value": "17" - } - ], - "valueName": "current" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": true, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": "$datasource", - "decimals": 1, - "description": "", - "format": "percent", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": true, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 3, - "w": 4, - "x": 10, - "y": 4 - }, - "hideTimeOverride": true, - "id": 27, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "repeat": "serverName", - "repeatDirection": "v", - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": true - }, - "tableColumn": "instance", - "targets": [ - { - "expr": "100 - wls_jvm_heap_free_percent{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=\"$serverName\"}", - "format": "time_series", - "hide": false, - "instant": true, - "interval": "10s", - "intervalFactor": 2, - "legendFormat": "", - "refId": "A" - } - ], - "thresholds": "50,80", - "timeFrom": null, - "timeShift": null, - "title": "Heap Usage", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "", - "value": "" - } - ], - "valueName": "current" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorPostfix": false, - "colorValue": true, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": "$datasource", - "decimals": 1, - "description": "", - "format": "ms", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 3, - "w": 5, - "x": 14, - "y": 4 - }, - "hideTimeOverride": true, - "id": 91, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "repeat": "serverName", - "repeatDirection": "v", - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "instance", - "targets": [ - { - "expr": "wls_jvm_uptime{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=\"$serverName\"}", - "format": "time_series", - "hide": false, - "instant": true, - "interval": "10s", - "intervalFactor": 2, - "legendFormat": "", - "refId": "A" - } - ], - "thresholds": "50,80", - "timeFrom": null, - "timeShift": null, - "title": "Running Time", - "type": "singlestat", - "valueFontSize": "50%", - "valueMaps": [ - { - "op": "=", - "text": "", - "value": "" - } - ], - "valueName": "current" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorPostfix": false, - "colorValue": true, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": "$datasource", - "decimals": 0, - "description": "", - "format": "short", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 3, - "w": 5, - "x": 19, - "y": 4 - }, - "hideTimeOverride": true, - "id": 96, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "repeat": "serverName", - "repeatDirection": "v", - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "instance", - "targets": [ - { - "expr": "wls_server_open_sockets_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=\"$serverName\"}", - "format": "time_series", - "hide": false, - "instant": true, - "interval": "10s", - "intervalFactor": 2, - "legendFormat": "", - "refId": "A" - } - ], - "thresholds": "50,80", - "timeFrom": null, - "timeShift": null, - "title": "Open Sockets", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "", - "value": "" - } - ], - "valueName": "current" - }, - { - "aliasColors": { - " heap free managed-server-1": "super-light-green", - " heap free managed-server-2": "dark-green", - "heap size managed-server-1 ": "super-light-red", - "heap size managed-server-2 ": "dark-red" - }, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "fill": 1, - "gridPos": { - "h": 10, - "w": 24, - "x": 0, - "y": 7 - }, - "id": 12, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "max": true, - "min": false, - "rightSide": false, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "wls_jvm_heap_free_current{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": " Heap Free ()", - "refId": "B" - }, - { - "expr": "wls_jvm_heap_size_current{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}", - "format": "time_series", - "instant": false, - "intervalFactor": 1, - "legendFormat": "Heap Size ()", - "refId": "A" - }, - { - "expr": "wls_jvm_heap_size_max{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}", - "format": "time_series", - "hide": true, - "intervalFactor": 1, - "legendFormat": "Heap Max ()", - "refId": "C" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "JVM Heap", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "decbytes", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": { - " heap free managed-server-1": "super-light-green", - " heap free managed-server-2": "dark-green", - "heap size managed-server-1 ": "super-light-red", - "heap size managed-server-2 ": "dark-red" - }, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "fill": 1, - "gridPos": { - "h": 7, - "w": 12, - "x": 0, - "y": 17 - }, - "id": 21, - "legend": { - "alignAsTable": false, - "avg": false, - "current": true, - "max": false, - "min": false, - "rightSide": false, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "wls_jvm_process_cpu_load{weblogic_domainUID=~\"$domainName\", weblogic_clusterName=~\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"} * 100", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": " ", - "refId": "B" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "CPU Load", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "percent", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "fill": 1, - "gridPos": { - "h": 7, - "w": 12, - "x": 12, - "y": 17 - }, - "id": 10, - "legend": { - "alignAsTable": false, - "avg": false, - "current": true, - "max": false, - "min": false, - "rightSide": false, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "wls_threadpool_execute_thread_total_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "Total Threads ()", - "refId": "A" - }, - { - "expr": "wls_threadpool_stuck_thread_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "Stuck Threads ()", - "refId": "D" - }, - { - "expr": "wls_threadpool_queue_length{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}", - "format": "time_series", - "hide": true, - "intervalFactor": 1, - "legendFormat": "queue", - "refId": "C" - }, - { - "expr": "wls_threadpool_hogging_thread_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}", - "format": "time_series", - "hide": true, - "intervalFactor": 1, - "legendFormat": "hogging", - "refId": "B" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Thread Pool", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "collapsed": true, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 24 - }, - "id": 35, - "panels": [ - { - "columns": [], - "datasource": "$datasource", - "fontSize": "100%", - "gridPos": { - "h": 7, - "w": 8, - "x": 0, - "y": 28 - }, - "hideTimeOverride": true, - "id": 126, - "links": [], - "pageSize": null, - "scroll": true, - "showHeader": true, - "sort": { - "col": 13, - "desc": true - }, - "styles": [ - { - "alias": "Time", - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "pattern": "Time", - "type": "hidden" - }, - { - "alias": "Webapp", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 2, - "mappingType": 1, - "pattern": "app", - "thresholds": [], - "type": "string", - "unit": "short" - }, - { - "alias": "Total Sessions", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 0, - "mappingType": 1, - "pattern": "Value", - "thresholds": [], - "type": "number", - "unit": "short" - }, - { - "alias": "", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "decimals": 2, - "pattern": "/.*/", - "thresholds": [], - "type": "hidden", - "unit": "short" - } - ], - "targets": [ - { - "expr": "topk($topN,sum(wls_webapp_config_sessions_opened_total_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (app))", - "format": "table", - "instant": true, - "intervalFactor": 1, - "refId": "B" - } - ], - "timeFrom": null, - "timeShift": null, - "title": "Total Sessions (top $topN)", - "transform": "table", - "type": "table" - }, - { - "columns": [], - "datasource": "$datasource", - "fontSize": "100%", - "gridPos": { - "h": 7, - "w": 8, - "x": 8, - "y": 28 - }, - "hideTimeOverride": true, - "id": 136, - "links": [], - "pageSize": null, - "scroll": true, - "showHeader": true, - "sort": { - "col": 13, - "desc": true - }, - "styles": [ - { - "alias": "Time", - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "pattern": "Time", - "type": "hidden" - }, - { - "alias": "Webapp", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 2, - "mappingType": 1, - "pattern": "app", - "thresholds": [], - "type": "string", - "unit": "short" - }, - { - "alias": "Total Requests", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 0, - "mappingType": 1, - "pattern": "Value", - "thresholds": [], - "type": "number", - "unit": "short" - }, - { - "alias": "", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "decimals": 2, - "pattern": "/.*/", - "thresholds": [], - "type": "hidden", - "unit": "short" - } - ], - "targets": [ - { - "expr": "topk($topN,sum(wls_servlet_invocation_total_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (app))", - "format": "table", - "instant": true, - "intervalFactor": 1, - "refId": "B" - } - ], - "timeFrom": null, - "timeShift": null, - "title": "Total Requests (top $topN)", - "transform": "table", - "type": "table" - }, - { - "columns": [], - "datasource": "$datasource", - "fontSize": "100%", - "gridPos": { - "h": 7, - "w": 8, - "x": 16, - "y": 28 - }, - "hideTimeOverride": true, - "id": 134, - "links": [], - "pageSize": null, - "scroll": true, - "showHeader": true, - "sort": { - "col": 13, - "desc": true - }, - "styles": [ - { - "alias": "Time", - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "pattern": "Time", - "type": "hidden" - }, - { - "alias": "Webapp", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 2, - "mappingType": 1, - "pattern": "app", - "thresholds": [], - "type": "string", - "unit": "short" - }, - { - "alias": "Total Time", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 0, - "mappingType": 1, - "pattern": "Value", - "thresholds": [], - "type": "number", - "unit": "ms" - }, - { - "alias": "", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "decimals": 2, - "pattern": "/.*/", - "thresholds": [], - "type": "hidden", - "unit": "short" - } - ], - "targets": [ - { - "expr": "topk($topN,sum(wls_servlet_execution_time_total{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (app))", - "format": "table", - "instant": true, - "intervalFactor": 1, - "refId": "B" - } - ], - "timeFrom": null, - "timeShift": null, - "title": "Total Execution Time (top $topN)", - "transform": "table", - "type": "table" - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "fill": 1, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 35 - }, - "id": 14, - "legend": { - "alignAsTable": false, - "avg": false, - "current": false, - "max": false, - "min": false, - "rightSide": false, - "show": true, - "sort": "current", - "sortDesc": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(wls_webapp_config_open_sessions_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (app)", - "format": "time_series", - "interval": "", - "intervalFactor": 1, - "legendFormat": "", - "refId": "A" - }, - { - "expr": "", - "format": "time_series", - "intervalFactor": 1, - "refId": "B" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Current Sessions ", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": "", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": true, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "fill": 1, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 35 - }, - "id": 128, - "legend": { - "alignAsTable": false, - "avg": false, - "current": false, - "max": false, - "min": false, - "rightSide": false, - "show": true, - "sort": "current", - "sortDesc": true, - "total": false, - "values": false - }, - "lines": false, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": " sum(irate(wls_webapp_config_sessions_opened_total_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}[5m])) by (app)", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Session Rate ", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": 0, - "format": "short", - "label": "per second", - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "fill": 1, - "gridPos": { - "h": 7, - "w": 12, - "x": 0, - "y": 43 - }, - "id": 132, - "legend": { - "alignAsTable": false, - "avg": false, - "current": false, - "max": false, - "min": false, - "rightSide": false, - "show": true, - "sort": "current", - "sortDesc": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "(sum(wls_servlet_execution_time_average{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (app)) / (count(wls_servlet_execution_time_average{weblogic_domainUID=\"domain1\", weblogic_clusterName=\"cluster-1\"}) by (app))", - "format": "time_series", - "interval": "", - "intervalFactor": 1, - "legendFormat": "", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Execution Time per Request ", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "ms", - "label": "", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": true, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "fill": 1, - "gridPos": { - "h": 7, - "w": 12, - "x": 12, - "y": 43 - }, - "id": 138, - "legend": { - "alignAsTable": false, - "avg": false, - "current": false, - "max": false, - "min": false, - "rightSide": false, - "show": true, - "sort": "current", - "sortDesc": true, - "total": false, - "values": false - }, - "lines": false, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(irate(wls_servlet_invocation_total_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}[5m])) by (app)", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Request Rate ", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": 0, - "format": "short", - "label": "per second", - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - } - ], - "title": "Web Applications", - "type": "row" - }, - { - "collapsed": true, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 25 - }, - "id": 43, - "panels": [ - { - "columns": [], - "datasource": "$datasource", - "fontSize": "100%", - "gridPos": { - "h": 4, - "w": 24, - "x": 0, - "y": 29 - }, - "hideTimeOverride": true, - "id": 111, - "links": [], - "pageSize": null, - "scroll": true, - "showHeader": true, - "sort": { - "col": 0, - "desc": true - }, - "styles": [ - { - "alias": "Time", - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "pattern": "Time", - "type": "hidden" - }, - { - "alias": "Server", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 2, - "mappingType": 1, - "pattern": "weblogic_serverName", - "thresholds": [], - "type": "string", - "unit": "short" - }, - { - "alias": "Name", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 2, - "mappingType": 1, - "pattern": "name", - "thresholds": [], - "type": "string", - "unit": "short" - }, - { - "alias": "Active Connections", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 0, - "mappingType": 1, - "pattern": "Value #A", - "thresholds": [], - "type": "number", - "unit": "short" - }, - { - "alias": "Current Capacity", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 0, - "mappingType": 1, - "pattern": "Value #C", - "thresholds": [], - "type": "number", - "unit": "short" - }, - { - "alias": "Total Connections", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 0, - "mappingType": 1, - "pattern": "Value #D", - "thresholds": [], - "type": "number", - "unit": "short" - }, - { - "alias": "Total Connections", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 0, - "mappingType": 1, - "pattern": "Value #D", - "thresholds": [], - "type": "number", - "unit": "short" - }, - { - "alias": "", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "decimals": 2, - "pattern": "/.*/", - "thresholds": [], - "type": "hidden", - "unit": "short" - } - ], - "targets": [ - { - "expr": "sum(wls_datasource_curr_capacity{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (weblogic_serverName,name)", - "format": "table", - "instant": true, - "intervalFactor": 1, - "refId": "C" - }, - { - "expr": "sum(wls_datasource_active_connections_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (weblogic_serverName,name)", - "format": "table", - "instant": true, - "intervalFactor": 1, - "refId": "A" - }, - { - "expr": "sum(wls_datasource_connections_total_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (weblogic_serverName,name)", - "format": "table", - "instant": true, - "intervalFactor": 1, - "refId": "D" - } - ], - "timeFrom": null, - "timeShift": null, - "title": "Overview", - "transform": "table", - "type": "table" - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "fill": 1, - "gridPos": { - "h": 8, - "w": 13, - "x": 0, - "y": 33 - }, - "id": 50, - "legend": { - "alignAsTable": false, - "avg": false, - "current": false, - "max": false, - "min": false, - "rightSide": false, - "show": true, - "sort": "current", - "sortDesc": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "wls_datasource_active_connections_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": " @ ", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Active Connections", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": 0, - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": true, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "fill": 1, - "gridPos": { - "h": 8, - "w": 11, - "x": 13, - "y": 33 - }, - "id": 71, - "legend": { - "alignAsTable": false, - "avg": false, - "current": false, - "max": false, - "min": false, - "rightSide": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "irate(wls_datasource_connections_total_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}[5m])", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": " @ ", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Connection Rate", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": 0, - "format": "short", - "label": "per second", - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "fill": 1, - "gridPos": { - "h": 9, - "w": 11, - "x": 0, - "y": 41 - }, - "id": 46, - "legend": { - "alignAsTable": false, - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "wls_datasource_waiting_for_connection_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": " @ ", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Pending Connection Requests", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": 0, - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "fill": 1, - "gridPos": { - "h": 9, - "w": 13, - "x": 11, - "y": 41 - }, - "id": 73, - "legend": { - "alignAsTable": false, - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "wls_datasource_connection_delay_time{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": " @ ", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Average Connection Delay Time", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": 0, - "format": "ms", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - } - ], - "title": "Data Sources", - "type": "row" - }, - { - "collapsed": true, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 26 - }, - "id": 40, - "panels": [ - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "fill": 1, - "gridPos": { - "h": 6, - "w": 12, - "x": 0, - "y": 30 - }, - "id": 145, - "legend": { - "alignAsTable": false, - "avg": false, - "current": false, - "max": false, - "min": false, - "rightSide": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(wls_jmsruntime_connections_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (weblogic_serverName)", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "JMS Connections", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": 0, - "format": "short", - "label": "", - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "fill": 1, - "gridPos": { - "h": 6, - "w": 12, - "x": 12, - "y": 30 - }, - "id": 147, - "legend": { - "alignAsTable": false, - "avg": false, - "current": false, - "max": false, - "min": false, - "rightSide": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(irate(wls_jmsruntime_connections_total_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}[5m])) by (weblogic_serverName)", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "JMS Connection Rate", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": null, - "format": "short", - "label": "", - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "columns": [], - "datasource": "$datasource", - "fontSize": "100%", - "gridPos": { - "h": 4, - "w": 24, - "x": 0, - "y": 36 - }, - "hideTimeOverride": true, - "id": 113, - "links": [], - "pageSize": null, - "scroll": true, - "showHeader": true, - "sort": { - "col": 0, - "desc": true - }, - "styles": [ - { - "alias": "Time", - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "pattern": "Time", - "type": "hidden" - }, - { - "alias": "Name", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 2, - "mappingType": 1, - "pattern": "jmsserver", - "thresholds": [], - "type": "string", - "unit": "short" - }, - { - "alias": "Current Dests", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 0, - "mappingType": 1, - "pattern": "Value #B", - "thresholds": [], - "type": "number", - "unit": "short" - }, - { - "alias": "Total Msgs", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 0, - "mappingType": 1, - "pattern": "Value #A", - "thresholds": [], - "type": "number", - "unit": "short" - }, - { - "alias": "Total Bytes", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 0, - "mappingType": 1, - "pattern": "Value #D", - "thresholds": [], - "type": "number", - "unit": "bytes" - }, - { - "alias": "Total Dests", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 0, - "mappingType": 1, - "pattern": "Value #E", - "thresholds": [], - "type": "number", - "unit": "short" - }, - { - "alias": "", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "decimals": 2, - "pattern": "/.*/", - "thresholds": [], - "type": "hidden", - "unit": "short" - } - ], - "targets": [ - { - "expr": "sum(wls_jms_destinations_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (jmsserver)", - "format": "table", - "instant": true, - "intervalFactor": 1, - "refId": "B" - }, - { - "expr": "sum(wls_jms_messages_received_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (jmsserver)", - "format": "table", - "instant": true, - "intervalFactor": 1, - "refId": "A" - }, - { - "expr": "sum(wls_jms_bytes_received_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (jmsserver)", - "format": "table", - "instant": true, - "intervalFactor": 1, - "refId": "D" - }, - { - "expr": "sum(wls_jms_destinations_total_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (jmsserver)", - "format": "table", - "instant": true, - "intervalFactor": 1, - "refId": "E" - }, - { - "expr": "sum(wls_jms_destinations_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (jmsserver)", - "format": "table", - "instant": true, - "intervalFactor": 1, - "refId": "F" - } - ], - "timeFrom": null, - "timeShift": null, - "title": "JMSServer Overview", - "transform": "table", - "type": "table" - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "fill": 1, - "gridPos": { - "h": 7, - "w": 12, - "x": 0, - "y": 40 - }, - "id": 54, - "legend": { - "alignAsTable": false, - "avg": false, - "current": true, - "max": false, - "min": false, - "rightSide": false, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(wls_jms_messages_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (jmsserver)", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "Current ()", - "refId": "A" - }, - { - "expr": "sum(wls_jms_messages_pending_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (jmsserver)", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "Pending ()", - "refId": "B" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Messages", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": 0, - "format": "short", - "label": "", - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "fill": 1, - "gridPos": { - "h": 7, - "w": 12, - "x": 12, - "y": 40 - }, - "id": 56, - "legend": { - "alignAsTable": false, - "avg": false, - "current": true, - "max": false, - "min": false, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(wls_jms_bytes_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (jmsserver)", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "Current ()", - "refId": "A" - }, - { - "expr": "sum(wls_jms_bytes_pending_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (jmsserver)", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "Pending ()", - "refId": "B" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Bytes", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": 0, - "format": "short", - "label": "", - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": true, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "fill": 1, - "gridPos": { - "h": 7, - "w": 12, - "x": 0, - "y": 47 - }, - "id": 58, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(irate(wls_jms_messages_received_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}[5m])) by (jmsserver)", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Received Message Rate ", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": null, - "format": "short", - "label": "", - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": true, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "fill": 1, - "gridPos": { - "h": 7, - "w": 12, - "x": 12, - "y": 47 - }, - "id": 117, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(irate(wls_jms_bytes_received_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}[5m])) by (jmsserver)", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Received Byte Rate", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": null, - "format": "short", - "label": "", - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "columns": [], - "datasource": "$datasource", - "fontSize": "100%", - "gridPos": { - "h": 5, - "w": 24, - "x": 0, - "y": 54 - }, - "hideTimeOverride": true, - "id": 119, - "links": [], - "pageSize": null, - "scroll": true, - "showHeader": true, - "sort": { - "col": 3, - "desc": false - }, - "styles": [ - { - "alias": "Time", - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "pattern": "Time", - "type": "hidden" - }, - { - "alias": "Destination", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 2, - "mappingType": 1, - "pattern": "destination", - "thresholds": [], - "type": "string", - "unit": "short" - }, - { - "alias": "Current Consumers", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 0, - "mappingType": 1, - "pattern": "Value #A", - "thresholds": [], - "type": "number", - "unit": "short" - }, - { - "alias": "Current Msgs", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 0, - "mappingType": 1, - "pattern": "Value #B", - "thresholds": [], - "type": "number", - "unit": "short" - }, - { - "alias": "Pending Msgs", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 0, - "mappingType": 1, - "pattern": "Value #C", - "thresholds": [], - "type": "number", - "unit": "short" - }, - { - "alias": "Currrent Bytes", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 0, - "mappingType": 1, - "pattern": "Value #D", - "thresholds": [], - "type": "number", - "unit": "bytes" - }, - { - "alias": "Pending Bytes", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 0, - "mappingType": 1, - "pattern": "Value #E", - "thresholds": [], - "type": "number", - "unit": "short" - }, - { - "alias": "Total Msgs", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 0, - "mappingType": 1, - "pattern": "Value #F", - "thresholds": [], - "type": "number", - "unit": "short" - }, - { - "alias": "Total Bytes", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 0, - "mappingType": 1, - "pattern": "Value #G", - "thresholds": [], - "type": "number", - "unit": "short" - }, - { - "alias": "", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "decimals": 2, - "pattern": "/.*/", - "thresholds": [], - "type": "hidden", - "unit": "short" - } - ], - "targets": [ - { - "expr": "sum(wls_jms_dest_consumers_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (destination)", - "format": "table", - "instant": true, - "intervalFactor": 1, - "refId": "A" - }, - { - "expr": "sum(wls_jms_dest_messages_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (destination)", - "format": "table", - "instant": true, - "intervalFactor": 1, - "refId": "B" - }, - { - "expr": "sum(wls_jms_dest_messages_pending_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (destination)", - "format": "table", - "instant": true, - "intervalFactor": 1, - "refId": "C" - }, - { - "expr": "sum(wls_jms_dest_bytes_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (destination)", - "format": "table", - "instant": true, - "intervalFactor": 1, - "refId": "D" - }, - { - "expr": "sum(wls_jms_dest_bytes_pending_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (destination)", - "format": "table", - "instant": true, - "intervalFactor": 1, - "refId": "E" - }, - { - "expr": "sum(wls_jms_dest_messages_received_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (destination)", - "format": "table", - "instant": true, - "interval": "", - "intervalFactor": 1, - "refId": "F" - }, - { - "expr": "sum(wls_jms_dest_bytes_received_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (destination)", - "format": "table", - "instant": true, - "intervalFactor": 1, - "refId": "G" - } - ], - "timeFrom": null, - "timeShift": null, - "title": "Destinations Overview", - "transform": "table", - "type": "table" - } - ], - "title": "JMS Services", - "type": "row" - } - ], - "refresh": false, - "schemaVersion": 16, - "style": "dark", - "tags": [], - "templating": { - "list": [ - { - "current": { - "text": "prometheus", - "value": "prometheus" - }, - "hide": 0, - "label": null, - "name": "datasource", - "options": [], - "query": "prometheus", - "refresh": 1, - "regex": "", - "type": "datasource" - }, - { - "allValue": null, - "current": {}, - "datasource": "$datasource", - "hide": 0, - "includeAll": false, - "label": "Domain", - "multi": false, - "name": "domainName", - "options": [], - "query": "label_values(weblogic_domainUID)", - "refresh": 1, - "regex": "", - "sort": 2, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "allValue": null, - "current": {}, - "datasource": "$datasource", - "hide": 0, - "includeAll": false, - "label": "Cluster", - "multi": false, - "name": "clusterName", - "options": [], - "query": "label_values(wls_jvm_uptime{weblogic_domainUID=\"$domainName\"},weblogic_clusterName)", - "refresh": 1, - "regex": "", - "sort": 2, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "allValue": null, - "current": {}, - "datasource": "$datasource", - "hide": 0, - "includeAll": true, - "label": "Server", - "multi": true, - "name": "serverName", - "options": [], - "query": "label_values(wls_jvm_uptime{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\"},weblogic_serverName)", - "refresh": 1, - "regex": "", - "sort": 2, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "allValue": null, - "current": { - "selected": false, - "tags": [], - "text": "5", - "value": "5" - }, - "hide": 0, - "includeAll": false, - "label": "Top N", - "multi": false, - "name": "topN", - "options": [ - { - "selected": false, - "text": "3", - "value": "3" - }, - { - "selected": true, - "text": "5", - "value": "5" - }, - { - "selected": false, - "text": "7", - "value": "7" - }, - { - "selected": false, - "text": "10", - "value": "10" - } - ], - "query": "3, 5, 7, 10", - "skipUrlSync": false, - "type": "custom" - } - ] - }, - "time": { - "from": "now-30m", - "to": "now" - }, - "timepicker": { - "hidden": false, - "refresh_intervals": [ - "5s", - "10s", - "30s", - "1m", - "5m", - "15m", - "30m", - "1h", - "2h", - "1d" - ], - "time_options": [ - "5m", - "15m", - "1h", - "6h", - "12h", - "24h", - "2d", - "7d", - "30d" - ] - }, - "timezone": "", - "title": "WebLogic Server Dashboard", - "uid": "5yUwzbZWz", - "version": 6 - } -} - +{ + "dashboard": { + "__inputs": [], + "__requires": [ + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "5.2.4" + }, + { + "type": "panel", + "id": "graph", + "name": "Graph", + "version": "5.0.0" + }, + { + "type": "panel", + "id": "singlestat", + "name": "Singlestat", + "version": "5.0.0" + }, + { + "type": "panel", + "id": "table", + "name": "Table", + "version": "5.0.0" + } + ], + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "id": null, + "iteration": 1563266678971, + "links": [], + "panels": [ + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 32, + "panels": [], + "title": "Servers", + "type": "row" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "datasource": "$datasource", + "decimals": 0, + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 13, + "x": 0, + "y": 1 + }, + "hideTimeOverride": true, + "id": 16, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "expr": "count(count (wls_jvm_uptime{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\"}) by (name))", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": "", + "timeFrom": null, + "timeShift": null, + "title": "Running Servers", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "datasource": "$datasource", + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 11, + "x": 13, + "y": 1 + }, + "id": 23, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "expr": "count(count(wls_webapp_config_deployment_state{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\"}) by (app))", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": "", + "timeFrom": null, + "timeShift": null, + "title": "Deployed Applications", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "datasource": "$datasource", + "decimals": 1, + "description": "", + "format": "percent", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 6, + "x": 0, + "y": 4 + }, + "hideTimeOverride": true, + "id": 104, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "repeat": "serverName", + "repeatDirection": "v", + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "weblogic_serverName", + "targets": [ + { + "expr": "wls_server_activation_time{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\",weblogic_serverName=\"$serverName\"}", + "format": "table", + "hide": false, + "instant": true, + "interval": "10s", + "intervalFactor": 2, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": "50,80", + "timeFrom": null, + "timeShift": null, + "title": "Server Name", + "type": "singlestat", + "valueFontSize": "50%", + "valueMaps": [ + { + "op": "=", + "text": "", + "value": "" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "#56A64B", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "datasource": "$datasource", + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 4, + "x": 6, + "y": 4 + }, + "id": 84, + "interval": "", + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "repeat": "serverName", + "repeatDirection": "v", + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "expr": "wls_server_state_val{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=\"$serverName\"}", + "format": "time_series", + "intervalFactor": 1, + "refId": "A" + } + ], + "thresholds": "", + "timeFrom": null, + "timeShift": null, + "title": "Server Status", + "type": "singlestat", + "valueFontSize": "50%", + "valueMaps": [ + { + "op": "=", + "text": "SHUTDOWN", + "value": "0" + }, + { + "op": "=", + "text": "STARTING", + "value": "1" + }, + { + "op": "=", + "text": "RUNNING", + "value": "2" + }, + { + "op": "=", + "text": "STANDBY", + "value": "3" + }, + { + "op": "=", + "text": "FAILED", + "value": "8" + }, + { + "op": "=", + "text": "FAILED", + "value": "17" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "datasource": "$datasource", + "decimals": 1, + "description": "", + "format": "percent", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": true, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 4, + "x": 10, + "y": 4 + }, + "hideTimeOverride": true, + "id": 27, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "repeat": "serverName", + "repeatDirection": "v", + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "instance", + "targets": [ + { + "expr": "100 - wls_jvm_heap_free_percent{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=\"$serverName\"}", + "format": "time_series", + "hide": false, + "instant": true, + "interval": "10s", + "intervalFactor": 2, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": "50,80", + "timeFrom": null, + "timeShift": null, + "title": "Heap Usage", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "", + "value": "" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorPostfix": false, + "colorValue": true, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "datasource": "$datasource", + "decimals": 1, + "description": "", + "format": "ms", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 5, + "x": 14, + "y": 4 + }, + "hideTimeOverride": true, + "id": 91, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "repeat": "serverName", + "repeatDirection": "v", + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "instance", + "targets": [ + { + "expr": "wls_jvm_uptime{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=\"$serverName\"}", + "format": "time_series", + "hide": false, + "instant": true, + "interval": "10s", + "intervalFactor": 2, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": "50,80", + "timeFrom": null, + "timeShift": null, + "title": "Running Time", + "type": "singlestat", + "valueFontSize": "50%", + "valueMaps": [ + { + "op": "=", + "text": "", + "value": "" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorPostfix": false, + "colorValue": true, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "datasource": "$datasource", + "decimals": 0, + "description": "", + "format": "short", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 5, + "x": 19, + "y": 4 + }, + "hideTimeOverride": true, + "id": 96, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "repeat": "serverName", + "repeatDirection": "v", + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "instance", + "targets": [ + { + "expr": "wls_server_open_sockets_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=\"$serverName\"}", + "format": "time_series", + "hide": false, + "instant": true, + "interval": "10s", + "intervalFactor": 2, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": "50,80", + "timeFrom": null, + "timeShift": null, + "title": "Open Sockets", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "", + "value": "" + } + ], + "valueName": "current" + }, + { + "aliasColors": { + " heap free managed-server-1": "super-light-green", + " heap free managed-server-2": "dark-green", + "heap size managed-server-1 ": "super-light-red", + "heap size managed-server-2 ": "dark-red" + }, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$datasource", + "fill": 1, + "gridPos": { + "h": 10, + "w": 24, + "x": 0, + "y": 7 + }, + "id": 12, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": true, + "min": false, + "rightSide": false, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "wls_jvm_heap_free_current{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": " Heap Free ()", + "refId": "B" + }, + { + "expr": "wls_jvm_heap_size_current{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}", + "format": "time_series", + "instant": false, + "intervalFactor": 1, + "legendFormat": "Heap Size ()", + "refId": "A" + }, + { + "expr": "wls_jvm_heap_size_max{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}", + "format": "time_series", + "hide": true, + "intervalFactor": 1, + "legendFormat": "Heap Max ()", + "refId": "C" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "JVM Heap", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "decbytes", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": { + " heap free managed-server-1": "super-light-green", + " heap free managed-server-2": "dark-green", + "heap size managed-server-1 ": "super-light-red", + "heap size managed-server-2 ": "dark-red" + }, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$datasource", + "fill": 1, + "gridPos": { + "h": 7, + "w": 12, + "x": 0, + "y": 17 + }, + "id": 21, + "legend": { + "alignAsTable": false, + "avg": false, + "current": true, + "max": false, + "min": false, + "rightSide": false, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "wls_jvm_process_cpu_load{weblogic_domainUID=~\"$domainName\", weblogic_clusterName=~\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"} * 100", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": " ", + "refId": "B" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "CPU Load", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "percent", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$datasource", + "fill": 1, + "gridPos": { + "h": 7, + "w": 12, + "x": 12, + "y": 17 + }, + "id": 10, + "legend": { + "alignAsTable": false, + "avg": false, + "current": true, + "max": false, + "min": false, + "rightSide": false, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "wls_threadpool_execute_thread_total_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Total Threads ()", + "refId": "A" + }, + { + "expr": "wls_threadpool_stuck_thread_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Stuck Threads ()", + "refId": "D" + }, + { + "expr": "wls_threadpool_queue_length{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}", + "format": "time_series", + "hide": true, + "intervalFactor": 1, + "legendFormat": "queue", + "refId": "C" + }, + { + "expr": "wls_threadpool_hogging_thread_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}", + "format": "time_series", + "hide": true, + "intervalFactor": 1, + "legendFormat": "hogging", + "refId": "B" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Thread Pool", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "collapsed": true, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 24 + }, + "id": 35, + "panels": [ + { + "columns": [], + "datasource": "$datasource", + "fontSize": "100%", + "gridPos": { + "h": 7, + "w": 8, + "x": 0, + "y": 28 + }, + "hideTimeOverride": true, + "id": 126, + "links": [], + "pageSize": null, + "scroll": true, + "showHeader": true, + "sort": { + "col": 13, + "desc": true + }, + "styles": [ + { + "alias": "Time", + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "pattern": "Time", + "type": "hidden" + }, + { + "alias": "Webapp", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "app", + "thresholds": [], + "type": "string", + "unit": "short" + }, + { + "alias": "Total Sessions", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "Value", + "thresholds": [], + "type": "number", + "unit": "short" + }, + { + "alias": "", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "decimals": 2, + "pattern": "/.*/", + "thresholds": [], + "type": "hidden", + "unit": "short" + } + ], + "targets": [ + { + "expr": "topk($topN,sum(wls_webapp_config_sessions_opened_total_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (app))", + "format": "table", + "instant": true, + "intervalFactor": 1, + "refId": "B" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Total Sessions (top $topN)", + "transform": "table", + "type": "table" + }, + { + "columns": [], + "datasource": "$datasource", + "fontSize": "100%", + "gridPos": { + "h": 7, + "w": 8, + "x": 8, + "y": 28 + }, + "hideTimeOverride": true, + "id": 136, + "links": [], + "pageSize": null, + "scroll": true, + "showHeader": true, + "sort": { + "col": 13, + "desc": true + }, + "styles": [ + { + "alias": "Time", + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "pattern": "Time", + "type": "hidden" + }, + { + "alias": "Webapp", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "app", + "thresholds": [], + "type": "string", + "unit": "short" + }, + { + "alias": "Total Requests", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "Value", + "thresholds": [], + "type": "number", + "unit": "short" + }, + { + "alias": "", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "decimals": 2, + "pattern": "/.*/", + "thresholds": [], + "type": "hidden", + "unit": "short" + } + ], + "targets": [ + { + "expr": "topk($topN,sum(wls_servlet_invocation_total_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (app))", + "format": "table", + "instant": true, + "intervalFactor": 1, + "refId": "B" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Total Requests (top $topN)", + "transform": "table", + "type": "table" + }, + { + "columns": [], + "datasource": "$datasource", + "fontSize": "100%", + "gridPos": { + "h": 7, + "w": 8, + "x": 16, + "y": 28 + }, + "hideTimeOverride": true, + "id": 134, + "links": [], + "pageSize": null, + "scroll": true, + "showHeader": true, + "sort": { + "col": 13, + "desc": true + }, + "styles": [ + { + "alias": "Time", + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "pattern": "Time", + "type": "hidden" + }, + { + "alias": "Webapp", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "app", + "thresholds": [], + "type": "string", + "unit": "short" + }, + { + "alias": "Total Time", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "Value", + "thresholds": [], + "type": "number", + "unit": "ms" + }, + { + "alias": "", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "decimals": 2, + "pattern": "/.*/", + "thresholds": [], + "type": "hidden", + "unit": "short" + } + ], + "targets": [ + { + "expr": "topk($topN,sum(wls_servlet_execution_time_total{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (app))", + "format": "table", + "instant": true, + "intervalFactor": 1, + "refId": "B" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Total Execution Time (top $topN)", + "transform": "table", + "type": "table" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$datasource", + "fill": 1, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 35 + }, + "id": 14, + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": false, + "show": true, + "sort": "current", + "sortDesc": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(wls_webapp_config_open_sessions_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (app)", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + }, + { + "expr": "", + "format": "time_series", + "intervalFactor": 1, + "refId": "B" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Current Sessions ", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": "", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": true, + "dashLength": 10, + "dashes": false, + "datasource": "$datasource", + "fill": 1, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 35 + }, + "id": 128, + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": false, + "show": true, + "sort": "current", + "sortDesc": true, + "total": false, + "values": false + }, + "lines": false, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": " sum(irate(wls_webapp_config_sessions_opened_total_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}[5m])) by (app)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Session Rate ", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": 0, + "format": "short", + "label": "per second", + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$datasource", + "fill": 1, + "gridPos": { + "h": 7, + "w": 12, + "x": 0, + "y": 43 + }, + "id": 132, + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": false, + "show": true, + "sort": "current", + "sortDesc": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "(sum(wls_servlet_execution_time_average{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (app)) / (count(wls_servlet_execution_time_average{weblogic_domainUID=\"domain1\", weblogic_clusterName=\"cluster-1\"}) by (app))", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Execution Time per Request ", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "ms", + "label": "", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": true, + "dashLength": 10, + "dashes": false, + "datasource": "$datasource", + "fill": 1, + "gridPos": { + "h": 7, + "w": 12, + "x": 12, + "y": 43 + }, + "id": 138, + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": false, + "show": true, + "sort": "current", + "sortDesc": true, + "total": false, + "values": false + }, + "lines": false, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(irate(wls_servlet_invocation_total_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}[5m])) by (app)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Request Rate ", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": 0, + "format": "short", + "label": "per second", + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + } + ], + "title": "Web Applications", + "type": "row" + }, + { + "collapsed": true, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 25 + }, + "id": 43, + "panels": [ + { + "columns": [], + "datasource": "$datasource", + "fontSize": "100%", + "gridPos": { + "h": 4, + "w": 24, + "x": 0, + "y": 29 + }, + "hideTimeOverride": true, + "id": 111, + "links": [], + "pageSize": null, + "scroll": true, + "showHeader": true, + "sort": { + "col": 0, + "desc": true + }, + "styles": [ + { + "alias": "Time", + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "pattern": "Time", + "type": "hidden" + }, + { + "alias": "Server", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "weblogic_serverName", + "thresholds": [], + "type": "string", + "unit": "short" + }, + { + "alias": "Name", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "name", + "thresholds": [], + "type": "string", + "unit": "short" + }, + { + "alias": "Active Connections", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "Value #A", + "thresholds": [], + "type": "number", + "unit": "short" + }, + { + "alias": "Current Capacity", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "Value #C", + "thresholds": [], + "type": "number", + "unit": "short" + }, + { + "alias": "Total Connections", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "Value #D", + "thresholds": [], + "type": "number", + "unit": "short" + }, + { + "alias": "Total Connections", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "Value #D", + "thresholds": [], + "type": "number", + "unit": "short" + }, + { + "alias": "", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "decimals": 2, + "pattern": "/.*/", + "thresholds": [], + "type": "hidden", + "unit": "short" + } + ], + "targets": [ + { + "expr": "sum(wls_datasource_curr_capacity{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (weblogic_serverName,name)", + "format": "table", + "instant": true, + "intervalFactor": 1, + "refId": "C" + }, + { + "expr": "sum(wls_datasource_active_connections_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (weblogic_serverName,name)", + "format": "table", + "instant": true, + "intervalFactor": 1, + "refId": "A" + }, + { + "expr": "sum(wls_datasource_connections_total_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (weblogic_serverName,name)", + "format": "table", + "instant": true, + "intervalFactor": 1, + "refId": "D" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Overview", + "transform": "table", + "type": "table" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$datasource", + "fill": 1, + "gridPos": { + "h": 8, + "w": 13, + "x": 0, + "y": 33 + }, + "id": 50, + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": false, + "show": true, + "sort": "current", + "sortDesc": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "wls_datasource_active_connections_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": " @ ", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Active Connections", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": 0, + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": true, + "dashLength": 10, + "dashes": false, + "datasource": "$datasource", + "fill": 1, + "gridPos": { + "h": 8, + "w": 11, + "x": 13, + "y": 33 + }, + "id": 71, + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "irate(wls_datasource_connections_total_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}[5m])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": " @ ", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Connection Rate", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": 0, + "format": "short", + "label": "per second", + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$datasource", + "fill": 1, + "gridPos": { + "h": 9, + "w": 11, + "x": 0, + "y": 41 + }, + "id": 46, + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "wls_datasource_waiting_for_connection_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": " @ ", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Pending Connection Requests", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": 0, + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$datasource", + "fill": 1, + "gridPos": { + "h": 9, + "w": 13, + "x": 11, + "y": 41 + }, + "id": 73, + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "wls_datasource_connection_delay_time{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": " @ ", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Average Connection Delay Time", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": 0, + "format": "ms", + "label": null, + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + } + ], + "title": "Data Sources", + "type": "row" + }, + { + "collapsed": true, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 26 + }, + "id": 40, + "panels": [ + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$datasource", + "fill": 1, + "gridPos": { + "h": 6, + "w": 12, + "x": 0, + "y": 30 + }, + "id": 145, + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(wls_jmsruntime_connections_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (weblogic_serverName)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "JMS Connections", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": 0, + "format": "short", + "label": "", + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$datasource", + "fill": 1, + "gridPos": { + "h": 6, + "w": 12, + "x": 12, + "y": 30 + }, + "id": 147, + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(irate(wls_jmsruntime_connections_total_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}[5m])) by (weblogic_serverName)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "JMS Connection Rate", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": null, + "format": "short", + "label": "", + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "columns": [], + "datasource": "$datasource", + "fontSize": "100%", + "gridPos": { + "h": 4, + "w": 24, + "x": 0, + "y": 36 + }, + "hideTimeOverride": true, + "id": 113, + "links": [], + "pageSize": null, + "scroll": true, + "showHeader": true, + "sort": { + "col": 0, + "desc": true + }, + "styles": [ + { + "alias": "Time", + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "pattern": "Time", + "type": "hidden" + }, + { + "alias": "Name", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "jmsserver", + "thresholds": [], + "type": "string", + "unit": "short" + }, + { + "alias": "Current Dests", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "Value #B", + "thresholds": [], + "type": "number", + "unit": "short" + }, + { + "alias": "Total Msgs", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "Value #A", + "thresholds": [], + "type": "number", + "unit": "short" + }, + { + "alias": "Total Bytes", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "Value #D", + "thresholds": [], + "type": "number", + "unit": "bytes" + }, + { + "alias": "Total Dests", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "Value #E", + "thresholds": [], + "type": "number", + "unit": "short" + }, + { + "alias": "", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "decimals": 2, + "pattern": "/.*/", + "thresholds": [], + "type": "hidden", + "unit": "short" + } + ], + "targets": [ + { + "expr": "sum(wls_jms_destinations_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (jmsserver)", + "format": "table", + "instant": true, + "intervalFactor": 1, + "refId": "B" + }, + { + "expr": "sum(wls_jms_messages_received_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (jmsserver)", + "format": "table", + "instant": true, + "intervalFactor": 1, + "refId": "A" + }, + { + "expr": "sum(wls_jms_bytes_received_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (jmsserver)", + "format": "table", + "instant": true, + "intervalFactor": 1, + "refId": "D" + }, + { + "expr": "sum(wls_jms_destinations_total_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (jmsserver)", + "format": "table", + "instant": true, + "intervalFactor": 1, + "refId": "E" + }, + { + "expr": "sum(wls_jms_destinations_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (jmsserver)", + "format": "table", + "instant": true, + "intervalFactor": 1, + "refId": "F" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "JMSServer Overview", + "transform": "table", + "type": "table" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$datasource", + "fill": 1, + "gridPos": { + "h": 7, + "w": 12, + "x": 0, + "y": 40 + }, + "id": 54, + "legend": { + "alignAsTable": false, + "avg": false, + "current": true, + "max": false, + "min": false, + "rightSide": false, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(wls_jms_messages_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (jmsserver)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Current ()", + "refId": "A" + }, + { + "expr": "sum(wls_jms_messages_pending_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (jmsserver)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Pending ()", + "refId": "B" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Messages", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": 0, + "format": "short", + "label": "", + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$datasource", + "fill": 1, + "gridPos": { + "h": 7, + "w": 12, + "x": 12, + "y": 40 + }, + "id": 56, + "legend": { + "alignAsTable": false, + "avg": false, + "current": true, + "max": false, + "min": false, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(wls_jms_bytes_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (jmsserver)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Current ()", + "refId": "A" + }, + { + "expr": "sum(wls_jms_bytes_pending_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (jmsserver)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Pending ()", + "refId": "B" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Bytes", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": 0, + "format": "short", + "label": "", + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": true, + "dashLength": 10, + "dashes": false, + "datasource": "$datasource", + "fill": 1, + "gridPos": { + "h": 7, + "w": 12, + "x": 0, + "y": 47 + }, + "id": 58, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(irate(wls_jms_messages_received_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}[5m])) by (jmsserver)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Received Message Rate ", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": null, + "format": "short", + "label": "", + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": true, + "dashLength": 10, + "dashes": false, + "datasource": "$datasource", + "fill": 1, + "gridPos": { + "h": 7, + "w": 12, + "x": 12, + "y": 47 + }, + "id": 117, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(irate(wls_jms_bytes_received_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}[5m])) by (jmsserver)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Received Byte Rate", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": null, + "format": "short", + "label": "", + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "columns": [], + "datasource": "$datasource", + "fontSize": "100%", + "gridPos": { + "h": 5, + "w": 24, + "x": 0, + "y": 54 + }, + "hideTimeOverride": true, + "id": 119, + "links": [], + "pageSize": null, + "scroll": true, + "showHeader": true, + "sort": { + "col": 3, + "desc": false + }, + "styles": [ + { + "alias": "Time", + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "pattern": "Time", + "type": "hidden" + }, + { + "alias": "Destination", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "destination", + "thresholds": [], + "type": "string", + "unit": "short" + }, + { + "alias": "Current Consumers", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "Value #A", + "thresholds": [], + "type": "number", + "unit": "short" + }, + { + "alias": "Current Msgs", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "Value #B", + "thresholds": [], + "type": "number", + "unit": "short" + }, + { + "alias": "Pending Msgs", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "Value #C", + "thresholds": [], + "type": "number", + "unit": "short" + }, + { + "alias": "Currrent Bytes", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "Value #D", + "thresholds": [], + "type": "number", + "unit": "bytes" + }, + { + "alias": "Pending Bytes", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "Value #E", + "thresholds": [], + "type": "number", + "unit": "short" + }, + { + "alias": "Total Msgs", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "Value #F", + "thresholds": [], + "type": "number", + "unit": "short" + }, + { + "alias": "Total Bytes", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "Value #G", + "thresholds": [], + "type": "number", + "unit": "short" + }, + { + "alias": "", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "decimals": 2, + "pattern": "/.*/", + "thresholds": [], + "type": "hidden", + "unit": "short" + } + ], + "targets": [ + { + "expr": "sum(wls_jms_dest_consumers_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (destination)", + "format": "table", + "instant": true, + "intervalFactor": 1, + "refId": "A" + }, + { + "expr": "sum(wls_jms_dest_messages_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (destination)", + "format": "table", + "instant": true, + "intervalFactor": 1, + "refId": "B" + }, + { + "expr": "sum(wls_jms_dest_messages_pending_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (destination)", + "format": "table", + "instant": true, + "intervalFactor": 1, + "refId": "C" + }, + { + "expr": "sum(wls_jms_dest_bytes_current_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (destination)", + "format": "table", + "instant": true, + "intervalFactor": 1, + "refId": "D" + }, + { + "expr": "sum(wls_jms_dest_bytes_pending_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (destination)", + "format": "table", + "instant": true, + "intervalFactor": 1, + "refId": "E" + }, + { + "expr": "sum(wls_jms_dest_messages_received_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (destination)", + "format": "table", + "instant": true, + "interval": "", + "intervalFactor": 1, + "refId": "F" + }, + { + "expr": "sum(wls_jms_dest_bytes_received_count{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\", weblogic_serverName=~\"${serverName:regex}\"}) by (destination)", + "format": "table", + "instant": true, + "intervalFactor": 1, + "refId": "G" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Destinations Overview", + "transform": "table", + "type": "table" + } + ], + "title": "JMS Services", + "type": "row" + } + ], + "refresh": false, + "schemaVersion": 16, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "current": { + "text": "prometheus", + "value": "prometheus" + }, + "hide": 0, + "label": null, + "name": "datasource", + "options": [], + "query": "prometheus", + "refresh": 1, + "regex": "", + "type": "datasource" + }, + { + "allValue": null, + "current": {}, + "datasource": "$datasource", + "hide": 0, + "includeAll": false, + "label": "Domain", + "multi": false, + "name": "domainName", + "options": [], + "query": "label_values(weblogic_domainUID)", + "refresh": 1, + "regex": "", + "sort": 2, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": null, + "current": {}, + "datasource": "$datasource", + "hide": 0, + "includeAll": false, + "label": "Cluster", + "multi": false, + "name": "clusterName", + "options": [], + "query": "label_values(wls_jvm_uptime{weblogic_domainUID=\"$domainName\"},weblogic_clusterName)", + "refresh": 1, + "regex": "", + "sort": 2, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": null, + "current": {}, + "datasource": "$datasource", + "hide": 0, + "includeAll": true, + "label": "Server", + "multi": true, + "name": "serverName", + "options": [], + "query": "label_values(wls_jvm_uptime{weblogic_domainUID=\"$domainName\", weblogic_clusterName=\"$clusterName\"},weblogic_serverName)", + "refresh": 1, + "regex": "", + "sort": 2, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": null, + "current": { + "selected": false, + "tags": [], + "text": "5", + "value": "5" + }, + "hide": 0, + "includeAll": false, + "label": "Top N", + "multi": false, + "name": "topN", + "options": [ + { + "selected": false, + "text": "3", + "value": "3" + }, + { + "selected": true, + "text": "5", + "value": "5" + }, + { + "selected": false, + "text": "7", + "value": "7" + }, + { + "selected": false, + "text": "10", + "value": "10" + } + ], + "query": "3, 5, 7, 10", + "skipUrlSync": false, + "type": "custom" + } + ] + }, + "time": { + "from": "now-30m", + "to": "now" + }, + "timepicker": { + "hidden": false, + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "timezone": "", + "title": "WebLogic Server Dashboard", + "uid": "5yUwzbZWz", + "version": 6 + } +} + diff --git a/OracleWebCenterPortal/kubernetes/monitoring-service/config/weblogic.xml b/OracleWebCenterPortal/kubernetes/monitoring-service/config/weblogic.xml old mode 100644 new mode 100755 diff --git a/OracleWebCenterPortal/kubernetes/monitoring-service/delete-monitoring.sh b/OracleWebCenterPortal/kubernetes/monitoring-service/delete-monitoring.sh old mode 100644 new mode 100755 index eee881c77..592c2f66b --- a/OracleWebCenterPortal/kubernetes/monitoring-service/delete-monitoring.sh +++ b/OracleWebCenterPortal/kubernetes/monitoring-service/delete-monitoring.sh @@ -1,122 +1,122 @@ -#!/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. -# -# delete-monitoring.sh - -# Initialize -script="${BASH_SOURCE[0]}" -scriptDir="$( cd "$( dirname "${script}" )" && pwd )" -OLD_PWD=`pwd` - - -# -## Function to exit and print an error message -## $1 - text of message -function fail { - printError $* - exit 1 -} - -# Function to print an error message -function removeFileIfExists { - echo "input is $1" - if [ -f $1 ]; then - rm -f $1 - fi -} - -function exitIfError { - if [ "$1" != "0" ]; then - echo "$2" - exit $1 - 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 usage { - echo usage: ${script} -i file [-v] [-h] - echo " -i Parameter inputs file, must be specified." - echo " -h Help" - exit $1 -} - - -function deletePrometheusGrafana { - helm delete ${monitoringNamespace} --namespace ${monitoringNamespace} -} - -#Parse the inputs -while getopts "hi:" opt; do - case $opt in - i) valuesInputFile="${OPTARG}" - ;; - h) usage 0 - ;; - *) usage 1 - ;; - esac -done - -if [ -z ${valuesInputFile} ]; then - echo "${script}: -i must be specified." - missingRequiredOption="true" -fi - -if [ "${missingRequiredOption}" == "true" ]; then - usage 1 -fi - -if [ ! -f ${valuesInputFile} ]; then - echo "Unable to locate the input parameters file ${valuesInputFile}" - fail 'The error listed above must be resolved before the script can continue' -fi - -exportValuesFile=$(mktemp /tmp/export-values-XXXXXXXXX.sh) -parseYaml ${valuesInputFile} ${exportValuesFile} - - -source ${exportValuesFile} -rm ${exportValuesFile} - -# Setting up the WebLogic Monitoring Exporter - -echo "Undeploy WebLogic Monitoring Exporter started" -serviceMonitor=${scriptDir}/manifests/wls-exporter-ServiceMonitor.yaml -kubectl delete --ignore-not-found=true -f ${serviceMonitor} -script=${scriptDir}/scripts/undeploy-weblogic-monitoring-exporter.sh -sh ${script} -if [ "$?" != "0" ]; then - echo "ERROR: $script failed." - echo "Undeploy WebLogic Monitoring Exporter completed with errors. Review the logs and rerun" -else - echo "Undeploy WebLogic Monitoring Exporter completed." -fi - -if [ "${setupKubePrometheusStack}" = "true" ]; then - echo "Deleting Prometheus and grafana started" - deletePrometheusGrafana - echo "Deleting Prometheus and grafana completed" -fi -cd $OLD_PWD - +#!/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. +# +# delete-monitoring.sh + +# Initialize +script="${BASH_SOURCE[0]}" +scriptDir="$( cd "$( dirname "${script}" )" && pwd )" +OLD_PWD=`pwd` + + +# +## Function to exit and print an error message +## $1 - text of message +function fail { + printError $* + exit 1 +} + +# Function to print an error message +function removeFileIfExists { + echo "input is $1" + if [ -f $1 ]; then + rm -f $1 + fi +} + +function exitIfError { + if [ "$1" != "0" ]; then + echo "$2" + exit $1 + 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 usage { + echo usage: ${script} -i file [-v] [-h] + echo " -i Parameter inputs file, must be specified." + echo " -h Help" + exit $1 +} + + +function deletePrometheusGrafana { + helm delete ${monitoringNamespace} --namespace ${monitoringNamespace} +} + +#Parse the inputs +while getopts "hi:" opt; do + case $opt in + i) valuesInputFile="${OPTARG}" + ;; + h) usage 0 + ;; + *) usage 1 + ;; + esac +done + +if [ -z ${valuesInputFile} ]; then + echo "${script}: -i must be specified." + missingRequiredOption="true" +fi + +if [ "${missingRequiredOption}" == "true" ]; then + usage 1 +fi + +if [ ! -f ${valuesInputFile} ]; then + echo "Unable to locate the input parameters file ${valuesInputFile}" + fail 'The error listed above must be resolved before the script can continue' +fi + +exportValuesFile=$(mktemp /tmp/export-values-XXXXXXXXX.sh) +parseYaml ${valuesInputFile} ${exportValuesFile} + + +source ${exportValuesFile} +rm ${exportValuesFile} + +# Setting up the WebLogic Monitoring Exporter + +echo "Undeploy WebLogic Monitoring Exporter started" +serviceMonitor=${scriptDir}/manifests/wls-exporter-ServiceMonitor.yaml +kubectl delete --ignore-not-found=true -f ${serviceMonitor} +script=${scriptDir}/scripts/undeploy-weblogic-monitoring-exporter.sh +sh ${script} +if [ "$?" != "0" ]; then + echo "ERROR: $script failed." + echo "Undeploy WebLogic Monitoring Exporter completed with errors. Review the logs and rerun" +else + echo "Undeploy WebLogic Monitoring Exporter completed." +fi + +if [ "${setupKubePrometheusStack}" = "true" ]; then + echo "Deleting Prometheus and grafana started" + deletePrometheusGrafana + echo "Deleting Prometheus and grafana completed" +fi +cd $OLD_PWD + diff --git a/OracleWebCenterPortal/kubernetes/monitoring-service/manifests/prometheus-roleBinding-domain-namespace.yaml b/OracleWebCenterPortal/kubernetes/monitoring-service/manifests/prometheus-roleBinding-domain-namespace.yaml old mode 100644 new mode 100755 index 98e23c3ea..b5b752268 --- a/OracleWebCenterPortal/kubernetes/monitoring-service/manifests/prometheus-roleBinding-domain-namespace.yaml +++ b/OracleWebCenterPortal/kubernetes/monitoring-service/manifests/prometheus-roleBinding-domain-namespace.yaml @@ -1,20 +1,20 @@ -# 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. -# -apiVersion: rbac.authorization.k8s.io/v1 -items: -- apiVersion: rbac.authorization.k8s.io/v1 - kind: RoleBinding - metadata: - name: prometheus-k8s - namespace: wcpns - roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: prometheus-k8s - subjects: - - kind: ServiceAccount - name: prometheus-k8s - namespace: monitoring -kind: RoleBindingList - +# 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. +# +apiVersion: rbac.authorization.k8s.io/v1 +items: +- apiVersion: rbac.authorization.k8s.io/v1 + kind: RoleBinding + metadata: + name: prometheus-k8s + namespace: wcpns + roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: prometheus-k8s + subjects: + - kind: ServiceAccount + name: prometheus-k8s + namespace: monitoring +kind: RoleBindingList + diff --git a/OracleWebCenterPortal/kubernetes/monitoring-service/manifests/prometheus-roleSpecific-domain-namespace.yaml b/OracleWebCenterPortal/kubernetes/monitoring-service/manifests/prometheus-roleSpecific-domain-namespace.yaml old mode 100644 new mode 100755 index aab147753..d74aa998c --- a/OracleWebCenterPortal/kubernetes/monitoring-service/manifests/prometheus-roleSpecific-domain-namespace.yaml +++ b/OracleWebCenterPortal/kubernetes/monitoring-service/manifests/prometheus-roleSpecific-domain-namespace.yaml @@ -1,23 +1,23 @@ -# 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. -# -apiVersion: rbac.authorization.k8s.io/v1 -items: -- apiVersion: rbac.authorization.k8s.io/v1 - kind: Role - metadata: - name: prometheus-k8s - namespace: wcpns - rules: - - apiGroups: - - "" - resources: - - services - - endpoints - - pods - verbs: - - get - - list - - watch -kind: RoleList - +# 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. +# +apiVersion: rbac.authorization.k8s.io/v1 +items: +- apiVersion: rbac.authorization.k8s.io/v1 + kind: Role + metadata: + name: prometheus-k8s + namespace: wcpns + rules: + - apiGroups: + - "" + resources: + - services + - endpoints + - pods + verbs: + - get + - list + - watch +kind: RoleList + diff --git a/OracleWebCenterPortal/kubernetes/monitoring-service/manifests/wls-exporter-ServiceMonitor.yaml b/OracleWebCenterPortal/kubernetes/monitoring-service/manifests/wls-exporter-ServiceMonitor.yaml old mode 100644 new mode 100755 diff --git a/OracleWebCenterPortal/kubernetes/monitoring-service/manifests/wls-exporter-ServiceMonitor.yaml.template b/OracleWebCenterPortal/kubernetes/monitoring-service/manifests/wls-exporter-ServiceMonitor.yaml.template old mode 100644 new mode 100755 index 63328f19d..442f1e566 --- a/OracleWebCenterPortal/kubernetes/monitoring-service/manifests/wls-exporter-ServiceMonitor.yaml.template +++ b/OracleWebCenterPortal/kubernetes/monitoring-service/manifests/wls-exporter-ServiceMonitor.yaml.template @@ -1,44 +1,44 @@ -# 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. -# -apiVersion: v1 -kind: Secret -metadata: - name: basic-auth - namespace: wcpns -data: - password: %PASSWORD% - user: %USERNAME% -type: Opaque ---- -apiVersion: monitoring.coreos.com/v1 -kind: ServiceMonitor -metadata: - name: wls-exporter - namespace: wcpns - labels: - k8s-app: wls-exporter - release: monitoring -spec: - namespaceSelector: - matchNames: - - wcpns - selector: - matchLabels: - weblogic.domainName: wcp-domain - endpoints: - - basicAuth: - password: - name: basic-auth - key: password - username: - name: basic-auth - key: user - port: default - relabelings: - - action: labelmap - regex: __meta_kubernetes_service_label_(.+) - interval: 10s - honorLabels: true - path: /wls-exporter/metrics - +# 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. +# +apiVersion: v1 +kind: Secret +metadata: + name: basic-auth + namespace: wcpns +data: + password: %PASSWORD% + user: %USERNAME% +type: Opaque +--- +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: wls-exporter + namespace: wcpns + labels: + k8s-app: wls-exporter + release: monitoring +spec: + namespaceSelector: + matchNames: + - wcpns + selector: + matchLabels: + weblogic.domainName: wcp-domain + endpoints: + - basicAuth: + password: + name: basic-auth + key: password + username: + name: basic-auth + key: user + port: default + relabelings: + - action: labelmap + regex: __meta_kubernetes_service_label_(.+) + interval: 10s + honorLabels: true + path: /wls-exporter/metrics + diff --git a/OracleWebCenterPortal/kubernetes/monitoring-service/monitoring-inputs.yaml b/OracleWebCenterPortal/kubernetes/monitoring-service/monitoring-inputs.yaml old mode 100644 new mode 100755 index a2b3c6647..5bfd36583 --- a/OracleWebCenterPortal/kubernetes/monitoring-service/monitoring-inputs.yaml +++ b/OracleWebCenterPortal/kubernetes/monitoring-service/monitoring-inputs.yaml @@ -1,64 +1,64 @@ -# 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. -# -# The version of this inputs file. Do not modify. -version: create-wcp-domain-monitoring-inputs-v1 - -# Unique ID identifying your domain. -# 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 domain namespace -domainNamespace: wcpns - -# Boolean value indicating whether to install kube-prometheus-stack -setupKubePrometheusStack: true - -# Additional parameters for helm install kube-prometheus-stack -# Refer https://github.com/prometheus-community/helm-charts/blob/main/charts/kube-prometheus-stack/values.yaml for additional parameters -# Sample : -# additionalParamForKubePrometheusStack: --set nodeExporter.enabled=false --set prometheusOperator.tls.enabled=false --set prometheusOperator.admissionWebhooks.enabled=false -additionalParamForKubePrometheusStack: - -# Name of the monitoring namespace -monitoringNamespace: monitoring - -# Name of the Admin Server -adminServerName: AdminServer -# -# Port number for admin server -adminServerPort: 7001 - -# Cluster name -wcpClusterName: wcp-cluster - -# Port number for managed server -wcpManagedServerPort: 8888 - -# WebLogic Monitoring Exporter to Cluster -wlsMonitoringExporterTowcpCluster: false - -# Portlet Cluster name -wcpPortletClusterName: wcportlet-cluster - -# Port number for Portlet managed server -wcpPortletManagedServerPort: 8889 - -# WebLogic Monitoring Exporter to PortletCluster -wlsMonitoringExporterTowcpPortletCluster: false - -# Boolean to indicate if the adminNodePort will be exposed -exposeMonitoringNodePort: false - -# NodePort to expose Prometheus -prometheusNodePort: 32101 - -# NodePort to expose Grafana -grafanaNodePort: 32100 - -# NodePort to expose Alertmanager -alertmanagerNodePort: 32102 - -# Name of the Kubernetes secret for the Admin Server's username and password -weblogicCredentialsSecretName: wcp-domain-domain-credentials - +# 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. +# +# The version of this inputs file. Do not modify. +version: create-wcp-domain-monitoring-inputs-v1 + +# Unique ID identifying your domain. +# 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 domain namespace +domainNamespace: wcpns + +# Boolean value indicating whether to install kube-prometheus-stack +setupKubePrometheusStack: true + +# Additional parameters for helm install kube-prometheus-stack +# Refer https://github.com/prometheus-community/helm-charts/blob/main/charts/kube-prometheus-stack/values.yaml for additional parameters +# Sample : +# additionalParamForKubePrometheusStack: --set nodeExporter.enabled=false --set prometheusOperator.tls.enabled=false --set prometheusOperator.admissionWebhooks.enabled=false +additionalParamForKubePrometheusStack: + +# Name of the monitoring namespace +monitoringNamespace: monitoring + +# Name of the Admin Server +adminServerName: AdminServer +# +# Port number for admin server +adminServerPort: 7001 + +# Cluster name +wcpClusterName: wcp-cluster + +# Port number for managed server +wcpManagedServerPort: 8888 + +# WebLogic Monitoring Exporter to Cluster +wlsMonitoringExporterTowcpCluster: false + +# Portlet Cluster name +wcpPortletClusterName: wcportlet-cluster + +# Port number for Portlet managed server +wcpPortletManagedServerPort: 8889 + +# WebLogic Monitoring Exporter to PortletCluster +wlsMonitoringExporterTowcpPortletCluster: false + +# Boolean to indicate if the adminNodePort will be exposed +exposeMonitoringNodePort: false + +# NodePort to expose Prometheus +prometheusNodePort: 32101 + +# NodePort to expose Grafana +grafanaNodePort: 32100 + +# NodePort to expose Alertmanager +alertmanagerNodePort: 32102 + +# Name of the Kubernetes secret for the Admin Server's username and password +weblogicCredentialsSecretName: wcp-domain-domain-credentials + diff --git a/OracleWebCenterPortal/kubernetes/monitoring-service/scripts/deploy-weblogic-monitoring-exporter.py b/OracleWebCenterPortal/kubernetes/monitoring-service/scripts/deploy-weblogic-monitoring-exporter.py old mode 100644 new mode 100755 index ebc5d0932..754df3c70 --- a/OracleWebCenterPortal/kubernetes/monitoring-service/scripts/deploy-weblogic-monitoring-exporter.py +++ b/OracleWebCenterPortal/kubernetes/monitoring-service/scripts/deploy-weblogic-monitoring-exporter.py @@ -1,105 +1,105 @@ -# 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. -# -import sys -#======================================================= -# Function for fresh plain deployment -#======================================================= -def newDeploy(appName,target): - try: - print 'Deploying .........' - deploy(appName,'/u01/oracle/wls-exporter-deploy/'+appName+'.war', target, upload="true",remote="true") - startApplication(appName) - except Exception, ex: - print ex.toString() - -#======================================================== -# Main program here... -# Target you can change as per your need -#======================================================== - -def usage(): - argsList = ' -domainName -adminServerName -adminURL -username -password ' - argsList=argsList + ' -wcpClusterName ' + ' -wlsMonitoringExporterTowcpCluster ' - argsList=argsList + ' -wcpPortletClusterName ' + ' -wlsMonitoringExporterTowcpPortletCluster ' - print sys.argv[0] + argsList - sys.exit(0) - -if len(sys.argv) < 1: - usage() - -# domainName will be passed by command line parameter -domainName. -domainName = "wcp-domain" - -# adminServerName will be passed by command line parameter -adminServerName -adminServerName = "AdminServer" - -# adminURL will be passed by command line parameter -adminURL -adminURL = "wcp-domain-adminserver:7001" - -# wcpClusterName will be passed by command line parameter -wcpClusterName -wcpClusterName = "wcp-cluster" - -# wlsMonitoringExporterTowcpCluster will be passed by command line parameter -wlsMonitoringExporterTowcpCluster -wlsMonitoringExporterTowcpCluster = "false" - - -# wcpPortletClusterName will be passed by command line parameter -wcpPortletClusterName -wcpPortletClusterName = "wcportlet-cluster" - -# wlsMonitoringExporterTowcpPortletCluster will be passed by command line parameter -wlsMonitoringExporterTowcpPortletCluster -wlsMonitoringExporterTowcpPortletCluster = "false" - -# username will be passed by command line parameter -username -username = "weblogic" - -# password will be passed by command line parameter -password -password = "Welcome1" - -i=1 -while i < len(sys.argv): - if sys.argv[i] == '-domainName': - domainName = sys.argv[i+1] - i += 2 - elif sys.argv[i] == '-adminServerName': - adminServerName = sys.argv[i+1] - i += 2 - elif sys.argv[i] == '-adminURL': - adminURL = sys.argv[i+1] - i += 2 - elif sys.argv[i] == '-username': - username = sys.argv[i+1] - i += 2 - elif sys.argv[i] == '-password': - password = sys.argv[i+1] - i += 2 - elif sys.argv[i] == '-wcpClusterName': - wcpClusterName = sys.argv[i+1] - i += 2 - elif sys.argv[i] == '-wlsMonitoringExporterTowcpCluster': - wlsMonitoringExporterTowcpCluster = sys.argv[i+1] - i += 2 - elif sys.argv[i] == '-wcpPortletClusterName': - wcpPortletClusterName = sys.argv[i+1] - i += 2 - elif sys.argv[i] == '-wlsMonitoringExporterTowcpPortletCluster': - wlsMonitoringExporterTowcpPortletCluster = sys.argv[i+1] - i += 2 - else: - print 'Unexpected argument switch at position ' + str(i) + ': ' + str(sys.argv[i]) - usage() - sys.exit(1) - -# Deployment -connect(username, password, 't3://' + adminURL) -cd('AppDeployments') -newDeploy('wls-exporter-adminserver',adminServerName) -if 'true' == wlsMonitoringExporterTowcpCluster: - newDeploy('wls-exporter-wcp',wcpClusterName) - -if 'true' == wlsMonitoringExporterTowcpPortletCluster: - newDeploy('wls-exporter-wcpPortlet',wcpPortletClusterName) - -disconnect() -exit() - +# 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. +# +import sys +#======================================================= +# Function for fresh plain deployment +#======================================================= +def newDeploy(appName,target): + try: + print 'Deploying .........' + deploy(appName,'/u01/oracle/wls-exporter-deploy/'+appName+'.war', target, upload="true",remote="true") + startApplication(appName) + except Exception, ex: + print ex.toString() + +#======================================================== +# Main program here... +# Target you can change as per your need +#======================================================== + +def usage(): + argsList = ' -domainName -adminServerName -adminURL -username -password ' + argsList=argsList + ' -wcpClusterName ' + ' -wlsMonitoringExporterTowcpCluster ' + argsList=argsList + ' -wcpPortletClusterName ' + ' -wlsMonitoringExporterTowcpPortletCluster ' + print sys.argv[0] + argsList + sys.exit(0) + +if len(sys.argv) < 1: + usage() + +# domainName will be passed by command line parameter -domainName. +domainName = "wcp-domain" + +# adminServerName will be passed by command line parameter -adminServerName +adminServerName = "AdminServer" + +# adminURL will be passed by command line parameter -adminURL +adminURL = "wcp-domain-adminserver:7001" + +# wcpClusterName will be passed by command line parameter -wcpClusterName +wcpClusterName = "wcp-cluster" + +# wlsMonitoringExporterTowcpCluster will be passed by command line parameter -wlsMonitoringExporterTowcpCluster +wlsMonitoringExporterTowcpCluster = "false" + + +# wcpPortletClusterName will be passed by command line parameter -wcpPortletClusterName +wcpPortletClusterName = "wcportlet-cluster" + +# wlsMonitoringExporterTowcpPortletCluster will be passed by command line parameter -wlsMonitoringExporterTowcpPortletCluster +wlsMonitoringExporterTowcpPortletCluster = "false" + +# username will be passed by command line parameter -username +username = "weblogic" + +# password will be passed by command line parameter -password +password = "Welcome1" + +i=1 +while i < len(sys.argv): + if sys.argv[i] == '-domainName': + domainName = sys.argv[i+1] + i += 2 + elif sys.argv[i] == '-adminServerName': + adminServerName = sys.argv[i+1] + i += 2 + elif sys.argv[i] == '-adminURL': + adminURL = sys.argv[i+1] + i += 2 + elif sys.argv[i] == '-username': + username = sys.argv[i+1] + i += 2 + elif sys.argv[i] == '-password': + password = sys.argv[i+1] + i += 2 + elif sys.argv[i] == '-wcpClusterName': + wcpClusterName = sys.argv[i+1] + i += 2 + elif sys.argv[i] == '-wlsMonitoringExporterTowcpCluster': + wlsMonitoringExporterTowcpCluster = sys.argv[i+1] + i += 2 + elif sys.argv[i] == '-wcpPortletClusterName': + wcpPortletClusterName = sys.argv[i+1] + i += 2 + elif sys.argv[i] == '-wlsMonitoringExporterTowcpPortletCluster': + wlsMonitoringExporterTowcpPortletCluster = sys.argv[i+1] + i += 2 + else: + print 'Unexpected argument switch at position ' + str(i) + ': ' + str(sys.argv[i]) + usage() + sys.exit(1) + +# Deployment +connect(username, password, 't3://' + adminURL) +cd('AppDeployments') +newDeploy('wls-exporter-adminserver',adminServerName) +if 'true' == wlsMonitoringExporterTowcpCluster: + newDeploy('wls-exporter-wcp',wcpClusterName) + +if 'true' == wlsMonitoringExporterTowcpPortletCluster: + newDeploy('wls-exporter-wcpPortlet',wcpPortletClusterName) + +disconnect() +exit() + diff --git a/OracleWebCenterPortal/kubernetes/monitoring-service/scripts/deploy-weblogic-monitoring-exporter.sh b/OracleWebCenterPortal/kubernetes/monitoring-service/scripts/deploy-weblogic-monitoring-exporter.sh old mode 100644 new mode 100755 index 32895973a..a47d4d27b --- a/OracleWebCenterPortal/kubernetes/monitoring-service/scripts/deploy-weblogic-monitoring-exporter.sh +++ b/OracleWebCenterPortal/kubernetes/monitoring-service/scripts/deploy-weblogic-monitoring-exporter.sh @@ -1,37 +1,37 @@ -#!/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. -# -# Initialize -script="${BASH_SOURCE[0]}" -scriptDir="$( cd "$( dirname "${script}" )" && pwd )" -warDir=$PWD -source ${scriptDir}/utils.sh - -# Setting default values -initialize -# 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" -} - -# username and password from Kubernetes secret -username=`kubectl get secrets ${weblogicCredentialsSecretName} -n ${domainNamespace} -o=jsonpath='{.data.username}'|base64 --decode` -password=`kubectl get secrets ${weblogicCredentialsSecretName} -n ${domainNamespace} -o=jsonpath='{.data.password}'|base64 --decode` - -adminServerPodName="${domainUID}-$(toDNS1123Legal ${adminServerName})" - -InputParameterList=" -domainName ${domainUID} -adminServerName ${adminServerName} -adminURL ${adminServerPodName}:${adminServerPort} -username ${username} -password ${password}" -InputParameterList="${InputParameterList} -wcpClusterName ${wcpClusterName} -wlsMonitoringExporterTowcpCluster ${wlsMonitoringExporterTowcpCluster}" -InputParameterList="${InputParameterList} -wcpPortletClusterName ${wcpPortletClusterName} -wlsMonitoringExporterTowcpPortletCluster ${wlsMonitoringExporterTowcpPortletCluster}" - -echo "Deploying WebLogic Monitoring Exporter with domainNamespace[$domainNamespace], domainUID[$domainUID], adminServerPodName[$adminServerPodName]" -. $scriptDir/get-wls-exporter.sh -kubectl cp $scriptDir/wls-exporter-deploy ${domainNamespace}/${adminServerPodName}:/u01/oracle -kubectl cp $scriptDir/deploy-weblogic-monitoring-exporter.py ${domainNamespace}/${adminServerPodName}:/u01/oracle/wls-exporter-deploy -EXEC_DEPLOY="kubectl exec -it -n ${domainNamespace} ${adminServerPodName} -- /u01/oracle/oracle_common/common/bin/wlst.sh /u01/oracle/wls-exporter-deploy/deploy-weblogic-monitoring-exporter.py ${InputParameterList}" -eval ${EXEC_DEPLOY} - +#!/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. +# +# Initialize +script="${BASH_SOURCE[0]}" +scriptDir="$( cd "$( dirname "${script}" )" && pwd )" +warDir=$PWD +source ${scriptDir}/utils.sh + +# Setting default values +initialize +# 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" +} + +# username and password from Kubernetes secret +username=`kubectl get secrets ${weblogicCredentialsSecretName} -n ${domainNamespace} -o=jsonpath='{.data.username}'|base64 --decode` +password=`kubectl get secrets ${weblogicCredentialsSecretName} -n ${domainNamespace} -o=jsonpath='{.data.password}'|base64 --decode` + +adminServerPodName="${domainUID}-$(toDNS1123Legal ${adminServerName})" + +InputParameterList=" -domainName ${domainUID} -adminServerName ${adminServerName} -adminURL ${adminServerPodName}:${adminServerPort} -username ${username} -password ${password}" +InputParameterList="${InputParameterList} -wcpClusterName ${wcpClusterName} -wlsMonitoringExporterTowcpCluster ${wlsMonitoringExporterTowcpCluster}" +InputParameterList="${InputParameterList} -wcpPortletClusterName ${wcpPortletClusterName} -wlsMonitoringExporterTowcpPortletCluster ${wlsMonitoringExporterTowcpPortletCluster}" + +echo "Deploying WebLogic Monitoring Exporter with domainNamespace[$domainNamespace], domainUID[$domainUID], adminServerPodName[$adminServerPodName]" +. $scriptDir/get-wls-exporter.sh +kubectl cp $scriptDir/wls-exporter-deploy ${domainNamespace}/${adminServerPodName}:/u01/oracle +kubectl cp $scriptDir/deploy-weblogic-monitoring-exporter.py ${domainNamespace}/${adminServerPodName}:/u01/oracle/wls-exporter-deploy +EXEC_DEPLOY="kubectl exec -it -n ${domainNamespace} ${adminServerPodName} -- /u01/oracle/oracle_common/common/bin/wlst.sh /u01/oracle/wls-exporter-deploy/deploy-weblogic-monitoring-exporter.py ${InputParameterList}" +eval ${EXEC_DEPLOY} + diff --git a/OracleWebCenterPortal/kubernetes/monitoring-service/scripts/get-wls-exporter.sh b/OracleWebCenterPortal/kubernetes/monitoring-service/scripts/get-wls-exporter.sh old mode 100644 new mode 100755 index f4f47a7b7..7da76cc31 --- a/OracleWebCenterPortal/kubernetes/monitoring-service/scripts/get-wls-exporter.sh +++ b/OracleWebCenterPortal/kubernetes/monitoring-service/scripts/get-wls-exporter.sh @@ -1,46 +1,46 @@ -#!/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. -# -# Initialize -script="${BASH_SOURCE[0]}" -scriptDir="$( cd "$( dirname "${script}" )" && pwd )" -source ${scriptDir}/utils.sh -warDir=$scriptDir/../bin -mkdir -p $warDir -curl -L -o $warDir/wls-exporter.war https://github.com/oracle/weblogic-monitoring-exporter/releases/download/v2.0.0/wls-exporter.war -mkdir -p $scriptDir/wls-exporter-deploy -echo "created $scriptDir/wls-exporter-deploy dir" - -function update_wls_exporter_war { - servername=$1 - port=$2 - tmp_dir=$(mktemp -d -t ci-XXXXXXXXXX) - echo "created $tmp_dir" - mkdir -p $tmp_dir/WEB-INF - cp $scriptDir/../config/config.yml.template $tmp_dir/config.yml - cp $scriptDir/../config/weblogic.xml $tmp_dir/WEB-INF/weblogic.xml - cp $warDir/wls-exporter.war $tmp_dir/wls-exporter.war - - sed -i -e "s:%PORT%:${port}:g" $tmp_dir/config.yml - pushd $tmp_dir - echo "in temp dir" - zip wls-exporter.war WEB-INF/weblogic.xml - zip wls-exporter.war config.yml - - cp wls-exporter.war ${scriptDir}/wls-exporter-deploy/wls-exporter-${servername}.war - popd -} - -initialize - -update_wls_exporter_war adminserver ${adminServerPort} -if [[ ${wlsMonitoringExporterTowcpCluster} == "true" ]]; -then - update_wls_exporter_war wcp ${wcpManagedServerPort} -fi -if [[ ${wlsMonitoringExporterTowcpPortletCluster} == "true" ]]; -then - update_wls_exporter_war wcpPortlet ${wcpPortletManagedServerPort} -fi - +#!/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. +# +# Initialize +script="${BASH_SOURCE[0]}" +scriptDir="$( cd "$( dirname "${script}" )" && pwd )" +source ${scriptDir}/utils.sh +warDir=$scriptDir/../bin +mkdir -p $warDir +curl -L -o $warDir/wls-exporter.war https://github.com/oracle/weblogic-monitoring-exporter/releases/download/v2.0.0/wls-exporter.war +mkdir -p $scriptDir/wls-exporter-deploy +echo "created $scriptDir/wls-exporter-deploy dir" + +function update_wls_exporter_war { + servername=$1 + port=$2 + tmp_dir=$(mktemp -d -t ci-XXXXXXXXXX) + echo "created $tmp_dir" + mkdir -p $tmp_dir/WEB-INF + cp $scriptDir/../config/config.yml.template $tmp_dir/config.yml + cp $scriptDir/../config/weblogic.xml $tmp_dir/WEB-INF/weblogic.xml + cp $warDir/wls-exporter.war $tmp_dir/wls-exporter.war + + sed -i -e "s:%PORT%:${port}:g" $tmp_dir/config.yml + pushd $tmp_dir + echo "in temp dir" + zip wls-exporter.war WEB-INF/weblogic.xml + zip wls-exporter.war config.yml + + cp wls-exporter.war ${scriptDir}/wls-exporter-deploy/wls-exporter-${servername}.war + popd +} + +initialize + +update_wls_exporter_war adminserver ${adminServerPort} +if [[ ${wlsMonitoringExporterTowcpCluster} == "true" ]]; +then + update_wls_exporter_war wcp ${wcpManagedServerPort} +fi +if [[ ${wlsMonitoringExporterTowcpPortletCluster} == "true" ]]; +then + update_wls_exporter_war wcpPortlet ${wcpPortletManagedServerPort} +fi + diff --git a/OracleWebCenterPortal/kubernetes/monitoring-service/scripts/undeploy-weblogic-monitoring-exporter.py b/OracleWebCenterPortal/kubernetes/monitoring-service/scripts/undeploy-weblogic-monitoring-exporter.py old mode 100644 new mode 100755 index 52fc3d040..1c9e282de --- a/OracleWebCenterPortal/kubernetes/monitoring-service/scripts/undeploy-weblogic-monitoring-exporter.py +++ b/OracleWebCenterPortal/kubernetes/monitoring-service/scripts/undeploy-weblogic-monitoring-exporter.py @@ -1,103 +1,103 @@ -# 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. -# -import sys -#======================================================= -# Function for undeployment -#======================================================= -def unDeploy(appName,target): - print 'Undeploying .........' - try: - stopApplication(appName) - undeploy(appName, target) - except Exception, ex: - print ex.toString() - -#======================================================== -# Main program here... -# Target you can change as per your need -#======================================================== -def usage(): - argsList = ' -domainName -adminServerName -adminURL -username -password ' - argsList=argsList + ' -wcpClusterName ' + ' -wlsMonitoringExporterTowcpCluster ' - argsList=argsList + ' -wcpPortletClusterName ' + ' -wlsMonitoringExporterTowcpPortletCluster ' - print sys.argv[0] + argsList - sys.exit(0) - -if len(sys.argv) < 1: - usage() - -# domainName will be passed by command line parameter -domainName. -domainName = "wcp-domain" - -# adminServerName will be passed by command line parameter -adminServerName -adminServerName = "AdminServer" - -# adminURL will be passed by command line parameter -adminURL -adminURL = "wcp-domain-adminserver:7001" - -# wcpClusterName will be passed by command line parameter -wcpClusterName -wcpClusterName = "wcp-cluster" - -# wlsMonitoringExporterTowcpCluster will be passed by command line parameter -wlsMonitoringExporterTowcpCluster -wlsMonitoringExporterTowcpCluster = "false" -# wcpPortletClusterName will be passed by command line parameter -wcpPortletClusterName -wcpPortletClusterName = "wcportlet-cluster" - -# wlsMonitoringExporterTowcpPortletCluster will be passed by command line parameter -wlsMonitoringExporterTowcpPortletCluster -wlsMonitoringExporterTowcpPortletCluster = "false" - -# username will be passed by command line parameter -username -username = "weblogic" - -# password will be passed by command line parameter -password -password = "Welcome1" - - -i=1 -while i < len(sys.argv): - if sys.argv[i] == '-domainName': - domainName = sys.argv[i+1] - i += 2 - elif sys.argv[i] == '-adminServerName': - adminServerName = sys.argv[i+1] - i += 2 - elif sys.argv[i] == '-adminURL': - adminURL = sys.argv[i+1] - i += 2 - elif sys.argv[i] == '-username': - username = sys.argv[i+1] - i += 2 - elif sys.argv[i] == '-password': - password = sys.argv[i+1] - i += 2 - elif sys.argv[i] == '-wcpClusterName': - wcpClusterName = sys.argv[i+1] - i += 2 - elif sys.argv[i] == '-wlsMonitoringExporterTowcpCluster': - wlsMonitoringExporterTowcpCluster = sys.argv[i+1] - i += 2 - elif sys.argv[i] == '-wcpPortletClusterName': - wcpPortletClusterName = sys.argv[i+1] - i += 2 - elif sys.argv[i] == '-wlsMonitoringExporterTowcpPortletCluster': - wlsMonitoringExporterTowcpPortletCluster = sys.argv[i+1] - i += 2 - - else: - print 'Unexpected argument switch at position ' + str(i) + ': ' + str(sys.argv[i]) - usage() - sys.exit(1) - -# Undeploy -connect(username, password, 't3://' + adminURL) -unDeploy('wls-exporter-adminserver',adminServerName) -if 'true' == wlsMonitoringExporterTowcpCluster: - unDeploy('wls-exporter-wcp',wcpClusterName) - -if 'true' == wlsMonitoringExporterTowcpPortletCluster: - unDeploy('wls-exporter-wcpPortlet',wcpPortletClusterName) - -disconnect() -exit() - +# 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. +# +import sys +#======================================================= +# Function for undeployment +#======================================================= +def unDeploy(appName,target): + print 'Undeploying .........' + try: + stopApplication(appName) + undeploy(appName, target) + except Exception, ex: + print ex.toString() + +#======================================================== +# Main program here... +# Target you can change as per your need +#======================================================== +def usage(): + argsList = ' -domainName -adminServerName -adminURL -username -password ' + argsList=argsList + ' -wcpClusterName ' + ' -wlsMonitoringExporterTowcpCluster ' + argsList=argsList + ' -wcpPortletClusterName ' + ' -wlsMonitoringExporterTowcpPortletCluster ' + print sys.argv[0] + argsList + sys.exit(0) + +if len(sys.argv) < 1: + usage() + +# domainName will be passed by command line parameter -domainName. +domainName = "wcp-domain" + +# adminServerName will be passed by command line parameter -adminServerName +adminServerName = "AdminServer" + +# adminURL will be passed by command line parameter -adminURL +adminURL = "wcp-domain-adminserver:7001" + +# wcpClusterName will be passed by command line parameter -wcpClusterName +wcpClusterName = "wcp-cluster" + +# wlsMonitoringExporterTowcpCluster will be passed by command line parameter -wlsMonitoringExporterTowcpCluster +wlsMonitoringExporterTowcpCluster = "false" +# wcpPortletClusterName will be passed by command line parameter -wcpPortletClusterName +wcpPortletClusterName = "wcportlet-cluster" + +# wlsMonitoringExporterTowcpPortletCluster will be passed by command line parameter -wlsMonitoringExporterTowcpPortletCluster +wlsMonitoringExporterTowcpPortletCluster = "false" + +# username will be passed by command line parameter -username +username = "weblogic" + +# password will be passed by command line parameter -password +password = "Welcome1" + + +i=1 +while i < len(sys.argv): + if sys.argv[i] == '-domainName': + domainName = sys.argv[i+1] + i += 2 + elif sys.argv[i] == '-adminServerName': + adminServerName = sys.argv[i+1] + i += 2 + elif sys.argv[i] == '-adminURL': + adminURL = sys.argv[i+1] + i += 2 + elif sys.argv[i] == '-username': + username = sys.argv[i+1] + i += 2 + elif sys.argv[i] == '-password': + password = sys.argv[i+1] + i += 2 + elif sys.argv[i] == '-wcpClusterName': + wcpClusterName = sys.argv[i+1] + i += 2 + elif sys.argv[i] == '-wlsMonitoringExporterTowcpCluster': + wlsMonitoringExporterTowcpCluster = sys.argv[i+1] + i += 2 + elif sys.argv[i] == '-wcpPortletClusterName': + wcpPortletClusterName = sys.argv[i+1] + i += 2 + elif sys.argv[i] == '-wlsMonitoringExporterTowcpPortletCluster': + wlsMonitoringExporterTowcpPortletCluster = sys.argv[i+1] + i += 2 + + else: + print 'Unexpected argument switch at position ' + str(i) + ': ' + str(sys.argv[i]) + usage() + sys.exit(1) + +# Undeploy +connect(username, password, 't3://' + adminURL) +unDeploy('wls-exporter-adminserver',adminServerName) +if 'true' == wlsMonitoringExporterTowcpCluster: + unDeploy('wls-exporter-wcp',wcpClusterName) + +if 'true' == wlsMonitoringExporterTowcpPortletCluster: + unDeploy('wls-exporter-wcpPortlet',wcpPortletClusterName) + +disconnect() +exit() + diff --git a/OracleWebCenterPortal/kubernetes/monitoring-service/scripts/undeploy-weblogic-monitoring-exporter.sh b/OracleWebCenterPortal/kubernetes/monitoring-service/scripts/undeploy-weblogic-monitoring-exporter.sh old mode 100644 new mode 100755 index 873ea52c2..40d13e4f2 --- a/OracleWebCenterPortal/kubernetes/monitoring-service/scripts/undeploy-weblogic-monitoring-exporter.sh +++ b/OracleWebCenterPortal/kubernetes/monitoring-service/scripts/undeploy-weblogic-monitoring-exporter.sh @@ -1,39 +1,39 @@ -#!/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. -# -# Initialize -script="${BASH_SOURCE[0]}" -scriptDir="$( cd "$( dirname "${script}" )" && pwd )" -source ${scriptDir}/utils.sh - -# 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" -} - -initialize - -# username and password from Kubernetes secret -username=`kubectl get secrets ${weblogicCredentialsSecretName} -n ${domainNamespace} -o=jsonpath='{.data.username}'|base64 --decode` -password=`kubectl get secrets ${weblogicCredentialsSecretName} -n ${domainNamespace} -o=jsonpath='{.data.password}'|base64 --decode` - -adminServerPodName="${domainUID}-$(toDNS1123Legal ${adminServerName})" - -InputParameterList="-domainName ${domainUID} -adminServerName ${adminServerName} -adminURL ${adminServerPodName}:${adminServerPort} -username ${username} -password ${password}" -InputParameterList="${InputParameterList} -wcpClusterName ${wcpClusterName} -wlsMonitoringExporterTowcpCluster ${wlsMonitoringExporterTowcpCluster}" -InputParameterList="${InputParameterList} -wcpPortletClusterName ${wcpPortletClusterName} -wlsMonitoringExporterTowcpPortletCluster ${wlsMonitoringExporterTowcpPortletCluster}" - -# Copy weblogic monitoring exporter jars for deployment -echo "Undeploying WebLogic Monitoring Exporter: domainNamespace[$domainNamespace], domainUID[$domainUID], adminServerPodName[$adminServerPodName]" - -kubectl cp $scriptDir/undeploy-weblogic-monitoring-exporter.py ${domainNamespace}/${adminServerPodName}:/u01/oracle/undeploy-weblogic-monitoring-exporter.py -EXEC_UNDEPLOY="kubectl exec -it -n ${domainNamespace} ${adminServerPodName} -- /u01/oracle/oracle_common/common/bin/wlst.sh /u01/oracle/undeploy-weblogic-monitoring-exporter.py ${InputParameterList}" -eval ${EXEC_UNDEPLOY} - -# Cleanup the local wars -rm -rf ${scriptDir}/wls-exporter-deploy - +#!/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. +# +# Initialize +script="${BASH_SOURCE[0]}" +scriptDir="$( cd "$( dirname "${script}" )" && pwd )" +source ${scriptDir}/utils.sh + +# 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" +} + +initialize + +# username and password from Kubernetes secret +username=`kubectl get secrets ${weblogicCredentialsSecretName} -n ${domainNamespace} -o=jsonpath='{.data.username}'|base64 --decode` +password=`kubectl get secrets ${weblogicCredentialsSecretName} -n ${domainNamespace} -o=jsonpath='{.data.password}'|base64 --decode` + +adminServerPodName="${domainUID}-$(toDNS1123Legal ${adminServerName})" + +InputParameterList="-domainName ${domainUID} -adminServerName ${adminServerName} -adminURL ${adminServerPodName}:${adminServerPort} -username ${username} -password ${password}" +InputParameterList="${InputParameterList} -wcpClusterName ${wcpClusterName} -wlsMonitoringExporterTowcpCluster ${wlsMonitoringExporterTowcpCluster}" +InputParameterList="${InputParameterList} -wcpPortletClusterName ${wcpPortletClusterName} -wlsMonitoringExporterTowcpPortletCluster ${wlsMonitoringExporterTowcpPortletCluster}" + +# Copy weblogic monitoring exporter jars for deployment +echo "Undeploying WebLogic Monitoring Exporter: domainNamespace[$domainNamespace], domainUID[$domainUID], adminServerPodName[$adminServerPodName]" + +kubectl cp $scriptDir/undeploy-weblogic-monitoring-exporter.py ${domainNamespace}/${adminServerPodName}:/u01/oracle/undeploy-weblogic-monitoring-exporter.py +EXEC_UNDEPLOY="kubectl exec -it -n ${domainNamespace} ${adminServerPodName} -- /u01/oracle/oracle_common/common/bin/wlst.sh /u01/oracle/undeploy-weblogic-monitoring-exporter.py ${InputParameterList}" +eval ${EXEC_UNDEPLOY} + +# Cleanup the local wars +rm -rf ${scriptDir}/wls-exporter-deploy + diff --git a/OracleWebCenterPortal/kubernetes/monitoring-service/scripts/utils.sh b/OracleWebCenterPortal/kubernetes/monitoring-service/scripts/utils.sh old mode 100644 new mode 100755 index 7d68513a2..280945a5c --- a/OracleWebCenterPortal/kubernetes/monitoring-service/scripts/utils.sh +++ b/OracleWebCenterPortal/kubernetes/monitoring-service/scripts/utils.sh @@ -1,61 +1,61 @@ -#!/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. -# - -function initialize { - if [ -z ${domainNamespace} ]; then - echo "domainNamespace is empty, setting to default wcpns" - domainNamespace="wcpns" - fi - - if [ -z ${domainUID} ]; then - echo "domainUID is empty, setting to default wcp-domain" - domainUID="wcp-domain" - fi - - if [ -z ${weblogicCredentialsSecretName} ]; then - echo "weblogicCredentialsSecretName is empty, setting to default \"wcp-domain-domain-credentials\"" - weblogicCredentialsSecretName="wcp-domain-domain-credentials" - fi - - if [ -z ${adminServerName} ]; then - echo "adminServerName is empty, setting to default \"AdminServer\"" - adminServerName="AdminServer" - fi - - if [ -z ${adminServerPort} ]; then - echo "adminServerPort is empty, setting to default \"7001\"" - adminServerPort="7001" - fi - - if [ -z ${wcpClusterName} ]; then - echo "wcpClusterName is empty, setting to default \"wcp-cluster\"" - wcpClusterName="wcp-cluster" - fi - - if [ -z ${wcpManagedServerPort} ]; then - echo "wcpManagedServerPort is empty, setting to default \"8888\"" - wcpManagedServerPort="8888" - fi - - if [ -z ${wlsMonitoringExporterTowcpCluster} ]; then - echo "wlsMonitoringExporterTowcpCluster is empty, setting to default \"false\"" - wlsMonitoringExporterTowcpCluster="false" - fi - if [ -z ${wcpPortletClusterName} ]; then - echo "wcpPortletClusterName is empty, setting to default \"wcportlet-cluster\"" - wcpPortletClusterName="wcportlet-cluster" - fi - - if [ -z ${wcpPortletManagedServerPort} ]; then - echo "wcpPortletManagedServerPort is empty, setting to default \"8889\"" - wcpPortletManagedServerPort="8889" - fi - - if [ -z ${wlsMonitoringExporterTowcpPortletCluster} ]; then - echo "wlsMonitoringExporterTowcpPortletCluster is empty, setting to default \"false\"" - wlsMonitoringExporterTowcpPortletCluster="false" - fi -} - +#!/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. +# + +function initialize { + if [ -z ${domainNamespace} ]; then + echo "domainNamespace is empty, setting to default wcpns" + domainNamespace="wcpns" + fi + + if [ -z ${domainUID} ]; then + echo "domainUID is empty, setting to default wcp-domain" + domainUID="wcp-domain" + fi + + if [ -z ${weblogicCredentialsSecretName} ]; then + echo "weblogicCredentialsSecretName is empty, setting to default \"wcp-domain-domain-credentials\"" + weblogicCredentialsSecretName="wcp-domain-domain-credentials" + fi + + if [ -z ${adminServerName} ]; then + echo "adminServerName is empty, setting to default \"AdminServer\"" + adminServerName="AdminServer" + fi + + if [ -z ${adminServerPort} ]; then + echo "adminServerPort is empty, setting to default \"7001\"" + adminServerPort="7001" + fi + + if [ -z ${wcpClusterName} ]; then + echo "wcpClusterName is empty, setting to default \"wcp-cluster\"" + wcpClusterName="wcp-cluster" + fi + + if [ -z ${wcpManagedServerPort} ]; then + echo "wcpManagedServerPort is empty, setting to default \"8888\"" + wcpManagedServerPort="8888" + fi + + if [ -z ${wlsMonitoringExporterTowcpCluster} ]; then + echo "wlsMonitoringExporterTowcpCluster is empty, setting to default \"false\"" + wlsMonitoringExporterTowcpCluster="false" + fi + if [ -z ${wcpPortletClusterName} ]; then + echo "wcpPortletClusterName is empty, setting to default \"wcportlet-cluster\"" + wcpPortletClusterName="wcportlet-cluster" + fi + + if [ -z ${wcpPortletManagedServerPort} ]; then + echo "wcpPortletManagedServerPort is empty, setting to default \"8889\"" + wcpPortletManagedServerPort="8889" + fi + + if [ -z ${wlsMonitoringExporterTowcpPortletCluster} ]; then + echo "wlsMonitoringExporterTowcpPortletCluster is empty, setting to default \"false\"" + wlsMonitoringExporterTowcpPortletCluster="false" + fi +} + diff --git a/OracleWebCenterPortal/kubernetes/monitoring-service/setup-monitoring.sh b/OracleWebCenterPortal/kubernetes/monitoring-service/setup-monitoring.sh old mode 100644 new mode 100755 index bf7d3619c..217390003 --- a/OracleWebCenterPortal/kubernetes/monitoring-service/setup-monitoring.sh +++ b/OracleWebCenterPortal/kubernetes/monitoring-service/setup-monitoring.sh @@ -1,194 +1,194 @@ -#!/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. -# -# setup-monitoring.sh - -# Initialize -script="${BASH_SOURCE[0]}" -scriptDir="$( cd "$( dirname "${script}" )" && pwd )" -OLD_PWD=`pwd` - - - -# -# 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 remove a file if it exists -# -function removeFileIfExists { - echo "input is $1" - if [ -f $1 ]; then - rm -f $1 - fi -} - -function exitIfError { - if [ "$1" != "0" ]; then - echo "$2" - exit $1 - 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 usage { - echo usage: ${script} -i file [-v] [-h] - echo " -i Parameter inputs file, must be specified." - echo " -h Help" - exit $1 -} - -function installKubePrometheusStack { - helm repo add prometheus-community https://prometheus-community.github.io/helm-charts - helm repo update - echo "Setup prometheus-community/kube-prometheus-stack in progress" - if [ ${exposeMonitoringNodePort} == "true" ]; then - - helm install ${monitoringNamespace} prometheus-community/kube-prometheus-stack \ - --namespace ${monitoringNamespace} ${additionalParamForKubePrometheusStack} \ - --set prometheus.service.type=NodePort --set prometheus.service.nodePort=${prometheusNodePort} \ - --set alertmanager.service.type=NodePort --set alertmanager.service.nodePort=${alertmanagerNodePort} \ - --set grafana.adminPassword=admin --set grafana.service.type=NodePort --set grafana.service.nodePort=${grafanaNodePort} \ - --version "16.5.0" \ - --atomic --wait - else - helm install ${monitoringNamespace} prometheus-community/kube-prometheus-stack \ - --namespace ${monitoringNamespace} ${additionalParamForKubePrometheusStack} \ - --set grafana.adminPassword=admin \ - --version "16.5.0" \ - --atomic --wait - fi - exitIfError $? "ERROR: prometheus-community/kube-prometheus-stack install failed." -} - -#Parse the inputs -while getopts "hi:" opt; do - case $opt in - i) valuesInputFile="${OPTARG}" - ;; - h) usage 0 - ;; - *) usage 1 - ;; - esac -done - -if [ -z ${valuesInputFile} ]; then - echo "${script}: -i must be specified." - missingRequiredOption="true" -fi - -if [ "${missingRequiredOption}" == "true" ]; then - usage 1 -fi - -if [ ! -f ${valuesInputFile} ]; then - echo "Unable to locate the input parameters file ${valuesInputFile}" - fail 'The error listed above must be resolved before the script can continue' -fi - - -exportValuesFile=$(mktemp /tmp/export-values-XXXXXXXXX.sh) -parseYaml ${valuesInputFile} ${exportValuesFile} - - -source ${exportValuesFile} -rm ${exportValuesFile} - - -if [ "${setupKubePrometheusStack}" = "true" ]; then - if test "$(kubectl get namespace ${monitoringNamespace} --ignore-not-found | wc -l)" = 0; then - echo "The namespace ${monitoringNamespace} for install prometheus-community/kube-promethues-stack does not exist. Creating the namespace ${monitoringNamespace}" - kubectl create namespace ${monitoringNamespace} - fi - echo -e "Monitoring setup in ${monitoringNamespace} in progress.......\n" - - # Create the namespace and CRDs, and then wait for them to be availble before creating the remaining resources - kubectl label nodes --all kubernetes.io/os=linux --overwrite=true - - echo "Setup prometheus-community/kube-prometheus-stack started" - installKubePrometheusStack - cd $OLD_PWD - - echo "Setup prometheus-community/kube-prometheus-stack completed" -fi - -export username=`kubectl get secrets ${weblogicCredentialsSecretName} -n ${domainNamespace} -o=jsonpath='{.data.username}'|base64 --decode` -export password=`kubectl get secrets ${weblogicCredentialsSecretName} -n ${domainNamespace} -o=jsonpath='{.data.password}'|base64 --decode` - -# Setting up the WebLogic Monitoring Exporter -echo "Deploy WebLogic Monitoring Exporter started" -script=${scriptDir}/scripts/deploy-weblogic-monitoring-exporter.sh -sh ${script} -exitIfError $? "ERROR: $script failed." -echo "Deploy WebLogic Monitoring Exporter completed" - - -# Deploy servicemonitors -serviceMonitor=${scriptDir}/manifests/wls-exporter-ServiceMonitor.yaml -cp "${serviceMonitor}.template" "${serviceMonitor}" -sed -i -e "s/release: monitoring/release: ${monitoringNamespace}/g" ${serviceMonitor} -sed -i -e "s/user: %USERNAME%/user: `echo -n $username|base64 -w0`/g" ${serviceMonitor} -sed -i -e "s/password: %PASSWORD%/password: `echo -n $password|base64 -w0`/g" ${serviceMonitor} -sed -i -e "s/namespace:.*/namespace: ${domainNamespace}/g" ${serviceMonitor} -sed -i -e "s/weblogic.domainName:.*/weblogic.domainName: ${domainUID}/g" ${serviceMonitor} -sed -i -e "$!N;s/matchNames:\n -.*/matchNames:\n - ${domainNamespace}/g;P;D" ${serviceMonitor} - -kubectl apply -f ${serviceMonitor} - - -if [ "${setupKubePrometheusStack}" = "true" ]; then - # Deploying WebLogic Server Grafana Dashboard - echo "Deploying WebLogic Server Grafana Dashboard...." - grafanaEndpointIP=$(kubectl get endpoints ${monitoringNamespace}-grafana -n ${monitoringNamespace} -o=jsonpath="{.subsets[].addresses[].ip}") - grafanaEndpointPort=$(kubectl get endpoints ${monitoringNamespace}-grafana -n ${monitoringNamespace} -o=jsonpath="{.subsets[].ports[].port}") - grafanaEndpoint="${grafanaEndpointIP}:${grafanaEndpointPort}" - curl --noproxy "*" -X POST -H "Content-Type: application/json" -d @config/weblogic-server-dashboard.json http://admin:admin@${grafanaEndpoint}/api/dashboards/db - echo "" - echo "Deployed WebLogic Server Grafana Dashboard successfully" - echo "" - if [ ${exposeMonitoringNodePort} == "true" ]; then - echo "Grafana is available at NodePort: ${grafanaNodePort}" - echo "Prometheus is available at NodePort: ${prometheusNodePort}" - echo "Altermanager is available at NodePort: ${alertmanagerNodePort}" - echo "==============================================================" - fi -else - echo "Please import config/weblogic-server-dashboard.json manually into Grafana" -fi - -echo "" - +#!/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. +# +# setup-monitoring.sh + +# Initialize +script="${BASH_SOURCE[0]}" +scriptDir="$( cd "$( dirname "${script}" )" && pwd )" +OLD_PWD=`pwd` + + + +# +# 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 remove a file if it exists +# +function removeFileIfExists { + echo "input is $1" + if [ -f $1 ]; then + rm -f $1 + fi +} + +function exitIfError { + if [ "$1" != "0" ]; then + echo "$2" + exit $1 + 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 usage { + echo usage: ${script} -i file [-v] [-h] + echo " -i Parameter inputs file, must be specified." + echo " -h Help" + exit $1 +} + +function installKubePrometheusStack { + helm repo add prometheus-community https://prometheus-community.github.io/helm-charts + helm repo update + echo "Setup prometheus-community/kube-prometheus-stack in progress" + if [ ${exposeMonitoringNodePort} == "true" ]; then + + helm install ${monitoringNamespace} prometheus-community/kube-prometheus-stack \ + --namespace ${monitoringNamespace} ${additionalParamForKubePrometheusStack} \ + --set prometheus.service.type=NodePort --set prometheus.service.nodePort=${prometheusNodePort} \ + --set alertmanager.service.type=NodePort --set alertmanager.service.nodePort=${alertmanagerNodePort} \ + --set grafana.adminPassword=admin --set grafana.service.type=NodePort --set grafana.service.nodePort=${grafanaNodePort} \ + --version "16.5.0" \ + --atomic --wait + else + helm install ${monitoringNamespace} prometheus-community/kube-prometheus-stack \ + --namespace ${monitoringNamespace} ${additionalParamForKubePrometheusStack} \ + --set grafana.adminPassword=admin \ + --version "16.5.0" \ + --atomic --wait + fi + exitIfError $? "ERROR: prometheus-community/kube-prometheus-stack install failed." +} + +#Parse the inputs +while getopts "hi:" opt; do + case $opt in + i) valuesInputFile="${OPTARG}" + ;; + h) usage 0 + ;; + *) usage 1 + ;; + esac +done + +if [ -z ${valuesInputFile} ]; then + echo "${script}: -i must be specified." + missingRequiredOption="true" +fi + +if [ "${missingRequiredOption}" == "true" ]; then + usage 1 +fi + +if [ ! -f ${valuesInputFile} ]; then + echo "Unable to locate the input parameters file ${valuesInputFile}" + fail 'The error listed above must be resolved before the script can continue' +fi + + +exportValuesFile=$(mktemp /tmp/export-values-XXXXXXXXX.sh) +parseYaml ${valuesInputFile} ${exportValuesFile} + + +source ${exportValuesFile} +rm ${exportValuesFile} + + +if [ "${setupKubePrometheusStack}" = "true" ]; then + if test "$(kubectl get namespace ${monitoringNamespace} --ignore-not-found | wc -l)" = 0; then + echo "The namespace ${monitoringNamespace} for install prometheus-community/kube-promethues-stack does not exist. Creating the namespace ${monitoringNamespace}" + kubectl create namespace ${monitoringNamespace} + fi + echo -e "Monitoring setup in ${monitoringNamespace} in progress.......\n" + + # Create the namespace and CRDs, and then wait for them to be availble before creating the remaining resources + kubectl label nodes --all kubernetes.io/os=linux --overwrite=true + + echo "Setup prometheus-community/kube-prometheus-stack started" + installKubePrometheusStack + cd $OLD_PWD + + echo "Setup prometheus-community/kube-prometheus-stack completed" +fi + +export username=`kubectl get secrets ${weblogicCredentialsSecretName} -n ${domainNamespace} -o=jsonpath='{.data.username}'|base64 --decode` +export password=`kubectl get secrets ${weblogicCredentialsSecretName} -n ${domainNamespace} -o=jsonpath='{.data.password}'|base64 --decode` + +# Setting up the WebLogic Monitoring Exporter +echo "Deploy WebLogic Monitoring Exporter started" +script=${scriptDir}/scripts/deploy-weblogic-monitoring-exporter.sh +sh ${script} +exitIfError $? "ERROR: $script failed." +echo "Deploy WebLogic Monitoring Exporter completed" + + +# Deploy servicemonitors +serviceMonitor=${scriptDir}/manifests/wls-exporter-ServiceMonitor.yaml +cp "${serviceMonitor}.template" "${serviceMonitor}" +sed -i -e "s/release: monitoring/release: ${monitoringNamespace}/g" ${serviceMonitor} +sed -i -e "s/user: %USERNAME%/user: `echo -n $username|base64 -w0`/g" ${serviceMonitor} +sed -i -e "s/password: %PASSWORD%/password: `echo -n $password|base64 -w0`/g" ${serviceMonitor} +sed -i -e "s/namespace:.*/namespace: ${domainNamespace}/g" ${serviceMonitor} +sed -i -e "s/weblogic.domainName:.*/weblogic.domainName: ${domainUID}/g" ${serviceMonitor} +sed -i -e "$!N;s/matchNames:\n -.*/matchNames:\n - ${domainNamespace}/g;P;D" ${serviceMonitor} + +kubectl apply -f ${serviceMonitor} + + +if [ "${setupKubePrometheusStack}" = "true" ]; then + # Deploying WebLogic Server Grafana Dashboard + echo "Deploying WebLogic Server Grafana Dashboard...." + grafanaEndpointIP=$(kubectl get endpoints ${monitoringNamespace}-grafana -n ${monitoringNamespace} -o=jsonpath="{.subsets[].addresses[].ip}") + grafanaEndpointPort=$(kubectl get endpoints ${monitoringNamespace}-grafana -n ${monitoringNamespace} -o=jsonpath="{.subsets[].ports[].port}") + grafanaEndpoint="${grafanaEndpointIP}:${grafanaEndpointPort}" + curl --noproxy "*" -X POST -H "Content-Type: application/json" -d @config/weblogic-server-dashboard.json http://admin:admin@${grafanaEndpoint}/api/dashboards/db + echo "" + echo "Deployed WebLogic Server Grafana Dashboard successfully" + echo "" + if [ ${exposeMonitoringNodePort} == "true" ]; then + echo "Grafana is available at NodePort: ${grafanaNodePort}" + echo "Prometheus is available at NodePort: ${prometheusNodePort}" + echo "Altermanager is available at NodePort: ${alertmanagerNodePort}" + echo "==============================================================" + fi +else + echo "Please import config/weblogic-server-dashboard.json manually into Grafana" +fi + +echo "" + diff --git a/OracleWebCenterPortal/kubernetes/rest/README.md b/OracleWebCenterPortal/kubernetes/rest/README.md old mode 100644 new mode 100755 index f0e09b088..2523a0375 --- a/OracleWebCenterPortal/kubernetes/rest/README.md +++ b/OracleWebCenterPortal/kubernetes/rest/README.md @@ -1,38 +1,38 @@ -# Sample to create certificates and keys for the operator - -When a user enables the operator's external REST API (by setting -`externalRestEnabled` to `true` when installing the operator Helm chart), the user needs -to provide the certificate and private key for api's SSL identity too (by creating a -`tls secret` before the installation of the operator helm chart). - -This sample script generates a self-signed certificate and private key that can be used -for the operator's external REST api when experimenting with the operator. They should -not be used in a production environment. - -The syntax of the script is: -```shell -$ kubernetes/samples/scripts/rest/generate-external-rest-identity.sh -n [-s ] -``` - -Where `` lists the subject alternative names to put into the generated self-signed -certificate for the external WebLogic Operator REST HTTPS interface, should match -the namespace where the operator will be installed, and optionally the secret name, which defaults -to `weblogic-operator-external-rest-identity`. Each must be prefaced -by `DNS:` (for a name) or `IP:` (for an address), for example: -``` -DNS:myhost,DNS:localhost,IP:127.0.0.1 -``` - -You should include the addresses of all masters and load balancers in this list. The certificate -cannot be conveniently changed after installation of the operator. - -The script creates the secret in the weblogic-operator namespace with the self-signed -certificate and private key - -Example usage: -```shell -$ generate-external-rest-identity.sh IP:127.0.0.1 -n weblogic-operator > my_values.yaml -$ echo "externalRestEnabled: true" >> my_values.yaml - ... -$ helm install my_operator kubernetes/charts/weblogic-operator --namespace my_operator-ns --values my_values.yaml --wait -``` +# Sample to create certificates and keys for the operator + +When a user enables the operator's external REST API (by setting +`externalRestEnabled` to `true` when installing the operator Helm chart), the user needs +to provide the certificate and private key for api's SSL identity too (by creating a +`tls secret` before the installation of the operator helm chart). + +This sample script generates a self-signed certificate and private key that can be used +for the operator's external REST api when experimenting with the operator. They should +not be used in a production environment. + +The syntax of the script is: +```shell +$ kubernetes/samples/scripts/rest/generate-external-rest-identity.sh -n [-s ] +``` + +Where `` lists the subject alternative names to put into the generated self-signed +certificate for the external WebLogic Operator REST HTTPS interface, should match +the namespace where the operator will be installed, and optionally the secret name, which defaults +to `weblogic-operator-external-rest-identity`. Each must be prefaced +by `DNS:` (for a name) or `IP:` (for an address), for example: +``` +DNS:myhost,DNS:localhost,IP:127.0.0.1 +``` + +You should include the addresses of all masters and load balancers in this list. The certificate +cannot be conveniently changed after installation of the operator. + +The script creates the secret in the weblogic-operator namespace with the self-signed +certificate and private key + +Example usage: +```shell +$ generate-external-rest-identity.sh IP:127.0.0.1 -n weblogic-operator > my_values.yaml +$ echo "externalRestEnabled: true" >> my_values.yaml + ... +$ helm install my_operator kubernetes/charts/weblogic-operator --namespace my_operator-ns --values my_values.yaml --wait +``` diff --git a/OracleWebCenterPortal/kubernetes/rest/generate-external-rest-identity.sh b/OracleWebCenterPortal/kubernetes/rest/generate-external-rest-identity.sh old mode 100644 new mode 100755 index e645d3925..3de431a72 --- a/OracleWebCenterPortal/kubernetes/rest/generate-external-rest-identity.sh +++ b/OracleWebCenterPortal/kubernetes/rest/generate-external-rest-identity.sh @@ -1,200 +1,200 @@ -#!/usr/bin/env bash -# 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. -# -# When the customer enables the operator's external REST api (by setting -# externalRestEnabled to true when installing the operator helm chart), the customer needs -# to provide the certificate and private key for api's SSL identity too (by creating a -# tls secret before the installation of the operator helm chart). -# -# This sample script generates a self-signed certificate and private key that can be used -# for the operator's external REST api when experimenting with the operator. They should -# not be used in a production environment. -# -# The sytax of the script is: -# -# kubernetes/samples/scripts/rest/generate-external-rest-identity.sh -a -n -# -# Where lists the subject alternative names to put into the generated self-signed -# certificate for the external WebLogic Operator REST https interface, for example: -# -# DNS:myhost,DNS:localhost,IP:127.0.0.1 -# -# You should include the addresses of all masters and load balancers in this list. The certificate -# cannot be conveniently changed after installation of the operator. -# -# The script creates the secret in the weblogic-operator namespace with the self-signed -# certificate and private key -# -# Example usage: -# generate-external-rest-identity.sh -a IP:127.0.0.1 -n weblogic-operator > my_values.yaml -# echo "externalRestEnabled: true" >> my_values.yaml -# ... -# helm install my_operator kubernetes/charts/weblogic-operator --namespace my_operator-ns --values my_values.yaml --wait -usage(){ -cat < -n -Options: --a SANS Required, the SANs for the certificate --n NAMESPACE Required, the namespace where the secret will be created. --s SECRET_NAME Optional, the name of the kubernetes secret. Default is: weblogic-operator-external-rest-identity. --h, --help Display this help text. -EOF -exit 1 -} - -if [ ! -x "$(command -v keytool)" ]; then - echo "Can't find keytool. Please add it to the path." - exit 1 -fi - -if [ ! -x "$(command -v openssl)" ]; then - echo "Can't find openssl. Please add it to the path." - exit 1 -fi - -if [ ! -x "$(command -v base64)" ]; then - echo "Can't find base64. Please add it to the path." - exit 1 -fi - -TEMP_DIR=`mktemp -d` -if [ $? -ne 0 ]; then - echo "$0: Can't create temp directory." - exit 1 -fi - -if [ -z $TEMP_DIR ]; then - echo "Can't create temp directory." - exit 1 -fi - -function cleanup { - rm -r $TEMP_DIR - if [[ $SUCCEEDED != "true" ]]; then - exit 1 - fi -} - -set -e -#set -x - -trap "cleanup" EXIT - -SECRET_NAME="weblogic-operator-external-rest-identity" - -while [ $# -gt 0 ] - do - key="$1" - case $key in - -a) - shift # past argument - if [ $# -eq 0 ] || [ ${1:0:1} == "-" ]; then echo "SANs is required and is missing"; usage; fi - SANS=$1 - shift # past value - ;; - -n) - shift # past argument - if [ $# -eq 0 ] || [ ${1:0:1} == "-" ]; then echo "Namespace is required and is missing"; usage; fi - NAMESPACE=$1 - shift # past value - ;; - -s) - shift # past argument - if [ $# -eq 0 ] || [ ${1:0:1} == "-" ]; then echo "Invalid secret name $1"; usage; fi - SECRET_NAME=$1 - shift # past value - ;; - -h) - shift # past argument - ;; - *) - SANS=$1 - shift # past argument - ;; - esac -done - -if [ -z "$SANS" ] -then - 1>&2 - echo "SANs is required and is missing" - usage -fi - -if [ -z "$NAMESPACE" ] -then - 1>&2 - echo "Namespace is required and is missing" - usage -fi - -DAYS_VALID="3650" -TEMP_PW="temp_password" -OP_PREFIX="weblogic-operator" -OP_ALIAS="${OP_PREFIX}-alias" -OP_JKS="${TEMP_DIR}/${OP_PREFIX}.jks" -OP_PKCS12="${TEMP_DIR}/${OP_PREFIX}.p12" -OP_CSR="${TEMP_DIR}/${OP_PREFIX}.csr" -OP_CERT_PEM="${TEMP_DIR}/${OP_PREFIX}.cert.pem" -OP_KEY_PEM="${TEMP_DIR}/${OP_PREFIX}.key.pem" - -# generate a keypair for the operator's REST service, putting it in a keystore -keytool \ - -genkey \ - -keystore ${OP_JKS} \ - -alias ${OP_ALIAS} \ - -storepass ${TEMP_PW} \ - -keypass ${TEMP_PW} \ - -keysize 2048 \ - -keyalg RSA \ - -validity ${DAYS_VALID} \ - -dname "CN=weblogic-operator" \ - -ext KU=digitalSignature,nonRepudiation,keyEncipherment,dataEncipherment,keyAgreement \ - -ext SAN="${SANS}" \ -2> /dev/null - -# extract the cert to a pem file -keytool \ - -exportcert \ - -keystore ${OP_JKS} \ - -storepass ${TEMP_PW} \ - -alias ${OP_ALIAS} \ - -rfc \ -> ${OP_CERT_PEM} 2> /dev/null - -# convert the keystore to a pkcs12 file -keytool \ - -importkeystore \ - -srckeystore ${OP_JKS} \ - -srcstorepass ${TEMP_PW} \ - -destkeystore ${OP_PKCS12} \ - -srcstorepass ${TEMP_PW} \ - -deststorepass ${TEMP_PW} \ - -deststoretype PKCS12 \ -2> /dev/null - -# extract the private key from the pkcs12 file to a pem file -openssl \ - pkcs12 \ - -in ${OP_PKCS12} \ - -passin pass:${TEMP_PW} \ - -nodes \ - -nocerts \ - -out ${OP_KEY_PEM} \ -2> /dev/null - -set +e -# Check if namespace exist -kubectl get namespace $NAMESPACE >/dev/null 2>/dev/null -if [ $? -eq 1 ]; then - echo "Namespace $NAMESPACE does not exist" - exit 1 -fi -kubectl get secret $SECRET_NAME -n $NAMESPACE >/dev/null 2>/dev/null -if [ $? -eq 1 ]; then - kubectl create secret tls "$SECRET_NAME" --cert=${OP_CERT_PEM} --key=${OP_KEY_PEM} -n $NAMESPACE >/dev/null -fi -echo "externalRestIdentitySecret: $SECRET_NAME" - -SUCCEEDED=true +#!/usr/bin/env bash +# 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. +# +# When the customer enables the operator's external REST api (by setting +# externalRestEnabled to true when installing the operator helm chart), the customer needs +# to provide the certificate and private key for api's SSL identity too (by creating a +# tls secret before the installation of the operator helm chart). +# +# This sample script generates a self-signed certificate and private key that can be used +# for the operator's external REST api when experimenting with the operator. They should +# not be used in a production environment. +# +# The sytax of the script is: +# +# kubernetes/samples/scripts/rest/generate-external-rest-identity.sh -a -n +# +# Where lists the subject alternative names to put into the generated self-signed +# certificate for the external WebLogic Operator REST https interface, for example: +# +# DNS:myhost,DNS:localhost,IP:127.0.0.1 +# +# You should include the addresses of all masters and load balancers in this list. The certificate +# cannot be conveniently changed after installation of the operator. +# +# The script creates the secret in the weblogic-operator namespace with the self-signed +# certificate and private key +# +# Example usage: +# generate-external-rest-identity.sh -a IP:127.0.0.1 -n weblogic-operator > my_values.yaml +# echo "externalRestEnabled: true" >> my_values.yaml +# ... +# helm install my_operator kubernetes/charts/weblogic-operator --namespace my_operator-ns --values my_values.yaml --wait +usage(){ +cat < -n +Options: +-a SANS Required, the SANs for the certificate +-n NAMESPACE Required, the namespace where the secret will be created. +-s SECRET_NAME Optional, the name of the kubernetes secret. Default is: weblogic-operator-external-rest-identity. +-h, --help Display this help text. +EOF +exit 1 +} + +if [ ! -x "$(command -v keytool)" ]; then + echo "Can't find keytool. Please add it to the path." + exit 1 +fi + +if [ ! -x "$(command -v openssl)" ]; then + echo "Can't find openssl. Please add it to the path." + exit 1 +fi + +if [ ! -x "$(command -v base64)" ]; then + echo "Can't find base64. Please add it to the path." + exit 1 +fi + +TEMP_DIR=`mktemp -d` +if [ $? -ne 0 ]; then + echo "$0: Can't create temp directory." + exit 1 +fi + +if [ -z $TEMP_DIR ]; then + echo "Can't create temp directory." + exit 1 +fi + +function cleanup { + rm -r $TEMP_DIR + if [[ $SUCCEEDED != "true" ]]; then + exit 1 + fi +} + +set -e +#set -x + +trap "cleanup" EXIT + +SECRET_NAME="weblogic-operator-external-rest-identity" + +while [ $# -gt 0 ] + do + key="$1" + case $key in + -a) + shift # past argument + if [ $# -eq 0 ] || [ ${1:0:1} == "-" ]; then echo "SANs is required and is missing"; usage; fi + SANS=$1 + shift # past value + ;; + -n) + shift # past argument + if [ $# -eq 0 ] || [ ${1:0:1} == "-" ]; then echo "Namespace is required and is missing"; usage; fi + NAMESPACE=$1 + shift # past value + ;; + -s) + shift # past argument + if [ $# -eq 0 ] || [ ${1:0:1} == "-" ]; then echo "Invalid secret name $1"; usage; fi + SECRET_NAME=$1 + shift # past value + ;; + -h) + shift # past argument + ;; + *) + SANS=$1 + shift # past argument + ;; + esac +done + +if [ -z "$SANS" ] +then + 1>&2 + echo "SANs is required and is missing" + usage +fi + +if [ -z "$NAMESPACE" ] +then + 1>&2 + echo "Namespace is required and is missing" + usage +fi + +DAYS_VALID="3650" +TEMP_PW="temp_password" +OP_PREFIX="weblogic-operator" +OP_ALIAS="${OP_PREFIX}-alias" +OP_JKS="${TEMP_DIR}/${OP_PREFIX}.jks" +OP_PKCS12="${TEMP_DIR}/${OP_PREFIX}.p12" +OP_CSR="${TEMP_DIR}/${OP_PREFIX}.csr" +OP_CERT_PEM="${TEMP_DIR}/${OP_PREFIX}.cert.pem" +OP_KEY_PEM="${TEMP_DIR}/${OP_PREFIX}.key.pem" + +# generate a keypair for the operator's REST service, putting it in a keystore +keytool \ + -genkey \ + -keystore ${OP_JKS} \ + -alias ${OP_ALIAS} \ + -storepass ${TEMP_PW} \ + -keypass ${TEMP_PW} \ + -keysize 2048 \ + -keyalg RSA \ + -validity ${DAYS_VALID} \ + -dname "CN=weblogic-operator" \ + -ext KU=digitalSignature,nonRepudiation,keyEncipherment,dataEncipherment,keyAgreement \ + -ext SAN="${SANS}" \ +2> /dev/null + +# extract the cert to a pem file +keytool \ + -exportcert \ + -keystore ${OP_JKS} \ + -storepass ${TEMP_PW} \ + -alias ${OP_ALIAS} \ + -rfc \ +> ${OP_CERT_PEM} 2> /dev/null + +# convert the keystore to a pkcs12 file +keytool \ + -importkeystore \ + -srckeystore ${OP_JKS} \ + -srcstorepass ${TEMP_PW} \ + -destkeystore ${OP_PKCS12} \ + -srcstorepass ${TEMP_PW} \ + -deststorepass ${TEMP_PW} \ + -deststoretype PKCS12 \ +2> /dev/null + +# extract the private key from the pkcs12 file to a pem file +openssl \ + pkcs12 \ + -in ${OP_PKCS12} \ + -passin pass:${TEMP_PW} \ + -nodes \ + -nocerts \ + -out ${OP_KEY_PEM} \ +2> /dev/null + +set +e +# Check if namespace exist +kubectl get namespace $NAMESPACE >/dev/null 2>/dev/null +if [ $? -eq 1 ]; then + echo "Namespace $NAMESPACE does not exist" + exit 1 +fi +kubectl get secret $SECRET_NAME -n $NAMESPACE >/dev/null 2>/dev/null +if [ $? -eq 1 ]; then + kubectl create secret tls "$SECRET_NAME" --cert=${OP_CERT_PEM} --key=${OP_KEY_PEM} -n $NAMESPACE >/dev/null +fi +echo "externalRestIdentitySecret: $SECRET_NAME" + +SUCCEEDED=true diff --git a/OracleWebCenterPortal/kubernetes/scaling/scalingAction.sh b/OracleWebCenterPortal/kubernetes/scaling/scalingAction.sh old mode 100644 new mode 100755 index 0da098e68..98d01d5d7 --- a/OracleWebCenterPortal/kubernetes/scaling/scalingAction.sh +++ b/OracleWebCenterPortal/kubernetes/scaling/scalingAction.sh @@ -1,504 +1,504 @@ -#!/bin/bash -# 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. - -# script parameters -scaling_action="" -wls_domain_uid="" -wls_cluster_name="" -wls_domain_namespace="default" -operator_service_name="internal-weblogic-operator-svc" -operator_namespace="weblogic-operator" -operator_service_account="weblogic-operator" -scaling_size=1 -access_token="" -no_op="" -kubernetes_master="https://${KUBERNETES_SERVICE_HOST}:${KUBERNETES_SERVICE_PORT}" -log_file_name="scalingAction.log" - -# timestamp -# purpose: echo timestamp in the form yyyy-mm-ddThh:mm:ss.nnnnnnZ -# example: 2018-10-01T14:00:00.000001Z -function timestamp() { - local timestamp="`date --utc '+%Y-%m-%dT%H:%M:%S.%NZ' 2>&1`" - if [ ! "${timestamp/illegal/xyz}" = "${timestamp}" ]; then - # old shell versions don't support %N or --utc - timestamp="`date -u '+%Y-%m-%dT%H:%M:%S.000000Z' 2>&1`" - fi - echo "${timestamp}" -} - -function trace() { - echo "@[$(timestamp)][$wls_domain_namespace][$wls_domain_uid][$wls_cluster_name][INFO]" "$@" >> ${log_file_name} -} - -function print_usage() { - echo "Usage: scalingAction.sh --action=[scaleUp | scaleDown] --domain_uid= --cluster_name= [--kubernetes_master=https://${KUBERNETES_SERVICE_HOST}:${KUBERNETES_SERVICE_PORT}] [--access_token=] [--wls_domain_namespace=default] [--operator_namespace=weblogic-operator] [--operator_service_name=weblogic-operator] [--scaling_size=1] [--no_op]" - echo " where" - echo " action - scaleUp or scaleDown" - echo " domain_uid - WebLogic Domain Unique Identifier" - echo " cluster_name - WebLogic Cluster Name" - echo " kubernetes_master - Kubernetes master URL, default=https://${KUBERNETES_SERVICE_HOST}:${KUBERNETES_SERVICE_PORT}" - echo " access_token - Service Account Bearer token for authentication and authorization for access to REST Resources" - echo " wls_domain_namespace - Kubernetes name space WebLogic Domain is defined in, default=default" - echo " operator_service_name - WebLogic Operator Service name, default=internal-weblogic-operator-svc" - echo " operator_service_account - Kubernetes Service Account for WebLogic Operator, default=weblogic-operator" - echo " operator_namespace - WebLogic Operator Namespace, default=weblogic-operator" - echo " scaling_size - number of WebLogic server instances by which to scale up or down, default=1" - echo " no_op - if specified, returns without doing anything. For use by unit test to include methods in the script" - exit 1 -} - -# Retrieve WebLogic Operator Service Account Token for Authorization -function initialize_access_token() { - if [ -z "$access_token" ] - then - access_token=`cat /var/run/secrets/kubernetes.io/serviceaccount/token` - fi -} - -function logScalingParameters() { - trace "scaling_action: $scaling_action" - trace "wls_domain_uid: $wls_domain_uid" - trace "wls_cluster_name: $wls_cluster_name" - trace "wls_domain_namespace: $wls_domain_namespace" - trace "operator_service_name: $operator_service_name" - trace "operator_service_account: $operator_service_account" - trace "operator_namespace: $operator_namespace" - trace "scaling_size: $scaling_size" -} - -function jq_available() { - if [ -x "$(command -v jq)" ] && [ -z "$DONT_USE_JQ" ]; then - return; - fi - false -} - -# Query WebLogic Operator Service Port -function get_operator_internal_rest_port() { - local STATUS=$(curl \ - -v \ - --cacert /var/run/secrets/kubernetes.io/serviceaccount/ca.crt \ - -H "Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)" \ - -X GET $kubernetes_master/api/v1/namespaces/$operator_namespace/services/$operator_service_name/status) - if [ $? -ne 0 ] - then - trace "Failed to retrieve status of $operator_service_name in name space: $operator_namespace" - trace "STATUS: $STATUS" - exit 1 - fi - - local port - if jq_available; then - local extractPortCmd="(.spec.ports[] | select (.name == \"rest\") | .port)" - port=$(echo "${STATUS}" | jq "${extractPortCmd}" 2>> ${log_file_name}) - else -cat > cmds-$$.py << INPUT -import sys, json -for i in json.load(sys.stdin)["spec"]["ports"]: - if i["name"] == "rest": - print(i["port"]) -INPUT -port=$(echo "${STATUS}" | python cmds-$$.py 2>> ${log_file_name}) - fi - echo "$port" -} - -# Retrieve the api version of the deployed Custom Resource Domain -function get_domain_api_version() { - # Retrieve Custom Resource Definition for WebLogic domain - local APIS=$(curl \ - -v \ - --cacert /var/run/secrets/kubernetes.io/serviceaccount/ca.crt \ - -H "Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)" \ - -X GET \ - $kubernetes_master/apis) - if [ $? -ne 0 ] - then - trace "Failed to retrieve list of APIs from Kubernetes cluster" - trace "APIS: $APIS" - exit 1 - fi - -# Find domain version - local domain_api_version - if jq_available; then - local extractVersionCmd="(.groups[] | select (.name == \"weblogic.oracle\") | .preferredVersion.version)" - domain_api_version=$(echo "${APIS}" | jq -r "${extractVersionCmd}" 2>> ${log_file_name}) - else -cat > cmds-$$.py << INPUT -import sys, json -for i in json.load(sys.stdin)["groups"]: - if i["name"] == "weblogic.oracle": - print(i["preferredVersion"]["version"]) -INPUT -domain_api_version=`echo ${APIS} | python cmds-$$.py 2>> ${log_file_name}` - fi - echo "$domain_api_version" -} - -# Retrieve Custom Resource Domain -function get_custom_resource_domain() { - local DOMAIN=$(curl \ - -v \ - --cacert /var/run/secrets/kubernetes.io/serviceaccount/ca.crt \ - -H "Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)" \ - $kubernetes_master/apis/weblogic.oracle/$domain_api_version/namespaces/$wls_domain_namespace/domains/$wls_domain_uid) - if [ $? -ne 0 ]; then - trace "Failed to retrieve WebLogic Domain Custom Resource Definition" - exit 1 - fi - echo "$DOMAIN" -} - -# Verify if cluster is defined in clusters of the Custom Resource Domain -# args: -# $1 Custom Resource Domain -function is_defined_in_clusters() { - local DOMAIN="$1" - local in_cluster_startup="False" - - if jq_available; then - local inClusterStartupCmd="(.spec.clusters[] | select (.clusterName == \"${wls_cluster_name}\"))" - local clusterDefinedInCRD=$(echo "${DOMAIN}" | jq "${inClusterStartupCmd}" 2>> ${log_file_name}) - if [ "${clusterDefinedInCRD}" != "" ]; then - in_cluster_startup="True" - fi - else -cat > cmds-$$.py << INPUT -import sys, json -outer_loop_must_break = False -for j in json.load(sys.stdin)["spec"]["clusters"]: - if j["clusterName"] == "$wls_cluster_name": - outer_loop_must_break = True - print (True) - break -if outer_loop_must_break == False: - print (False) -INPUT -in_cluster_startup=`echo ${DOMAIN} | python cmds-$$.py 2>> ${log_file_name}` - fi - echo "$in_cluster_startup" -} - -# Gets the current replica count of the cluster -# args: -# $1 Custom Resource Domain -function get_num_ms_in_cluster() { - local DOMAIN="$1" - local num_ms - if jq_available; then - local numManagedServersCmd="(.spec.clusters[] | select (.clusterName == \"${wls_cluster_name}\") | .replicas)" - num_ms=$(echo "${DOMAIN}" | jq "${numManagedServersCmd}" 2>> ${log_file_name}) - else -cat > cmds-$$.py << INPUT -import sys, json -for j in json.load(sys.stdin)["spec"]["clusters"]: - if j["clusterName"] == "$wls_cluster_name": - print (j["replicas"]) -INPUT - num_ms=`echo ${DOMAIN} | python cmds-$$.py 2>> ${log_file_name}` - fi - - if [ "${num_ms}" == "null" ] || [ "${num_ms}" == '' ] ; then - num_ms=0 - fi - - echo "$num_ms" -} - -# Gets the replica count at the Domain level -# args: -# $1 Custom Resource Domain -function get_num_ms_domain_scope() { - local DOMAIN="$1" - local num_ms - if jq_available; then - num_ms=$(echo "${DOMAIN}" | jq -r '.spec.replicas' 2>> ${log_file_name}) - else -cat > cmds-$$.py << INPUT -import sys, json -print (json.load(sys.stdin)["spec"]["replicas"]) -INPUT - num_ms=`echo ${DOMAIN} | python cmds-$$.py 2>> ${log_file_name}` - fi - - if [ "${num_ms}" == "null" ] || [ "${num_ms}" == '' ] ; then - # if not defined then default to 0 - num_ms=0 - fi - - echo "$num_ms" -} - -# -# Function to get minimum replica count for cluster -# $1 - Domain resource in json format -# $2 - Name of the cluster -# $3 - Return value containing minimum replica count -# -function get_min_replicas { - local domainJson=$1 - local clusterName=$2 - local __result=$3 - - eval $__result=0 - if jq_available; then - minReplicaCmd="(.status.clusters[] | select (.clusterName == \"${clusterName}\")) \ - | .minimumReplicas" - minReplicas=$(echo ${domainJson} | jq "${minReplicaCmd}" 2>> ${log_file_name}) - else -cat > cmds-$$.py << INPUT -import sys, json -for j in json.load(sys.stdin)["status"]["clusters"]: - if j["clusterName"] == "$clusterName": - print (j["minimumReplicas"]) -INPUT - minReplicas=`echo ${DOMAIN} | python cmds-$$.py 2>> ${log_file_name}` - fi - eval $__result=${minReplicas} -} - -# Get the current replica count for the WLS cluster if defined in the CRD's Cluster -# configuration. If WLS cluster is not defined in the CRD then return the Domain -# scoped replica value, if present. Returns replica count = 0 if no replica count found. -# args: -# $1 "True" if WLS cluster configuration defined in CRD, "False" otherwise -# $2 Custom Resource Domain -function get_replica_count() { - local in_cluster_startup="$1" - local DOMAIN="$2" - local num_ms - if [ "$in_cluster_startup" == "True" ] - then - trace "$wls_cluster_name defined in clusters" - num_ms=$(get_num_ms_in_cluster "$DOMAIN") - else - trace "$wls_cluster_name NOT defined in clusters" - num_ms=$(get_num_ms_domain_scope "$DOMAIN") - fi - - get_min_replicas "${DOMAIN}" "${wls_cluster_name}" minReplicas - if [[ "${num_ms}" -lt "${minReplicas}" ]]; then - # Reset managed server count to minimum replicas - num_ms=${minReplicas} - fi - - echo "$num_ms" -} - -# Determine the nuber of managed servers to scale -# args: -# $1 scaling action (scaleUp or scaleDown) -# $2 current replica count -# $3 scaling increment value -function calculate_new_ms_count() { - local scaling_action="$1" - local current_replica_count="$2" - local scaling_size="$3" - local new_ms - if [ "$scaling_action" == "scaleUp" ]; - then - # Scale up by specified scaling size - # shellcheck disable=SC2004 - new_ms=$(($current_replica_count + $scaling_size)) - else - # Scale down by specified scaling size - new_ms=$(($current_replica_count - $scaling_size)) - fi - echo "$new_ms" -} - -# Verify if requested managed server scaling count is less than the configured -# minimum replica count for the cluster. -# args: -# $1 Managed server count -# $2 Custom Resource Domain -# $3 Cluster name -function verify_minimum_ms_count_for_cluster() { - local new_ms="$1" - local domainJson="$2" - local clusterName="$3" - # check if replica count is less than minimum replicas - get_min_replicas "${domainJson}" "${clusterName}" minReplicas - if [ "${new_ms}" -lt "${minReplicas}" ]; then - trace "Scaling request to new managed server count $new_ms is less than configured minimum \ - replica count $minReplicas" - exit 1 - fi -} - -# Create the REST endpoint CA certificate in PEM format -# args: -# $1 certificate file name to create -function create_ssl_certificate_file() { - local pem_filename="$1" - if [ ${INTERNAL_OPERATOR_CERT} ]; - then - echo ${INTERNAL_OPERATOR_CERT} | base64 --decode > $pem_filename - else - trace "Operator Cert File not found" - exit 1 - fi -} - -# Create request body for scaling request -# args: -# $1 replica count -function get_request_body() { -local new_ms="$1" -local request_body=$(cat <> ${log_file_name} +} + +function print_usage() { + echo "Usage: scalingAction.sh --action=[scaleUp | scaleDown] --domain_uid= --cluster_name= [--kubernetes_master=https://${KUBERNETES_SERVICE_HOST}:${KUBERNETES_SERVICE_PORT}] [--access_token=] [--wls_domain_namespace=default] [--operator_namespace=weblogic-operator] [--operator_service_name=weblogic-operator] [--scaling_size=1] [--no_op]" + echo " where" + echo " action - scaleUp or scaleDown" + echo " domain_uid - WebLogic Domain Unique Identifier" + echo " cluster_name - WebLogic Cluster Name" + echo " kubernetes_master - Kubernetes master URL, default=https://${KUBERNETES_SERVICE_HOST}:${KUBERNETES_SERVICE_PORT}" + echo " access_token - Service Account Bearer token for authentication and authorization for access to REST Resources" + echo " wls_domain_namespace - Kubernetes name space WebLogic Domain is defined in, default=default" + echo " operator_service_name - WebLogic Operator Service name, default=internal-weblogic-operator-svc" + echo " operator_service_account - Kubernetes Service Account for WebLogic Operator, default=weblogic-operator" + echo " operator_namespace - WebLogic Operator Namespace, default=weblogic-operator" + echo " scaling_size - number of WebLogic server instances by which to scale up or down, default=1" + echo " no_op - if specified, returns without doing anything. For use by unit test to include methods in the script" + exit 1 +} + +# Retrieve WebLogic Operator Service Account Token for Authorization +function initialize_access_token() { + if [ -z "$access_token" ] + then + access_token=`cat /var/run/secrets/kubernetes.io/serviceaccount/token` + fi +} + +function logScalingParameters() { + trace "scaling_action: $scaling_action" + trace "wls_domain_uid: $wls_domain_uid" + trace "wls_cluster_name: $wls_cluster_name" + trace "wls_domain_namespace: $wls_domain_namespace" + trace "operator_service_name: $operator_service_name" + trace "operator_service_account: $operator_service_account" + trace "operator_namespace: $operator_namespace" + trace "scaling_size: $scaling_size" +} + +function jq_available() { + if [ -x "$(command -v jq)" ] && [ -z "$DONT_USE_JQ" ]; then + return; + fi + false +} + +# Query WebLogic Operator Service Port +function get_operator_internal_rest_port() { + local STATUS=$(curl \ + -v \ + --cacert /var/run/secrets/kubernetes.io/serviceaccount/ca.crt \ + -H "Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)" \ + -X GET $kubernetes_master/api/v1/namespaces/$operator_namespace/services/$operator_service_name/status) + if [ $? -ne 0 ] + then + trace "Failed to retrieve status of $operator_service_name in name space: $operator_namespace" + trace "STATUS: $STATUS" + exit 1 + fi + + local port + if jq_available; then + local extractPortCmd="(.spec.ports[] | select (.name == \"rest\") | .port)" + port=$(echo "${STATUS}" | jq "${extractPortCmd}" 2>> ${log_file_name}) + else +cat > cmds-$$.py << INPUT +import sys, json +for i in json.load(sys.stdin)["spec"]["ports"]: + if i["name"] == "rest": + print(i["port"]) +INPUT +port=$(echo "${STATUS}" | python cmds-$$.py 2>> ${log_file_name}) + fi + echo "$port" +} + +# Retrieve the api version of the deployed Custom Resource Domain +function get_domain_api_version() { + # Retrieve Custom Resource Definition for WebLogic domain + local APIS=$(curl \ + -v \ + --cacert /var/run/secrets/kubernetes.io/serviceaccount/ca.crt \ + -H "Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)" \ + -X GET \ + $kubernetes_master/apis) + if [ $? -ne 0 ] + then + trace "Failed to retrieve list of APIs from Kubernetes cluster" + trace "APIS: $APIS" + exit 1 + fi + +# Find domain version + local domain_api_version + if jq_available; then + local extractVersionCmd="(.groups[] | select (.name == \"weblogic.oracle\") | .preferredVersion.version)" + domain_api_version=$(echo "${APIS}" | jq -r "${extractVersionCmd}" 2>> ${log_file_name}) + else +cat > cmds-$$.py << INPUT +import sys, json +for i in json.load(sys.stdin)["groups"]: + if i["name"] == "weblogic.oracle": + print(i["preferredVersion"]["version"]) +INPUT +domain_api_version=`echo ${APIS} | python cmds-$$.py 2>> ${log_file_name}` + fi + echo "$domain_api_version" +} + +# Retrieve Custom Resource Domain +function get_custom_resource_domain() { + local DOMAIN=$(curl \ + -v \ + --cacert /var/run/secrets/kubernetes.io/serviceaccount/ca.crt \ + -H "Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)" \ + $kubernetes_master/apis/weblogic.oracle/$domain_api_version/namespaces/$wls_domain_namespace/domains/$wls_domain_uid) + if [ $? -ne 0 ]; then + trace "Failed to retrieve WebLogic Domain Custom Resource Definition" + exit 1 + fi + echo "$DOMAIN" +} + +# Verify if cluster is defined in clusters of the Custom Resource Domain +# args: +# $1 Custom Resource Domain +function is_defined_in_clusters() { + local DOMAIN="$1" + local in_cluster_startup="False" + + if jq_available; then + local inClusterStartupCmd="(.spec.clusters[] | select (.clusterName == \"${wls_cluster_name}\"))" + local clusterDefinedInCRD=$(echo "${DOMAIN}" | jq "${inClusterStartupCmd}" 2>> ${log_file_name}) + if [ "${clusterDefinedInCRD}" != "" ]; then + in_cluster_startup="True" + fi + else +cat > cmds-$$.py << INPUT +import sys, json +outer_loop_must_break = False +for j in json.load(sys.stdin)["spec"]["clusters"]: + if j["clusterName"] == "$wls_cluster_name": + outer_loop_must_break = True + print (True) + break +if outer_loop_must_break == False: + print (False) +INPUT +in_cluster_startup=`echo ${DOMAIN} | python cmds-$$.py 2>> ${log_file_name}` + fi + echo "$in_cluster_startup" +} + +# Gets the current replica count of the cluster +# args: +# $1 Custom Resource Domain +function get_num_ms_in_cluster() { + local DOMAIN="$1" + local num_ms + if jq_available; then + local numManagedServersCmd="(.spec.clusters[] | select (.clusterName == \"${wls_cluster_name}\") | .replicas)" + num_ms=$(echo "${DOMAIN}" | jq "${numManagedServersCmd}" 2>> ${log_file_name}) + else +cat > cmds-$$.py << INPUT +import sys, json +for j in json.load(sys.stdin)["spec"]["clusters"]: + if j["clusterName"] == "$wls_cluster_name": + print (j["replicas"]) +INPUT + num_ms=`echo ${DOMAIN} | python cmds-$$.py 2>> ${log_file_name}` + fi + + if [ "${num_ms}" == "null" ] || [ "${num_ms}" == '' ] ; then + num_ms=0 + fi + + echo "$num_ms" +} + +# Gets the replica count at the Domain level +# args: +# $1 Custom Resource Domain +function get_num_ms_domain_scope() { + local DOMAIN="$1" + local num_ms + if jq_available; then + num_ms=$(echo "${DOMAIN}" | jq -r '.spec.replicas' 2>> ${log_file_name}) + else +cat > cmds-$$.py << INPUT +import sys, json +print (json.load(sys.stdin)["spec"]["replicas"]) +INPUT + num_ms=`echo ${DOMAIN} | python cmds-$$.py 2>> ${log_file_name}` + fi + + if [ "${num_ms}" == "null" ] || [ "${num_ms}" == '' ] ; then + # if not defined then default to 0 + num_ms=0 + fi + + echo "$num_ms" +} + +# +# Function to get minimum replica count for cluster +# $1 - Domain resource in json format +# $2 - Name of the cluster +# $3 - Return value containing minimum replica count +# +function get_min_replicas { + local domainJson=$1 + local clusterName=$2 + local __result=$3 + + eval $__result=0 + if jq_available; then + minReplicaCmd="(.status.clusters[] | select (.clusterName == \"${clusterName}\")) \ + | .minimumReplicas" + minReplicas=$(echo ${domainJson} | jq "${minReplicaCmd}" 2>> ${log_file_name}) + else +cat > cmds-$$.py << INPUT +import sys, json +for j in json.load(sys.stdin)["status"]["clusters"]: + if j["clusterName"] == "$clusterName": + print (j["minimumReplicas"]) +INPUT + minReplicas=`echo ${DOMAIN} | python cmds-$$.py 2>> ${log_file_name}` + fi + eval $__result=${minReplicas} +} + +# Get the current replica count for the WLS cluster if defined in the CRD's Cluster +# configuration. If WLS cluster is not defined in the CRD then return the Domain +# scoped replica value, if present. Returns replica count = 0 if no replica count found. +# args: +# $1 "True" if WLS cluster configuration defined in CRD, "False" otherwise +# $2 Custom Resource Domain +function get_replica_count() { + local in_cluster_startup="$1" + local DOMAIN="$2" + local num_ms + if [ "$in_cluster_startup" == "True" ] + then + trace "$wls_cluster_name defined in clusters" + num_ms=$(get_num_ms_in_cluster "$DOMAIN") + else + trace "$wls_cluster_name NOT defined in clusters" + num_ms=$(get_num_ms_domain_scope "$DOMAIN") + fi + + get_min_replicas "${DOMAIN}" "${wls_cluster_name}" minReplicas + if [[ "${num_ms}" -lt "${minReplicas}" ]]; then + # Reset managed server count to minimum replicas + num_ms=${minReplicas} + fi + + echo "$num_ms" +} + +# Determine the nuber of managed servers to scale +# args: +# $1 scaling action (scaleUp or scaleDown) +# $2 current replica count +# $3 scaling increment value +function calculate_new_ms_count() { + local scaling_action="$1" + local current_replica_count="$2" + local scaling_size="$3" + local new_ms + if [ "$scaling_action" == "scaleUp" ]; + then + # Scale up by specified scaling size + # shellcheck disable=SC2004 + new_ms=$(($current_replica_count + $scaling_size)) + else + # Scale down by specified scaling size + new_ms=$(($current_replica_count - $scaling_size)) + fi + echo "$new_ms" +} + +# Verify if requested managed server scaling count is less than the configured +# minimum replica count for the cluster. +# args: +# $1 Managed server count +# $2 Custom Resource Domain +# $3 Cluster name +function verify_minimum_ms_count_for_cluster() { + local new_ms="$1" + local domainJson="$2" + local clusterName="$3" + # check if replica count is less than minimum replicas + get_min_replicas "${domainJson}" "${clusterName}" minReplicas + if [ "${new_ms}" -lt "${minReplicas}" ]; then + trace "Scaling request to new managed server count $new_ms is less than configured minimum \ + replica count $minReplicas" + exit 1 + fi +} + +# Create the REST endpoint CA certificate in PEM format +# args: +# $1 certificate file name to create +function create_ssl_certificate_file() { + local pem_filename="$1" + if [ ${INTERNAL_OPERATOR_CERT} ]; + then + echo ${INTERNAL_OPERATOR_CERT} | base64 --decode > $pem_filename + else + trace "Operator Cert File not found" + exit 1 + fi +} + +# Create request body for scaling request +# args: +# $1 replica count +function get_request_body() { +local new_ms="$1" +local request_body=$(cat <c. " +description : "Describes how to configure a WebCenter Portal domain to use logstash and publish the WebLogic Server logs to Elasticsearch." +--- +#### Install Elasticsearch and Kibana + +To install Elasticsearch and Kibana, run the following command: + + ```bash + $ cd ${WORKDIR}/elasticsearch-and-kibana + $ kubectl create -f elasticsearch_and_kibana.yaml + ``` + +#### Publish to Elasticsearch + +The diagnostics or other logs can be pushed to Elasticsearch server using logstash pod. The logstash pod should have access to the shared domain home or the log location. In case of the Oracle WebCenter Portal domain, the persistent volume of the domain home can be used in the logstash pod. The steps to create the logstash pod are, + +1. Get domain home persistence volume claim details of the Oracle WebCenter Portal domain. The following command will list the persistent volume claim details in the namespace - `wcpns`. In the example below the persistent volume claim is `wcp-domain-domain-pvc`. + + ```bash + $ kubectl get pv -n wcpns + NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE + wcp-domain-domain-pv 10Gi RWX Retain Bound wcpns/wcp-domain-domain-pvc wcp-domain-domain-storage-class 175d + ``` + +1. Create logstash configuration file `logstash.conf`. Below is a sample Logstash configuration file is located at `${WORKDIR}/logging-services/logstash`. Below configuration pushes diagnostic and all domains logs. + + ```bash + input { + file { + path => "/u01/oracle/user_projects/domains/wcp-domain/servers/**/logs/*-diagnostic.log" + start_position => beginning + } + file { + path => "/u01/oracle/user_projects/domains/logs/wcp-domain/*.log" + start_position => beginning + } + } + + filter { + grok { + match => [ "message", "<%{DATA:log_timestamp}> <%{WORD:log_level}> <%{WORD:thread}> <%{HOSTNAME:hostname}> <%{HOSTNAME:servername}> <%{DATA:timer}> <<%{DATA:kernel}>> <> <%{DATA:uuid}> <%{NUMBER:timestamp}> <%{DATA:misc}> <%{DATA:log_number}> <%{DATA:log_message}>" ] + } + } + output { + elasticsearch { + hosts => ["elasticsearch.default.svc.cluster.local:9200"] + } + } + + ``` + +1. Copy the `logstash.conf` into say `/u01/oracle/user_projects/domains` so that it can be used for logstash deployment, using Administration Server pod ( For example `wcp-domain-adminserver` pod in namespace `wcpns`): + + ```bash + $ kubectl cp ${WORKDIR}/logging-services/logstash/logstash.conf wcpns/wcp-domain-adminserver:/u01/oracle/user_projects/domains -n wcpns + ``` + + +1. Create deployment YAML `logstash.yaml` for logstash pod using the domain home persistence volume claim. Make sure to point the logstash configuration file to correct location ( For example: we copied logstash.conf to /u01/oracle/user_projects/domains/logstash.conf) and also correct domain home persistence volume claim. Sample Logstash deployment is located at `kubernetes/samples/scripts/create-wcp-domain/utils/logstash/logstash.yaml`: + + + ``` + apiVersion: apps/v1 + kind: Deployment + metadata: + name: logstash + namespace: wcpns + spec: + selector: + matchLabels: + app: logstash + template: + metadata: + labels: + app: logstash + spec: + volumes: + - name: domain-storage-volume + persistentVolumeClaim: + claimName: wcp-domain-domain-pvc + - name: shared-logs + emptyDir: {} + containers: + - name: logstash + image: logstash:6.6.0 + command: ["/bin/sh"] + args: ["/usr/share/logstash/bin/logstash", "-f", "/u01/oracle/user_projects/domains/logstash.conf"] + imagePullPolicy: IfNotPresent + volumeMounts: + - mountPath: /u01/oracle/user_projects/domains + name: domain-storage-volume + - name: shared-logs + mountPath: /shared-logs + ports: + - containerPort: 5044 + name: logstash + ``` + + + + +1. Deploy logstash to start publish logs to Elasticsearch + + ```bash + $ kubectl create -f ${WORKDIR}/logging-services/logstash/logstash.yaml + ``` + +#### Create an Index Pattern in Kibana +Create an index pattern `logstash*` in **Kibana > Management**. After the servers are started, you will see the log data in the Kibana dashboard: + +![WLS-Kibana-Dashboard](wcp-kibana-dashboard.jpg) \ No newline at end of file diff --git a/docs-source/content/wcportal-domains/manage-wcportal-domains/monitoring-and-publishing-logs/publishing-logs/logstash/wcp-kibana-dashboard.jpg b/docs-source/content/wcportal-domains/manage-wcportal-domains/monitoring-and-publishing-logs/publishing-logs/logstash/wcp-kibana-dashboard.jpg new file mode 100644 index 000000000..2021d25d2 Binary files /dev/null and b/docs-source/content/wcportal-domains/manage-wcportal-domains/monitoring-and-publishing-logs/publishing-logs/logstash/wcp-kibana-dashboard.jpg differ diff --git a/docs/22.2.3/404.html b/docs/22.2.3/404.html new file mode 100644 index 000000000..99f885b86 --- /dev/null +++ b/docs/22.2.3/404.html @@ -0,0 +1,57 @@ + + + + + + + + + 404 Page not found + + + + + + + + + + + + + + + + +
+
+
+
+

Error

+

+

+

Woops. Looks like this page doesn't exist ¯\_(ツ)_/¯.

+

+

Go to homepage

+

Page not found!

+
+
+ +
+ + + diff --git a/docs/22.2.3/categories/index.html b/docs/22.2.3/categories/index.html new file mode 100644 index 000000000..7c315cce5 --- /dev/null +++ b/docs/22.2.3/categories/index.html @@ -0,0 +1,1283 @@ + + + + + + + + + + + + Categories :: Oracle Fusion Middleware on Kubernetes + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ +
+
+ + + + +
+
+ +
+
+ + +
+
+ +
+ +
+ +
+ +

+ + Categories +

+ + + + + + + + + +
    + +
+ + +
+ +
+ + +
+ + +
+ + + +
+ +
+
+
+ + + + + + + + + + + + + + + + + + diff --git a/docs/22.2.3/categories/index.xml b/docs/22.2.3/categories/index.xml new file mode 100644 index 000000000..39f7be425 --- /dev/null +++ b/docs/22.2.3/categories/index.xml @@ -0,0 +1,14 @@ + + + + Categories on Oracle Fusion Middleware on Kubernetes + /fmw-kubernetes/22.2.3/categories/ + Recent content in Categories on Oracle Fusion Middleware on Kubernetes + Hugo -- gohugo.io + en-us + + + + + + \ No newline at end of file diff --git a/docs/22.2.3/css/atom-one-dark-reasonable.css b/docs/22.2.3/css/atom-one-dark-reasonable.css new file mode 100644 index 000000000..fd41c996a --- /dev/null +++ b/docs/22.2.3/css/atom-one-dark-reasonable.css @@ -0,0 +1,77 @@ +/* + +Atom One Dark With support for ReasonML by Gidi Morris, based off work by Daniel Gamage + +Original One Dark Syntax theme from https://github.com/atom/one-dark-syntax + +*/ +.hljs { + display: block; + overflow-x: auto; + padding: 0.5em; + line-height: 1.3em; + color: #abb2bf; + background: #282c34; + border-radius: 5px; +} +.hljs-keyword, .hljs-operator { + color: #F92672; +} +.hljs-pattern-match { + color: #F92672; +} +.hljs-pattern-match .hljs-constructor { + color: #61aeee; +} +.hljs-function { + color: #61aeee; +} +.hljs-function .hljs-params { + color: #A6E22E; +} +.hljs-function .hljs-params .hljs-typing { + color: #FD971F; +} +.hljs-module-access .hljs-module { + color: #7e57c2; +} +.hljs-constructor { + color: #e2b93d; +} +.hljs-constructor .hljs-string { + color: #9CCC65; +} +.hljs-comment, .hljs-quote { + color: #b18eb1; + font-style: italic; +} +.hljs-doctag, .hljs-formula { + color: #c678dd; +} +.hljs-section, .hljs-name, .hljs-selector-tag, .hljs-deletion, .hljs-subst { + color: #e06c75; +} +.hljs-literal { + color: #56b6c2; +} +.hljs-string, .hljs-regexp, .hljs-addition, .hljs-attribute, .hljs-meta-string { + color: #98c379; +} +.hljs-built_in, .hljs-class .hljs-title { + color: #e6c07b; +} +.hljs-attr, .hljs-variable, .hljs-template-variable, .hljs-type, .hljs-selector-class, .hljs-selector-attr, .hljs-selector-pseudo, .hljs-number { + color: #d19a66; +} +.hljs-symbol, .hljs-bullet, .hljs-link, .hljs-meta, .hljs-selector-id, .hljs-title { + color: #61aeee; +} +.hljs-emphasis { + font-style: italic; +} +.hljs-strong { + font-weight: bold; +} +.hljs-link { + text-decoration: underline; +} diff --git a/docs/22.2.3/css/auto-complete.css b/docs/22.2.3/css/auto-complete.css new file mode 100644 index 000000000..ac6979ad3 --- /dev/null +++ b/docs/22.2.3/css/auto-complete.css @@ -0,0 +1,47 @@ +.autocomplete-suggestions { + text-align: left; + cursor: default; + border: 1px solid #ccc; + border-top: 0; + background: #fff; + box-shadow: -1px 1px 3px rgba(0,0,0,.1); + + /* core styles should not be changed */ + position: absolute; + display: none; + z-index: 9999; + max-height: 254px; + overflow: hidden; + overflow-y: auto; + box-sizing: border-box; + +} +.autocomplete-suggestion { + position: relative; + cursor: pointer; + padding: 7px; + line-height: 23px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + color: #333; +} + +.autocomplete-suggestion b { + font-weight: normal; + color: #1f8dd6; +} + +.autocomplete-suggestion.selected { + background: #333; + color: #fff; +} + +.autocomplete-suggestion:hover { + background: #444; + color: #fff; +} + +.autocomplete-suggestion > .context { + font-size: 12px; +} diff --git a/docs/22.2.3/css/featherlight.min.css b/docs/22.2.3/css/featherlight.min.css new file mode 100644 index 000000000..1b00c7861 --- /dev/null +++ b/docs/22.2.3/css/featherlight.min.css @@ -0,0 +1,8 @@ +/** + * Featherlight - ultra slim jQuery lightbox + * Version 1.7.13 - http://noelboss.github.io/featherlight/ + * + * Copyright (c) 2015, Noël Raoul Bossart (http://www.noelboss.com) + * MIT Licensed. +**/ +html.with-featherlight{overflow:hidden}.featherlight{display:none;position:fixed;top:0;right:0;bottom:0;left:0;z-index:2147483647;text-align:center;white-space:nowrap;cursor:pointer;background:#333;background:rgba(0,0,0,0)}.featherlight:last-of-type{background:rgba(0,0,0,.8)}.featherlight:before{content:'';display:inline-block;height:100%;vertical-align:middle}.featherlight .featherlight-content{position:relative;text-align:left;vertical-align:middle;display:inline-block;overflow:auto;padding:25px 25px 0;border-bottom:25px solid transparent;margin-left:5%;margin-right:5%;max-height:95%;background:#fff;cursor:auto;white-space:normal}.featherlight .featherlight-inner{display:block}.featherlight link.featherlight-inner,.featherlight script.featherlight-inner,.featherlight style.featherlight-inner{display:none}.featherlight .featherlight-close-icon{position:absolute;z-index:9999;top:0;right:0;line-height:25px;width:25px;cursor:pointer;text-align:center;font-family:Arial,sans-serif;background:#fff;background:rgba(255,255,255,.3);color:#000;border:0;padding:0}.featherlight .featherlight-close-icon::-moz-focus-inner{border:0;padding:0}.featherlight .featherlight-image{width:100%}.featherlight-iframe .featherlight-content{border-bottom:0;padding:0;-webkit-overflow-scrolling:touch}.featherlight iframe{border:0}.featherlight *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}@media only screen and (max-width:1024px){.featherlight .featherlight-content{margin-left:0;margin-right:0;max-height:98%;padding:10px 10px 0;border-bottom:10px solid transparent}}@media print{html.with-featherlight>*>:not(.featherlight){display:none}} \ No newline at end of file diff --git a/docs/22.2.3/css/fontawesome-all.min.css b/docs/22.2.3/css/fontawesome-all.min.css new file mode 100644 index 000000000..de5647372 --- /dev/null +++ b/docs/22.2.3/css/fontawesome-all.min.css @@ -0,0 +1 @@ +.fa,.fab,.fal,.far,.fas{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:inline-block;font-style:normal;font-variant:normal;text-rendering:auto;line-height:1}.fa-lg{font-size:1.33333em;line-height:.75em;vertical-align:-.0667em}.fa-xs{font-size:.75em}.fa-sm{font-size:.875em}.fa-1x{font-size:1em}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-6x{font-size:6em}.fa-7x{font-size:7em}.fa-8x{font-size:8em}.fa-9x{font-size:9em}.fa-10x{font-size:10em}.fa-fw{text-align:center;width:1.25em}.fa-ul{list-style-type:none;margin-left:2.5em;padding-left:0}.fa-ul>li{position:relative}.fa-li{left:-2em;position:absolute;text-align:center;width:2em;line-height:inherit}.fa-border{border:.08em solid #eee;border-radius:.1em;padding:.2em .25em .15em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left,.fab.fa-pull-left,.fal.fa-pull-left,.far.fa-pull-left,.fas.fa-pull-left{margin-right:.3em}.fa.fa-pull-right,.fab.fa-pull-right,.fal.fa-pull-right,.far.fa-pull-right,.fas.fa-pull-right{margin-left:.3em}.fa-spin{animation:fa-spin 2s infinite linear}.fa-pulse{animation:fa-spin 1s infinite steps(8)}@keyframes fa-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";transform:scaleX(-1)}.fa-flip-vertical{transform:scaleY(-1)}.fa-flip-horizontal.fa-flip-vertical,.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)"}.fa-flip-horizontal.fa-flip-vertical{transform:scale(-1)}:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270{filter:none}.fa-stack{display:inline-block;height:2em;line-height:2em;position:relative;vertical-align:middle;width:2.5em}.fa-stack-1x,.fa-stack-2x{left:0;position:absolute;text-align:center;width:100%}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-500px:before{content:"\f26e"}.fa-accessible-icon:before{content:"\f368"}.fa-accusoft:before{content:"\f369"}.fa-acquisitions-incorporated:before{content:"\f6af"}.fa-ad:before{content:"\f641"}.fa-address-book:before{content:"\f2b9"}.fa-address-card:before{content:"\f2bb"}.fa-adjust:before{content:"\f042"}.fa-adn:before{content:"\f170"}.fa-adobe:before{content:"\f778"}.fa-adversal:before{content:"\f36a"}.fa-affiliatetheme:before{content:"\f36b"}.fa-air-freshener:before{content:"\f5d0"}.fa-algolia:before{content:"\f36c"}.fa-align-center:before{content:"\f037"}.fa-align-justify:before{content:"\f039"}.fa-align-left:before{content:"\f036"}.fa-align-right:before{content:"\f038"}.fa-alipay:before{content:"\f642"}.fa-allergies:before{content:"\f461"}.fa-amazon:before{content:"\f270"}.fa-amazon-pay:before{content:"\f42c"}.fa-ambulance:before{content:"\f0f9"}.fa-american-sign-language-interpreting:before{content:"\f2a3"}.fa-amilia:before{content:"\f36d"}.fa-anchor:before{content:"\f13d"}.fa-android:before{content:"\f17b"}.fa-angellist:before{content:"\f209"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-down:before{content:"\f107"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angry:before{content:"\f556"}.fa-angrycreative:before{content:"\f36e"}.fa-angular:before{content:"\f420"}.fa-ankh:before{content:"\f644"}.fa-app-store:before{content:"\f36f"}.fa-app-store-ios:before{content:"\f370"}.fa-apper:before{content:"\f371"}.fa-apple:before{content:"\f179"}.fa-apple-alt:before{content:"\f5d1"}.fa-apple-pay:before{content:"\f415"}.fa-archive:before{content:"\f187"}.fa-archway:before{content:"\f557"}.fa-arrow-alt-circle-down:before{content:"\f358"}.fa-arrow-alt-circle-left:before{content:"\f359"}.fa-arrow-alt-circle-right:before{content:"\f35a"}.fa-arrow-alt-circle-up:before{content:"\f35b"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-down:before{content:"\f063"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrows-alt:before{content:"\f0b2"}.fa-arrows-alt-h:before{content:"\f337"}.fa-arrows-alt-v:before{content:"\f338"}.fa-artstation:before{content:"\f77a"}.fa-assistive-listening-systems:before{content:"\f2a2"}.fa-asterisk:before{content:"\f069"}.fa-asymmetrik:before{content:"\f372"}.fa-at:before{content:"\f1fa"}.fa-atlas:before{content:"\f558"}.fa-atlassian:before{content:"\f77b"}.fa-atom:before{content:"\f5d2"}.fa-audible:before{content:"\f373"}.fa-audio-description:before{content:"\f29e"}.fa-autoprefixer:before{content:"\f41c"}.fa-avianex:before{content:"\f374"}.fa-aviato:before{content:"\f421"}.fa-award:before{content:"\f559"}.fa-aws:before{content:"\f375"}.fa-baby:before{content:"\f77c"}.fa-baby-carriage:before{content:"\f77d"}.fa-backspace:before{content:"\f55a"}.fa-backward:before{content:"\f04a"}.fa-balance-scale:before{content:"\f24e"}.fa-ban:before{content:"\f05e"}.fa-band-aid:before{content:"\f462"}.fa-bandcamp:before{content:"\f2d5"}.fa-barcode:before{content:"\f02a"}.fa-bars:before{content:"\f0c9"}.fa-baseball-ball:before{content:"\f433"}.fa-basketball-ball:before{content:"\f434"}.fa-bath:before{content:"\f2cd"}.fa-battery-empty:before{content:"\f244"}.fa-battery-full:before{content:"\f240"}.fa-battery-half:before{content:"\f242"}.fa-battery-quarter:before{content:"\f243"}.fa-battery-three-quarters:before{content:"\f241"}.fa-bed:before{content:"\f236"}.fa-beer:before{content:"\f0fc"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-bell:before{content:"\f0f3"}.fa-bell-slash:before{content:"\f1f6"}.fa-bezier-curve:before{content:"\f55b"}.fa-bible:before{content:"\f647"}.fa-bicycle:before{content:"\f206"}.fa-bimobject:before{content:"\f378"}.fa-binoculars:before{content:"\f1e5"}.fa-biohazard:before{content:"\f780"}.fa-birthday-cake:before{content:"\f1fd"}.fa-bitbucket:before{content:"\f171"}.fa-bitcoin:before{content:"\f379"}.fa-bity:before{content:"\f37a"}.fa-black-tie:before{content:"\f27e"}.fa-blackberry:before{content:"\f37b"}.fa-blender:before{content:"\f517"}.fa-blender-phone:before{content:"\f6b6"}.fa-blind:before{content:"\f29d"}.fa-blog:before{content:"\f781"}.fa-blogger:before{content:"\f37c"}.fa-blogger-b:before{content:"\f37d"}.fa-bluetooth:before{content:"\f293"}.fa-bluetooth-b:before{content:"\f294"}.fa-bold:before{content:"\f032"}.fa-bolt:before{content:"\f0e7"}.fa-bomb:before{content:"\f1e2"}.fa-bone:before{content:"\f5d7"}.fa-bong:before{content:"\f55c"}.fa-book:before{content:"\f02d"}.fa-book-dead:before{content:"\f6b7"}.fa-book-open:before{content:"\f518"}.fa-book-reader:before{content:"\f5da"}.fa-bookmark:before{content:"\f02e"}.fa-bowling-ball:before{content:"\f436"}.fa-box:before{content:"\f466"}.fa-box-open:before{content:"\f49e"}.fa-boxes:before{content:"\f468"}.fa-braille:before{content:"\f2a1"}.fa-brain:before{content:"\f5dc"}.fa-briefcase:before{content:"\f0b1"}.fa-briefcase-medical:before{content:"\f469"}.fa-broadcast-tower:before{content:"\f519"}.fa-broom:before{content:"\f51a"}.fa-brush:before{content:"\f55d"}.fa-btc:before{content:"\f15a"}.fa-bug:before{content:"\f188"}.fa-building:before{content:"\f1ad"}.fa-bullhorn:before{content:"\f0a1"}.fa-bullseye:before{content:"\f140"}.fa-burn:before{content:"\f46a"}.fa-buromobelexperte:before{content:"\f37f"}.fa-bus:before{content:"\f207"}.fa-bus-alt:before{content:"\f55e"}.fa-business-time:before{content:"\f64a"}.fa-buysellads:before{content:"\f20d"}.fa-calculator:before{content:"\f1ec"}.fa-calendar:before{content:"\f133"}.fa-calendar-alt:before{content:"\f073"}.fa-calendar-check:before{content:"\f274"}.fa-calendar-day:before{content:"\f783"}.fa-calendar-minus:before{content:"\f272"}.fa-calendar-plus:before{content:"\f271"}.fa-calendar-times:before{content:"\f273"}.fa-calendar-week:before{content:"\f784"}.fa-camera:before{content:"\f030"}.fa-camera-retro:before{content:"\f083"}.fa-campground:before{content:"\f6bb"}.fa-canadian-maple-leaf:before{content:"\f785"}.fa-candy-cane:before{content:"\f786"}.fa-cannabis:before{content:"\f55f"}.fa-capsules:before{content:"\f46b"}.fa-car:before{content:"\f1b9"}.fa-car-alt:before{content:"\f5de"}.fa-car-battery:before{content:"\f5df"}.fa-car-crash:before{content:"\f5e1"}.fa-car-side:before{content:"\f5e4"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-caret-square-down:before{content:"\f150"}.fa-caret-square-left:before{content:"\f191"}.fa-caret-square-right:before{content:"\f152"}.fa-caret-square-up:before{content:"\f151"}.fa-caret-up:before{content:"\f0d8"}.fa-carrot:before{content:"\f787"}.fa-cart-arrow-down:before{content:"\f218"}.fa-cart-plus:before{content:"\f217"}.fa-cash-register:before{content:"\f788"}.fa-cat:before{content:"\f6be"}.fa-cc-amazon-pay:before{content:"\f42d"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-apple-pay:before{content:"\f416"}.fa-cc-diners-club:before{content:"\f24c"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-jcb:before{content:"\f24b"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-cc-visa:before{content:"\f1f0"}.fa-centercode:before{content:"\f380"}.fa-centos:before{content:"\f789"}.fa-certificate:before{content:"\f0a3"}.fa-chair:before{content:"\f6c0"}.fa-chalkboard:before{content:"\f51b"}.fa-chalkboard-teacher:before{content:"\f51c"}.fa-charging-station:before{content:"\f5e7"}.fa-chart-area:before{content:"\f1fe"}.fa-chart-bar:before{content:"\f080"}.fa-chart-line:before{content:"\f201"}.fa-chart-pie:before{content:"\f200"}.fa-check:before{content:"\f00c"}.fa-check-circle:before{content:"\f058"}.fa-check-double:before{content:"\f560"}.fa-check-square:before{content:"\f14a"}.fa-chess:before{content:"\f439"}.fa-chess-bishop:before{content:"\f43a"}.fa-chess-board:before{content:"\f43c"}.fa-chess-king:before{content:"\f43f"}.fa-chess-knight:before{content:"\f441"}.fa-chess-pawn:before{content:"\f443"}.fa-chess-queen:before{content:"\f445"}.fa-chess-rook:before{content:"\f447"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-down:before{content:"\f078"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-chevron-up:before{content:"\f077"}.fa-child:before{content:"\f1ae"}.fa-chrome:before{content:"\f268"}.fa-church:before{content:"\f51d"}.fa-circle:before{content:"\f111"}.fa-circle-notch:before{content:"\f1ce"}.fa-city:before{content:"\f64f"}.fa-clipboard:before{content:"\f328"}.fa-clipboard-check:before{content:"\f46c"}.fa-clipboard-list:before{content:"\f46d"}.fa-clock:before{content:"\f017"}.fa-clone:before{content:"\f24d"}.fa-closed-captioning:before{content:"\f20a"}.fa-cloud:before{content:"\f0c2"}.fa-cloud-download-alt:before{content:"\f381"}.fa-cloud-meatball:before{content:"\f73b"}.fa-cloud-moon:before{content:"\f6c3"}.fa-cloud-moon-rain:before{content:"\f73c"}.fa-cloud-rain:before{content:"\f73d"}.fa-cloud-showers-heavy:before{content:"\f740"}.fa-cloud-sun:before{content:"\f6c4"}.fa-cloud-sun-rain:before{content:"\f743"}.fa-cloud-upload-alt:before{content:"\f382"}.fa-cloudscale:before{content:"\f383"}.fa-cloudsmith:before{content:"\f384"}.fa-cloudversify:before{content:"\f385"}.fa-cocktail:before{content:"\f561"}.fa-code:before{content:"\f121"}.fa-code-branch:before{content:"\f126"}.fa-codepen:before{content:"\f1cb"}.fa-codiepie:before{content:"\f284"}.fa-coffee:before{content:"\f0f4"}.fa-cog:before{content:"\f013"}.fa-cogs:before{content:"\f085"}.fa-coins:before{content:"\f51e"}.fa-columns:before{content:"\f0db"}.fa-comment:before{content:"\f075"}.fa-comment-alt:before{content:"\f27a"}.fa-comment-dollar:before{content:"\f651"}.fa-comment-dots:before{content:"\f4ad"}.fa-comment-slash:before{content:"\f4b3"}.fa-comments:before{content:"\f086"}.fa-comments-dollar:before{content:"\f653"}.fa-compact-disc:before{content:"\f51f"}.fa-compass:before{content:"\f14e"}.fa-compress:before{content:"\f066"}.fa-compress-arrows-alt:before{content:"\f78c"}.fa-concierge-bell:before{content:"\f562"}.fa-confluence:before{content:"\f78d"}.fa-connectdevelop:before{content:"\f20e"}.fa-contao:before{content:"\f26d"}.fa-cookie:before{content:"\f563"}.fa-cookie-bite:before{content:"\f564"}.fa-copy:before{content:"\f0c5"}.fa-copyright:before{content:"\f1f9"}.fa-couch:before{content:"\f4b8"}.fa-cpanel:before{content:"\f388"}.fa-creative-commons:before{content:"\f25e"}.fa-creative-commons-by:before{content:"\f4e7"}.fa-creative-commons-nc:before{content:"\f4e8"}.fa-creative-commons-nc-eu:before{content:"\f4e9"}.fa-creative-commons-nc-jp:before{content:"\f4ea"}.fa-creative-commons-nd:before{content:"\f4eb"}.fa-creative-commons-pd:before{content:"\f4ec"}.fa-creative-commons-pd-alt:before{content:"\f4ed"}.fa-creative-commons-remix:before{content:"\f4ee"}.fa-creative-commons-sa:before{content:"\f4ef"}.fa-creative-commons-sampling:before{content:"\f4f0"}.fa-creative-commons-sampling-plus:before{content:"\f4f1"}.fa-creative-commons-share:before{content:"\f4f2"}.fa-creative-commons-zero:before{content:"\f4f3"}.fa-credit-card:before{content:"\f09d"}.fa-critical-role:before{content:"\f6c9"}.fa-crop:before{content:"\f125"}.fa-crop-alt:before{content:"\f565"}.fa-cross:before{content:"\f654"}.fa-crosshairs:before{content:"\f05b"}.fa-crow:before{content:"\f520"}.fa-crown:before{content:"\f521"}.fa-css3:before{content:"\f13c"}.fa-css3-alt:before{content:"\f38b"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-cut:before{content:"\f0c4"}.fa-cuttlefish:before{content:"\f38c"}.fa-d-and-d:before{content:"\f38d"}.fa-d-and-d-beyond:before{content:"\f6ca"}.fa-dashcube:before{content:"\f210"}.fa-database:before{content:"\f1c0"}.fa-deaf:before{content:"\f2a4"}.fa-delicious:before{content:"\f1a5"}.fa-democrat:before{content:"\f747"}.fa-deploydog:before{content:"\f38e"}.fa-deskpro:before{content:"\f38f"}.fa-desktop:before{content:"\f108"}.fa-dev:before{content:"\f6cc"}.fa-deviantart:before{content:"\f1bd"}.fa-dharmachakra:before{content:"\f655"}.fa-dhl:before{content:"\f790"}.fa-diagnoses:before{content:"\f470"}.fa-diaspora:before{content:"\f791"}.fa-dice:before{content:"\f522"}.fa-dice-d20:before{content:"\f6cf"}.fa-dice-d6:before{content:"\f6d1"}.fa-dice-five:before{content:"\f523"}.fa-dice-four:before{content:"\f524"}.fa-dice-one:before{content:"\f525"}.fa-dice-six:before{content:"\f526"}.fa-dice-three:before{content:"\f527"}.fa-dice-two:before{content:"\f528"}.fa-digg:before{content:"\f1a6"}.fa-digital-ocean:before{content:"\f391"}.fa-digital-tachograph:before{content:"\f566"}.fa-directions:before{content:"\f5eb"}.fa-discord:before{content:"\f392"}.fa-discourse:before{content:"\f393"}.fa-divide:before{content:"\f529"}.fa-dizzy:before{content:"\f567"}.fa-dna:before{content:"\f471"}.fa-dochub:before{content:"\f394"}.fa-docker:before{content:"\f395"}.fa-dog:before{content:"\f6d3"}.fa-dollar-sign:before{content:"\f155"}.fa-dolly:before{content:"\f472"}.fa-dolly-flatbed:before{content:"\f474"}.fa-donate:before{content:"\f4b9"}.fa-door-closed:before{content:"\f52a"}.fa-door-open:before{content:"\f52b"}.fa-dot-circle:before{content:"\f192"}.fa-dove:before{content:"\f4ba"}.fa-download:before{content:"\f019"}.fa-draft2digital:before{content:"\f396"}.fa-drafting-compass:before{content:"\f568"}.fa-dragon:before{content:"\f6d5"}.fa-draw-polygon:before{content:"\f5ee"}.fa-dribbble:before{content:"\f17d"}.fa-dribbble-square:before{content:"\f397"}.fa-dropbox:before{content:"\f16b"}.fa-drum:before{content:"\f569"}.fa-drum-steelpan:before{content:"\f56a"}.fa-drumstick-bite:before{content:"\f6d7"}.fa-drupal:before{content:"\f1a9"}.fa-dumbbell:before{content:"\f44b"}.fa-dumpster:before{content:"\f793"}.fa-dumpster-fire:before{content:"\f794"}.fa-dungeon:before{content:"\f6d9"}.fa-dyalog:before{content:"\f399"}.fa-earlybirds:before{content:"\f39a"}.fa-ebay:before{content:"\f4f4"}.fa-edge:before{content:"\f282"}.fa-edit:before{content:"\f044"}.fa-eject:before{content:"\f052"}.fa-elementor:before{content:"\f430"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-ello:before{content:"\f5f1"}.fa-ember:before{content:"\f423"}.fa-empire:before{content:"\f1d1"}.fa-envelope:before{content:"\f0e0"}.fa-envelope-open:before{content:"\f2b6"}.fa-envelope-open-text:before{content:"\f658"}.fa-envelope-square:before{content:"\f199"}.fa-envira:before{content:"\f299"}.fa-equals:before{content:"\f52c"}.fa-eraser:before{content:"\f12d"}.fa-erlang:before{content:"\f39d"}.fa-ethereum:before{content:"\f42e"}.fa-ethernet:before{content:"\f796"}.fa-etsy:before{content:"\f2d7"}.fa-euro-sign:before{content:"\f153"}.fa-exchange-alt:before{content:"\f362"}.fa-exclamation:before{content:"\f12a"}.fa-exclamation-circle:before{content:"\f06a"}.fa-exclamation-triangle:before{content:"\f071"}.fa-expand:before{content:"\f065"}.fa-expand-arrows-alt:before{content:"\f31e"}.fa-expeditedssl:before{content:"\f23e"}.fa-external-link-alt:before{content:"\f35d"}.fa-external-link-square-alt:before{content:"\f360"}.fa-eye:before{content:"\f06e"}.fa-eye-dropper:before{content:"\f1fb"}.fa-eye-slash:before{content:"\f070"}.fa-facebook:before{content:"\f09a"}.fa-facebook-f:before{content:"\f39e"}.fa-facebook-messenger:before{content:"\f39f"}.fa-facebook-square:before{content:"\f082"}.fa-fantasy-flight-games:before{content:"\f6dc"}.fa-fast-backward:before{content:"\f049"}.fa-fast-forward:before{content:"\f050"}.fa-fax:before{content:"\f1ac"}.fa-feather:before{content:"\f52d"}.fa-feather-alt:before{content:"\f56b"}.fa-fedex:before{content:"\f797"}.fa-fedora:before{content:"\f798"}.fa-female:before{content:"\f182"}.fa-fighter-jet:before{content:"\f0fb"}.fa-figma:before{content:"\f799"}.fa-file:before{content:"\f15b"}.fa-file-alt:before{content:"\f15c"}.fa-file-archive:before{content:"\f1c6"}.fa-file-audio:before{content:"\f1c7"}.fa-file-code:before{content:"\f1c9"}.fa-file-contract:before{content:"\f56c"}.fa-file-csv:before{content:"\f6dd"}.fa-file-download:before{content:"\f56d"}.fa-file-excel:before{content:"\f1c3"}.fa-file-export:before{content:"\f56e"}.fa-file-image:before{content:"\f1c5"}.fa-file-import:before{content:"\f56f"}.fa-file-invoice:before{content:"\f570"}.fa-file-invoice-dollar:before{content:"\f571"}.fa-file-medical:before{content:"\f477"}.fa-file-medical-alt:before{content:"\f478"}.fa-file-pdf:before{content:"\f1c1"}.fa-file-powerpoint:before{content:"\f1c4"}.fa-file-prescription:before{content:"\f572"}.fa-file-signature:before{content:"\f573"}.fa-file-upload:before{content:"\f574"}.fa-file-video:before{content:"\f1c8"}.fa-file-word:before{content:"\f1c2"}.fa-fill:before{content:"\f575"}.fa-fill-drip:before{content:"\f576"}.fa-film:before{content:"\f008"}.fa-filter:before{content:"\f0b0"}.fa-fingerprint:before{content:"\f577"}.fa-fire:before{content:"\f06d"}.fa-fire-alt:before{content:"\f7e4"}.fa-fire-extinguisher:before{content:"\f134"}.fa-firefox:before{content:"\f269"}.fa-first-aid:before{content:"\f479"}.fa-first-order:before{content:"\f2b0"}.fa-first-order-alt:before{content:"\f50a"}.fa-firstdraft:before{content:"\f3a1"}.fa-fish:before{content:"\f578"}.fa-fist-raised:before{content:"\f6de"}.fa-flag:before{content:"\f024"}.fa-flag-checkered:before{content:"\f11e"}.fa-flag-usa:before{content:"\f74d"}.fa-flask:before{content:"\f0c3"}.fa-flickr:before{content:"\f16e"}.fa-flipboard:before{content:"\f44d"}.fa-flushed:before{content:"\f579"}.fa-fly:before{content:"\f417"}.fa-folder:before{content:"\f07b"}.fa-folder-minus:before{content:"\f65d"}.fa-folder-open:before{content:"\f07c"}.fa-folder-plus:before{content:"\f65e"}.fa-font:before{content:"\f031"}.fa-font-awesome:before{content:"\f2b4"}.fa-font-awesome-alt:before{content:"\f35c"}.fa-font-awesome-flag:before{content:"\f425"}.fa-font-awesome-logo-full:before{content:"\f4e6"}.fa-fonticons:before{content:"\f280"}.fa-fonticons-fi:before{content:"\f3a2"}.fa-football-ball:before{content:"\f44e"}.fa-fort-awesome:before{content:"\f286"}.fa-fort-awesome-alt:before{content:"\f3a3"}.fa-forumbee:before{content:"\f211"}.fa-forward:before{content:"\f04e"}.fa-foursquare:before{content:"\f180"}.fa-free-code-camp:before{content:"\f2c5"}.fa-freebsd:before{content:"\f3a4"}.fa-frog:before{content:"\f52e"}.fa-frown:before{content:"\f119"}.fa-frown-open:before{content:"\f57a"}.fa-fulcrum:before{content:"\f50b"}.fa-funnel-dollar:before{content:"\f662"}.fa-futbol:before{content:"\f1e3"}.fa-galactic-republic:before{content:"\f50c"}.fa-galactic-senate:before{content:"\f50d"}.fa-gamepad:before{content:"\f11b"}.fa-gas-pump:before{content:"\f52f"}.fa-gavel:before{content:"\f0e3"}.fa-gem:before{content:"\f3a5"}.fa-genderless:before{content:"\f22d"}.fa-get-pocket:before{content:"\f265"}.fa-gg:before{content:"\f260"}.fa-gg-circle:before{content:"\f261"}.fa-ghost:before{content:"\f6e2"}.fa-gift:before{content:"\f06b"}.fa-gifts:before{content:"\f79c"}.fa-git:before{content:"\f1d3"}.fa-git-square:before{content:"\f1d2"}.fa-github:before{content:"\f09b"}.fa-github-alt:before{content:"\f113"}.fa-github-square:before{content:"\f092"}.fa-gitkraken:before{content:"\f3a6"}.fa-gitlab:before{content:"\f296"}.fa-gitter:before{content:"\f426"}.fa-glass-cheers:before{content:"\f79f"}.fa-glass-martini:before{content:"\f000"}.fa-glass-martini-alt:before{content:"\f57b"}.fa-glass-whiskey:before{content:"\f7a0"}.fa-glasses:before{content:"\f530"}.fa-glide:before{content:"\f2a5"}.fa-glide-g:before{content:"\f2a6"}.fa-globe:before{content:"\f0ac"}.fa-globe-africa:before{content:"\f57c"}.fa-globe-americas:before{content:"\f57d"}.fa-globe-asia:before{content:"\f57e"}.fa-globe-europe:before{content:"\f7a2"}.fa-gofore:before{content:"\f3a7"}.fa-golf-ball:before{content:"\f450"}.fa-goodreads:before{content:"\f3a8"}.fa-goodreads-g:before{content:"\f3a9"}.fa-google:before{content:"\f1a0"}.fa-google-drive:before{content:"\f3aa"}.fa-google-play:before{content:"\f3ab"}.fa-google-plus:before{content:"\f2b3"}.fa-google-plus-g:before{content:"\f0d5"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-wallet:before{content:"\f1ee"}.fa-gopuram:before{content:"\f664"}.fa-graduation-cap:before{content:"\f19d"}.fa-gratipay:before{content:"\f184"}.fa-grav:before{content:"\f2d6"}.fa-greater-than:before{content:"\f531"}.fa-greater-than-equal:before{content:"\f532"}.fa-grimace:before{content:"\f57f"}.fa-grin:before{content:"\f580"}.fa-grin-alt:before{content:"\f581"}.fa-grin-beam:before{content:"\f582"}.fa-grin-beam-sweat:before{content:"\f583"}.fa-grin-hearts:before{content:"\f584"}.fa-grin-squint:before{content:"\f585"}.fa-grin-squint-tears:before{content:"\f586"}.fa-grin-stars:before{content:"\f587"}.fa-grin-tears:before{content:"\f588"}.fa-grin-tongue:before{content:"\f589"}.fa-grin-tongue-squint:before{content:"\f58a"}.fa-grin-tongue-wink:before{content:"\f58b"}.fa-grin-wink:before{content:"\f58c"}.fa-grip-horizontal:before{content:"\f58d"}.fa-grip-lines:before{content:"\f7a4"}.fa-grip-lines-vertical:before{content:"\f7a5"}.fa-grip-vertical:before{content:"\f58e"}.fa-gripfire:before{content:"\f3ac"}.fa-grunt:before{content:"\f3ad"}.fa-guitar:before{content:"\f7a6"}.fa-gulp:before{content:"\f3ae"}.fa-h-square:before{content:"\f0fd"}.fa-hacker-news:before{content:"\f1d4"}.fa-hacker-news-square:before{content:"\f3af"}.fa-hackerrank:before{content:"\f5f7"}.fa-hammer:before{content:"\f6e3"}.fa-hamsa:before{content:"\f665"}.fa-hand-holding:before{content:"\f4bd"}.fa-hand-holding-heart:before{content:"\f4be"}.fa-hand-holding-usd:before{content:"\f4c0"}.fa-hand-lizard:before{content:"\f258"}.fa-hand-paper:before{content:"\f256"}.fa-hand-peace:before{content:"\f25b"}.fa-hand-point-down:before{content:"\f0a7"}.fa-hand-point-left:before{content:"\f0a5"}.fa-hand-point-right:before{content:"\f0a4"}.fa-hand-point-up:before{content:"\f0a6"}.fa-hand-pointer:before{content:"\f25a"}.fa-hand-rock:before{content:"\f255"}.fa-hand-scissors:before{content:"\f257"}.fa-hand-spock:before{content:"\f259"}.fa-hands:before{content:"\f4c2"}.fa-hands-helping:before{content:"\f4c4"}.fa-handshake:before{content:"\f2b5"}.fa-hanukiah:before{content:"\f6e6"}.fa-hashtag:before{content:"\f292"}.fa-hat-wizard:before{content:"\f6e8"}.fa-haykal:before{content:"\f666"}.fa-hdd:before{content:"\f0a0"}.fa-heading:before{content:"\f1dc"}.fa-headphones:before{content:"\f025"}.fa-headphones-alt:before{content:"\f58f"}.fa-headset:before{content:"\f590"}.fa-heart:before{content:"\f004"}.fa-heart-broken:before{content:"\f7a9"}.fa-heartbeat:before{content:"\f21e"}.fa-helicopter:before{content:"\f533"}.fa-highlighter:before{content:"\f591"}.fa-hiking:before{content:"\f6ec"}.fa-hippo:before{content:"\f6ed"}.fa-hips:before{content:"\f452"}.fa-hire-a-helper:before{content:"\f3b0"}.fa-history:before{content:"\f1da"}.fa-hockey-puck:before{content:"\f453"}.fa-holly-berry:before{content:"\f7aa"}.fa-home:before{content:"\f015"}.fa-hooli:before{content:"\f427"}.fa-hornbill:before{content:"\f592"}.fa-horse:before{content:"\f6f0"}.fa-horse-head:before{content:"\f7ab"}.fa-hospital:before{content:"\f0f8"}.fa-hospital-alt:before{content:"\f47d"}.fa-hospital-symbol:before{content:"\f47e"}.fa-hot-tub:before{content:"\f593"}.fa-hotel:before{content:"\f594"}.fa-hotjar:before{content:"\f3b1"}.fa-hourglass:before{content:"\f254"}.fa-hourglass-end:before{content:"\f253"}.fa-hourglass-half:before{content:"\f252"}.fa-hourglass-start:before{content:"\f251"}.fa-house-damage:before{content:"\f6f1"}.fa-houzz:before{content:"\f27c"}.fa-hryvnia:before{content:"\f6f2"}.fa-html5:before{content:"\f13b"}.fa-hubspot:before{content:"\f3b2"}.fa-i-cursor:before{content:"\f246"}.fa-icicles:before{content:"\f7ad"}.fa-id-badge:before{content:"\f2c1"}.fa-id-card:before{content:"\f2c2"}.fa-id-card-alt:before{content:"\f47f"}.fa-igloo:before{content:"\f7ae"}.fa-image:before{content:"\f03e"}.fa-images:before{content:"\f302"}.fa-imdb:before{content:"\f2d8"}.fa-inbox:before{content:"\f01c"}.fa-indent:before{content:"\f03c"}.fa-industry:before{content:"\f275"}.fa-infinity:before{content:"\f534"}.fa-info:before{content:"\f129"}.fa-info-circle:before{content:"\f05a"}.fa-instagram:before{content:"\f16d"}.fa-intercom:before{content:"\f7af"}.fa-internet-explorer:before{content:"\f26b"}.fa-invision:before{content:"\f7b0"}.fa-ioxhost:before{content:"\f208"}.fa-italic:before{content:"\f033"}.fa-itunes:before{content:"\f3b4"}.fa-itunes-note:before{content:"\f3b5"}.fa-java:before{content:"\f4e4"}.fa-jedi:before{content:"\f669"}.fa-jedi-order:before{content:"\f50e"}.fa-jenkins:before{content:"\f3b6"}.fa-jira:before{content:"\f7b1"}.fa-joget:before{content:"\f3b7"}.fa-joint:before{content:"\f595"}.fa-joomla:before{content:"\f1aa"}.fa-journal-whills:before{content:"\f66a"}.fa-js:before{content:"\f3b8"}.fa-js-square:before{content:"\f3b9"}.fa-jsfiddle:before{content:"\f1cc"}.fa-kaaba:before{content:"\f66b"}.fa-kaggle:before{content:"\f5fa"}.fa-key:before{content:"\f084"}.fa-keybase:before{content:"\f4f5"}.fa-keyboard:before{content:"\f11c"}.fa-keycdn:before{content:"\f3ba"}.fa-khanda:before{content:"\f66d"}.fa-kickstarter:before{content:"\f3bb"}.fa-kickstarter-k:before{content:"\f3bc"}.fa-kiss:before{content:"\f596"}.fa-kiss-beam:before{content:"\f597"}.fa-kiss-wink-heart:before{content:"\f598"}.fa-kiwi-bird:before{content:"\f535"}.fa-korvue:before{content:"\f42f"}.fa-landmark:before{content:"\f66f"}.fa-language:before{content:"\f1ab"}.fa-laptop:before{content:"\f109"}.fa-laptop-code:before{content:"\f5fc"}.fa-laravel:before{content:"\f3bd"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-laugh:before{content:"\f599"}.fa-laugh-beam:before{content:"\f59a"}.fa-laugh-squint:before{content:"\f59b"}.fa-laugh-wink:before{content:"\f59c"}.fa-layer-group:before{content:"\f5fd"}.fa-leaf:before{content:"\f06c"}.fa-leanpub:before{content:"\f212"}.fa-lemon:before{content:"\f094"}.fa-less:before{content:"\f41d"}.fa-less-than:before{content:"\f536"}.fa-less-than-equal:before{content:"\f537"}.fa-level-down-alt:before{content:"\f3be"}.fa-level-up-alt:before{content:"\f3bf"}.fa-life-ring:before{content:"\f1cd"}.fa-lightbulb:before{content:"\f0eb"}.fa-line:before{content:"\f3c0"}.fa-link:before{content:"\f0c1"}.fa-linkedin:before{content:"\f08c"}.fa-linkedin-in:before{content:"\f0e1"}.fa-linode:before{content:"\f2b8"}.fa-linux:before{content:"\f17c"}.fa-lira-sign:before{content:"\f195"}.fa-list:before{content:"\f03a"}.fa-list-alt:before{content:"\f022"}.fa-list-ol:before{content:"\f0cb"}.fa-list-ul:before{content:"\f0ca"}.fa-location-arrow:before{content:"\f124"}.fa-lock:before{content:"\f023"}.fa-lock-open:before{content:"\f3c1"}.fa-long-arrow-alt-down:before{content:"\f309"}.fa-long-arrow-alt-left:before{content:"\f30a"}.fa-long-arrow-alt-right:before{content:"\f30b"}.fa-long-arrow-alt-up:before{content:"\f30c"}.fa-low-vision:before{content:"\f2a8"}.fa-luggage-cart:before{content:"\f59d"}.fa-lyft:before{content:"\f3c3"}.fa-magento:before{content:"\f3c4"}.fa-magic:before{content:"\f0d0"}.fa-magnet:before{content:"\f076"}.fa-mail-bulk:before{content:"\f674"}.fa-mailchimp:before{content:"\f59e"}.fa-male:before{content:"\f183"}.fa-mandalorian:before{content:"\f50f"}.fa-map:before{content:"\f279"}.fa-map-marked:before{content:"\f59f"}.fa-map-marked-alt:before{content:"\f5a0"}.fa-map-marker:before{content:"\f041"}.fa-map-marker-alt:before{content:"\f3c5"}.fa-map-pin:before{content:"\f276"}.fa-map-signs:before{content:"\f277"}.fa-markdown:before{content:"\f60f"}.fa-marker:before{content:"\f5a1"}.fa-mars:before{content:"\f222"}.fa-mars-double:before{content:"\f227"}.fa-mars-stroke:before{content:"\f229"}.fa-mars-stroke-h:before{content:"\f22b"}.fa-mars-stroke-v:before{content:"\f22a"}.fa-mask:before{content:"\f6fa"}.fa-mastodon:before{content:"\f4f6"}.fa-maxcdn:before{content:"\f136"}.fa-medal:before{content:"\f5a2"}.fa-medapps:before{content:"\f3c6"}.fa-medium:before{content:"\f23a"}.fa-medium-m:before{content:"\f3c7"}.fa-medkit:before{content:"\f0fa"}.fa-medrt:before{content:"\f3c8"}.fa-meetup:before{content:"\f2e0"}.fa-megaport:before{content:"\f5a3"}.fa-meh:before{content:"\f11a"}.fa-meh-blank:before{content:"\f5a4"}.fa-meh-rolling-eyes:before{content:"\f5a5"}.fa-memory:before{content:"\f538"}.fa-mendeley:before{content:"\f7b3"}.fa-menorah:before{content:"\f676"}.fa-mercury:before{content:"\f223"}.fa-meteor:before{content:"\f753"}.fa-microchip:before{content:"\f2db"}.fa-microphone:before{content:"\f130"}.fa-microphone-alt:before{content:"\f3c9"}.fa-microphone-alt-slash:before{content:"\f539"}.fa-microphone-slash:before{content:"\f131"}.fa-microscope:before{content:"\f610"}.fa-microsoft:before{content:"\f3ca"}.fa-minus:before{content:"\f068"}.fa-minus-circle:before{content:"\f056"}.fa-minus-square:before{content:"\f146"}.fa-mitten:before{content:"\f7b5"}.fa-mix:before{content:"\f3cb"}.fa-mixcloud:before{content:"\f289"}.fa-mizuni:before{content:"\f3cc"}.fa-mobile:before{content:"\f10b"}.fa-mobile-alt:before{content:"\f3cd"}.fa-modx:before{content:"\f285"}.fa-monero:before{content:"\f3d0"}.fa-money-bill:before{content:"\f0d6"}.fa-money-bill-alt:before{content:"\f3d1"}.fa-money-bill-wave:before{content:"\f53a"}.fa-money-bill-wave-alt:before{content:"\f53b"}.fa-money-check:before{content:"\f53c"}.fa-money-check-alt:before{content:"\f53d"}.fa-monument:before{content:"\f5a6"}.fa-moon:before{content:"\f186"}.fa-mortar-pestle:before{content:"\f5a7"}.fa-mosque:before{content:"\f678"}.fa-motorcycle:before{content:"\f21c"}.fa-mountain:before{content:"\f6fc"}.fa-mouse-pointer:before{content:"\f245"}.fa-mug-hot:before{content:"\f7b6"}.fa-music:before{content:"\f001"}.fa-napster:before{content:"\f3d2"}.fa-neos:before{content:"\f612"}.fa-network-wired:before{content:"\f6ff"}.fa-neuter:before{content:"\f22c"}.fa-newspaper:before{content:"\f1ea"}.fa-nimblr:before{content:"\f5a8"}.fa-nintendo-switch:before{content:"\f418"}.fa-node:before{content:"\f419"}.fa-node-js:before{content:"\f3d3"}.fa-not-equal:before{content:"\f53e"}.fa-notes-medical:before{content:"\f481"}.fa-npm:before{content:"\f3d4"}.fa-ns8:before{content:"\f3d5"}.fa-nutritionix:before{content:"\f3d6"}.fa-object-group:before{content:"\f247"}.fa-object-ungroup:before{content:"\f248"}.fa-odnoklassniki:before{content:"\f263"}.fa-odnoklassniki-square:before{content:"\f264"}.fa-oil-can:before{content:"\f613"}.fa-old-republic:before{content:"\f510"}.fa-om:before{content:"\f679"}.fa-opencart:before{content:"\f23d"}.fa-openid:before{content:"\f19b"}.fa-opera:before{content:"\f26a"}.fa-optin-monster:before{content:"\f23c"}.fa-osi:before{content:"\f41a"}.fa-otter:before{content:"\f700"}.fa-outdent:before{content:"\f03b"}.fa-page4:before{content:"\f3d7"}.fa-pagelines:before{content:"\f18c"}.fa-paint-brush:before{content:"\f1fc"}.fa-paint-roller:before{content:"\f5aa"}.fa-palette:before{content:"\f53f"}.fa-palfed:before{content:"\f3d8"}.fa-pallet:before{content:"\f482"}.fa-paper-plane:before{content:"\f1d8"}.fa-paperclip:before{content:"\f0c6"}.fa-parachute-box:before{content:"\f4cd"}.fa-paragraph:before{content:"\f1dd"}.fa-parking:before{content:"\f540"}.fa-passport:before{content:"\f5ab"}.fa-pastafarianism:before{content:"\f67b"}.fa-paste:before{content:"\f0ea"}.fa-patreon:before{content:"\f3d9"}.fa-pause:before{content:"\f04c"}.fa-pause-circle:before{content:"\f28b"}.fa-paw:before{content:"\f1b0"}.fa-paypal:before{content:"\f1ed"}.fa-peace:before{content:"\f67c"}.fa-pen:before{content:"\f304"}.fa-pen-alt:before{content:"\f305"}.fa-pen-fancy:before{content:"\f5ac"}.fa-pen-nib:before{content:"\f5ad"}.fa-pen-square:before{content:"\f14b"}.fa-pencil-alt:before{content:"\f303"}.fa-pencil-ruler:before{content:"\f5ae"}.fa-penny-arcade:before{content:"\f704"}.fa-people-carry:before{content:"\f4ce"}.fa-percent:before{content:"\f295"}.fa-percentage:before{content:"\f541"}.fa-periscope:before{content:"\f3da"}.fa-person-booth:before{content:"\f756"}.fa-phabricator:before{content:"\f3db"}.fa-phoenix-framework:before{content:"\f3dc"}.fa-phoenix-squadron:before{content:"\f511"}.fa-phone:before{content:"\f095"}.fa-phone-slash:before{content:"\f3dd"}.fa-phone-square:before{content:"\f098"}.fa-phone-volume:before{content:"\f2a0"}.fa-php:before{content:"\f457"}.fa-pied-piper:before{content:"\f2ae"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-pied-piper-hat:before{content:"\f4e5"}.fa-pied-piper-pp:before{content:"\f1a7"}.fa-piggy-bank:before{content:"\f4d3"}.fa-pills:before{content:"\f484"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-p:before{content:"\f231"}.fa-pinterest-square:before{content:"\f0d3"}.fa-place-of-worship:before{content:"\f67f"}.fa-plane:before{content:"\f072"}.fa-plane-arrival:before{content:"\f5af"}.fa-plane-departure:before{content:"\f5b0"}.fa-play:before{content:"\f04b"}.fa-play-circle:before{content:"\f144"}.fa-playstation:before{content:"\f3df"}.fa-plug:before{content:"\f1e6"}.fa-plus:before{content:"\f067"}.fa-plus-circle:before{content:"\f055"}.fa-plus-square:before{content:"\f0fe"}.fa-podcast:before{content:"\f2ce"}.fa-poll:before{content:"\f681"}.fa-poll-h:before{content:"\f682"}.fa-poo:before{content:"\f2fe"}.fa-poo-storm:before{content:"\f75a"}.fa-poop:before{content:"\f619"}.fa-portrait:before{content:"\f3e0"}.fa-pound-sign:before{content:"\f154"}.fa-power-off:before{content:"\f011"}.fa-pray:before{content:"\f683"}.fa-praying-hands:before{content:"\f684"}.fa-prescription:before{content:"\f5b1"}.fa-prescription-bottle:before{content:"\f485"}.fa-prescription-bottle-alt:before{content:"\f486"}.fa-print:before{content:"\f02f"}.fa-procedures:before{content:"\f487"}.fa-product-hunt:before{content:"\f288"}.fa-project-diagram:before{content:"\f542"}.fa-pushed:before{content:"\f3e1"}.fa-puzzle-piece:before{content:"\f12e"}.fa-python:before{content:"\f3e2"}.fa-qq:before{content:"\f1d6"}.fa-qrcode:before{content:"\f029"}.fa-question:before{content:"\f128"}.fa-question-circle:before{content:"\f059"}.fa-quidditch:before{content:"\f458"}.fa-quinscape:before{content:"\f459"}.fa-quora:before{content:"\f2c4"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-quran:before{content:"\f687"}.fa-r-project:before{content:"\f4f7"}.fa-radiation:before{content:"\f7b9"}.fa-radiation-alt:before{content:"\f7ba"}.fa-rainbow:before{content:"\f75b"}.fa-random:before{content:"\f074"}.fa-raspberry-pi:before{content:"\f7bb"}.fa-ravelry:before{content:"\f2d9"}.fa-react:before{content:"\f41b"}.fa-reacteurope:before{content:"\f75d"}.fa-readme:before{content:"\f4d5"}.fa-rebel:before{content:"\f1d0"}.fa-receipt:before{content:"\f543"}.fa-recycle:before{content:"\f1b8"}.fa-red-river:before{content:"\f3e3"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-alien:before{content:"\f281"}.fa-reddit-square:before{content:"\f1a2"}.fa-redhat:before{content:"\f7bc"}.fa-redo:before{content:"\f01e"}.fa-redo-alt:before{content:"\f2f9"}.fa-registered:before{content:"\f25d"}.fa-renren:before{content:"\f18b"}.fa-reply:before{content:"\f3e5"}.fa-reply-all:before{content:"\f122"}.fa-replyd:before{content:"\f3e6"}.fa-republican:before{content:"\f75e"}.fa-researchgate:before{content:"\f4f8"}.fa-resolving:before{content:"\f3e7"}.fa-restroom:before{content:"\f7bd"}.fa-retweet:before{content:"\f079"}.fa-rev:before{content:"\f5b2"}.fa-ribbon:before{content:"\f4d6"}.fa-ring:before{content:"\f70b"}.fa-road:before{content:"\f018"}.fa-robot:before{content:"\f544"}.fa-rocket:before{content:"\f135"}.fa-rocketchat:before{content:"\f3e8"}.fa-rockrms:before{content:"\f3e9"}.fa-route:before{content:"\f4d7"}.fa-rss:before{content:"\f09e"}.fa-rss-square:before{content:"\f143"}.fa-ruble-sign:before{content:"\f158"}.fa-ruler:before{content:"\f545"}.fa-ruler-combined:before{content:"\f546"}.fa-ruler-horizontal:before{content:"\f547"}.fa-ruler-vertical:before{content:"\f548"}.fa-running:before{content:"\f70c"}.fa-rupee-sign:before{content:"\f156"}.fa-sad-cry:before{content:"\f5b3"}.fa-sad-tear:before{content:"\f5b4"}.fa-safari:before{content:"\f267"}.fa-sass:before{content:"\f41e"}.fa-satellite:before{content:"\f7bf"}.fa-satellite-dish:before{content:"\f7c0"}.fa-save:before{content:"\f0c7"}.fa-schlix:before{content:"\f3ea"}.fa-school:before{content:"\f549"}.fa-screwdriver:before{content:"\f54a"}.fa-scribd:before{content:"\f28a"}.fa-scroll:before{content:"\f70e"}.fa-sd-card:before{content:"\f7c2"}.fa-search:before{content:"\f002"}.fa-search-dollar:before{content:"\f688"}.fa-search-location:before{content:"\f689"}.fa-search-minus:before{content:"\f010"}.fa-search-plus:before{content:"\f00e"}.fa-searchengin:before{content:"\f3eb"}.fa-seedling:before{content:"\f4d8"}.fa-sellcast:before{content:"\f2da"}.fa-sellsy:before{content:"\f213"}.fa-server:before{content:"\f233"}.fa-servicestack:before{content:"\f3ec"}.fa-shapes:before{content:"\f61f"}.fa-share:before{content:"\f064"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-share-square:before{content:"\f14d"}.fa-shekel-sign:before{content:"\f20b"}.fa-shield-alt:before{content:"\f3ed"}.fa-ship:before{content:"\f21a"}.fa-shipping-fast:before{content:"\f48b"}.fa-shirtsinbulk:before{content:"\f214"}.fa-shoe-prints:before{content:"\f54b"}.fa-shopping-bag:before{content:"\f290"}.fa-shopping-basket:before{content:"\f291"}.fa-shopping-cart:before{content:"\f07a"}.fa-shopware:before{content:"\f5b5"}.fa-shower:before{content:"\f2cc"}.fa-shuttle-van:before{content:"\f5b6"}.fa-sign:before{content:"\f4d9"}.fa-sign-in-alt:before{content:"\f2f6"}.fa-sign-language:before{content:"\f2a7"}.fa-sign-out-alt:before{content:"\f2f5"}.fa-signal:before{content:"\f012"}.fa-signature:before{content:"\f5b7"}.fa-sim-card:before{content:"\f7c4"}.fa-simplybuilt:before{content:"\f215"}.fa-sistrix:before{content:"\f3ee"}.fa-sitemap:before{content:"\f0e8"}.fa-sith:before{content:"\f512"}.fa-skating:before{content:"\f7c5"}.fa-sketch:before{content:"\f7c6"}.fa-skiing:before{content:"\f7c9"}.fa-skiing-nordic:before{content:"\f7ca"}.fa-skull:before{content:"\f54c"}.fa-skull-crossbones:before{content:"\f714"}.fa-skyatlas:before{content:"\f216"}.fa-skype:before{content:"\f17e"}.fa-slack:before{content:"\f198"}.fa-slack-hash:before{content:"\f3ef"}.fa-slash:before{content:"\f715"}.fa-sleigh:before{content:"\f7cc"}.fa-sliders-h:before{content:"\f1de"}.fa-slideshare:before{content:"\f1e7"}.fa-smile:before{content:"\f118"}.fa-smile-beam:before{content:"\f5b8"}.fa-smile-wink:before{content:"\f4da"}.fa-smog:before{content:"\f75f"}.fa-smoking:before{content:"\f48d"}.fa-smoking-ban:before{content:"\f54d"}.fa-sms:before{content:"\f7cd"}.fa-snapchat:before{content:"\f2ab"}.fa-snapchat-ghost:before{content:"\f2ac"}.fa-snapchat-square:before{content:"\f2ad"}.fa-snowboarding:before{content:"\f7ce"}.fa-snowflake:before{content:"\f2dc"}.fa-snowman:before{content:"\f7d0"}.fa-snowplow:before{content:"\f7d2"}.fa-socks:before{content:"\f696"}.fa-solar-panel:before{content:"\f5ba"}.fa-sort:before{content:"\f0dc"}.fa-sort-alpha-down:before{content:"\f15d"}.fa-sort-alpha-up:before{content:"\f15e"}.fa-sort-amount-down:before{content:"\f160"}.fa-sort-amount-up:before{content:"\f161"}.fa-sort-down:before{content:"\f0dd"}.fa-sort-numeric-down:before{content:"\f162"}.fa-sort-numeric-up:before{content:"\f163"}.fa-sort-up:before{content:"\f0de"}.fa-soundcloud:before{content:"\f1be"}.fa-sourcetree:before{content:"\f7d3"}.fa-spa:before{content:"\f5bb"}.fa-space-shuttle:before{content:"\f197"}.fa-speakap:before{content:"\f3f3"}.fa-spider:before{content:"\f717"}.fa-spinner:before{content:"\f110"}.fa-splotch:before{content:"\f5bc"}.fa-spotify:before{content:"\f1bc"}.fa-spray-can:before{content:"\f5bd"}.fa-square:before{content:"\f0c8"}.fa-square-full:before{content:"\f45c"}.fa-square-root-alt:before{content:"\f698"}.fa-squarespace:before{content:"\f5be"}.fa-stack-exchange:before{content:"\f18d"}.fa-stack-overflow:before{content:"\f16c"}.fa-stamp:before{content:"\f5bf"}.fa-star:before{content:"\f005"}.fa-star-and-crescent:before{content:"\f699"}.fa-star-half:before{content:"\f089"}.fa-star-half-alt:before{content:"\f5c0"}.fa-star-of-david:before{content:"\f69a"}.fa-star-of-life:before{content:"\f621"}.fa-staylinked:before{content:"\f3f5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-steam-symbol:before{content:"\f3f6"}.fa-step-backward:before{content:"\f048"}.fa-step-forward:before{content:"\f051"}.fa-stethoscope:before{content:"\f0f1"}.fa-sticker-mule:before{content:"\f3f7"}.fa-sticky-note:before{content:"\f249"}.fa-stop:before{content:"\f04d"}.fa-stop-circle:before{content:"\f28d"}.fa-stopwatch:before{content:"\f2f2"}.fa-store:before{content:"\f54e"}.fa-store-alt:before{content:"\f54f"}.fa-strava:before{content:"\f428"}.fa-stream:before{content:"\f550"}.fa-street-view:before{content:"\f21d"}.fa-strikethrough:before{content:"\f0cc"}.fa-stripe:before{content:"\f429"}.fa-stripe-s:before{content:"\f42a"}.fa-stroopwafel:before{content:"\f551"}.fa-studiovinari:before{content:"\f3f8"}.fa-stumbleupon:before{content:"\f1a4"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-subscript:before{content:"\f12c"}.fa-subway:before{content:"\f239"}.fa-suitcase:before{content:"\f0f2"}.fa-suitcase-rolling:before{content:"\f5c1"}.fa-sun:before{content:"\f185"}.fa-superpowers:before{content:"\f2dd"}.fa-superscript:before{content:"\f12b"}.fa-supple:before{content:"\f3f9"}.fa-surprise:before{content:"\f5c2"}.fa-suse:before{content:"\f7d6"}.fa-swatchbook:before{content:"\f5c3"}.fa-swimmer:before{content:"\f5c4"}.fa-swimming-pool:before{content:"\f5c5"}.fa-synagogue:before{content:"\f69b"}.fa-sync:before{content:"\f021"}.fa-sync-alt:before{content:"\f2f1"}.fa-syringe:before{content:"\f48e"}.fa-table:before{content:"\f0ce"}.fa-table-tennis:before{content:"\f45d"}.fa-tablet:before{content:"\f10a"}.fa-tablet-alt:before{content:"\f3fa"}.fa-tablets:before{content:"\f490"}.fa-tachometer-alt:before{content:"\f3fd"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-tape:before{content:"\f4db"}.fa-tasks:before{content:"\f0ae"}.fa-taxi:before{content:"\f1ba"}.fa-teamspeak:before{content:"\f4f9"}.fa-teeth:before{content:"\f62e"}.fa-teeth-open:before{content:"\f62f"}.fa-telegram:before{content:"\f2c6"}.fa-telegram-plane:before{content:"\f3fe"}.fa-temperature-high:before{content:"\f769"}.fa-temperature-low:before{content:"\f76b"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-tenge:before{content:"\f7d7"}.fa-terminal:before{content:"\f120"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-th:before{content:"\f00a"}.fa-th-large:before{content:"\f009"}.fa-th-list:before{content:"\f00b"}.fa-the-red-yeti:before{content:"\f69d"}.fa-theater-masks:before{content:"\f630"}.fa-themeco:before{content:"\f5c6"}.fa-themeisle:before{content:"\f2b2"}.fa-thermometer:before{content:"\f491"}.fa-thermometer-empty:before{content:"\f2cb"}.fa-thermometer-full:before{content:"\f2c7"}.fa-thermometer-half:before{content:"\f2c9"}.fa-thermometer-quarter:before{content:"\f2ca"}.fa-thermometer-three-quarters:before{content:"\f2c8"}.fa-think-peaks:before{content:"\f731"}.fa-thumbs-down:before{content:"\f165"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbtack:before{content:"\f08d"}.fa-ticket-alt:before{content:"\f3ff"}.fa-times:before{content:"\f00d"}.fa-times-circle:before{content:"\f057"}.fa-tint:before{content:"\f043"}.fa-tint-slash:before{content:"\f5c7"}.fa-tired:before{content:"\f5c8"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-toilet:before{content:"\f7d8"}.fa-toilet-paper:before{content:"\f71e"}.fa-toolbox:before{content:"\f552"}.fa-tools:before{content:"\f7d9"}.fa-tooth:before{content:"\f5c9"}.fa-torah:before{content:"\f6a0"}.fa-torii-gate:before{content:"\f6a1"}.fa-tractor:before{content:"\f722"}.fa-trade-federation:before{content:"\f513"}.fa-trademark:before{content:"\f25c"}.fa-traffic-light:before{content:"\f637"}.fa-train:before{content:"\f238"}.fa-tram:before{content:"\f7da"}.fa-transgender:before{content:"\f224"}.fa-transgender-alt:before{content:"\f225"}.fa-trash:before{content:"\f1f8"}.fa-trash-alt:before{content:"\f2ed"}.fa-tree:before{content:"\f1bb"}.fa-trello:before{content:"\f181"}.fa-tripadvisor:before{content:"\f262"}.fa-trophy:before{content:"\f091"}.fa-truck:before{content:"\f0d1"}.fa-truck-loading:before{content:"\f4de"}.fa-truck-monster:before{content:"\f63b"}.fa-truck-moving:before{content:"\f4df"}.fa-truck-pickup:before{content:"\f63c"}.fa-tshirt:before{content:"\f553"}.fa-tty:before{content:"\f1e4"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-tv:before{content:"\f26c"}.fa-twitch:before{content:"\f1e8"}.fa-twitter:before{content:"\f099"}.fa-twitter-square:before{content:"\f081"}.fa-typo3:before{content:"\f42b"}.fa-uber:before{content:"\f402"}.fa-ubuntu:before{content:"\f7df"}.fa-uikit:before{content:"\f403"}.fa-umbrella:before{content:"\f0e9"}.fa-umbrella-beach:before{content:"\f5ca"}.fa-underline:before{content:"\f0cd"}.fa-undo:before{content:"\f0e2"}.fa-undo-alt:before{content:"\f2ea"}.fa-uniregistry:before{content:"\f404"}.fa-universal-access:before{content:"\f29a"}.fa-university:before{content:"\f19c"}.fa-unlink:before{content:"\f127"}.fa-unlock:before{content:"\f09c"}.fa-unlock-alt:before{content:"\f13e"}.fa-untappd:before{content:"\f405"}.fa-upload:before{content:"\f093"}.fa-ups:before{content:"\f7e0"}.fa-usb:before{content:"\f287"}.fa-user:before{content:"\f007"}.fa-user-alt:before{content:"\f406"}.fa-user-alt-slash:before{content:"\f4fa"}.fa-user-astronaut:before{content:"\f4fb"}.fa-user-check:before{content:"\f4fc"}.fa-user-circle:before{content:"\f2bd"}.fa-user-clock:before{content:"\f4fd"}.fa-user-cog:before{content:"\f4fe"}.fa-user-edit:before{content:"\f4ff"}.fa-user-friends:before{content:"\f500"}.fa-user-graduate:before{content:"\f501"}.fa-user-injured:before{content:"\f728"}.fa-user-lock:before{content:"\f502"}.fa-user-md:before{content:"\f0f0"}.fa-user-minus:before{content:"\f503"}.fa-user-ninja:before{content:"\f504"}.fa-user-plus:before{content:"\f234"}.fa-user-secret:before{content:"\f21b"}.fa-user-shield:before{content:"\f505"}.fa-user-slash:before{content:"\f506"}.fa-user-tag:before{content:"\f507"}.fa-user-tie:before{content:"\f508"}.fa-user-times:before{content:"\f235"}.fa-users:before{content:"\f0c0"}.fa-users-cog:before{content:"\f509"}.fa-usps:before{content:"\f7e1"}.fa-ussunnah:before{content:"\f407"}.fa-utensil-spoon:before{content:"\f2e5"}.fa-utensils:before{content:"\f2e7"}.fa-vaadin:before{content:"\f408"}.fa-vector-square:before{content:"\f5cb"}.fa-venus:before{content:"\f221"}.fa-venus-double:before{content:"\f226"}.fa-venus-mars:before{content:"\f228"}.fa-viacoin:before{content:"\f237"}.fa-viadeo:before{content:"\f2a9"}.fa-viadeo-square:before{content:"\f2aa"}.fa-vial:before{content:"\f492"}.fa-vials:before{content:"\f493"}.fa-viber:before{content:"\f409"}.fa-video:before{content:"\f03d"}.fa-video-slash:before{content:"\f4e2"}.fa-vihara:before{content:"\f6a7"}.fa-vimeo:before{content:"\f40a"}.fa-vimeo-square:before{content:"\f194"}.fa-vimeo-v:before{content:"\f27d"}.fa-vine:before{content:"\f1ca"}.fa-vk:before{content:"\f189"}.fa-vnv:before{content:"\f40b"}.fa-volleyball-ball:before{content:"\f45f"}.fa-volume-down:before{content:"\f027"}.fa-volume-mute:before{content:"\f6a9"}.fa-volume-off:before{content:"\f026"}.fa-volume-up:before{content:"\f028"}.fa-vote-yea:before{content:"\f772"}.fa-vr-cardboard:before{content:"\f729"}.fa-vuejs:before{content:"\f41f"}.fa-walking:before{content:"\f554"}.fa-wallet:before{content:"\f555"}.fa-warehouse:before{content:"\f494"}.fa-water:before{content:"\f773"}.fa-weebly:before{content:"\f5cc"}.fa-weibo:before{content:"\f18a"}.fa-weight:before{content:"\f496"}.fa-weight-hanging:before{content:"\f5cd"}.fa-weixin:before{content:"\f1d7"}.fa-whatsapp:before{content:"\f232"}.fa-whatsapp-square:before{content:"\f40c"}.fa-wheelchair:before{content:"\f193"}.fa-whmcs:before{content:"\f40d"}.fa-wifi:before{content:"\f1eb"}.fa-wikipedia-w:before{content:"\f266"}.fa-wind:before{content:"\f72e"}.fa-window-close:before{content:"\f410"}.fa-window-maximize:before{content:"\f2d0"}.fa-window-minimize:before{content:"\f2d1"}.fa-window-restore:before{content:"\f2d2"}.fa-windows:before{content:"\f17a"}.fa-wine-bottle:before{content:"\f72f"}.fa-wine-glass:before{content:"\f4e3"}.fa-wine-glass-alt:before{content:"\f5ce"}.fa-wix:before{content:"\f5cf"}.fa-wizards-of-the-coast:before{content:"\f730"}.fa-wolf-pack-battalion:before{content:"\f514"}.fa-won-sign:before{content:"\f159"}.fa-wordpress:before{content:"\f19a"}.fa-wordpress-simple:before{content:"\f411"}.fa-wpbeginner:before{content:"\f297"}.fa-wpexplorer:before{content:"\f2de"}.fa-wpforms:before{content:"\f298"}.fa-wpressr:before{content:"\f3e4"}.fa-wrench:before{content:"\f0ad"}.fa-x-ray:before{content:"\f497"}.fa-xbox:before{content:"\f412"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-y-combinator:before{content:"\f23b"}.fa-yahoo:before{content:"\f19e"}.fa-yandex:before{content:"\f413"}.fa-yandex-international:before{content:"\f414"}.fa-yarn:before{content:"\f7e3"}.fa-yelp:before{content:"\f1e9"}.fa-yen-sign:before{content:"\f157"}.fa-yin-yang:before{content:"\f6ad"}.fa-yoast:before{content:"\f2b1"}.fa-youtube:before{content:"\f167"}.fa-youtube-square:before{content:"\f431"}.fa-zhihu:before{content:"\f63f"}.sr-only{border:0;clip:rect(0,0,0,0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.sr-only-focusable:active,.sr-only-focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}@font-face{font-family:"Font Awesome 5 Brands";font-style:normal;font-weight:normal;src:url(../webfonts/fa-brands-400.eot);src:url(../webfonts/fa-brands-400.eot?#iefix) format("embedded-opentype"),url(../webfonts/fa-brands-400.woff2) format("woff2"),url(../webfonts/fa-brands-400.woff) format("woff"),url(../webfonts/fa-brands-400.ttf) format("truetype"),url(../webfonts/fa-brands-400.svg#fontawesome) format("svg")}.fab{font-family:"Font Awesome 5 Brands"}@font-face{font-family:"Font Awesome 5 Free";font-style:normal;font-weight:400;src:url(../webfonts/fa-regular-400.eot);src:url(../webfonts/fa-regular-400.eot?#iefix) format("embedded-opentype"),url(../webfonts/fa-regular-400.woff2) format("woff2"),url(../webfonts/fa-regular-400.woff) format("woff"),url(../webfonts/fa-regular-400.ttf) format("truetype"),url(../webfonts/fa-regular-400.svg#fontawesome) format("svg")}.far{font-weight:400}@font-face{font-family:"Font Awesome 5 Free";font-style:normal;font-weight:900;src:url(../webfonts/fa-solid-900.eot);src:url(../webfonts/fa-solid-900.eot?#iefix) format("embedded-opentype"),url(../webfonts/fa-solid-900.woff2) format("woff2"),url(../webfonts/fa-solid-900.woff) format("woff"),url(../webfonts/fa-solid-900.ttf) format("truetype"),url(../webfonts/fa-solid-900.svg#fontawesome) format("svg")}.fa,.far,.fas{font-family:"Font Awesome 5 Free"}.fa,.fas{font-weight:900} \ No newline at end of file diff --git a/docs/22.2.3/css/hugo-theme.css b/docs/22.2.3/css/hugo-theme.css new file mode 100644 index 000000000..741cab196 --- /dev/null +++ b/docs/22.2.3/css/hugo-theme.css @@ -0,0 +1,254 @@ +/* Insert here special css for hugo theme, on top of any other imported css */ + + +/* Table of contents */ + +.progress ul { + list-style: none; + margin: 0; + padding: 0 5px; +} + +#TableOfContents { + font-size: 13px !important; + max-height: 85vh; + overflow: auto; + padding: 15px !important; +} + + +#TableOfContents > ul > li > ul > li > ul li { + margin-right: 8px; +} + +#TableOfContents > ul > li > a { + font-weight: bold; padding: 0 18px; margin: 0 2px; +} + +#TableOfContents > ul > li > ul > li > a { + font-weight: bold; +} + +#TableOfContents > ul > li > ul > li > ul > li > ul > li > ul > li { + display: none; +} + +body { + font-size: 16px !important; + color: #323232 !important; +} + +#body a.highlight, #body a.highlight:hover, #body a.highlight:focus { + text-decoration: none; + outline: none; + outline: 0; +} +#body a.highlight { + line-height: 1.1; + display: inline-block; +} +#body a.highlight:after { + display: block; + content: ""; + height: 1px; + width: 0%; + background-color: #0082a7; /*#CE3B2F*/ + -webkit-transition: width 0.5s ease; + -moz-transition: width 0.5s ease; + -ms-transition: width 0.5s ease; + transition: width 0.5s ease; +} +#body a.highlight:hover:after, #body a.highlight:focus:after { + width: 100%; +} +.progress { + position:absolute; + background-color: rgba(246, 246, 246, 0.97); + width: auto; + border: thin solid #ECECEC; + display:none; + z-index:200; +} + +#toc-menu { + border-right: thin solid #DAD8D8 !important; + padding-right: 1rem !important; + margin-right: 0.5rem !important; +} + +#sidebar-toggle-span { + border-right: thin solid #DAD8D8 !important; + padding-right: 0.5rem !important; + margin-right: 1rem !important; +} + +.btn { + display: inline-block !important; + padding: 6px 12px !important; + margin-bottom: 0 !important; + font-size: 14px !important; + font-weight: normal !important; + line-height: 1.42857143 !important; + text-align: center !important; + white-space: nowrap !important; + vertical-align: middle !important; + -ms-touch-action: manipulation !important; + touch-action: manipulation !important; + cursor: pointer !important; + -webkit-user-select: none !important; + -moz-user-select: none !important; + -ms-user-select: none !important; + user-select: none !important; + background-image: none !important; + border: 1px solid transparent !important; + border-radius: 4px !important; + -webkit-transition: all 0.15s !important; + -moz-transition: all 0.15s !important; + transition: all 0.15s !important; +} +.btn:focus { + /*outline: thin dotted; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px;*/ + outline: none !important; +} +.btn:hover, +.btn:focus { + color: #2b2b2b !important; + text-decoration: none !important; +} + +.btn-default { + color: #333 !important; + background-color: #fff !important; + border-color: #ccc !important; +} +.btn-default:hover, +.btn-default:focus, +.btn-default:active { + color: #fff !important; + background-color: #9e9e9e !important; + border-color: #9e9e9e !important; +} +.btn-default:active { + background-image: none !important; +} + +/* anchors */ +.anchor { + color: #00bdf3; + font-size: 0.5em; + cursor:pointer; + visibility:hidden; + margin-left: 0.5em; + position: absolute; + margin-top:0.1em; +} + +h2:hover .anchor, h3:hover .anchor, h4:hover .anchor, h5:hover .anchor, h6:hover .anchor { + visibility:visible; +} + +/* Redfines headers style */ + +h2, h3, h4, h5, h6 { + font-weight: 400; + line-height: 1.1; +} + +h1 a, h2 a, h3 a, h4 a, h5 a, h6 a { + font-weight: inherit; +} + +h2 { + font-size: 2.5rem; + line-height: 110% !important; + margin: 2.5rem 0 1.5rem 0; +} + +h3 { + font-size: 2rem; + line-height: 110% !important; + margin: 2rem 0 1rem 0; +} + +h4 { + font-size: 1.5rem; + line-height: 110% !important; + margin: 1.5rem 0 0.75rem 0; +} + +h5 { + font-size: 1rem; + line-height: 110% !important; + margin: 1rem 0 0.2rem 0; +} + +h6 { + font-size: 0.5rem; + line-height: 110% !important; + margin: 0.5rem 0 0.2rem 0; +} + +p { + margin: 1rem 0; +} + +figcaption h4 { + font-weight: 300 !important; + opacity: .85; + font-size: 1em; + text-align: center; + margin-top: -1.5em; +} + +.select-style { + border: 0; + width: 150px; + border-radius: 0px; + overflow: hidden; + display: inline-flex; +} + +.select-style svg { + fill: #ccc; + width: 14px; + height: 14px; + pointer-events: none; + margin: auto; +} + +.select-style svg:hover { + fill: #e6e6e6; +} + +.select-style select { + padding: 0; + width: 130%; + border: none; + box-shadow: none; + background: transparent; + background-image: none; + -webkit-appearance: none; + margin: auto; + margin-left: 0px; + margin-right: -20px; +} + +.select-style select:focus { + outline: none; +} + +.select-style :hover { + cursor: pointer; +} + +@media only all and (max-width: 47.938em) { + #breadcrumbs .links, #top-github-link-text { + display: none; + } +} + +.is-sticky #top-bar { + box-shadow: -1px 2px 5px 1px rgba(0, 0, 0, 0.1); +} \ No newline at end of file diff --git a/docs/22.2.3/css/hybrid.css b/docs/22.2.3/css/hybrid.css new file mode 100644 index 000000000..29735a189 --- /dev/null +++ b/docs/22.2.3/css/hybrid.css @@ -0,0 +1,102 @@ +/* + +vim-hybrid theme by w0ng (https://github.com/w0ng/vim-hybrid) + +*/ + +/*background color*/ +.hljs { + display: block; + overflow-x: auto; + padding: 0.5em; + background: #1d1f21; +} + +/*selection color*/ +.hljs::selection, +.hljs span::selection { + background: #373b41; +} + +.hljs::-moz-selection, +.hljs span::-moz-selection { + background: #373b41; +} + +/*foreground color*/ +.hljs { + color: #c5c8c6; +} + +/*color: fg_yellow*/ +.hljs-title, +.hljs-name { + color: #f0c674; +} + +/*color: fg_comment*/ +.hljs-comment, +.hljs-meta, +.hljs-meta .hljs-keyword { + color: #707880; +} + +/*color: fg_red*/ +.hljs-number, +.hljs-symbol, +.hljs-literal, +.hljs-deletion, +.hljs-link { + color: #cc6666 +} + +/*color: fg_green*/ +.hljs-string, +.hljs-doctag, +.hljs-addition, +.hljs-regexp, +.hljs-selector-attr, +.hljs-selector-pseudo { + color: #b5bd68; +} + +/*color: fg_purple*/ +.hljs-attribute, +.hljs-code, +.hljs-selector-id { + color: #b294bb; +} + +/*color: fg_blue*/ +.hljs-keyword, +.hljs-selector-tag, +.hljs-bullet, +.hljs-tag { + color: #81a2be; +} + +/*color: fg_aqua*/ +.hljs-subst, +.hljs-variable, +.hljs-template-tag, +.hljs-template-variable { + color: #8abeb7; +} + +/*color: fg_orange*/ +.hljs-type, +.hljs-built_in, +.hljs-builtin-name, +.hljs-quote, +.hljs-section, +.hljs-selector-class { + color: #de935f; +} + +.hljs-emphasis { + font-style: italic; +} + +.hljs-strong { + font-weight: bold; +} diff --git a/docs/22.2.3/css/nucleus.css b/docs/22.2.3/css/nucleus.css new file mode 100644 index 000000000..1897fc5d6 --- /dev/null +++ b/docs/22.2.3/css/nucleus.css @@ -0,0 +1,615 @@ +*, *::before, *::after { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; } + +@-webkit-viewport { + width: device-width; } +@-moz-viewport { + width: device-width; } +@-ms-viewport { + width: device-width; } +@-o-viewport { + width: device-width; } +@viewport { + width: device-width; } +html { + font-size: 100%; + -ms-text-size-adjust: 100%; + -webkit-text-size-adjust: 100%; } + +body { + margin: 0; } + +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +main, +nav, +section, +summary { + display: block; } + +audio, +canvas, +progress, +video { + display: inline-block; + vertical-align: baseline; } + +audio:not([controls]) { + display: none; + height: 0; } + +[hidden], +template { + display: none; } + +a { + background: transparent; + text-decoration: none; } + +a:active, +a:hover { + outline: 0; } + +abbr[title] { + border-bottom: 1px dotted; } + +b, +strong { + font-weight: bold; } + +dfn { + font-style: italic; } + +mark { + background: #FFFF27; + color: #333; } + +sub, +sup { + font-size: 0.8rem; + line-height: 0; + position: relative; + vertical-align: baseline; } + +sup { + top: -0.5em; } + +sub { + bottom: -0.25em; } + +img { + border: 0; + max-width: 100%; } + +svg:not(:root) { + overflow: hidden; } + +figure { + margin: 1em 40px; } + +hr { + height: 0; } + +pre { + overflow: auto; } + +button, +input, +optgroup, +select, +textarea { + color: inherit; + font: inherit; + margin: 0; } + +button { + overflow: visible; } + +button, +select { + text-transform: none; } + +button, +html input[type="button"], +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; + cursor: pointer; } + +button[disabled], +html input[disabled] { + cursor: default; } + +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; } + +input { + line-height: normal; } + +input[type="checkbox"], +input[type="radio"] { + padding: 0; } + +input[type="number"]::-webkit-inner-spin-button, +input[type="number"]::-webkit-outer-spin-button { + height: auto; } + +input[type="search"] { + -webkit-appearance: textfield; } + +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; } + +legend { + border: 0; + padding: 0; } + +textarea { + overflow: auto; } + +optgroup { + font-weight: bold; } + +table { + border-collapse: collapse; + border-spacing: 0; + table-layout: fixed; + width: 100%; } + +tr, td, th { + vertical-align: middle; } + +th, td { + padding: 0.425rem 0; } + +th { + text-align: left; } + +.container { + width: 75em; + margin: 0 auto; + padding: 0; } + @media only all and (min-width: 60em) and (max-width: 74.938em) { + .container { + width: 60em; } } + @media only all and (min-width: 48em) and (max-width: 59.938em) { + .container { + width: 48em; } } + @media only all and (min-width: 30.063em) and (max-width: 47.938em) { + .container { + width: 30em; } } + @media only all and (max-width: 30em) { + .container { + width: 100%; } } + +.grid { + display: -webkit-box; + display: -moz-box; + display: box; + display: -webkit-flex; + display: -moz-flex; + display: -ms-flexbox; + display: flex; + -webkit-flex-flow: row; + -moz-flex-flow: row; + flex-flow: row; + list-style: none; + margin: 0; + padding: 0; } + @media only all and (max-width: 47.938em) { + .grid { + -webkit-flex-flow: row wrap; + -moz-flex-flow: row wrap; + flex-flow: row wrap; } } + +.block { + -webkit-box-flex: 1; + -moz-box-flex: 1; + box-flex: 1; + -webkit-flex: 1; + -moz-flex: 1; + -ms-flex: 1; + flex: 1; + min-width: 0; + min-height: 0; } + @media only all and (max-width: 47.938em) { + .block { + -webkit-box-flex: 0; + -moz-box-flex: 0; + box-flex: 0; + -webkit-flex: 0 100%; + -moz-flex: 0 100%; + -ms-flex: 0 100%; + flex: 0 100%; } } + +.content { + margin: 0.625rem; + padding: 0.938rem; } + +@media only all and (max-width: 47.938em) { + body [class*="size-"] { + -webkit-box-flex: 0; + -moz-box-flex: 0; + box-flex: 0; + -webkit-flex: 0 100%; + -moz-flex: 0 100%; + -ms-flex: 0 100%; + flex: 0 100%; } } + +.size-1-2 { + -webkit-box-flex: 0; + -moz-box-flex: 0; + box-flex: 0; + -webkit-flex: 0 50%; + -moz-flex: 0 50%; + -ms-flex: 0 50%; + flex: 0 50%; } + +.size-1-3 { + -webkit-box-flex: 0; + -moz-box-flex: 0; + box-flex: 0; + -webkit-flex: 0 33.33333%; + -moz-flex: 0 33.33333%; + -ms-flex: 0 33.33333%; + flex: 0 33.33333%; } + +.size-1-4 { + -webkit-box-flex: 0; + -moz-box-flex: 0; + box-flex: 0; + -webkit-flex: 0 25%; + -moz-flex: 0 25%; + -ms-flex: 0 25%; + flex: 0 25%; } + +.size-1-5 { + -webkit-box-flex: 0; + -moz-box-flex: 0; + box-flex: 0; + -webkit-flex: 0 20%; + -moz-flex: 0 20%; + -ms-flex: 0 20%; + flex: 0 20%; } + +.size-1-6 { + -webkit-box-flex: 0; + -moz-box-flex: 0; + box-flex: 0; + -webkit-flex: 0 16.66667%; + -moz-flex: 0 16.66667%; + -ms-flex: 0 16.66667%; + flex: 0 16.66667%; } + +.size-1-7 { + -webkit-box-flex: 0; + -moz-box-flex: 0; + box-flex: 0; + -webkit-flex: 0 14.28571%; + -moz-flex: 0 14.28571%; + -ms-flex: 0 14.28571%; + flex: 0 14.28571%; } + +.size-1-8 { + -webkit-box-flex: 0; + -moz-box-flex: 0; + box-flex: 0; + -webkit-flex: 0 12.5%; + -moz-flex: 0 12.5%; + -ms-flex: 0 12.5%; + flex: 0 12.5%; } + +.size-1-9 { + -webkit-box-flex: 0; + -moz-box-flex: 0; + box-flex: 0; + -webkit-flex: 0 11.11111%; + -moz-flex: 0 11.11111%; + -ms-flex: 0 11.11111%; + flex: 0 11.11111%; } + +.size-1-10 { + -webkit-box-flex: 0; + -moz-box-flex: 0; + box-flex: 0; + -webkit-flex: 0 10%; + -moz-flex: 0 10%; + -ms-flex: 0 10%; + flex: 0 10%; } + +.size-1-11 { + -webkit-box-flex: 0; + -moz-box-flex: 0; + box-flex: 0; + -webkit-flex: 0 9.09091%; + -moz-flex: 0 9.09091%; + -ms-flex: 0 9.09091%; + flex: 0 9.09091%; } + +.size-1-12 { + -webkit-box-flex: 0; + -moz-box-flex: 0; + box-flex: 0; + -webkit-flex: 0 8.33333%; + -moz-flex: 0 8.33333%; + -ms-flex: 0 8.33333%; + flex: 0 8.33333%; } + +@media only all and (min-width: 48em) and (max-width: 59.938em) { + .size-tablet-1-2 { + -webkit-box-flex: 0; + -moz-box-flex: 0; + box-flex: 0; + -webkit-flex: 0 50%; + -moz-flex: 0 50%; + -ms-flex: 0 50%; + flex: 0 50%; } + + .size-tablet-1-3 { + -webkit-box-flex: 0; + -moz-box-flex: 0; + box-flex: 0; + -webkit-flex: 0 33.33333%; + -moz-flex: 0 33.33333%; + -ms-flex: 0 33.33333%; + flex: 0 33.33333%; } + + .size-tablet-1-4 { + -webkit-box-flex: 0; + -moz-box-flex: 0; + box-flex: 0; + -webkit-flex: 0 25%; + -moz-flex: 0 25%; + -ms-flex: 0 25%; + flex: 0 25%; } + + .size-tablet-1-5 { + -webkit-box-flex: 0; + -moz-box-flex: 0; + box-flex: 0; + -webkit-flex: 0 20%; + -moz-flex: 0 20%; + -ms-flex: 0 20%; + flex: 0 20%; } + + .size-tablet-1-6 { + -webkit-box-flex: 0; + -moz-box-flex: 0; + box-flex: 0; + -webkit-flex: 0 16.66667%; + -moz-flex: 0 16.66667%; + -ms-flex: 0 16.66667%; + flex: 0 16.66667%; } + + .size-tablet-1-7 { + -webkit-box-flex: 0; + -moz-box-flex: 0; + box-flex: 0; + -webkit-flex: 0 14.28571%; + -moz-flex: 0 14.28571%; + -ms-flex: 0 14.28571%; + flex: 0 14.28571%; } + + .size-tablet-1-8 { + -webkit-box-flex: 0; + -moz-box-flex: 0; + box-flex: 0; + -webkit-flex: 0 12.5%; + -moz-flex: 0 12.5%; + -ms-flex: 0 12.5%; + flex: 0 12.5%; } + + .size-tablet-1-9 { + -webkit-box-flex: 0; + -moz-box-flex: 0; + box-flex: 0; + -webkit-flex: 0 11.11111%; + -moz-flex: 0 11.11111%; + -ms-flex: 0 11.11111%; + flex: 0 11.11111%; } + + .size-tablet-1-10 { + -webkit-box-flex: 0; + -moz-box-flex: 0; + box-flex: 0; + -webkit-flex: 0 10%; + -moz-flex: 0 10%; + -ms-flex: 0 10%; + flex: 0 10%; } + + .size-tablet-1-11 { + -webkit-box-flex: 0; + -moz-box-flex: 0; + box-flex: 0; + -webkit-flex: 0 9.09091%; + -moz-flex: 0 9.09091%; + -ms-flex: 0 9.09091%; + flex: 0 9.09091%; } + + .size-tablet-1-12 { + -webkit-box-flex: 0; + -moz-box-flex: 0; + box-flex: 0; + -webkit-flex: 0 8.33333%; + -moz-flex: 0 8.33333%; + -ms-flex: 0 8.33333%; + flex: 0 8.33333%; } } +@media only all and (max-width: 47.938em) { + @supports not (flex-wrap: wrap) { + .grid { + display: block; + -webkit-box-lines: inherit; + -moz-box-lines: inherit; + box-lines: inherit; + -webkit-flex-wrap: inherit; + -moz-flex-wrap: inherit; + -ms-flex-wrap: inherit; + flex-wrap: inherit; } + + .block { + display: block; + -webkit-box-flex: inherit; + -moz-box-flex: inherit; + box-flex: inherit; + -webkit-flex: inherit; + -moz-flex: inherit; + -ms-flex: inherit; + flex: inherit; } } } +.first-block { + -webkit-box-ordinal-group: 0; + -webkit-order: -1; + -ms-flex-order: -1; + order: -1; } + +.last-block { + -webkit-box-ordinal-group: 2; + -webkit-order: 1; + -ms-flex-order: 1; + order: 1; } + +.fixed-blocks { + -webkit-flex-flow: row wrap; + -moz-flex-flow: row wrap; + flex-flow: row wrap; } + .fixed-blocks .block { + -webkit-box-flex: inherit; + -moz-box-flex: inherit; + box-flex: inherit; + -webkit-flex: inherit; + -moz-flex: inherit; + -ms-flex: inherit; + flex: inherit; + width: 25%; } + @media only all and (min-width: 60em) and (max-width: 74.938em) { + .fixed-blocks .block { + width: 33.33333%; } } + @media only all and (min-width: 48em) and (max-width: 59.938em) { + .fixed-blocks .block { + width: 50%; } } + @media only all and (max-width: 47.938em) { + .fixed-blocks .block { + width: 100%; } } + +body { + font-size: 1.05rem; + line-height: 1.7; } + +h1, h2, h3, h4, h5, h6 { + margin: 0.85rem 0 1.7rem 0; + text-rendering: optimizeLegibility; } + +h1 { + font-size: 3.25rem; } + +h2 { + font-size: 2.55rem; } + +h3 { + font-size: 2.15rem; } + +h4 { + font-size: 1.8rem; } + +h5 { + font-size: 1.4rem; } + +h6 { + font-size: 0.9rem; } + +p { + margin: 1.7rem 0; } + +ul, ol { + margin-top: 1.7rem; + margin-bottom: 1.7rem; } + ul ul, ul ol, ol ul, ol ol { + margin-top: 0; + margin-bottom: 0; } + +blockquote { + margin: 1.7rem 0; + padding-left: 0.85rem; } + +cite { + display: block; + font-size: 0.925rem; } + cite:before { + content: "\2014 \0020"; } + +pre { + margin: 1.7rem 0; + padding: 0.938rem; } + +code { + vertical-align: bottom; } + +small { + font-size: 0.925rem; } + +hr { + border-left: none; + border-right: none; + border-top: none; + margin: 1.7rem 0; } + +fieldset { + border: 0; + padding: 0.938rem; + margin: 0 0 1.7rem 0; } + +input, +label, +select { + display: block; } + +label { + margin-bottom: 0.425rem; } + label.required:after { + content: "*"; } + label abbr { + display: none; } + +textarea, input[type="email"], input[type="number"], input[type="password"], input[type="search"], input[type="tel"], input[type="text"], input[type="url"], input[type="color"], input[type="date"], input[type="datetime"], input[type="datetime-local"], input[type="month"], input[type="time"], input[type="week"], select[multiple=multiple] { + -webkit-transition: border-color; + -moz-transition: border-color; + transition: border-color; + border-radius: 0.1875rem; + margin-bottom: 0.85rem; + padding: 0.425rem 0.425rem; + width: 100%; } + textarea:focus, input[type="email"]:focus, input[type="number"]:focus, input[type="password"]:focus, input[type="search"]:focus, input[type="tel"]:focus, input[type="text"]:focus, input[type="url"]:focus, input[type="color"]:focus, input[type="date"]:focus, input[type="datetime"]:focus, input[type="datetime-local"]:focus, input[type="month"]:focus, input[type="time"]:focus, input[type="week"]:focus, select[multiple=multiple]:focus { + outline: none; } + +textarea { + resize: vertical; } + +input[type="checkbox"], input[type="radio"] { + display: inline; + margin-right: 0.425rem; } + +input[type="file"] { + width: 100%; } + +select { + width: auto; + max-width: 100%; + margin-bottom: 1.7rem; } + +button, +input[type="submit"] { + cursor: pointer; + user-select: none; + vertical-align: middle; + white-space: nowrap; + border: inherit; } diff --git a/docs/22.2.3/css/perfect-scrollbar.min.css b/docs/22.2.3/css/perfect-scrollbar.min.css new file mode 100644 index 000000000..ebd2cb43b --- /dev/null +++ b/docs/22.2.3/css/perfect-scrollbar.min.css @@ -0,0 +1,2 @@ +/* perfect-scrollbar v0.6.13 */ +.ps-container{-ms-touch-action:auto;touch-action:auto;overflow:hidden !important;-ms-overflow-style:none}@supports (-ms-overflow-style: none){.ps-container{overflow:auto !important}}@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none){.ps-container{overflow:auto !important}}.ps-container.ps-active-x>.ps-scrollbar-x-rail,.ps-container.ps-active-y>.ps-scrollbar-y-rail{display:block;background-color:transparent}.ps-container.ps-in-scrolling.ps-x>.ps-scrollbar-x-rail{background-color:#eee;opacity:.9}.ps-container.ps-in-scrolling.ps-x>.ps-scrollbar-x-rail>.ps-scrollbar-x{background-color:#999;height:11px}.ps-container.ps-in-scrolling.ps-y>.ps-scrollbar-y-rail{background-color:#eee;opacity:.9}.ps-container.ps-in-scrolling.ps-y>.ps-scrollbar-y-rail>.ps-scrollbar-y{background-color:#999;width:11px}.ps-container>.ps-scrollbar-x-rail{display:none;position:absolute;opacity:0;-webkit-transition:background-color .2s linear, opacity .2s linear;-o-transition:background-color .2s linear, opacity .2s linear;-moz-transition:background-color .2s linear, opacity .2s linear;transition:background-color .2s linear, opacity .2s linear;bottom:0px;height:15px}.ps-container>.ps-scrollbar-x-rail>.ps-scrollbar-x{position:absolute;background-color:#aaa;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-transition:background-color .2s linear, height .2s linear, width .2s ease-in-out, -webkit-border-radius .2s ease-in-out;transition:background-color .2s linear, height .2s linear, width .2s ease-in-out, -webkit-border-radius .2s ease-in-out;-o-transition:background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out;-moz-transition:background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out, -moz-border-radius .2s ease-in-out;transition:background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out;transition:background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out, -webkit-border-radius .2s ease-in-out, -moz-border-radius .2s ease-in-out;bottom:2px;height:6px}.ps-container>.ps-scrollbar-x-rail:hover>.ps-scrollbar-x,.ps-container>.ps-scrollbar-x-rail:active>.ps-scrollbar-x{height:11px}.ps-container>.ps-scrollbar-y-rail{display:none;position:absolute;opacity:0;-webkit-transition:background-color .2s linear, opacity .2s linear;-o-transition:background-color .2s linear, opacity .2s linear;-moz-transition:background-color .2s linear, opacity .2s linear;transition:background-color .2s linear, opacity .2s linear;right:0;width:15px}.ps-container>.ps-scrollbar-y-rail>.ps-scrollbar-y{position:absolute;background-color:#aaa;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-transition:background-color .2s linear, height .2s linear, width .2s ease-in-out, -webkit-border-radius .2s ease-in-out;transition:background-color .2s linear, height .2s linear, width .2s ease-in-out, -webkit-border-radius .2s ease-in-out;-o-transition:background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out;-moz-transition:background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out, -moz-border-radius .2s ease-in-out;transition:background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out;transition:background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out, -webkit-border-radius .2s ease-in-out, -moz-border-radius .2s ease-in-out;right:2px;width:6px}.ps-container>.ps-scrollbar-y-rail:hover>.ps-scrollbar-y,.ps-container>.ps-scrollbar-y-rail:active>.ps-scrollbar-y{width:11px}.ps-container:hover.ps-in-scrolling.ps-x>.ps-scrollbar-x-rail{background-color:#eee;opacity:.9}.ps-container:hover.ps-in-scrolling.ps-x>.ps-scrollbar-x-rail>.ps-scrollbar-x{background-color:#999;height:11px}.ps-container:hover.ps-in-scrolling.ps-y>.ps-scrollbar-y-rail{background-color:#eee;opacity:.9}.ps-container:hover.ps-in-scrolling.ps-y>.ps-scrollbar-y-rail>.ps-scrollbar-y{background-color:#999;width:11px}.ps-container:hover>.ps-scrollbar-x-rail,.ps-container:hover>.ps-scrollbar-y-rail{opacity:.6}.ps-container:hover>.ps-scrollbar-x-rail:hover{background-color:#eee;opacity:.9}.ps-container:hover>.ps-scrollbar-x-rail:hover>.ps-scrollbar-x{background-color:#999}.ps-container:hover>.ps-scrollbar-y-rail:hover{background-color:#eee;opacity:.9}.ps-container:hover>.ps-scrollbar-y-rail:hover>.ps-scrollbar-y{background-color:#999} diff --git a/docs/22.2.3/css/tags.css b/docs/22.2.3/css/tags.css new file mode 100644 index 000000000..495d2f9f7 --- /dev/null +++ b/docs/22.2.3/css/tags.css @@ -0,0 +1,49 @@ +/* Tags */ + +#head-tags{ + margin-left:1em; + margin-top:1em; +} + +#body .tags a.tag-link { + display: inline-block; + line-height: 2em; + font-size: 0.8em; + position: relative; + margin: 0 16px 8px 0; + padding: 0 10px 0 12px; + background: #8451a1; + + -webkit-border-bottom-right-radius: 3px; + border-bottom-right-radius: 3px; + -webkit-border-top-right-radius: 3px; + border-top-right-radius: 3px; + + -webkit-box-shadow: 0 1px 2px rgba(0,0,0,0.2); + box-shadow: 0 1px 2px rgba(0,0,0,0.2); + color: #fff; +} + +#body .tags a.tag-link:before { + content: ""; + position: absolute; + top:0; + left: -1em; + width: 0; + height: 0; + border-color: transparent #8451a1 transparent transparent; + border-style: solid; + border-width: 1em 1em 1em 0; +} + +#body .tags a.tag-link:after { + content: ""; + position: absolute; + top: 10px; + left: 1px; + width: 5px; + height: 5px; + -webkit-border-radius: 50%; + border-radius: 100%; + background: #fff; +} diff --git a/docs/22.2.3/css/theme-blue.css b/docs/22.2.3/css/theme-blue.css new file mode 100644 index 000000000..9771ae5e3 --- /dev/null +++ b/docs/22.2.3/css/theme-blue.css @@ -0,0 +1,111 @@ + +:root{ + + --MAIN-TEXT-color:#323232; /* Color of text by default */ + --MAIN-TITLES-TEXT-color: #5e5e5e; /* Color of titles h2-h3-h4-h5 */ + --MAIN-LINK-color:#1C90F3; /* Color of links */ + --MAIN-LINK-HOVER-color:#167ad0; /* Color of hovered links */ + --MAIN-ANCHOR-color: #1C90F3; /* color of anchors on titles */ + + --MENU-HEADER-BG-color:#1C90F3; /* Background color of menu header */ + --MENU-HEADER-BORDER-color:#33a1ff; /*Color of menu header border */ + + --MENU-SEARCH-BG-color:#167ad0; /* Search field background color (by default borders + icons) */ + --MENU-SEARCH-BOX-color: #33a1ff; /* Override search field border color */ + --MENU-SEARCH-BOX-ICONS-color: #a1d2fd; /* Override search field icons color */ + + --MENU-SECTIONS-ACTIVE-BG-color:#20272b; /* Background color of the active section and its childs */ + --MENU-SECTIONS-BG-color:#252c31; /* Background color of other sections */ + --MENU-SECTIONS-LINK-color: #ccc; /* Color of links in menu */ + --MENU-SECTIONS-LINK-HOVER-color: #e6e6e6; /* Color of links in menu, when hovered */ + --MENU-SECTION-ACTIVE-CATEGORY-color: #777; /* Color of active category text */ + --MENU-SECTION-ACTIVE-CATEGORY-BG-color: #fff; /* Color of background for the active category (only) */ + + --MENU-VISITED-color: #33a1ff; /* Color of 'page visited' icons in menu */ + --MENU-SECTION-HR-color: #20272b; /* Color of
separator in menu */ + +} + +body { + color: var(--MAIN-TEXT-color) !important; +} + +textarea:focus, input[type="email"]:focus, input[type="number"]:focus, input[type="password"]:focus, input[type="search"]:focus, input[type="tel"]:focus, input[type="text"]:focus, input[type="url"]:focus, input[type="color"]:focus, input[type="date"]:focus, input[type="datetime"]:focus, input[type="datetime-local"]:focus, input[type="month"]:focus, input[type="time"]:focus, input[type="week"]:focus, select[multiple=multiple]:focus { + border-color: none; + box-shadow: none; +} + +h2, h3, h4, h5 { + color: var(--MAIN-TITLES-TEXT-color) !important; +} + +a { + color: var(--MAIN-LINK-color); +} + +.anchor { + color: var(--MAIN-ANCHOR-color); +} + +a:hover { + color: var(--MAIN-LINK-HOVER-color); +} + +#sidebar ul li.visited > a .read-icon { + color: var(--MENU-VISITED-color); +} + +#body a.highlight:after { + display: block; + content: ""; + height: 1px; + width: 0%; + -webkit-transition: width 0.5s ease; + -moz-transition: width 0.5s ease; + -ms-transition: width 0.5s ease; + transition: width 0.5s ease; + background-color: var(--MAIN-LINK-HOVER-color); +} +#sidebar { + background-color: var(--MENU-SECTIONS-BG-color); +} +#sidebar #header-wrapper { + background: var(--MENU-HEADER-BG-color); + color: var(--MENU-SEARCH-BOX-color); + border-color: var(--MENU-HEADER-BORDER-color); +} +#sidebar .searchbox { + border-color: var(--MENU-SEARCH-BOX-color); + background: var(--MENU-SEARCH-BG-color); +} +#sidebar ul.topics > li.parent, #sidebar ul.topics > li.active { + background: var(--MENU-SECTIONS-ACTIVE-BG-color); +} +#sidebar .searchbox * { + color: var(--MENU-SEARCH-BOX-ICONS-color); +} + +#sidebar a { + color: var(--MENU-SECTIONS-LINK-color); +} + +#sidebar a:hover { + color: var(--MENU-SECTIONS-LINK-HOVER-color); +} + +#sidebar ul li.active > a { + background: var(--MENU-SECTION-ACTIVE-CATEGORY-BG-color); + color: var(--MENU-SECTION-ACTIVE-CATEGORY-color) !important; +} + +#sidebar hr { + border-color: var(--MENU-SECTION-HR-color); +} + +#body .tags a.tag-link { + background-color: var(--MENU-HEADER-BG-color); +} + +#body .tags a.tag-link:before { + border-right-color: var(--MENU-HEADER-BG-color); +} \ No newline at end of file diff --git a/docs/22.2.3/css/theme-green.css b/docs/22.2.3/css/theme-green.css new file mode 100644 index 000000000..3b0b1f721 --- /dev/null +++ b/docs/22.2.3/css/theme-green.css @@ -0,0 +1,111 @@ + +:root{ + + --MAIN-TEXT-color:#323232; /* Color of text by default */ + --MAIN-TITLES-TEXT-color: #5e5e5e; /* Color of titles h2-h3-h4-h5 */ + --MAIN-LINK-color:#599a3e; /* Color of links */ + --MAIN-LINK-HOVER-color:#3f6d2c; /* Color of hovered links */ + --MAIN-ANCHOR-color: #599a3e; /* color of anchors on titles */ + + --MENU-HEADER-BG-color:#74b559; /* Background color of menu header */ + --MENU-HEADER-BORDER-color:#9cd484; /*Color of menu header border */ + + --MENU-SEARCH-BG-color:#599a3e; /* Search field background color (by default borders + icons) */ + --MENU-SEARCH-BOX-color: #84c767; /* Override search field border color */ + --MENU-SEARCH-BOX-ICONS-color: #c7f7c4; /* Override search field icons color */ + + --MENU-SECTIONS-ACTIVE-BG-color:#1b211c; /* Background color of the active section and its childs */ + --MENU-SECTIONS-BG-color:#222723; /* Background color of other sections */ + --MENU-SECTIONS-LINK-color: #ccc; /* Color of links in menu */ + --MENU-SECTIONS-LINK-HOVER-color: #e6e6e6; /* Color of links in menu, when hovered */ + --MENU-SECTION-ACTIVE-CATEGORY-color: #777; /* Color of active category text */ + --MENU-SECTION-ACTIVE-CATEGORY-BG-color: #fff; /* Color of background for the active category (only) */ + + --MENU-VISITED-color: #599a3e; /* Color of 'page visited' icons in menu */ + --MENU-SECTION-HR-color: #18211c; /* Color of
separator in menu */ + +} + +body { + color: var(--MAIN-TEXT-color) !important; +} + +textarea:focus, input[type="email"]:focus, input[type="number"]:focus, input[type="password"]:focus, input[type="search"]:focus, input[type="tel"]:focus, input[type="text"]:focus, input[type="url"]:focus, input[type="color"]:focus, input[type="date"]:focus, input[type="datetime"]:focus, input[type="datetime-local"]:focus, input[type="month"]:focus, input[type="time"]:focus, input[type="week"]:focus, select[multiple=multiple]:focus { + border-color: none; + box-shadow: none; +} + +h2, h3, h4, h5 { + color: var(--MAIN-TITLES-TEXT-color) !important; +} + +a { + color: var(--MAIN-LINK-color); +} + +.anchor { + color: var(--MAIN-ANCHOR-color); +} + +a:hover { + color: var(--MAIN-LINK-HOVER-color); +} + +#sidebar ul li.visited > a .read-icon { + color: var(--MENU-VISITED-color); +} + +#body a.highlight:after { + display: block; + content: ""; + height: 1px; + width: 0%; + -webkit-transition: width 0.5s ease; + -moz-transition: width 0.5s ease; + -ms-transition: width 0.5s ease; + transition: width 0.5s ease; + background-color: var(--MAIN-LINK-HOVER-color); +} +#sidebar { + background-color: var(--MENU-SECTIONS-BG-color); +} +#sidebar #header-wrapper { + background: var(--MENU-HEADER-BG-color); + color: var(--MENU-SEARCH-BOX-color); + border-color: var(--MENU-HEADER-BORDER-color); +} +#sidebar .searchbox { + border-color: var(--MENU-SEARCH-BOX-color); + background: var(--MENU-SEARCH-BG-color); +} +#sidebar ul.topics > li.parent, #sidebar ul.topics > li.active { + background: var(--MENU-SECTIONS-ACTIVE-BG-color); +} +#sidebar .searchbox * { + color: var(--MENU-SEARCH-BOX-ICONS-color); +} + +#sidebar a { + color: var(--MENU-SECTIONS-LINK-color); +} + +#sidebar a:hover { + color: var(--MENU-SECTIONS-LINK-HOVER-color); +} + +#sidebar ul li.active > a { + background: var(--MENU-SECTION-ACTIVE-CATEGORY-BG-color); + color: var(--MENU-SECTION-ACTIVE-CATEGORY-color) !important; +} + +#sidebar hr { + border-color: var(--MENU-SECTION-HR-color); +} + +#body .tags a.tag-link { + background-color: var(--MENU-HEADER-BG-color); +} + +#body .tags a.tag-link:before { + border-right-color: var(--MENU-HEADER-BG-color); +} \ No newline at end of file diff --git a/docs/22.2.3/css/theme-red.css b/docs/22.2.3/css/theme-red.css new file mode 100644 index 000000000..36c9278e5 --- /dev/null +++ b/docs/22.2.3/css/theme-red.css @@ -0,0 +1,111 @@ + +:root{ + + --MAIN-TEXT-color:#323232; /* Color of text by default */ + --MAIN-TITLES-TEXT-color: #5e5e5e; /* Color of titles h2-h3-h4-h5 */ + --MAIN-LINK-color:#f31c1c; /* Color of links */ + --MAIN-LINK-HOVER-color:#d01616; /* Color of hovered links */ + --MAIN-ANCHOR-color: #f31c1c; /* color of anchors on titles */ + + --MENU-HEADER-BG-color:#dc1010; /* Background color of menu header */ + --MENU-HEADER-BORDER-color:#e23131; /*Color of menu header border */ + + --MENU-SEARCH-BG-color:#b90000; /* Search field background color (by default borders + icons) */ + --MENU-SEARCH-BOX-color: #ef2020; /* Override search field border color */ + --MENU-SEARCH-BOX-ICONS-color: #fda1a1; /* Override search field icons color */ + + --MENU-SECTIONS-ACTIVE-BG-color:#2b2020; /* Background color of the active section and its childs */ + --MENU-SECTIONS-BG-color:#312525; /* Background color of other sections */ + --MENU-SECTIONS-LINK-color: #ccc; /* Color of links in menu */ + --MENU-SECTIONS-LINK-HOVER-color: #e6e6e6; /* Color of links in menu, when hovered */ + --MENU-SECTION-ACTIVE-CATEGORY-color: #777; /* Color of active category text */ + --MENU-SECTION-ACTIVE-CATEGORY-BG-color: #fff; /* Color of background for the active category (only) */ + + --MENU-VISITED-color: #ff3333; /* Color of 'page visited' icons in menu */ + --MENU-SECTION-HR-color: #2b2020; /* Color of
separator in menu */ + +} + +body { + color: var(--MAIN-TEXT-color) !important; +} + +textarea:focus, input[type="email"]:focus, input[type="number"]:focus, input[type="password"]:focus, input[type="search"]:focus, input[type="tel"]:focus, input[type="text"]:focus, input[type="url"]:focus, input[type="color"]:focus, input[type="date"]:focus, input[type="datetime"]:focus, input[type="datetime-local"]:focus, input[type="month"]:focus, input[type="time"]:focus, input[type="week"]:focus, select[multiple=multiple]:focus { + border-color: none; + box-shadow: none; +} + +h2, h3, h4, h5 { + color: var(--MAIN-TITLES-TEXT-color) !important; +} + +a { + color: var(--MAIN-LINK-color); +} + +.anchor { + color: var(--MAIN-ANCHOR-color); +} + +a:hover { + color: var(--MAIN-LINK-HOVER-color); +} + +#sidebar ul li.visited > a .read-icon { + color: var(--MENU-VISITED-color); +} + +#body a.highlight:after { + display: block; + content: ""; + height: 1px; + width: 0%; + -webkit-transition: width 0.5s ease; + -moz-transition: width 0.5s ease; + -ms-transition: width 0.5s ease; + transition: width 0.5s ease; + background-color: var(--MAIN-LINK-HOVER-color); +} +#sidebar { + background-color: var(--MENU-SECTIONS-BG-color); +} +#sidebar #header-wrapper { + background: var(--MENU-HEADER-BG-color); + color: var(--MENU-SEARCH-BOX-color); + border-color: var(--MENU-HEADER-BORDER-color); +} +#sidebar .searchbox { + border-color: var(--MENU-SEARCH-BOX-color); + background: var(--MENU-SEARCH-BG-color); +} +#sidebar ul.topics > li.parent, #sidebar ul.topics > li.active { + background: var(--MENU-SECTIONS-ACTIVE-BG-color); +} +#sidebar .searchbox * { + color: var(--MENU-SEARCH-BOX-ICONS-color); +} + +#sidebar a { + color: var(--MENU-SECTIONS-LINK-color); +} + +#sidebar a:hover { + color: var(--MENU-SECTIONS-LINK-HOVER-color); +} + +#sidebar ul li.active > a { + background: var(--MENU-SECTION-ACTIVE-CATEGORY-BG-color); + color: var(--MENU-SECTION-ACTIVE-CATEGORY-color) !important; +} + +#sidebar hr { + border-color: var(--MENU-SECTION-HR-color); +} + +#body .tags a.tag-link { + background-color: var(--MENU-HEADER-BG-color); +} + +#body .tags a.tag-link:before { + border-right-color: var(--MENU-HEADER-BG-color); +} \ No newline at end of file diff --git a/docs/22.2.3/css/theme.css b/docs/22.2.3/css/theme.css new file mode 100644 index 000000000..9b4550457 --- /dev/null +++ b/docs/22.2.3/css/theme.css @@ -0,0 +1,1141 @@ +@charset "UTF-8"; + +/* Tags */ +@import "tags.css"; + +#top-github-link, #body #breadcrumbs { + position: relative; + top: 50%; + -webkit-transform: translateY(-50%); + -moz-transform: translateY(-50%); + -o-transform: translateY(-50%); + -ms-transform: translateY(-50%); + transform: translateY(-50%); +} +.button, .button-secondary { + display: inline-block; + padding: 7px 12px; +} +.button:active, .button-secondary:active { + margin: 2px 0 -2px 0; +} +@font-face { + font-family: 'Novacento Sans Wide'; + src: url("../fonts/Novecentosanswide-UltraLight-webfont.eot"); + src: url("../fonts/Novecentosanswide-UltraLight-webfont.eot?#iefix") format("embedded-opentype"), url("../fonts/Novecentosanswide-UltraLight-webfont.woff2") format("woff2"), url("../fonts/Novecentosanswide-UltraLight-webfont.woff") format("woff"), url("../fonts/Novecentosanswide-UltraLight-webfont.ttf") format("truetype"), url("../fonts/Novecentosanswide-UltraLight-webfont.svg#novecento_sans_wideultralight") format("svg"); + font-style: normal; + font-weight: 200; +} +@font-face { + font-family: 'Work Sans'; + font-style: normal; + font-weight: 300; + src: url("../fonts/Work_Sans_300.eot?#iefix") format("embedded-opentype"), url("../fonts/Work_Sans_300.woff") format("woff"), url("../fonts/Work_Sans_300.woff2") format("woff2"), url("../fonts/Work_Sans_300.svg#WorkSans") format("svg"), url("../fonts/Work_Sans_300.ttf") format("truetype"); +} +@font-face { + font-family: 'Work Sans'; + font-style: normal; + font-weight: 500; + src: url("../fonts/Work_Sans_500.eot?#iefix") format("embedded-opentype"), url("../fonts/Work_Sans_500.woff") format("woff"), url("../fonts/Work_Sans_500.woff2") format("woff2"), url("../fonts/Work_Sans_500.svg#WorkSans") format("svg"), url("../fonts/Work_Sans_500.ttf") format("truetype"); +} +body { + background: #fff; + color: #777; +} +body #chapter h1 { + font-size: 3.5rem; +} +@media only all and (min-width: 48em) and (max-width: 59.938em) { + body #chapter h1 { + font-size: 3rem; + } +} +@media only all and (max-width: 47.938em) { + body #chapter h1 { + font-size: 2rem; + } +} +a { + color: #00bdf3; +} +a:hover { + color: #0082a7; +} +pre { + position: relative; + color: #ffffff; +} +.bg { + background: #fff; + border: 1px solid #eaeaea; +} +b, strong, label, th { + font-weight: 600; +} +.default-animation, #header #logo-svg, #header #logo-svg path, #sidebar, #sidebar ul, #body, #body .padding, #body .nav { + -webkit-transition: all 0.5s ease; + -moz-transition: all 0.5s ease; + transition: all 0.5s ease; +} +#grav-logo { + max-width: 60%; +} +#grav-logo path { + fill: #fff !important; +} +#sidebar { + font-weight: 300 !important; +} +fieldset { + border: 1px solid #ddd; +} +textarea, input[type="email"], input[type="number"], input[type="password"], input[type="search"], input[type="tel"], input[type="text"], input[type="url"], input[type="color"], input[type="date"], input[type="datetime"], input[type="datetime-local"], input[type="month"], input[type="time"], input[type="week"], select[multiple=multiple] { + background-color: white; + border: 1px solid #ddd; + box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06); +} +textarea:hover, input[type="email"]:hover, input[type="number"]:hover, input[type="password"]:hover, input[type="search"]:hover, input[type="tel"]:hover, input[type="text"]:hover, input[type="url"]:hover, input[type="color"]:hover, input[type="date"]:hover, input[type="datetime"]:hover, input[type="datetime-local"]:hover, input[type="month"]:hover, input[type="time"]:hover, input[type="week"]:hover, select[multiple=multiple]:hover { + border-color: #c4c4c4; +} +textarea:focus, input[type="email"]:focus, input[type="number"]:focus, input[type="password"]:focus, input[type="search"]:focus, input[type="tel"]:focus, input[type="text"]:focus, input[type="url"]:focus, input[type="color"]:focus, input[type="date"]:focus, input[type="datetime"]:focus, input[type="datetime-local"]:focus, input[type="month"]:focus, input[type="time"]:focus, input[type="week"]:focus, select[multiple=multiple]:focus { + border-color: #00bdf3; + box-shadow: inset 0 1px 3px rgba(0,0,0,.06),0 0 5px rgba(0,169,218,.7) +} +#header-wrapper { + background: #8451a1; + color: #fff; + text-align: center; + border-bottom: 4px solid #9c6fb6; + padding: 1rem; +} +#header a { + display: inline-block; +} +#header #logo-svg { + width: 8rem; + height: 2rem; +} +#header #logo-svg path { + fill: #fff; +} +.searchbox { + margin-top: 1rem; + position: relative; + border: 1px solid #915eae; + background: #764890; + border-radius: 4px; +} +.searchbox label { + color: rgba(255, 255, 255, 0.8); + position: absolute; + left: 10px; + top: 3px; +} +.searchbox span { + color: rgba(255, 255, 255, 0.6); + position: absolute; + right: 10px; + top: 3px; + cursor: pointer; +} +.searchbox span:hover { + color: rgba(255, 255, 255, 0.9); +} +.searchbox input { + display: inline-block; + color: #fff; + width: 100%; + height: 30px; + background: transparent; + border: 0; + padding: 0 25px 0 30px; + margin: 0; + font-weight: 300; +} +.searchbox input::-webkit-input-placeholder { + color: rgba(255, 255, 255, 0.6); +} +.searchbox input::-moz-placeholder { + color: rgba(255, 255, 255, 0.6); +} +.searchbox input:-moz-placeholder { + color: rgba(255, 255, 255, 0.6); +} +.searchbox input:-ms-input-placeholder { + color: rgba(255, 255, 255, 0.6); +} +#sidebar-toggle-span { + display: none; +} +@media only all and (max-width: 47.938em) { + #sidebar-toggle-span { + display: inline; + } +} +#sidebar { + background-color: #322A38; + position: fixed; + top: 0; + width: 300px; + bottom: 0; + left: 0; + font-weight: 400; + font-size: 15px; +} +#sidebar a { + color: #ccc; +} +#sidebar a:hover { + color: #e6e6e6; +} +#sidebar a.subtitle { + color: rgba(204, 204, 204, 0.6); +} +#sidebar hr { + border-bottom: 1px solid #2a232f; +} +#sidebar a.padding { + padding: 0 1rem; +} +#sidebar h5 { + margin: 2rem 0 0; + position: relative; + line-height: 2; +} +#sidebar h5 a { + display: block; + margin-left: 0; + margin-right: 0; + padding-left: 1rem; + padding-right: 1rem; +} +#sidebar h5 i { + color: rgba(204, 204, 204, 0.6); + position: absolute; + right: 0.6rem; + top: 0.7rem; + font-size: 80%; +} +#sidebar h5.parent a { + background: #201b24; + color: #d9d9d9 !important; +} +#sidebar h5.active a { + background: #fff; + color: #777 !important; +} +#sidebar h5.active i { + color: #777 !important; +} +#sidebar h5 + ul.topics { + display: none; + margin-top: 0; +} +#sidebar h5.parent + ul.topics, #sidebar h5.active + ul.topics { + display: block; +} +#sidebar ul { + list-style: none; + padding: 0; + margin: 0; +} +#sidebar ul.searched a { + color: #999999; +} +#sidebar ul.searched .search-match a { + color: #e6e6e6; +} +#sidebar ul.searched .search-match a:hover { + color: white; +} +#sidebar ul.topics { + margin: 0 1rem; +} +#sidebar ul.topics.searched ul { + display: block; +} +#sidebar ul.topics ul { + display: none; + padding-bottom: 1rem; +} +#sidebar ul.topics ul ul { + padding-bottom: 0; +} +#sidebar ul.topics li.parent ul, #sidebar ul.topics > li.active ul { + display: block; +} +#sidebar ul.topics > li > a { + line-height: 2rem; + font-size: 1.1rem; +} +#sidebar ul.topics > li > a b { + opacity: 0.5; + font-weight: normal; +} +#sidebar ul.topics > li > a .fa { + margin-top: 9px; +} +#sidebar ul.topics > li.parent, #sidebar ul.topics > li.active { + background: #251f29; + margin-left: -1rem; + margin-right: -1rem; + padding-left: 1rem; + padding-right: 1rem; +} +#sidebar ul li.active > a { + background: #fff; + color: #777 !important; + margin-left: -1rem; + margin-right: -1rem; + padding-left: 1rem; + padding-right: 1rem; +} +#sidebar ul li { + padding: 0; +} +#sidebar ul li.visited + span { + margin-right: 16px; +} +#sidebar ul li a { + display: block; + padding: 2px 0; +} +#sidebar ul li a span { + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + display: block; +} +#sidebar ul li > a { + padding: 4px 0; +} +#sidebar ul li.visited > a .read-icon { + color: #9c6fb6; + display: inline; +} +#sidebar ul li li { + padding-left: 1rem; + text-indent: 0.2rem; +} +#main { + background: #f7f7f7; + margin: 0 0 1.563rem 0; +} +#body { + position: relative; + margin-left: 300px; + min-height: 100%; +} +#body img, #body .video-container { + margin: 3rem auto; + display: block; + text-align: center; +} +#body img.border, #body .video-container.border { + border: 2px solid #e6e6e6 !important; + padding: 2px; +} +#body img.shadow, #body .video-container.shadow { + box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1); +} +#body img.inline { + display: inline !important; + margin: 0 !important; + vertical-align: bottom; +} +#body .bordered { + border: 1px solid #ccc; +} +#body .padding { + padding: 3rem 6rem; +} +@media only all and (max-width: 59.938em) { + #body .padding { + position: static; + padding: 15px 3rem; + } +} +@media only all and (max-width: 47.938em) { + #body .padding { + padding: 5px 1rem; + } +} +#body h1 + hr { + margin-top: -1.7rem; + margin-bottom: 3rem; +} +@media only all and (max-width: 59.938em) { + #body #navigation { + position: static; + margin-right: 0 !important; + width: 100%; + display: table; + } +} +#body .nav { + position: fixed; + top: 0; + bottom: 0; + width: 4rem; + font-size: 50px; + height: 100%; + cursor: pointer; + display: table; + text-align: center; +} +#body .nav > i { + display: table-cell; + vertical-align: middle; + text-align: center; +} +@media only all and (max-width: 59.938em) { + #body .nav { + display: table-cell; + position: static; + top: auto; + width: 50%; + text-align: center; + height: 100px; + line-height: 100px; + padding-top: 0; + } + #body .nav > i { + display: inline-block; + } +} +#body .nav:hover { + background: #F6F6F6; +} +#body .nav.nav-pref { + left: 0; +} +#body .nav.nav-next { + right: 0; +} +#body-inner { + margin-bottom: 5rem; +} +#chapter { + display: flex; + align-items: center; + justify-content: center; + height: 100%; + padding: 2rem 0; +} +#chapter #body-inner { + padding-bottom: 3rem; + max-width: 80%; +} +#chapter h3 { + font-family: "Work Sans", "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif; + font-weight: 300; + text-align: center; +} +#chapter h1 { + font-size: 5rem; + border-bottom: 4px solid #F0F2F4; +} +#chapter p { + text-align: center; + font-size: 1.2rem; +} +#footer { + padding: 3rem 1rem; + color: #b3b3b3; + font-size: 13px; +} +#footer p { + margin: 0; +} +body { + font-family: "Work Sans", "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif; + font-weight: 300; + line-height: 1.6; + font-size: 18px !important; +} +h2, h3, h4, h5, h6 { + font-family: "Work Sans", "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif; + text-rendering: optimizeLegibility; + color: #5e5e5e; + font-weight: 400; + letter-spacing: -1px; +} +h1 { + font-family: "Novacento Sans Wide", "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif; + text-align: center; + text-transform: uppercase; + color: #222; + font-weight: 200; +} +blockquote { + border-left: 10px solid #F0F2F4; +} +blockquote p { + font-size: 1.1rem; + color: #999; +} +blockquote cite { + display: block; + text-align: right; + color: #666; + font-size: 1.2rem; +} +div.notices { + margin: 2rem 0; + position: relative; +} +div.notices p { + padding: 15px; + display: block; + font-size: 1rem; + margin-top: 0rem; + margin-bottom: 0rem; + color: #666; +} +div.notices p:first-child:before { + position: absolute; + top: 2px; + color: #fff; + font-family: "Font Awesome 5 Free"; + font-weight: 900; + content: "\f06a"; + left: 10px; +} +div.notices p:first-child:after { + position: absolute; + top: 2px; + color: #fff; + left: 2rem; +} +div.notices.info p { + border-top: 30px solid #F0B37E; + background: #FFF2DB; +} +div.notices.info p:first-child:after { + content: 'Info'; +} +div.notices.warning p { + border-top: 30px solid rgba(217, 83, 79, 0.8); + background: #FAE2E2; +} +div.notices.warning p:first-child:after { + content: 'Warning'; +} +div.notices.note p { + border-top: 30px solid #6AB0DE; + background: #E7F2FA; +} +div.notices.note p:first-child:after { + content: 'Note'; +} +div.notices.tip p { + border-top: 30px solid rgba(92, 184, 92, 0.8); + background: #E6F9E6; +} +div.notices.tip p:first-child:after { + content: 'Tip'; +} + +/* attachments shortcode */ + +section.attachments { + margin: 2rem 0; + position: relative; +} + +section.attachments label { + font-weight: 400; + padding-left: 0.5em; + padding-top: 0.2em; + padding-bottom: 0.2em; + margin: 0; +} + +section.attachments .attachments-files { + padding: 15px; + display: block; + font-size: 1rem; + margin-top: 0rem; + margin-bottom: 0rem; + color: #666; +} + +section.attachments.orange label { + color: #fff; + background: #F0B37E; +} + +section.attachments.orange .attachments-files { + background: #FFF2DB; +} + +section.attachments.green label { + color: #fff; + background: rgba(92, 184, 92, 0.8); +} + +section.attachments.green .attachments-files { + background: #E6F9E6; +} + +section.attachments.blue label { + color: #fff; + background: #6AB0DE; +} + +section.attachments.blue .attachments-files { + background: #E7F2FA; +} + +section.attachments.grey label { + color: #fff; + background: #505d65; +} + +section.attachments.grey .attachments-files { + background: #f4f4f4; +} + +/* Children shortcode */ + +/* Children shortcode */ +.children p { + font-size: small; + margin-top: 0px; + padding-top: 0px; + margin-bottom: 0px; + padding-bottom: 0px; +} +.children-li p { + font-size: small; + font-style: italic; + +} +.children-h2 p, .children-h3 p { + font-size: small; + margin-top: 0px; + padding-top: 0px; + margin-bottom: 0px; + padding-bottom: 0px; +} +.children h3,.children h2 { + margin-bottom: 0px; + margin-top: 5px; +} + +code, kbd, pre, samp { + font-family: "Consolas", menlo, monospace; + font-size: 92%; +} +code { + border-radius: 2px; + white-space: nowrap; + color: #5e5e5e; + background: #FFF7DD; + border: 1px solid #fbf0cb; + padding: 0px 2px; +} +code + .copy-to-clipboard { + margin-left: -1px; + border-left: 0 !important; + font-size: inherit !important; + vertical-align: middle; + height: 21px; + top: 0; +} +pre { + padding: 1rem; + margin: 2rem 0; + background: #282c34; + border: 0; + border-radius: 2px; + line-height: 1.15; +} +pre code { + color: whitesmoke; + background: inherit; + white-space: inherit; + border: 0; + padding: 0; + margin: 0; + font-size: 15px; +} +hr { + border-bottom: 4px solid #F0F2F4; +} +.page-title { + margin-top: -25px; + padding: 25px; + float: left; + clear: both; + background: #9c6fb6; + color: #fff; +} +#body a.anchor-link { + color: #ccc; +} +#body a.anchor-link:hover { + color: #9c6fb6; +} +#body-inner .tabs-wrapper.ui-theme-badges { + background: #1d1f21; +} +#body-inner .tabs-wrapper.ui-theme-badges .tabs-nav li { + font-size: 0.9rem; + text-transform: uppercase; +} +#body-inner .tabs-wrapper.ui-theme-badges .tabs-nav li a { + background: #35393c; +} +#body-inner .tabs-wrapper.ui-theme-badges .tabs-nav li.current a { + background: #4d5257; +} +#body-inner pre { + white-space: pre-wrap; +} +.tabs-wrapper pre { + margin: 1rem 0; + border: 0; + padding: 0; + background: inherit; +} +table { + border: 1px solid #eaeaea; + table-layout: auto; +} +th { + background: #f7f7f7; + padding: 0.5rem; +} +td { + padding: 0.5rem; + border: 1px solid #eaeaea; +} +.button { + background: #9c6fb6; + color: #fff; + box-shadow: 0 3px 0 #00a5d4; +} +.button:hover { + background: #00a5d4; + box-shadow: 0 3px 0 #008db6; + color: #fff; +} +.button:active { + box-shadow: 0 1px 0 #008db6; +} +.button-secondary { + background: #F8B450; + color: #fff; + box-shadow: 0 3px 0 #f7a733; +} +.button-secondary:hover { + background: #f7a733; + box-shadow: 0 3px 0 #f69b15; + color: #fff; +} +.button-secondary:active { + box-shadow: 0 1px 0 #f69b15; +} +.bullets { + margin: 1.7rem 0; + margin-left: -0.85rem; + margin-right: -0.85rem; + overflow: auto; +} +.bullet { + float: left; + padding: 0 0.85rem; +} +.two-column-bullet { + width: 50%; +} +@media only all and (max-width: 47.938em) { + .two-column-bullet { + width: 100%; + } +} +.three-column-bullet { + width: 33.33333%; +} +@media only all and (max-width: 47.938em) { + .three-column-bullet { + width: 100%; + } +} +.four-column-bullet { + width: 25%; +} +@media only all and (max-width: 47.938em) { + .four-column-bullet { + width: 100%; + } +} +.bullet-icon { + float: left; + background: #9c6fb6; + padding: 0.875rem; + width: 3.5rem; + height: 3.5rem; + border-radius: 50%; + color: #fff; + font-size: 1.75rem; + text-align: center; +} +.bullet-icon-1 { + background: #9c6fb6; +} +.bullet-icon-2 { + background: #00f3d8; +} +.bullet-icon-3 { + background: #e6f300; +} +.bullet-content { + margin-left: 4.55rem; +} +.tooltipped { + position: relative; +} +.tooltipped:after { + position: absolute; + z-index: 1000000; + display: none; + padding: 5px 8px; + font: normal normal 11px/1.5 "Work Sans", "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif; + color: #fff; + text-align: center; + text-decoration: none; + text-shadow: none; + text-transform: none; + letter-spacing: normal; + word-wrap: break-word; + white-space: pre; + pointer-events: none; + content: attr(aria-label); + background: rgba(0, 0, 0, 0.8); + border-radius: 3px; + -webkit-font-smoothing: subpixel-antialiased; +} +.tooltipped:before { + position: absolute; + z-index: 1000001; + display: none; + width: 0; + height: 0; + color: rgba(0, 0, 0, 0.8); + pointer-events: none; + content: ""; + border: 5px solid transparent; +} +.tooltipped:hover:before, .tooltipped:hover:after, .tooltipped:active:before, .tooltipped:active:after, .tooltipped:focus:before, .tooltipped:focus:after { + display: inline-block; + text-decoration: none; +} +.tooltipped-s:after, .tooltipped-se:after, .tooltipped-sw:after { + top: 100%; + right: 50%; + margin-top: 5px; +} +.tooltipped-s:before, .tooltipped-se:before, .tooltipped-sw:before { + top: auto; + right: 50%; + bottom: -5px; + margin-right: -5px; + border-bottom-color: rgba(0, 0, 0, 0.8); +} +.tooltipped-se:after { + right: auto; + left: 50%; + margin-left: -15px; +} +.tooltipped-sw:after { + margin-right: -15px; +} +.tooltipped-n:after, .tooltipped-ne:after, .tooltipped-nw:after { + right: 50%; + bottom: 100%; + margin-bottom: 5px; +} +.tooltipped-n:before, .tooltipped-ne:before, .tooltipped-nw:before { + top: -5px; + right: 50%; + bottom: auto; + margin-right: -5px; + border-top-color: rgba(0, 0, 0, 0.8); +} +.tooltipped-ne:after { + right: auto; + left: 50%; + margin-left: -15px; +} +.tooltipped-nw:after { + margin-right: -15px; +} +.tooltipped-s:after, .tooltipped-n:after { + transform: translateX(50%); +} +.tooltipped-w:after { + right: 100%; + bottom: 50%; + margin-right: 5px; + transform: translateY(50%); +} +.tooltipped-w:before { + top: 50%; + bottom: 50%; + left: -5px; + margin-top: -5px; + border-left-color: rgba(0, 0, 0, 0.8); +} +.tooltipped-e:after { + bottom: 50%; + left: 100%; + margin-left: 5px; + transform: translateY(50%); +} +.tooltipped-e:before { + top: 50%; + right: -5px; + bottom: 50%; + margin-top: -5px; + border-right-color: rgba(0, 0, 0, 0.8); +} +.highlightable { + padding: 1rem 0 1rem; + overflow: auto; + position: relative; +} +.hljs::selection, .hljs span::selection { + background: #b7b7b7; +} +.lightbox-active #body { + overflow: visible; +} +.lightbox-active #body .padding { + overflow: visible; +} +#github-contrib i { + vertical-align: middle; +} +.featherlight img { + margin: 0 !important; +} +.lifecycle #body-inner ul { + list-style: none; + margin: 0; + padding: 2rem 0 0; + position: relative; +} +.lifecycle #body-inner ol { + margin: 1rem 0 1rem 0; + padding: 2rem; + position: relative; +} +.lifecycle #body-inner ol li { + margin-left: 1rem; +} +.lifecycle #body-inner ol strong, .lifecycle #body-inner ol label, .lifecycle #body-inner ol th { + text-decoration: underline; +} +.lifecycle #body-inner ol ol { + margin-left: -1rem; +} +.lifecycle #body-inner h3[class*='level'] { + font-size: 20px; + position: absolute; + margin: 0; + padding: 4px 10px; + right: 0; + z-index: 1000; + color: #fff; + background: #1ABC9C; +} +.lifecycle #body-inner ol h3 { + margin-top: 1rem !important; + right: 2rem !important; +} +.lifecycle #body-inner .level-1 + ol { + background: #f6fefc; + border: 4px solid #1ABC9C; + color: #16A085; +} +.lifecycle #body-inner .level-1 + ol h3 { + background: #2ECC71; +} +.lifecycle #body-inner .level-2 + ol { + background: #f7fdf9; + border: 4px solid #2ECC71; + color: #27AE60; +} +.lifecycle #body-inner .level-2 + ol h3 { + background: #3498DB; +} +.lifecycle #body-inner .level-3 + ol { + background: #f3f9fd; + border: 4px solid #3498DB; + color: #2980B9; +} +.lifecycle #body-inner .level-3 + ol h3 { + background: #34495E; +} +.lifecycle #body-inner .level-4 + ol { + background: #e4eaf0; + border: 4px solid #34495E; + color: #2C3E50; +} +.lifecycle #body-inner .level-4 + ol h3 { + background: #34495E; +} +#top-bar { + background: #F6F6F6; + border-radius: 2px; + padding: 0 1rem; + height: 0; + min-height: 3rem; +} +#top-github-link { + position: relative; + z-index: 1; + float: right; + display: block; +} +#body #breadcrumbs { + height: auto; + margin-bottom: 0; + padding-left: 0; + line-height: 1.4; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + width: 70%; + display: inline-block; + float: left; +} +#body #breadcrumbs span { + padding: 0 0.1rem; +} +@media only all and (max-width: 59.938em) { + #sidebar { + width: 230px; + } + #body { + margin-left: 230px; + } +} +@media only all and (max-width: 47.938em) { + #sidebar { + width: 230px; + left: -230px; + } + #body { + margin-left: 0; + width: 100%; + } + .sidebar-hidden { + overflow: hidden; + } + .sidebar-hidden #sidebar { + left: 0; + } + .sidebar-hidden #body { + margin-left: 230px; + overflow: hidden; + } + .sidebar-hidden #overlay { + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + z-index: 10; + background: rgba(255, 255, 255, 0.5); + cursor: pointer; + } +} +.copy-to-clipboard { + background-image: url(../images/clippy.svg); + background-position: 50% 50%; + background-size: 16px 16px; + background-repeat: no-repeat; + width: 27px; + height: 1.45rem; + top: -1px; + display: inline-block; + vertical-align: middle; + position: relative; + color: #5e5e5e; + background-color: #FFF7DD; + margin-left: -.2rem; + cursor: pointer; + border-radius: 0 2px 2px 0; + margin-bottom: 1px; +} +.copy-to-clipboard:hover { + background-color: #E8E2CD; +} +pre .copy-to-clipboard { + position: absolute; + right: 4px; + top: 4px; + background-color: #949bab; + color: #ccc; + border-radius: 2px; +} +pre .copy-to-clipboard:hover { + background-color: #656c72; + color: #fff; +} +.parent-element { + -webkit-transform-style: preserve-3d; + -moz-transform-style: preserve-3d; + transform-style: preserve-3d; +} + +#sidebar ul.topics > li > a .read-icon { + margin-top: 9px; +} + +#sidebar ul { + list-style: none; + padding: 0; + margin: 0; +} + +#sidebar #shortcuts li { + padding: 2px 0; + list-style: none; +} + +#sidebar ul li .read-icon { + display: none; + float: right; + font-size: 13px; + min-width: 16px; + margin: 4px 0 0 0; + text-align: right; +} +#sidebar ul li.visited > a .read-icon { + color: #00bdf3; + display: inline; +} + +#sidebar #shortcuts h3 { + font-family: "Novacento Sans Wide", "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif; + color: white ; + margin-top:1rem; + padding-left: 1rem; +} +#homelinks { + background-color: #9c6fb6; + color: #fff; + padding: 7px 0; + border-bottom: 4px solid #9c6fb6; +} +#searchResults { + text-align: left; +} + +option { + color: initial; +} diff --git a/docs/22.2.3/fonts/Inconsolata.eot b/docs/22.2.3/fonts/Inconsolata.eot new file mode 100644 index 000000000..0a705d653 Binary files /dev/null and b/docs/22.2.3/fonts/Inconsolata.eot differ diff --git a/docs/22.2.3/fonts/Inconsolata.svg b/docs/22.2.3/fonts/Inconsolata.svg new file mode 100644 index 000000000..b7f97c875 --- /dev/null +++ b/docs/22.2.3/fonts/Inconsolata.svg @@ -0,0 +1,359 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/22.2.3/fonts/Inconsolata.ttf b/docs/22.2.3/fonts/Inconsolata.ttf new file mode 100644 index 000000000..4b8a36d24 Binary files /dev/null and b/docs/22.2.3/fonts/Inconsolata.ttf differ diff --git a/docs/22.2.3/fonts/Inconsolata.woff b/docs/22.2.3/fonts/Inconsolata.woff new file mode 100644 index 000000000..6f39625e5 Binary files /dev/null and b/docs/22.2.3/fonts/Inconsolata.woff differ diff --git a/docs/22.2.3/fonts/Novecentosanswide-Normal-webfont.eot b/docs/22.2.3/fonts/Novecentosanswide-Normal-webfont.eot new file mode 100644 index 000000000..9984682fc Binary files /dev/null and b/docs/22.2.3/fonts/Novecentosanswide-Normal-webfont.eot differ diff --git a/docs/22.2.3/fonts/Novecentosanswide-Normal-webfont.svg b/docs/22.2.3/fonts/Novecentosanswide-Normal-webfont.svg new file mode 100644 index 000000000..c412ea8c1 --- /dev/null +++ b/docs/22.2.3/fonts/Novecentosanswide-Normal-webfont.svg @@ -0,0 +1,1019 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/22.2.3/fonts/Novecentosanswide-Normal-webfont.ttf b/docs/22.2.3/fonts/Novecentosanswide-Normal-webfont.ttf new file mode 100644 index 000000000..8cfb62dd5 Binary files /dev/null and b/docs/22.2.3/fonts/Novecentosanswide-Normal-webfont.ttf differ diff --git a/docs/22.2.3/fonts/Novecentosanswide-Normal-webfont.woff b/docs/22.2.3/fonts/Novecentosanswide-Normal-webfont.woff new file mode 100644 index 000000000..d5c429079 Binary files /dev/null and b/docs/22.2.3/fonts/Novecentosanswide-Normal-webfont.woff differ diff --git a/docs/22.2.3/fonts/Novecentosanswide-Normal-webfont.woff2 b/docs/22.2.3/fonts/Novecentosanswide-Normal-webfont.woff2 new file mode 100644 index 000000000..eefb4a318 Binary files /dev/null and b/docs/22.2.3/fonts/Novecentosanswide-Normal-webfont.woff2 differ diff --git a/docs/22.2.3/fonts/Novecentosanswide-UltraLight-webfont.eot b/docs/22.2.3/fonts/Novecentosanswide-UltraLight-webfont.eot new file mode 100644 index 000000000..2a26561f9 Binary files /dev/null and b/docs/22.2.3/fonts/Novecentosanswide-UltraLight-webfont.eot differ diff --git a/docs/22.2.3/fonts/Novecentosanswide-UltraLight-webfont.svg b/docs/22.2.3/fonts/Novecentosanswide-UltraLight-webfont.svg new file mode 100644 index 000000000..e642ab076 --- /dev/null +++ b/docs/22.2.3/fonts/Novecentosanswide-UltraLight-webfont.svg @@ -0,0 +1,918 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/22.2.3/fonts/Novecentosanswide-UltraLight-webfont.ttf b/docs/22.2.3/fonts/Novecentosanswide-UltraLight-webfont.ttf new file mode 100644 index 000000000..9ce9c7f99 Binary files /dev/null and b/docs/22.2.3/fonts/Novecentosanswide-UltraLight-webfont.ttf differ diff --git a/docs/22.2.3/fonts/Novecentosanswide-UltraLight-webfont.woff b/docs/22.2.3/fonts/Novecentosanswide-UltraLight-webfont.woff new file mode 100644 index 000000000..381650c98 Binary files /dev/null and b/docs/22.2.3/fonts/Novecentosanswide-UltraLight-webfont.woff differ diff --git a/docs/22.2.3/fonts/Novecentosanswide-UltraLight-webfont.woff2 b/docs/22.2.3/fonts/Novecentosanswide-UltraLight-webfont.woff2 new file mode 100644 index 000000000..7e659549b Binary files /dev/null and b/docs/22.2.3/fonts/Novecentosanswide-UltraLight-webfont.woff2 differ diff --git a/docs/22.2.3/fonts/Work_Sans_200.eot b/docs/22.2.3/fonts/Work_Sans_200.eot new file mode 100644 index 000000000..4052e4f94 Binary files /dev/null and b/docs/22.2.3/fonts/Work_Sans_200.eot differ diff --git a/docs/22.2.3/fonts/Work_Sans_200.svg b/docs/22.2.3/fonts/Work_Sans_200.svg new file mode 100644 index 000000000..58ab4ba22 --- /dev/null +++ b/docs/22.2.3/fonts/Work_Sans_200.svg @@ -0,0 +1,332 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/22.2.3/fonts/Work_Sans_200.ttf b/docs/22.2.3/fonts/Work_Sans_200.ttf new file mode 100644 index 000000000..68019e1cc Binary files /dev/null and b/docs/22.2.3/fonts/Work_Sans_200.ttf differ diff --git a/docs/22.2.3/fonts/Work_Sans_200.woff b/docs/22.2.3/fonts/Work_Sans_200.woff new file mode 100644 index 000000000..a1bd9e469 Binary files /dev/null and b/docs/22.2.3/fonts/Work_Sans_200.woff differ diff --git a/docs/22.2.3/fonts/Work_Sans_200.woff2 b/docs/22.2.3/fonts/Work_Sans_200.woff2 new file mode 100644 index 000000000..20c68a75c Binary files /dev/null and b/docs/22.2.3/fonts/Work_Sans_200.woff2 differ diff --git a/docs/22.2.3/fonts/Work_Sans_300.eot b/docs/22.2.3/fonts/Work_Sans_300.eot new file mode 100644 index 000000000..ace799382 Binary files /dev/null and b/docs/22.2.3/fonts/Work_Sans_300.eot differ diff --git a/docs/22.2.3/fonts/Work_Sans_300.svg b/docs/22.2.3/fonts/Work_Sans_300.svg new file mode 100644 index 000000000..f29d0c8a1 --- /dev/null +++ b/docs/22.2.3/fonts/Work_Sans_300.svg @@ -0,0 +1,331 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/22.2.3/fonts/Work_Sans_300.ttf b/docs/22.2.3/fonts/Work_Sans_300.ttf new file mode 100644 index 000000000..35387c235 Binary files /dev/null and b/docs/22.2.3/fonts/Work_Sans_300.ttf differ diff --git a/docs/22.2.3/fonts/Work_Sans_300.woff b/docs/22.2.3/fonts/Work_Sans_300.woff new file mode 100644 index 000000000..8d789eae9 Binary files /dev/null and b/docs/22.2.3/fonts/Work_Sans_300.woff differ diff --git a/docs/22.2.3/fonts/Work_Sans_300.woff2 b/docs/22.2.3/fonts/Work_Sans_300.woff2 new file mode 100644 index 000000000..f6e216d64 Binary files /dev/null and b/docs/22.2.3/fonts/Work_Sans_300.woff2 differ diff --git a/docs/22.2.3/fonts/Work_Sans_500.eot b/docs/22.2.3/fonts/Work_Sans_500.eot new file mode 100644 index 000000000..9df692942 Binary files /dev/null and b/docs/22.2.3/fonts/Work_Sans_500.eot differ diff --git a/docs/22.2.3/fonts/Work_Sans_500.svg b/docs/22.2.3/fonts/Work_Sans_500.svg new file mode 100644 index 000000000..4b030b790 --- /dev/null +++ b/docs/22.2.3/fonts/Work_Sans_500.svg @@ -0,0 +1,333 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/22.2.3/fonts/Work_Sans_500.ttf b/docs/22.2.3/fonts/Work_Sans_500.ttf new file mode 100644 index 000000000..5b8cc5342 Binary files /dev/null and b/docs/22.2.3/fonts/Work_Sans_500.ttf differ diff --git a/docs/22.2.3/fonts/Work_Sans_500.woff b/docs/22.2.3/fonts/Work_Sans_500.woff new file mode 100644 index 000000000..df058514f Binary files /dev/null and b/docs/22.2.3/fonts/Work_Sans_500.woff differ diff --git a/docs/22.2.3/fonts/Work_Sans_500.woff2 b/docs/22.2.3/fonts/Work_Sans_500.woff2 new file mode 100644 index 000000000..b06c54df0 Binary files /dev/null and b/docs/22.2.3/fonts/Work_Sans_500.woff2 differ diff --git a/docs/22.2.3/images/.gitkeep b/docs/22.2.3/images/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/docs/22.2.3/images/clippy.svg b/docs/22.2.3/images/clippy.svg new file mode 100644 index 000000000..1c8abc2fd --- /dev/null +++ b/docs/22.2.3/images/clippy.svg @@ -0,0 +1 @@ + diff --git a/docs/22.2.3/images/favicon.png b/docs/22.2.3/images/favicon.png new file mode 100644 index 000000000..df06e35d6 Binary files /dev/null and b/docs/22.2.3/images/favicon.png differ diff --git a/docs/22.2.3/images/fmw_12c_12_2_1_4_0-logo.png b/docs/22.2.3/images/fmw_12c_12_2_1_4_0-logo.png new file mode 100644 index 000000000..6a2d34fff Binary files /dev/null and b/docs/22.2.3/images/fmw_12c_12_2_1_4_0-logo.png differ diff --git a/docs/22.2.3/images/gopher-404.jpg b/docs/22.2.3/images/gopher-404.jpg new file mode 100644 index 000000000..2a5054389 Binary files /dev/null and b/docs/22.2.3/images/gopher-404.jpg differ diff --git a/docs/22.2.3/images/logo.png b/docs/22.2.3/images/logo.png new file mode 100644 index 000000000..6bfe10627 Binary files /dev/null and b/docs/22.2.3/images/logo.png differ diff --git a/docs/22.2.3/images/soa-domains/CreateApplicationServerConnection.jpg b/docs/22.2.3/images/soa-domains/CreateApplicationServerConnection.jpg new file mode 100644 index 000000000..e69f13ac0 Binary files /dev/null and b/docs/22.2.3/images/soa-domains/CreateApplicationServerConnection.jpg differ diff --git a/docs/22.2.3/images/soa-domains/CreateApplicationServerConnectionTestConnection.jpg b/docs/22.2.3/images/soa-domains/CreateApplicationServerConnectionTestConnection.jpg new file mode 100644 index 000000000..84796fec9 Binary files /dev/null and b/docs/22.2.3/images/soa-domains/CreateApplicationServerConnectionTestConnection.jpg differ diff --git a/docs/22.2.3/images/soa-domains/ExposeSOAMST3.png b/docs/22.2.3/images/soa-domains/ExposeSOAMST3.png new file mode 100644 index 000000000..119d72c67 Binary files /dev/null and b/docs/22.2.3/images/soa-domains/ExposeSOAMST3.png differ diff --git a/docs/22.2.3/images/soa-domains/JDEV_OSB_Deploy_Success_Status.png b/docs/22.2.3/images/soa-domains/JDEV_OSB_Deploy_Success_Status.png new file mode 100644 index 000000000..26adedcf5 Binary files /dev/null and b/docs/22.2.3/images/soa-domains/JDEV_OSB_Deploy_Success_Status.png differ diff --git a/docs/22.2.3/images/soa-domains/JDEV_OSB_Deploying_Progress.png b/docs/22.2.3/images/soa-domains/JDEV_OSB_Deploying_Progress.png new file mode 100644 index 000000000..c834a7852 Binary files /dev/null and b/docs/22.2.3/images/soa-domains/JDEV_OSB_Deploying_Progress.png differ diff --git a/docs/22.2.3/images/soa-domains/JDEV_OSB_Deployment_Start.png b/docs/22.2.3/images/soa-domains/JDEV_OSB_Deployment_Start.png new file mode 100644 index 000000000..e15c9d7a4 Binary files /dev/null and b/docs/22.2.3/images/soa-domains/JDEV_OSB_Deployment_Start.png differ diff --git a/docs/22.2.3/images/soa-domains/JDEV_OSB_Deployment_Summary.jpg b/docs/22.2.3/images/soa-domains/JDEV_OSB_Deployment_Summary.jpg new file mode 100644 index 000000000..303ab5151 Binary files /dev/null and b/docs/22.2.3/images/soa-domains/JDEV_OSB_Deployment_Summary.jpg differ diff --git a/docs/22.2.3/images/soa-domains/JDEV_OSB_Deployment_Summary.png b/docs/22.2.3/images/soa-domains/JDEV_OSB_Deployment_Summary.png new file mode 100644 index 000000000..303ab5151 Binary files /dev/null and b/docs/22.2.3/images/soa-domains/JDEV_OSB_Deployment_Summary.png differ diff --git a/docs/22.2.3/images/soa-domains/JDEV_OSB_Select_Application_Server.png b/docs/22.2.3/images/soa-domains/JDEV_OSB_Select_Application_Server.png new file mode 100644 index 000000000..1ea311e9c Binary files /dev/null and b/docs/22.2.3/images/soa-domains/JDEV_OSB_Select_Application_Server.png differ diff --git a/docs/22.2.3/images/soa-domains/JDEV_OSB_Select_Deployment_Action.png b/docs/22.2.3/images/soa-domains/JDEV_OSB_Select_Deployment_Action.png new file mode 100644 index 000000000..ae3fecbf8 Binary files /dev/null and b/docs/22.2.3/images/soa-domains/JDEV_OSB_Select_Deployment_Action.png differ diff --git a/docs/22.2.3/images/soa-domains/JDEV_OSB_servicebus_launch_test_console.png b/docs/22.2.3/images/soa-domains/JDEV_OSB_servicebus_launch_test_console.png new file mode 100644 index 000000000..a01fe9f55 Binary files /dev/null and b/docs/22.2.3/images/soa-domains/JDEV_OSB_servicebus_launch_test_console.png differ diff --git a/docs/22.2.3/images/soa-domains/JDEV_Reference_Config_Settings.png b/docs/22.2.3/images/soa-domains/JDEV_Reference_Config_Settings.png new file mode 100644 index 000000000..549fa9390 Binary files /dev/null and b/docs/22.2.3/images/soa-domains/JDEV_Reference_Config_Settings.png differ diff --git a/docs/22.2.3/images/soa-domains/JDEV_SOA_Deploy_Configuration.png b/docs/22.2.3/images/soa-domains/JDEV_SOA_Deploy_Configuration.png new file mode 100644 index 000000000..8d4320237 Binary files /dev/null and b/docs/22.2.3/images/soa-domains/JDEV_SOA_Deploy_Configuration.png differ diff --git a/docs/22.2.3/images/soa-domains/JDEV_SOA_Deploy_Success_Status.png b/docs/22.2.3/images/soa-domains/JDEV_SOA_Deploy_Success_Status.png new file mode 100644 index 000000000..84a132f0b Binary files /dev/null and b/docs/22.2.3/images/soa-domains/JDEV_SOA_Deploy_Success_Status.png differ diff --git a/docs/22.2.3/images/soa-domains/JDEV_SOA_Deploying_Progress.png b/docs/22.2.3/images/soa-domains/JDEV_SOA_Deploying_Progress.png new file mode 100644 index 000000000..ef49c887c Binary files /dev/null and b/docs/22.2.3/images/soa-domains/JDEV_SOA_Deploying_Progress.png differ diff --git a/docs/22.2.3/images/soa-domains/JDEV_SOA_Deployment_Start.png b/docs/22.2.3/images/soa-domains/JDEV_SOA_Deployment_Start.png new file mode 100644 index 000000000..45cb532c7 Binary files /dev/null and b/docs/22.2.3/images/soa-domains/JDEV_SOA_Deployment_Start.png differ diff --git a/docs/22.2.3/images/soa-domains/JDEV_SOA_Deployment_Summary.png b/docs/22.2.3/images/soa-domains/JDEV_SOA_Deployment_Summary.png new file mode 100644 index 000000000..02ac26fdc Binary files /dev/null and b/docs/22.2.3/images/soa-domains/JDEV_SOA_Deployment_Summary.png differ diff --git a/docs/22.2.3/images/soa-domains/JDEV_SOA_Select_Application_Server.png b/docs/22.2.3/images/soa-domains/JDEV_SOA_Select_Application_Server.png new file mode 100644 index 000000000..f751e0c56 Binary files /dev/null and b/docs/22.2.3/images/soa-domains/JDEV_SOA_Select_Application_Server.png differ diff --git a/docs/22.2.3/images/soa-domains/JDEV_SOA_Select_Deployment_Action.png b/docs/22.2.3/images/soa-domains/JDEV_SOA_Select_Deployment_Action.png new file mode 100644 index 000000000..a4eaf58fb Binary files /dev/null and b/docs/22.2.3/images/soa-domains/JDEV_SOA_Select_Deployment_Action.png differ diff --git a/docs/22.2.3/images/soa-domains/JDEV_SOA_Server_Lookup.png b/docs/22.2.3/images/soa-domains/JDEV_SOA_Server_Lookup.png new file mode 100644 index 000000000..fae2f2378 Binary files /dev/null and b/docs/22.2.3/images/soa-domains/JDEV_SOA_Server_Lookup.png differ diff --git a/docs/22.2.3/images/soa-domains/JDEV_SOA_Target_soa_servers.png b/docs/22.2.3/images/soa-domains/JDEV_SOA_Target_soa_servers.png new file mode 100644 index 000000000..5b8cd53f6 Binary files /dev/null and b/docs/22.2.3/images/soa-domains/JDEV_SOA_Target_soa_servers.png differ diff --git a/docs/22.2.3/images/soa-domains/JDEV_SOA_soainfra_server1.png b/docs/22.2.3/images/soa-domains/JDEV_SOA_soainfra_server1.png new file mode 100644 index 000000000..9f225df7c Binary files /dev/null and b/docs/22.2.3/images/soa-domains/JDEV_SOA_soainfra_server1.png differ diff --git a/docs/22.2.3/images/soa-domains/JDEV_SOA_soainfra_server2.png b/docs/22.2.3/images/soa-domains/JDEV_SOA_soainfra_server2.png new file mode 100644 index 000000000..4e5e1f768 Binary files /dev/null and b/docs/22.2.3/images/soa-domains/JDEV_SOA_soainfra_server2.png differ diff --git a/docs/22.2.3/images/soa-domains/SOA_Composites_Deploy_using_Jdev.png b/docs/22.2.3/images/soa-domains/SOA_Composites_Deploy_using_Jdev.png new file mode 100644 index 000000000..baaf4f82b Binary files /dev/null and b/docs/22.2.3/images/soa-domains/SOA_Composites_Deploy_using_Jdev.png differ diff --git a/docs/22.2.3/images/soa-domains/custIdentity-custTrust-keystores.png b/docs/22.2.3/images/soa-domains/custIdentity-custTrust-keystores.png new file mode 100644 index 000000000..290492743 Binary files /dev/null and b/docs/22.2.3/images/soa-domains/custIdentity-custTrust-keystores.png differ diff --git a/docs/22.2.3/images/soasuite-logo.png b/docs/22.2.3/images/soasuite-logo.png new file mode 100644 index 000000000..347663f5b Binary files /dev/null and b/docs/22.2.3/images/soasuite-logo.png differ diff --git a/docs/22.2.3/index.html b/docs/22.2.3/index.html new file mode 100644 index 000000000..a837b7f65 --- /dev/null +++ b/docs/22.2.3/index.html @@ -0,0 +1,1282 @@ + + + + + + + + + + + + Oracle Fusion Middleware on Kubernetes :: Oracle Fusion Middleware on Kubernetes + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ +
+ +
+ +
+ + + + + + + navigation + + + +

Oracle Fusion Middleware on Kubernetes

+

Oracle supports the deployment of the following Oracle Fusion Middleware products on Kubernetes. Click on the appropriate document link below to get started on setting up the product.

+ + + + + + + +
    + + + + + + + + + + + + + + + + + + + +

    +Oracle WebCenter Portal +

    + + + + + +

    The WebLogic Kubernetes operator (the “operator”) supports deployment of Oracle WebCenter Portal. Follow the instructions in this guide to set up Oracle WebCenter Portal domain on Kubernetes.

    + + + + + + + + +
+ + + + + + + +
+ + +
+ + + +
+ +
+
+
+ + + + + + + + + + + + + + + + + + + diff --git a/docs/22.2.3/index.json b/docs/22.2.3/index.json new file mode 100644 index 000000000..8d4415e66 --- /dev/null +++ b/docs/22.2.3/index.json @@ -0,0 +1,197 @@ +[ +{ + "uri": "/fmw-kubernetes/22.2.3/", + "title": "Oracle Fusion Middleware on Kubernetes", + "tags": [], + "description": "This document lists all the Oracle Fusion Middleware products deployment supported on Kubernetes.", + "content": "Oracle Fusion Middleware on Kubernetes Oracle supports the deployment of the following Oracle Fusion Middleware products on Kubernetes. Click on the appropriate document link below to get started on setting up the product.\n Oracle WebCenter Portal The WebLogic Kubernetes operator (the “operator”) supports deployment of Oracle WebCenter Portal. Follow the instructions in this guide to set up Oracle WebCenter Portal domain on Kubernetes.\n " +}, +{ + "uri": "/fmw-kubernetes/22.2.3/wcportal-domains/appendix/wcp-cluster-sizing-info/", + "title": "Domain resource sizing", + "tags": [], + "description": "Describes the resourse sizing information for the Oracle WebCenter Portal domain setup on Kubernetes cluster.", + "content": "Oracle WebCenter Portal cluster sizing recommendations WebCenter Portal Normal Usage Moderate Usage High Usage Admin Server No of CPU(s) : 1, Memory : 4GB No of CPU(s) : 1, Memory : 4GB No of CPU(s) : 1, Memory : 4GB Number of Managed Server No of Servers : 2 No of Servers : 2 No of Servers : 3 Configurations per Managed Server No of CPU(s) : 2, Memory : 16GB No of CPU(s) : 4, Memory : 16GB No of CPU(s) : 6, Memory : 16-32GB PV Storage Minimum 250GB Minimum 250GB Minimum 500GB " +}, +{ + "uri": "/fmw-kubernetes/22.2.3/wcportal-domains/manage-wcportal-domains/configure-load-balancer/", + "title": "Set up a load balancer", + "tags": [], + "description": "Configure different load balancers for the Oracle WebCenter Portal domain.", + "content": "The WebLogic Kubernetes Operator supports ingress-based load balancers such as Traefik and NGINX (kubernetes/ingress-nginx) . It also supports the Apache webtier load balancer.\n Traefik Configure the ingress-based Traefik load balancer for an Oracle WebCenter Portal domain.\n NGINX Configure the ingress-based NGINX load balancer for an Oracle WebCenter Portal domain.\n Apache webtier Configure the Apache webtier load balancer for an Oracle WebCenter Portal domain.\n " +}, +{ + "uri": "/fmw-kubernetes/22.2.3/wcportal-domains/manage-wcportal-domains/configure-load-balancer/traefik/", + "title": "Traefik", + "tags": [], + "description": "Configure the ingress-based Traefik load balancer for an Oracle WebCenter Portal domain.", + "content": "To load balance Oracle WebCenter Portal domain clusters, you can install the ingress-based Traefik load balancer (version 2.2.1 or later for production deployments) and configure it for non-SSL, SSL termination, and end-to-end SSL access of the application URL. Follow these steps to set up Traefik as a load balancer for an Oracle WebCenter Portal domain in a Kubernetes cluster:\n Non-SSL and SSL termination\n Install the Traefik (ingress-based) load balancer Configure Traefik to manage ingresses Create an Ingress for the domain Verify domain application URL access Uninstall the Traefik ingress End-to-end SSL configuration\n Install the Traefik load balancer for End-to-end SSL Configure Traefik to manage domain Create IngressRouteTCP Verify end-to-end SSL access Uninstall Traefik Non-SSL and SSL termination Install the Traefik (ingress-based) load balancer Use Helm to install the Traefik (ingress-based) load balancer. You can use the following values.yaml sample file and set kubernetes.namespaces as required.\n$ cd ${WORKDIR} $ kubectl create namespace traefik $ helm repo add traefik https://containous.github.io/traefik-helm-chart Sample output:\n\u0026#34;traefik\u0026#34; has been added to your repositories Install Traefik:\n$ helm install traefik traefik/traefik \\ --namespace traefik \\ --values charts/traefik/values.yaml \\ --set \u0026#34;kubernetes.namespaces={traefik}\u0026#34; \\ --set \u0026#34;service.type=NodePort\u0026#34; --wait Click here to see the sample output. LAST DEPLOYED: Sun Sep 13 21:32:00 2020 NAMESPACE: traefik STATUS: deployed REVISION: 1 TEST SUITE: None A sample values.yaml for deployment of Traefik 2.2.x looks like this:\nimage: name: traefik tag: 2.2.8 pullPolicy: IfNotPresent ingressRoute: dashboard: enabled: true annotations: {} labels: {} providers: kubernetesCRD: enabled: true kubernetesIngress: enabled: true ports: traefik: port: 9000 expose: true exposedPort: 9000 protocol: TCP web: port: 8000 expose: true exposedPort: 30305 nodePort: 30305 protocol: TCP websecure: port: 8443 expose: true exposedPort: 30443 protocol: TCP nodePort: 30443 Verify the Traefik status and find the port number of the SSL and non-SSL services:\n$ kubectl get all -n traefik Click here to see the sample output. NAME READY STATUS RESTARTS AGE pod/traefik-f9cf58697-29dlx 1/1 Running 0 35s NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE service/traefik NodePort 10.100.113.37 \u0026lt;none\u0026gt; 9000:30070/TCP,30305:30305/TCP,30443:30443/TCP 35s NAME READY UP-TO-DATE AVAILABLE AGE deployment.apps/traefik 1/1 1 1 36s NAME DESIRED CURRENT READY AGE replicaset.apps/traefik-f9cf58697 1 1 1 36s Access the Traefik dashboard through the URL http://$(hostname -f):30070, with the HTTP host traefik.example.com:\n$ curl -H \u0026#34;host: $(hostname -f)\u0026#34; http://$(hostname -f):30070/dashboard/ Note: Make sure that you specify a fully qualified node name for $(hostname -f)\n Configure Traefik to manage ingresses Configure Traefik to manage ingresses created in this namespace. In the following sample, traefik is the Traefik namespace and wcpns is the namespace of the domain:\n$ helm upgrade traefik traefik/traefik \\ --reuse-values \\ --namespace traefik \\ --set \u0026#34;kubernetes.namespaces={traefik,wcpns}\u0026#34; \\ --wait Click here to see the sample output. Release \u0026#34;traefik\u0026#34; has been upgraded. Happy Helming! NAME: traefik LAST DEPLOYED: Tue Jan 12 04:33:15 2021 NAMESPACE: traefik STATUS: deployed REVISION: 2 TEST SUITE: None Create an ingress for the domain Create an ingress for the domain in the domain namespace by using the sample Helm chart. Here path-based routing is used for ingress. Sample values for default configuration are shown in the file ${WORKDIR}/charts/ingress-per-domain/values.yaml. By default, type is TRAEFIK , tls is Non-SSL. You can override these values by passing values through the command line or edit them in the sample values.yaml file based on the type of configuration (non-SSL or SSL).\n NOTE: This is not an exhaustive list of rules. You can enhance it based on the application URLs that need to be accessed externally.\n If needed, you can update the ingress YAML file to define more path rules (in section spec.rules.host.http.paths) based on the domain application URLs that need to be accessed. The template YAML file for the Traefik (ingress-based) load balancer is located at ${WORKDIR}/charts/ingress-per-domain/templates/traefik-ingress.yaml You can add new path rules like shown below .\n- path: /NewPathRule backend: serviceName: \u0026#39;Backend Service Name\u0026#39; servicePort: \u0026#39;Backend Service Port\u0026#39; Install ingress-per-domain using Helm for non-SSL configuration:\n$ cd ${WORKDIR} $ helm install wcp-traefik-ingress \\ charts/ingress-per-domain \\ --namespace wcpns \\ --values charts/ingress-per-domain/values.yaml \\ --set \u0026#34;traefik.hostname=$(hostname -f)\u0026#34; Sample output:\nNAME: wcp-traefik-ingress LAST DEPLOYED: Mon Jul 20 11:44:13 2020 NAMESPACE: wcpns STATUS: deployed REVISION: 1 TEST SUITE: None For secured access (SSL) to the Oracle WebCenter Portal application, create a certificate and generate a Kubernetes secret:\n$ openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /tmp/tls1.key -out /tmp/tls1.crt -subj \u0026#34;/CN=*\u0026#34; $ kubectl -n wcpns create secret tls wcp-domain-tls-cert --key /tmp/tls1.key --cert /tmp/tls1.crt Note: The value of CN is the host on which this ingress is to be deployed.\n Create the Traefik TLSStore custom resource.\nIn case of SSL termination, Traefik should be configured to use the user-defined SSL certificate. If the user-defined SSL certificate is not configured, Traefik creates a default SSL certificate. To configure a user-defined SSL certificate for Traefik, use the TLSStore custom resource. The Kubernetes secret created with the SSL certificate should be referenced in the TLSStore object. Run the following command to create the TLSStore:\n$ cat \u0026lt;\u0026lt;EOF | kubectl apply -f - apiVersion: traefik.containo.us/v1alpha1 kind: TLSStore metadata: name: default namespace: wcpns spec: defaultCertificate: secretName: wcp-domain-tls-cert EOF Install ingress-per-domain using Helm for SSL configuration.\nThe Kubernetes secret name should be updated in the template file.\nThe template file also contains the following annotations:\ntraefik.ingress.kubernetes.io/router.entrypoints: websecure traefik.ingress.kubernetes.io/router.tls: \u0026#34;true\u0026#34; traefik.ingress.kubernetes.io/router.middlewares: wcpns-wls-proxy-ssl@kubernetescrd The entry point for SSL access and the Middleware name should be updated in the annotation. The Middleware name should be in the form \u0026lt;namespace\u0026gt;-\u0026lt;middleware name\u0026gt;@kubernetescrd.\n$ cd ${WORKDIR} $ helm install wcp-traefik-ingress \\ charts/ingress-per-domain \\ --namespace wcpns \\ --values charts/ingress-per-domain/values.yaml \\ --set \u0026#34;traefik.hostname=$(hostname -f)\u0026#34; \\ --set sslType=SSL Sample output:\nNAME: wcp-traefik-ingress LAST DEPLOYED: Mon Jul 20 11:44:13 2020 NAMESPACE: wcpns STATUS: deployed REVISION: 1 TEST SUITE: None For non-SSL access to the Oracle WebCenter Portal application, get the details of the services by the ingress:\n$ kubectl describe ingress wcp-domain-traefik -n wcpns Click here to see all services supported by the above deployed ingress. Name: wcp-domain-traefik Namespace: wcpns Address: Default backend: default-http-backend:80 (\u0026lt;error: endpoints \u0026#34;default-http-backend\u0026#34; not found\u0026gt;) Rules: Host Path Backends ---- ---- -------- www.example.com /webcenter wcp-domain-cluster-wcp-cluster:8888 (10.244.0.52:8888,10.244.0.53:8888) /console wcp-domain-adminserver:7001 (10.244.0.51:7001) /rsscrawl wcp-domain-cluster-wcp-cluster:8888 (10.244.0.52:8888,10.244.0.53:8888) /rest wcp-domain-cluster-wcp-cluster:8888 (10.244.0.52:8888,10.244.0.53:8888) /webcenterhelp wcp-domain-cluster-wcp-cluster:8888 (10.244.0.52:8888,10.244.0.53:8888) /em wcp-domain-adminserver:7001 (10.244.0.51:7001) /wsrp-tools wcp-domain-cluster-wcportlet-cluster:8889 (10.244.0.52:8889,10.244.0.53:8889) /portalTools wcp-domain-cluster-wcportlet-cluster:8889 (10.244.0.52:8889,10.244.0.53:8889) Annotations: kubernetes.io/ingress.class: traefik meta.helm.sh/release-name: wcp-traefik-ingress meta.helm.sh/release-namespace: wcpns Events: \u0026lt;none\u0026gt; For SSL access to the Oracle WebCenter Portal application, get the details of the services by the above deployed ingress:\n$ kubectl describe ingress wcp-domain-traefik -n wcpns Click here to see all services supported by the above deployed ingress. Name: wcp-domain-traefik Namespace: wcpns Address: Default backend: default-http-backend:80 (\u0026lt;error: endpoints \u0026quot;default-http-backend\u0026quot; not found\u0026gt;) TLS: wcp-domain-tls-cert terminates www.example.com Rules: Host Path Backends ---- ---- -------- www.example.com /webcenter wcp-domain-cluster-wcp-cluster:8888 (10.244.0.52:8888,10.244.0.53:8888) /console wcp-domain-adminserver:7001 (10.244.0.51:7001) /rsscrawl wcp-domain-cluster-wcp-cluster:8888 (10.244.0.52:8888,10.244.0.53:8888) /rest wcp-domain-cluster-wcp-cluster:8888 (10.244.0.52:8888,10.244.0.53:8888) /webcenterhelp wcp-domain-cluster-wcp-cluster:8888 (10.244.0.52:8888,10.244.0.53:8888) /em wcp-domain-adminserver:7001 (10.244.0.51:7001) /wsrp-tools wcp-domain-cluster-wcportlet-cluster:8889 (10.244.0.52:8889,10.244.0.53:8889) /portalTools wcp-domain-cluster-wcportlet-cluster:8889 (10.244.0.52:8889,10.244.0.53:8889) Annotations: kubernetes.io/ingress.class: traefik meta.helm.sh/release-name: wcp-traefik-ingress meta.helm.sh/release-namespace: wcpns traefik.ingress.kubernetes.io/router.entrypoints: websecure traefik.ingress.kubernetes.io/router.middlewares: wcpns-wls-proxy-ssl@kubernetescrd traefik.ingress.kubernetes.io/router.tls: true Events: \u0026lt;none\u0026gt; To confirm that the load balancer noticed the new ingress and is successfully routing to the domain server pods, you can send a request to the URL for the WebLogic ReadyApp framework, which should return an HTTP 200 status code, as follows:\n$ curl -v http://${LOADBALANCER_HOSTNAME}:${LOADBALANCER_PORT}/weblogic/ready * Trying 149.87.129.203... \u0026gt; GET http://${LOADBALANCER_HOSTNAME}:${LOADBALANCER_PORT}/weblogic/ready HTTP/1.1 \u0026gt; User-Agent: curl/7.29.0 \u0026gt; Accept: */* \u0026gt; Proxy-Connection: Keep-Alive \u0026gt; host: $(hostname -f) \u0026gt; \u0026lt; HTTP/1.1 200 OK \u0026lt; Date: Sat, 14 Mar 2020 08:35:03 GMT \u0026lt; Vary: Accept-Encoding \u0026lt; Content-Length: 0 \u0026lt; Proxy-Connection: Keep-Alive \u0026lt; * Connection #0 to host localhost left intact Verify domain application URL access For non-SSL configuration After setting up the Traefik (ingress-based) load balancer, verify that the domain application URLs are accessible through the non-SSL load balancer port 30305 for HTTP access. The sample URLs for Oracle WebCenter Portal domain are:\nhttp://${LOADBALANCER_HOSTNAME}:${LOADBALANCER-Non-SSLPORT}/webcenter http://${LOADBALANCER_HOSTNAME}:${LOADBALANCER-Non-SSLPORT}/console http://${LOADBALANCER_HOSTNAME}:${LOADBALANCER-Non-SSLPORT}/em http://${LOADBALANCER_HOSTNAME}:${LOADBALANCER-Non-SSLPORT}/rsscrawl http://${LOADBALANCER_HOSTNAME}:${LOADBALANCER-Non-SSLPORT}/rest http://${LOADBALANCER_HOSTNAME}:${LOADBALANCER-Non-SSLPORT}/webcenterhelp http://${LOADBALANCER_HOSTNAME}:${LOADBALANCER-Non-SSLPORT}/wsrp-tools http://${LOADBALANCER_HOSTNAME}:${LOADBALANCER-Non-SSLPORT}/portalTools For SSL configuration After setting up the Traefik (ingress-based) load balancer, verify that the domain applications are accessible through the SSL load balancer port 30443 for HTTPS access. The sample URLs for Oracle WebCenter Portal domain are:\nhttps://${LOADBALANCER_HOSTNAME}:${LOADBALANCER-SSLPORT}/webcenter https://${LOADBALANCER_HOSTNAME}:${LOADBALANCER-SSLPORT}/console https://${LOADBALANCER_HOSTNAME}:${LOADBALANCER-SSLPORT}/em https://${LOADBALANCER_HOSTNAME}:${LOADBALANCER-SSLPORT}/rsscrawl https://${LOADBALANCER_HOSTNAME}:${LOADBALANCER-SSLPORT}/rest https://${LOADBALANCER_HOSTNAME}:${LOADBALANCER-SSLPORT}/webcenterhelp https://${LOADBALANCER_HOSTNAME}:${LOADBALANCER-SSLPORT}/wsrp-tools https://${LOADBALANCER_HOSTNAME}:${LOADBALANCER-SSLPORT}/portalTools Uninstall the Traefik ingress Uninstall and delete the ingress deployment:\n$ helm delete wcp-traefik-ingress -n wcpns End-to-end SSL configuration Install the Traefik load balancer for end-to-end SSL Use Helm to install the Traefik (ingress-based) load balancer. You can use the values.yaml sample file and set kubernetes.namespaces as required.\n$ cd ${WORKDIR} $ kubectl create namespace traefik $ helm repo add traefik https://containous.github.io/traefik-helm-chart Sample output:\n\u0026#34;traefik\u0026#34; has been added to your repositories Install Traefik:\n$ helm install traefik traefik/traefik \\ --namespace traefik \\ --values charts/traefik/values.yaml \\ --set \u0026#34;kubernetes.namespaces={traefik}\u0026#34; \\ --set \u0026#34;service.type=NodePort\u0026#34; --wait Click here to see the sample output. LAST DEPLOYED: Sun Sep 13 21:32:00 2020 NAMESPACE: traefik STATUS: deployed REVISION: 1 TEST SUITE: None Verify the Traefik operator status and find the port number of the SSL and non-SSL services:\n$ kubectl get all -n traefik Click here to see the sample output. NAME READY STATUS RESTARTS AGE pod/traefik-845f5d6dbb-swb96 1/1 Running 0 32s NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE service/traefik NodePort 10.99.52.249 \u0026lt;none\u0026gt; 9000:31288/TCP,30305:30305/TCP,30443:30443/TCP 32s NAME READY UP-TO-DATE AVAILABLE AGE deployment.apps/traefik 1/1 1 1 33s NAME DESIRED CURRENT READY AGE replicaset.apps/traefik-845f5d6dbb 1 1 1 33s Access the Traefik dashboard through the URL http://$(hostname -f):31288, with the HTTP host traefik.example.com:\n$ curl -H \u0026#34;host: $(hostname -f)\u0026#34; http://$(hostname -f):31288/dashboard/ Note: Make sure that you specify a fully qualified node name for $(hostname -f).\n Configure Traefik to manage the domain Configure Traefik to manage the domain application service created in this namespace. In the following sample, traefik is the Traefik namespace and wcpns is the namespace of the domain:\n$ helm upgrade traefik traefik/traefik --namespace traefik --reuse-values \\ --set \u0026#34;kubernetes.namespaces={traefik,wcpns}\u0026#34; Click here to see the sample output. Release \u0026quot;traefik\u0026quot; has been upgraded. Happy Helming! NAME: traefik LAST DEPLOYED: Sun Sep 13 21:32:12 2020 NAMESPACE: traefik STATUS: deployed REVISION: 2 TEST SUITE: None Create IngressRouteTCP For each backend service, create different ingresses, as Traefik does not support multiple paths or rules with annotation ssl-passthrough. For example, for wcp-domain-adminserver and wcp-domain-cluster-wcp-cluster, different ingresses must be created.\n To enable SSL passthrough in Traefik, you can configure a TCP router. A sample YAML for IngressRouteTCP is available at ${WORKDIR}/charts/ingress-per-domain/tls/traefik-tls.yaml. The following should be updated in traefik-tls.yaml:\n The service name and the SSL port should be updated in the services. The load balancer host name should be updated in the HostSNI rule. Sample traefik-tls.yaml:\napiVersion: traefik.containo.us/v1alpha1 kind: IngressRouteTCP metadata: name: wcp-domain-cluster-routetcp namespace: wcpns spec: entryPoints: - websecure routes: - match: HostSNI(`${LOADBALANCER_HOSTNAME}`) services: - name: wcp-domain-cluster-wcp-cluster port: 8888 weight: 3 TerminationDelay: 400 tls: passthrough: true Create the IngressRouteTCP:\n$ kubectl apply -f traefik-tls.yaml Verify end-to-end SSL access Verify the access to application URLs exposed through the configured service. The configured WCP cluster service enables you to access the following WCP domain URLs:\nhttps://${LOADBALANCER_HOSTNAME}:${LOADBALANCER-SSLPORT}/webcenter https://${LOADBALANCER_HOSTNAME}:${LOADBALANCER-SSLPORT}/rsscrawl https://${LOADBALANCER_HOSTNAME}:${LOADBALANCER-SSLPORT}/rest https://${LOADBALANCER_HOSTNAME}:${LOADBALANCER-SSLPORT}/webcenterhelp Uninstall Traefik $ helm delete traefik -n traefik $ cd ${WORKDIR}/charts/ingress-per-domain/tls $ kubectl delete -f traefik-tls.yaml " +}, +{ + "uri": "/fmw-kubernetes/22.2.3/wcportal-domains/manage-wcportal-domains/monitoring-and-publishing-logs/publishing-logs/fluentd/", + "title": " Fluentd", + "tags": [], + "description": "Describes how to configure a WebCenter Portal domain to use Fluentd to send log information to Elasticsearch.", + "content": "Overview You can configure your WebLogic domain to use Fluentd so it can send the log information to Elasticsearch.\nHere\u0026rsquo;s how this works:\n fluentd runs as a separate container in the Administration Server and Managed Server pods. The log files reside on a volume that is shared between the weblogic-server and fluentd containers. fluentd tails the domain logs files and exports them to Elasticsearch. A ConfigMap contains the filter and format rules for exporting log records. Prerequisites It is assumed that you are editing an existing WebCenter Portal domain. However, you can make all the changes to the domain YAML before creating the domain. A complete example of a domain definition with fluentd configuration is at the end of this document.\nThese identifiers are used in the sample commands.\n wcpns: WebCenter Portal domain namespace wcp-domain: domainUID wcp-domain-domain-credentials: Kubernetes secret The sample Elasticsearch configuration is:\nelasticsearchhost: elasticsearch.wcp-domain.sample.com elasticsearchport: 443 elasticsearchuser: username elasticsearchpassword: password Install Elasticsearch and Kibana To install Elasticsearch and Kibana, run the following command:\n$ kubectl apply -f kubernetes/samples/scripts/elasticsearch-and-kibana/elasticsearch_and_kibana.yaml Configure log files to use a volume The domain log files must be written to a volume that can be shared between the weblogic-server and fluentd containers. The following elements are required to accomplish this:\n logHome must be a path that can be shared between containers. logHomeEnabled must be set to true so that the logs are written outside the pod and persist across pod restarts. A volume must be defined on which the log files will reside. In the example, emptyDir is a volume that gets created when a Pod is created. It will persist across pod restarts but deleting the pod would delete the emptyDir content. The volumeMounts mounts the named volume created with emptyDir and establishes the base path for accessing the volume. NOTE: For brevity, only the paths to the relevant configuration are here.\nFor Example, run : kubectl edit domain wcp-domain -n wcpns and make the following edits:\nspec: logHome: /u01/oracle/user_projects/domains/logs/wcp-domain logHomeEnabled: true serverPod: volumes: - emptyDir: {} name: weblogic-domain-storage-volume volumeMounts: - mountPath: /scratch name: weblogic-domain-storage-volume Add Elasticsearch secrets to WebLogic domain credentials Configure the fluentd container to look for Elasticsearch parameters in the domain credentials. Edit the domain credentials and add the parameters shown in the example below.\nFor example, run: kubectl edit secret wcp-domain-domain-credentials -n wcpns and add the base64 encoded values of each Elasticsearch parameter:\nelasticsearchhost: ZWxhc3RpY3NlYXJjaC5ib2JzLWJvb2tzLnNhbXBsZS5jb20= elasticsearchport: NDQz elasticsearchuser: Ym9i elasticsearchpassword: d2VsY29tZTE= Create Fluentd configuration Create a ConfigMap named fluentd-config in the namespace of the domain. The ConfigMap contains the parsing rules and Elasticsearch configuration.\nHere\u0026rsquo;s an explanation of some elements defined in the ConfigMap:\n The @type tail indicates that tail is used to obtain updates to the log file. The path of the log file obtained from the LOG_PATH environment variable that is defined in the fluentd container. The tag value of log records obtained from the DOMAIN_UID environment variable that is defined in the fluentd container. The \u0026lt;parse\u0026gt; section defines how to interpret and tag each element of a log record. The \u0026lt;match **\u0026gt; section contains the configuration information for connecting to Elasticsearch and defines the index name of each record to be the domainUID. The scheme indicates type of connection between fluentd and Elasticsearch. The following is an example of how to create the ConfigMap:\ncat \u0026lt;\u0026lt;EOF | kubectl apply -f - apiVersion: v1 kind: ConfigMap metadata: labels: weblogic.domainUID: wcp-domain weblogic.resourceVersion: domain-v2 name: fluentd-config namespace: wcpns data: fluentd.conf: | \u0026lt;match fluent.**\u0026gt; @type null \u0026lt;/match\u0026gt; \u0026lt;source\u0026gt; @type tail path \u0026#34;#{ENV[\u0026#39;LOG_PATH\u0026#39;]}\u0026#34; pos_file /tmp/server.log.pos read_from_head true tag \u0026#34;#{ENV[\u0026#39;DOMAIN_UID\u0026#39;]}\u0026#34; # multiline_flush_interval 20s \u0026lt;parse\u0026gt; @type multiline format_firstline /^####/ format1 /^####\u0026lt;(?\u0026lt;timestamp\u0026gt;(.*?))\u0026gt;/ format2 / \u0026lt;(?\u0026lt;level\u0026gt;(.*?))\u0026gt;/ format3 / \u0026lt;(?\u0026lt;subSystem\u0026gt;(.*?))\u0026gt;/ format4 / \u0026lt;(?\u0026lt;serverName\u0026gt;(.*?))\u0026gt;/ format5 / \u0026lt;(?\u0026lt;serverName2\u0026gt;(.*?))\u0026gt;/ format6 / \u0026lt;(?\u0026lt;threadName\u0026gt;(.*?))\u0026gt;/ format7 / \u0026lt;(?\u0026lt;info1\u0026gt;(.*?))\u0026gt;/ format8 / \u0026lt;(?\u0026lt;info2\u0026gt;(.*?))\u0026gt;/ format9 / \u0026lt;(?\u0026lt;info3\u0026gt;(.*?))\u0026gt;/ format10 / \u0026lt;(?\u0026lt;sequenceNumber\u0026gt;(.*?))\u0026gt;/ format11 / \u0026lt;(?\u0026lt;severity\u0026gt;(.*?))\u0026gt;/ format12 / \u0026lt;(?\u0026lt;messageID\u0026gt;(.*?))\u0026gt;/ format13 / \u0026lt;(?\u0026lt;message\u0026gt;(.*?))\u0026gt;/ \u0026lt;/parse\u0026gt; \u0026lt;/source\u0026gt; \u0026lt;match **\u0026gt; @type elasticsearch host \u0026#34;#{ENV[\u0026#39;ELASTICSEARCH_HOST\u0026#39;]}\u0026#34; port \u0026#34;#{ENV[\u0026#39;ELASTICSEARCH_PORT\u0026#39;]}\u0026#34; user \u0026#34;#{ENV[\u0026#39;ELASTICSEARCH_USER\u0026#39;]}\u0026#34; password \u0026#34;#{ENV[\u0026#39;ELASTICSEARCH_PASSWORD\u0026#39;]}\u0026#34; index_name \u0026#34;#{ENV[\u0026#39;DOMAIN_UID\u0026#39;]}\u0026#34; scheme http \u0026lt;/match\u0026gt; EOF Mount the ConfigMap as a volume in the weblogic-server container Edit the domain definition and configure a volume for the ConfigMap containing the fluentd configuration.\nNOTE: For brevity, only the paths to the relevant configuration are shown.\nFor example, run: kubectl edit domain wcp-domain -n wcpns and add the following portions to the domain definition.\nspec: serverPod: volumes: - configMap: defaultMode: 420 name: fluentd-config name: fluentd-config-volume Add fluentd container Add a container to the domain to run fluentd in the Administration Server and Managed Server pods.\nThe container definition:\n Defines a LOG_PATH environment variable that points to the log location of bobbys-front-end. Defines ELASTICSEARCH_HOST, ELASTICSEARCH_PORT, ELASTICSEARCH_USER, and ELASTICSEARCH_PASSWORD environment variables that are all retrieving their values from the secret wcp-domain-domain-credentials. Includes volume mounts for the fluentd-config ConfigMap and the volume containing the domain logs. NOTE: For brevity, only the paths to the relevant configuration are shown.\nFor example, run: kubectl edit domain wcp-domain -n wcpcns and add the following container definition.\nspec: serverPod: containers: - args: - -c - /etc/fluent.conf env: - name: DOMAIN_UID valueFrom: fieldRef: fieldPath: metadata.labels[\u0026#39;weblogic.domainUID\u0026#39;] - name: SERVER_NAME valueFrom: fieldRef: fieldPath: metadata.labels[\u0026#39;weblogic.serverName\u0026#39;] - name: LOG_PATH value: /u01/oracle/user_projects/domains/logs/wcp-domain/$(SERVER_NAME).log - name: FLUENTD_CONF value: fluentd.conf - name: FLUENT_ELASTICSEARCH_SED_DISABLE value: \u0026#34;true\u0026#34; - name: ELASTICSEARCH_HOST valueFrom: secretKeyRef: key: elasticsearchhost name: wcp-domain-domain-credentials - name: ELASTICSEARCH_PORT valueFrom: secretKeyRef: key: elasticsearchport name: wcp-domain-domain-credentials - name: ELASTICSEARCH_USER valueFrom: secretKeyRef: key: elasticsearchuser name: wcp-domain-domain-credentials optional: true - name: ELASTICSEARCH_PASSWORD valueFrom: secretKeyRef: key: elasticsearchpassword name: wcp-domain-domain-credentials optional: true image: fluent/fluentd-kubernetes-daemonset:v1.3.3-debian-elasticsearch-1.3 imagePullPolicy: IfNotPresent name: fluentd resources: {} volumeMounts: - mountPath: /fluentd/etc/fluentd.conf name: fluentd-config-volume subPath: fluentd.conf - mountPath: /scratch name: weblogic-domain-storage-volume Verify logs exported to Elasticsearch The logs are sent to Elasticsearch after you start the Administration Server and Managed Server pods after making the changes described previously.\nYou can check if the fluentd container is successfully tailing the log by executing a command like kubectl logs -f wcp-domain-adminserver -n wcpns fluentd. The log output should look similar to this:\n2019-10-01 16:23:44 +0000 [info]: #0 starting fluentd worker pid=13 ppid=9 worker=0 2019-10-01 16:23:44 +0000 [warn]: #0 /scratch/logs/bobs-bookstore/managed-server1.log not found. Continuing without tailing it. 2019-10-01 16:23:44 +0000 [info]: #0 fluentd worker is now running worker=0 2019-10-01 16:24:01 +0000 [info]: #0 following tail of /scratch/logs/bobs-bookstore/managed-server1.log When you connect to Kibana, you will see an index created for the domainUID.\nDomain example The following is a complete example of a domain custom resource with a fluentd container configured.\napiVersion: weblogic.oracle/v8 kind: Domain metadata: labels: weblogic.domainUID: wcp-domain name: wcp-domain namespace: wcpns spec: domainHome: /u01/oracle/user_projects/domains/wcp-domain domainHomeSourceType: PersistentVolume image: \u0026#34;oracle/wcportal:12.2.1.4\u0026#34; imagePullPolicy: \u0026#34;IfNotPresent\u0026#34; webLogicCredentialsSecret: name: wcp-domain-domain-credentials includeServerOutInPodLog: true logHomeEnabled: true httpAccessLogInLogHome: true logHome: /u01/oracle/user_projects/domains/logs/wcp-domain dataHome: \u0026#34;\u0026#34; serverStartPolicy: \u0026#34;IF_NEEDED\u0026#34; adminServer: serverStartState: \u0026#34;RUNNING\u0026#34; clusters: - clusterName: wcp_cluster serverStartState: \u0026#34;RUNNING\u0026#34; serverPod: affinity: podAntiAffinity: preferredDuringSchedulingIgnoredDuringExecution: - weight: 100 podAffinityTerm: labelSelector: matchExpressions: - key: \u0026#34;weblogic.clusterName\u0026#34; operator: In values: - $(CLUSTER_NAME) topologyKey: \u0026#34;kubernetes.io/hostname\u0026#34; replicas: 2 serverPod: containers: - args: - -c - /etc/fluent.conf env: - name: DOMAIN_UID valueFrom: fieldRef: fieldPath: metadata.labels[\u0026#39;weblogic.domainUID\u0026#39;] - name: SERVER_NAME valueFrom: fieldRef: fieldPath: metadata.labels[\u0026#39;weblogic.serverName\u0026#39;] - name: LOG_PATH value: /u01/oracle/user_projects/domains/logs/wcp-domain/$(SERVER_NAME).log - name: FLUENTD_CONF value: fluentd.conf - name: FLUENT_ELASTICSEARCH_SED_DISABLE value: \u0026#34;true\u0026#34; - name: ELASTICSEARCH_HOST valueFrom: secretKeyRef: key: elasticsearchport name: wcp-domain-domain-credentials - name: ELASTICSEARCH_PORT valueFrom: secretKeyRef: key: elasticsearchhost name: wcp-domain-domain-credentials - name: ELASTICSEARCH_USER valueFrom: secretKeyRef: key: elasticsearchuser name: wcp-domain-domain-credentials - name: ELASTICSEARCH_PASSWORD valueFrom: secretKeyRef: key: elasticsearchpassword name: wcp-domain-domain-credentials image: fluent/fluentd-kubernetes-daemonset:v1.11.5-debian-elasticsearch6-1.0 imagePullPolicy: IfNotPresent name: fluentd resources: {} volumeMounts: - mountPath: /fluentd/etc/fluentd.conf name: fluentd-config-volume subPath: fluentd.conf - mountPath: /u01/oracle/user_projects/domains name: weblogic-domain-storage-volume env: - name: JAVA_OPTIONS value: -Dweblogic.StdoutDebugEnabled=false - name: USER_MEM_ARGS value: \u0026#39;-Djava.security.egd=file:/dev/./urandom -Xms1g -Xmx2g\u0026#39; volumeMounts: - mountPath: /u01/oracle/user_projects/domains name: weblogic-domain-storage-volume volumes: - name: weblogic-domain-storage-volume persistentVolumeClaim: claimName: wcp-domain-domain-pvc - emptyDir: {} name: weblogic-domain-storage-volume - configMap: defaultMode: 420 name: fluentd-config name: fluentd-config-volume serverStartPolicy: IF_NEEDED webLogicCredentialsSecret: name: wcp-domain-domain-credentials Get the Kibana dashboard port information as shown below: -bash-4.2$ kubectl get pods -w NAME READY STATUS RESTARTS AGE elasticsearch-8bdb7cf54-mjs6s 1/1 Running 0 4m3s kibana-dbf8964b6-n8rcj 1/1 Running 0 4m3s -bash-4.2$ kubectl get svc NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE elasticsearch ClusterIP 10.100.11.154 \u0026lt;none\u0026gt; 9200/TCP,9300/TCP 4m32s kibana NodePort 10.97.205.0 \u0026lt;none\u0026gt; 5601:31884/TCP 4m32s kubernetes ClusterIP 10.96.0.1 \u0026lt;none\u0026gt; 443/TCP 71d You can access the Kibana dashboard at http://mycompany.com:kibana-nodeport/. In our example, the node port is 31884.\nCreate an Index Pattern in Kibana Create an index pattern wcp-domain* in Kibana by navigating to the dashboard through the Management option. When the servers are started, the log data is shown on the Kibana dashboard.\n" +}, +{ + "uri": "/fmw-kubernetes/22.2.3/wcportal-domains/manage-wcportal-domains/monitoring-and-publishing-logs/monitoring-domain/", + "title": " Monitor a WebCenter Portal domain", + "tags": [], + "description": "Monitor an WebCenter Portal instance using Prometheus and Grafana.", + "content": "You can monitor a WebCenter Portal domain using Prometheus and Grafana by exporting the metrics from the domain instance using the WebLogic Monitoring Exporter. This sample shows you how to set up the WebLogic Monitoring Exporter to push the data to Prometheus.\nPrerequisites This document assumes that the Prometheus Operator is deployed on the Kubernetes cluster. If it is not already deployed, follow the steps below for deploying the Prometheus Operator.\nPrepare to use the setup monitoring script The sample scripts for setup monitoring for OracleWebCenterPortal domain are available at ${WORKDIR}/monitoring-service.\nYou must edit monitoring-inputs.yaml(or a copy of it) to provide the details of your domain. Refer to the configuration parameters below to understand the information that you must provide in this file.\nConfiguration parameters The following parameters can be provided in the inputs file.\n Parameter Description Default domainUID domainUID of the OracleWebCenterPortal domain. wcp-domain domainNamespace Kubernetes namespace of the OracleWebCenterPortal domain. wcpns setupKubePrometheusStack Boolean value indicating whether kube-prometheus-stack (Prometheus, Grafana and Alertmanager) to be installed true additionalParamForKubePrometheusStack The script install\u0026rsquo;s kube-prometheus-stack with service.type as NodePort and values for service.nodePort as per the parameters defined in monitoring-inputs.yaml. Use additionalParamForKubePrometheusStack parameter to further configure with additional parameters as per values.yaml. Sample value to disable NodeExporter, Prometheus-Operator TLS support and Admission webhook support for PrometheusRules resources is --set nodeExporter.enabled=false --set prometheusOperator.tls.enabled=false --set prometheusOperator.admissionWebhooks.enabled=false monitoringNamespace Kubernetes namespace for monitoring setup. monitoring adminServerName Name of the Administration Server. AdminServer adminServerPort Port number for the Administration Server inside the Kubernetes cluster. 7001 wcpClusterName Name of the wcpCluster. wcp_cluster wcpManagedServerPort Port number of the managed servers in the wcpCluster. 8888 wlsMonitoringExporterTowcpCluster Boolean value indicating whether to deploy WebLogic Monitoring Exporter to wcpCluster. false wcpPortletClusterName Name of the wcpPortletCluster. wcportlet-cluster wcpManagedServerPort Port number of the Portlet managed servers in the wcpPortletCluster. 8889 wlsMonitoringExporterTowcpPortletCluster Boolean value indicating whether to deploy WebLogic Monitoring Exporter to wcpPortletCluster. false exposeMonitoringNodePort Boolean value indicating if the Monitoring Services (Prometheus, Grafana and Alertmanager) is exposed outside of the Kubernetes cluster. false prometheusNodePort Port number of the Prometheus outside the Kubernetes cluster. 32101 grafanaNodePort Port number of the Grafana outside the Kubernetes cluster. 32100 alertmanagerNodePort Port number of the Alertmanager outside the Kubernetes cluster. 32102 weblogicCredentialsSecretName Name of the Kubernetes secret which has Administration Server’s user name and password. wcp-domain-domain-credentials Note that the values specified in the monitoring-inputs.yaml file will be used to install kube-prometheus-stack (Prometheus, Grafana and Alertmanager) and deploying WebLogic Monitoring Exporter into the OracleWebCenterPortal domain. Hence make the domain specific values to be same as that used during domain creation.\nRun the setup monitoring script Update the values in monitoring-inputs.yaml as per your requirement and run the setup-monitoring.sh script, specifying your inputs file:\n$ cd ${WORKDIR}/monitoring-service $ ./setup-monitoring.sh \\ -i monitoring-inputs.yaml The script will perform the following steps:\n Helm install prometheus-community/kube-prometheus-stack of version \u0026ldquo;16.5.0\u0026rdquo; if setupKubePrometheusStack is set to true. Deploys WebLogic Monitoring Exporter to Administration Server. Deploys WebLogic Monitoring Exporter to wcpCluster if wlsMonitoringExporterTowcpCluster is set to true. Deploys WebLogic Monitoring Exporter to wcpPortletCluster if wlsMonitoringExporterTowcpPortletCluster is set to true. Exposes the Monitoring Services (Prometheus at 32101, Grafana at 32100 and Alertmanager at 32102) outside of the Kubernetes cluster if exposeMonitoringNodePort is set to true. Imports the WebLogic Server Grafana Dashboard if setupKubePrometheusStack is set to true. Verify the results The setup monitoring script will report failure if there was any error. However, verify that required resources were created by the script.\nVerify the kube-prometheus-stack To confirm that prometheus-community/kube-prometheus-stack was installed when setupKubePrometheusStack is set to true, run the following command:\n$ helm ls -n monitoring Sample output:\n$ helm ls -n monitoring NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION monitoring monitoring 1 2021-06-18 12:58:35.177221969 +0000 UTC deployed kube-prometheus-stack-16.5.0 0.48.0 $ Verify the Prometheus, Grafana and Alertmanager setup When exposeMonitoringNodePort was set to true, verify that monitoring services are accessible outside of the Kubernetes cluster:\n 32100 is the external port for Grafana and with credentials admin:admin 32101 is the external port for Prometheus 32102 is the external port for Alertmanager Verify the service discovery of WebLogic Monitoring Exporter Verify whether prometheus is able to discover wls-exporter and collect the metrics:\n Access the Prometheus dashboard at http://mycompany.com:32101/\n Navigate to Status to see the Service Discovery details.\n Verify that wls-exporter is listed in the discovered services.\n Verify the WebLogic Server dashoard You can access the Grafana dashboard at http://mycompany.com:32100/.\n Log in to Grafana dashboard with username: admin and password: admin.\n Navigate to \u0026ldquo;WebLogic Server Dashboard\u0026rdquo; under General and verify.\nThis displays the WebLogic Server Dashboard.\n Delete the monitoring setup To delete the monitoring setup created by Run the setup monitoring script, run the below command:\n$ cd ${WORKDIR}/monitoring-service $ ./delete-monitoring.sh \\ -i monitoring-inputs.yaml " +}, +{ + "uri": "/fmw-kubernetes/22.2.3/wcportal-domains/release-notes/", + "title": "Release Notes", + "tags": [], + "description": "", + "content": "Recent changes Date Version Change June 10, 2022 22.2.3 Only Oracle WebCenter Portal 12.2.1.4 is supported and certified with the WebLogic Kubernetes operator version 3.3.0. June 30, 2021 21.2.3 Only Oracle WebCenter Portal 12.2.1.4 is supported and certified with the WebLogic Kubernetes operator version 3.1.1. " +}, +{ + "uri": "/fmw-kubernetes/22.2.3/wcportal-domains/installguide/prerequisites/", + "title": "Requirements and limitations", + "tags": [], + "description": "Understand the system requirements and limitations for deploying and running Oracle WebCenter Portal with the WebLogic Kubernetes operator.", + "content": "Contents Introduction System Requirements Limitations Introduction This document describes the special considerations for deploying and running a WebCenter Portal domain with the WebLogic Kubernetes Operator. Other than those considerations listed here, the WebCenter Portal domain works in the same way as Fusion Middleware Infrastructure and WebLogic Server domains do.\nIn this release, WebCenter Portal domain is based on the domain on a persistent volume model where a WebCenter Portal domain is located in a persistent volume (PV).\nSystem Requirements Kubernetes 1.18.18+, 1.19.7+, and 1.20.6+ (check with kubectl version). Flannel networking v0.14.0 or later (check with docker images | grep flannel), Calico networking v3.15. Docker 19.03.11+ (check with docker version). Helm 3.4+ (check with helm version). WebLogic Kubernetes operator 3.3.0 (see the operator releases page). Oracle WebCenter Portal 12.2.1.4.0 image. These proxy setups are used for pulling the required binaries and source code from the respective repositories: export NO_PROXY=\u0026quot;localhost,127.0.0.0/8,$(hostname -i),.your-company.com,/var/run/docker.sock\u0026rdquo; export no_proxy=\u0026quot;localhost,127.0.0.0/8,$(hostname -i),.your-company.com,/var/run/docker.sock\u0026rdquo; export http_proxy=http://www-proxy-your-company.com:80 export https_proxy=http://www-proxy-your-company.com:80 export HTTP_PROXY=http://www-proxy-your-company.com:80 export HTTPS_PROXY=http://www-proxy-your-company.com:80 NOTE: Add your host IP by using hostname -i and nslookup IP addresses to the no_proxy, NO_PROXY list above.\nLimitations Compared to running a WebLogic Server domain in Kubernetes using the operator, the following limitations currently exist for a WebCenter Portal domain:\n Domain in image model is not supported in this version of the operator. Only configured clusters are supported. Dynamic clusters are not supported on WebCenter Portal domains. Note that you can still use all of the scaling features. You just need to define the maximum size of your cluster at the time when you create a domain. At present, WebCenter Portal doesn\u0026rsquo;t run on non-Linux containers. Deploying and running a WebCenter Portal domain is supported only in the operator versions 3.3.0 and later. The WebLogic Logging Exporter currently supports WebLogic Server logs only. Other logs are not sent to Elasticsearch. Note, however, that you can use a sidecar with a log handling tool like Fluentd to get logs. The WebLogic Monitoring Exporter currently supports the WebLogic MBean trees only. Support for JRF MBeans has not been added yet. " +}, +{ + "uri": "/fmw-kubernetes/22.2.3/wcportal-domains/installguide/", + "title": "Install Guide", + "tags": [], + "description": "", + "content": "Install the WebLogic Kubernetes operator and prepare and deploy the Oracle WebCenter Portal domain.\n Requirements and limitations Understand the system requirements and limitations for deploying and running Oracle WebCenter Portal with the WebLogic Kubernetes operator.\n Prepare your environment Prepare for creating the Oracle WebCenter Portal domain, This preparation includes but not limited to creating required secrets, persistent volume and volume claim, and database schema.\n Create WebCenter Portal domain Create an Oracle WebCenter Portal domain home on an existing PV or PVC, and create the domain resource YAML file for deploying the generated Oracle WebCenter Portal domain.\n Configure WebCenter Portal For Search Set up search functionality in Oracle WebCenter Portal using Elasticsearch.\n " +}, +{ + "uri": "/fmw-kubernetes/22.2.3/wcportal-domains/appendix/quickstart-deployment-on-prem/", + "title": "Quick start deployment on-premise", + "tags": [], + "description": "Describes how to quickly get an Oracle WebCenter Portal domain instance running (using the defaults, nothing special) for development and test purposes.", + "content": "Use this Quick Start to create an Oracle WebCenter Portal domain deployment in a Kubernetes cluster (on-premise environments) with the WebLogic Kubernetes Operator. Note that this walkthrough is for demonstration purposes only, not for use in production. These instructions assume that you are already familiar with Kubernetes. If you need more detailed instructions, refer to the Install Guide.\nHardware requirements The Linux kernel supported for deploying and running Oracle WebCenter Portal domains with the operator is Oracle Linux 7 (UL6+) and Red Hat Enterprise Linux 7 (UL3+ only with standalone Kubernetes). Refer to the prerequisites for more details.\nFor this exercise, the minimum hardware requirements to create a single-node Kubernetes cluster and then deploy the domain type with one Managed Server along with Oracle Database running as a container are:\n Hardware Size RAM 32GB Disk Space 250GB+ CPU core(s) 6 See here for resource sizing information for Oracle WebCenter Portal domain set up on a Kubernetes cluster.\nSet up Oracle WebCenter Portal in an on-premise environment Use the steps in this topic to create a single-instance on-premise Kubernetes cluster and then create an Oracle WebCenter Portal domain.\n Step 1 - Prepare a virtual machine for the Kubernetes cluster Step 2 - Set up a single instance Kubernetes cluster Step 3 - Get scripts and images Step 4 - Install the WebLogic Kubernetes operator Step 5 - Install the Traefik (ingress-based) load balancer Step 6 - Create and configure an Oracle WebCenter Portal domain 1. Prepare a virtual machine for the Kubernetes cluster For illustration purposes, these instructions are for Oracle Linux 7u6+. If you are using a different flavor of Linux, you will need to adjust the steps accordingly.\nThese steps must be run with the root user, unless specified otherwise. Any time you see YOUR_USERID in a command, you should replace it with your actual userid.\n 1.1 Prerequisites Choose the directories where your Docker and Kubernetes files will be stored. The Docker directory should be on a disk with a lot of free space (more than 100GB) because it will be used for the Docker file system, which contains all of your images and containers. The Kubernetes directory is used for the /var/lib/kubelet file system and persistent volume storage.\n$ export docker_dir=/u01/docker $ export kubelet_dir=/u01/kubelet $ mkdir -p $docker_dir $kubelet_dir $ ln -s $kubelet_dir /var/lib/kubelet Verify that IPv4 forwarding is enabled on your host.\nNote: Replace eth0 with the ethernet interface name of your compute resource if it is different.\n$ /sbin/sysctl -a 2\u0026gt;\u0026amp;1|grep -s 'net.ipv4.conf.docker0.forwarding' $ /sbin/sysctl -a 2\u0026gt;\u0026amp;1|grep -s 'net.ipv4.conf.eth0.forwarding' $ /sbin/sysctl -a 2\u0026gt;\u0026amp;1|grep -s 'net.ipv4.conf.lo.forwarding' $ /sbin/sysctl -a 2\u0026gt;\u0026amp;1|grep -s 'net.ipv4.ip_nonlocal_bind' For example: Verify that all are set to 1:\n$ net.ipv4.conf.docker0.forwarding = 1 $ net.ipv4.conf.eth0.forwarding = 1 $ net.ipv4.conf.lo.forwarding = 1 $ net.ipv4.ip_nonlocal_bind = 1 Solution: Set all values to 1 immediately:\n$ /sbin/sysctl net.ipv4.conf.docker0.forwarding=1 $ /sbin/sysctl net.ipv4.conf.eth0.forwarding=1 $ /sbin/sysctl net.ipv4.conf.lo.forwarding=1 $ /sbin/sysctl net.ipv4.ip_nonlocal_bind=1 To preserve the settings permanently: Update the above values to 1 in files in /usr/lib/sysctl.d/, /run/sysctl.d/, and /etc/sysctl.d/.\n Verify the iptables rule for forwarding.\nKubernetes uses iptables to handle many networking and port forwarding rules. A standard Docker installation may create a firewall rule that prevents forwarding.\nVerify if the iptables rule to accept forwarding traffic is set:\n$ /sbin/iptables -L -n | awk '/Chain FORWARD / {print $4}' | tr -d \u0026quot;)\u0026quot; If the output is \u0026ldquo;DROP\u0026rdquo;, then run the following command:\n$ /sbin/iptables -P FORWARD ACCEPT Verify if the iptables rule is properly set to \u0026ldquo;ACCEPT\u0026rdquo;:\n$ /sbin/iptables -L -n | awk '/Chain FORWARD / {print $4}' | tr -d \u0026quot;)\u0026quot; Disable and stop firewalld:\n$ systemctl disable firewalld $ systemctl stop firewalld 1.2 Install and configure Docker Note: If you have already installed Docker with version 18.03+ and configured the Docker daemon root to sufficient disk space along with proxy settings, continue to Install and configure Kubernetes.\n Make sure that you have the right operating system version:\n$ uname -a $ more /etc/oracle-release Example output:\nLinux xxxxxxx 4.1.12-124.27.1.el7uek.x86_64 #2 SMP Mon May 13 08:56:17 PDT 2019 x86_64 x86_64 x86_64 GNU/Linux Oracle Linux Server release 7.6 Install the latest docker-engine and start the Docker service:\n$ yum-config-manager --enable ol7_addons $ docker_version=\u0026quot;19.03.11-ol\u0026quot; $ yum install docker-engine-$docker_version $ systemctl enable docker $ systemctl start docker Add your user ID to the Docker group to allow you to run Docker commands without root access:\n$ /sbin/usermod -a -G docker \u0026lt;YOUR_USERID\u0026gt; Check that your Docker version is at least 18.03:\n$ docker version Example output:\nClient: Docker Engine - Community Version: 19.03.11-ol API version: 1.40 Go version: go1.15.5 Git commit: 748876d Built: Thu Dec 3 19:36:03 2020 OS/Arch: linux/amd64 Experimental: false Server: Docker Engine - Community Engine: Version: 19.03.11-ol API version: 1.40 (minimum version 1.12) Go version: go1.15.8 Git commit: f0aae77 Built: Wed Feb 10 16:13:32 2021 OS/Arch: linux/amd64 Experimental: false Default Registry: docker.io containerd: Version: v1.3.9 GitCommit: runc: Version: 1.0.0-rc5+dev GitCommit: 4bb1fe4ace1a32d3676bb98f5d3b6a4e32bf6c58 docker-init: Version: 0.18.0 GitCommit: fec3683 Update the Docker engine configuration:\n$ mkdir -p /etc/docker $ cat \u0026lt;\u0026lt;EOF \u0026gt; /etc/docker/daemon.json { \u0026quot;group\u0026quot;: \u0026quot;docker\u0026quot;, \u0026quot;data-root\u0026quot;: \u0026quot;/u01/docker\u0026quot; } EOF Configure proxy settings if you are behind an HTTP proxy:\n ### Create the drop-in file /etc/systemd/system/docker.service.d/http-proxy.conf that contains proxy details: $ cat \u0026lt;\u0026lt;EOF \u0026gt; /etc/systemd/system/docker.service.d/http-proxy.conf [Service] Environment=\u0026quot;HTTP_PROXY=http://REPLACE-WITH-YOUR-COMPANY-PROXY-HOST:PORT\u0026quot; Environment=\u0026quot;HTTPS_PROXY=http://REPLACE-WITH-YOUR-COMPANY-PROXY-HOST:PORT\u0026quot; Environment=\u0026quot;NO_PROXY=localhost,127.0.0.0/8,ADD-YOUR-INTERNAL-NO-PROXY-LIST,/var/run/docker.sock\u0026quot; EOF Note: On some hosts /etc/systemd/system/docker.service.d may not be available. Create this directory if it is not available.\n Restart the Docker daemon to load the latest changes:\n$ systemctl daemon-reload $ systemctl restart docker Verify that the proxy is configured with Docker:\n$ docker info|grep -i proxy Example output:\nHTTP Proxy: http://REPLACE-WITH-YOUR-COMPANY-PROXY-HOST:PORT HTTPS Proxy: http://REPLACE-WITH-YOUR-COMPANY-PROXY-HOST:PORT No Proxy: localhost,127.0.0.0/8,ADD-YOUR-INTERNAL-NO-PROXY-LIST,/var/run/docker.sock Verify Docker installation:\n$ docker run hello-world Example output:\nHello from Docker! This message shows that your installation appears to be working correctly. To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the \u0026quot;hello-world\u0026quot; image from the Docker Hub. (amd64) 3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading. 4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal. To try something more ambitious, you can run an Ubuntu container with: $ docker run -it ubuntu bash Share images, automate workflows, and more with a free Docker ID: https://hub.docker.com/ For more examples and ideas, visit: https://docs.docker.com/get-started/ 1.3 Install and configure Kubernetes Add the external Kubernetes repository:\n$ cat \u0026lt;\u0026lt;EOF | sudo tee /etc/yum.repos.d/kubernetes.repo [kubernetes] name=Kubernetes baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-\\$basearch enabled=1 gpgcheck=1 repo_gpgcheck=1 gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg exclude=kubelet kubeadm kubectl EOF Set SELinux in permissive mode (effectively disabling it):\n$ export PATH=/sbin:$PATH $ setenforce 0 $ sed -i 's/^SELINUX=enforcing$/SELINUX=permissive/' /etc/selinux/config Export proxy and install kubeadm, kubelet, and kubectl:\n### Get the nslookup IP address of the master node to use with apiserver-advertise-address during setting up Kubernetes master ### as the host may have different internal ip (hostname -i) and nslookup $HOSTNAME $ ip_addr=`nslookup $(hostname -f) | grep -m2 Address | tail -n1| awk -F: '{print $2}'| tr -d \u0026quot; \u0026quot;` $ echo $ip_addr ### Set the proxies $ export NO_PROXY=localhost,127.0.0.0/8,ADD-YOUR-INTERNAL-NO-PROXY-LIST,/var/run/docker.sock,$ip_addr $ export no_proxy=localhost,127.0.0.0/8,ADD-YOUR-INTERNAL-NO-PROXY-LIST,/var/run/docker.sock,$ip_addr $ export http_proxy=http://REPLACE-WITH-YOUR-COMPANY-PROXY-HOST:PORT $ export https_proxy=http://REPLACE-WITH-YOUR-COMPANY-PROXY-HOST:PORT $ export HTTPS_PROXY=http://REPLACE-WITH-YOUR-COMPANY-PROXY-HOST:PORT $ export HTTP_PROXY=http://REPLACE-WITH-YOUR-COMPANY-PROXY-HOST:PORT ### install kubernetes 1.20.10 $ VERSION=1.20.10 $ yum install -y kubelet-$VERSION kubeadm-$VERSION kubectl-$VERSION --disableexcludes=kubernetes ### enable kubelet service so that it auto-restart on reboot $ systemctl enable --now kubelet Ensure net.bridge.bridge-nf-call-iptables is set to 1 in your sysctl to avoid traffic routing issues:\n$ cat \u0026lt;\u0026lt;EOF \u0026gt; /etc/sysctl.d/k8s.conf net.bridge.bridge-nf-call-ip6tables = 1 net.bridge.bridge-nf-call-iptables = 1 EOF $ sysctl --system Disable swap check:\n$ sed -i 's/KUBELET_EXTRA_ARGS=/KUBELET_EXTRA_ARGS=\u0026quot;--fail-swap-on=false\u0026quot;/' /etc/sysconfig/kubelet $ cat /etc/sysconfig/kubelet ### Reload and restart kubelet $ systemctl daemon-reload $ systemctl restart kubelet 1.4 Set up Helm Install Helm v3.4+\na. Download Helm from https://github.com/helm/helm/releases.\nFor example, to download Helm v3.4.1:\n$ wget https://get.helm.sh/helm-v3.4.1-linux-amd64.tar.gz b. Unpack tar.gz:\n$ tar -zxvf helm-v3.4.1-linux-amd64.tar.gz c. Find the Helm binary in the unpacked directory, and move it to its desired destination:\n$ mv linux-amd64/helm /usr/bin/helm Run helm version to verify its installation:\n$ helm version version.BuildInfo{Version:\u0026quot;v3.4.1\u0026quot;, GitCommit:\u0026quot;0ad800ef43d3b826f31a5ad8dfbb4fe05d143688\u0026quot;, GitTreeState:\u0026quot;clean\u0026quot;, GoVersion:\u0026quot;go1.13.12\u0026quot;} 2. Set up a single instance Kubernetes cluster Notes:\n These steps must be run with the root user, unless specified otherwise! If you choose to use a different CIDR block (that is, other than 10.244.0.0/16 for the --pod-network-cidr= in the kubeadm init command), then also update NO_PROXY and no_proxy with the appropriate value. Also make sure to update kube-flannel.yaml with the new value before deploying. Replace the following with appropriate values: ADD-YOUR-INTERNAL-NO-PROXY-LIST REPLACE-WITH-YOUR-COMPANY-PROXY-HOST:PORT 2.1 Set up the master node Create a shell script that sets up the necessary environment variables. You can append this to the user’s .bashrc so that it will run at login. You must also configure your proxy settings here if you are behind an HTTP proxy:\n## grab my IP address to pass into kubeadm init, and to add to no_proxy vars ip_addr=`nslookup $(hostname -f) | grep -m2 Address | tail -n1| awk -F: '{print $2}'| tr -d \u0026quot; \u0026quot;` export pod_network_cidr=\u0026quot;10.244.0.0/16\u0026quot; export service_cidr=\u0026quot;10.96.0.0/12\u0026quot; export PATH=$PATH:/sbin:/usr/sbin ### Set the proxies export NO_PROXY=localhost,127.0.0.0/8,ADD-YOUR-INTERNAL-NO-PROXY-LIST,/var/run/docker.sock,$ip_addr,$pod_network_cidr,$service_cidr export no_proxy=localhost,127.0.0.0/8,ADD-YOUR-INTERNAL-NO-PROXY-LIST,/var/run/docker.sock,$ip_addr,$pod_network_cidr,$service_cidr export http_proxy=http://REPLACE-WITH-YOUR-COMPANY-PROXY-HOST:PORT export https_proxy=http://REPLACE-WITH-YOUR-COMPANY-PROXY-HOST:PORT export HTTPS_PROXY=http://REPLACE-WITH-YOUR-COMPANY-PROXY-HOST:PORT export HTTP_PROXY=http://REPLACE-WITH-YOUR-COMPANY-PROXY-HOST:PORT Source the script to set up your environment variables:\n$ . ~/.bashrc To implement command completion, add the following to the script:\n$ [ -f /usr/share/bash-completion/bash_completion ] \u0026amp;\u0026amp; . /usr/share/bash-completion/bash_completion $ source \u0026lt;(kubectl completion bash) Run kubeadm init to create the master node:\n$ kubeadm init \\ --pod-network-cidr=$pod_network_cidr \\ --apiserver-advertise-address=$ip_addr \\ --ignore-preflight-errors=Swap \u0026gt; /tmp/kubeadm-init.out 2\u0026gt;\u0026amp;1 Log in to the terminal with YOUR_USERID:YOUR_GROUP. Then set up the ~/.bashrc similar to steps 1 to 3 with YOUR_USERID:YOUR_GROUP.\n Note that from now on we will be using YOUR_USERID:YOUR_GROUP to execute any kubectl commands and not root.\n Set up YOUR_USERID:YOUR_GROUP to access the Kubernetes cluster:\n$ mkdir -p $HOME/.kube $ sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config $ sudo chown $(id -u):$(id -g) $HOME/.kube/config Verify that YOUR_USERID:YOUR_GROUP is set up to access the Kubernetes cluster using the kubectl command:\n$ kubectl get nodes Note: At this step, the node is not in ready state as we have not yet installed the pod network add-on. After the next step, the node will show status as Ready.\n Install a pod network add-on (flannel) so that your pods can communicate with each other.\n Note: If you are using a different CIDR block than 10.244.0.0/16, then download and update kube-flannel.yml with the correct CIDR address before deploying into the cluster:\n $ kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/v0.12.0/Documentation/kube-flannel.yml Verify that the master node is in Ready status:\n$ kubectl get nodes Sample output:\nNAME STATUS ROLES AGE VERSION mymasternode Ready master 8m26s v1.18.4 or:\n$ kubectl get pods -n kube-system Sample output:\nNAME READY STATUS RESTARTS AGE pod/coredns-86c58d9df4-58p9f 1/1 Running 0 3m59s pod/coredns-86c58d9df4-mzrr5 1/1 Running 0 3m59s pod/etcd-mymasternode 1/1 Running 0 3m4s pod/kube-apiserver-node 1/1 Running 0 3m21s pod/kube-controller-manager-mymasternode 1/1 Running 0 3m25s pod/kube-flannel-ds-amd64-6npx4 1/1 Running 0 49s pod/kube-proxy-4vsgm 1/1 Running 0 3m59s pod/kube-scheduler-mymasternode 1/1 Running 0 2m58s To schedule pods on the master node, taint the node:\n$ kubectl taint nodes --all node-role.kubernetes.io/master- Congratulations! Your Kubernetes cluster environment is ready to deploy your Oracle WebCenter Portal domain.\nFor additional references on Kubernetes cluster setup, check the cheat sheet.\n3. Get scripts and images 3.1 Set up the code repository to deploy Oracle WebCenter Portal Follow these steps to set up the source code repository required to deploy Oracle WebCenter Portal domain.\n3.2 Get required Docker images and add them to your local registry Pull the operator image:\n$ docker pull ghcr.io/oracle/weblogic-kubernetes-operator:3.3.0 Obtain the Oracle Database image from the Oracle Container Registry:\na. For first time users, to pull an image from the Oracle Container Registry, navigate to https://container-registry.oracle.com and log in using the Oracle Single Sign-On (SSO) authentication service. If you do not already have SSO credentials, you can create an Oracle Account using:\nhttps://profile.oracle.com/myprofile/account/create-account.jspx.\nUse the web interface to accept the Oracle Standard Terms and Restrictions for the Oracle software images that you intend to deploy. Your acceptance of these terms are stored in a database that links the software images to your Oracle Single Sign-On login credentials.\nTo obtain the image, log in to the Oracle Container Registry:\n$ docker login container-registry.oracle.com b. Find and then pull the Oracle Database image for 12.2.0.1:\n$ docker pull container-registry.oracle.com/database/enterprise:12.2.0.1-slim c. Build Oracle WebCenter Portal 12.2.1.4 Image by following steps from this document.\n 4. Install the WebLogic Kubernetes operator 4.1 Prepare for the WebLogic Kubernetes operator. Create a namespace operator-ns for the operator:\n$ kubectl create namespace operator-ns Create a service account operator-sa for the operator in the operator’s namespace:\n$ kubectl create serviceaccount -n operator-ns operator-sa 4.2 Install the WebLogic Kubernetes operator Use Helm to install and start the operator from the directory you just cloned:\n $ cd ${WORKDIR} $ helm install weblogic-kubernetes-operator charts/weblogic-operator \\ --namespace operator-ns \\ --set image=oracle/weblogic-kubernetes-operator:3.3.0 \\ --set serviceAccount=operator-sa \\ --set \u0026quot;domainNamespaces={}\u0026quot; \\ --wait 4.3 Verify the WebLogic Kubernetes operator Verify that the operator’s pod is running by listing the pods in the operator’s namespace. You should see one for the operator:\n$ kubectl get pods -n operator-ns Verify that the operator is up and running by viewing the operator pod\u0026rsquo;s logs:\n$ kubectl logs -n operator-ns -c weblogic-operator deployments/weblogic-operator The WebLogic Kubernetes operator v3.3.0 has been installed. Continue with the load balancer and Oracle WebCenter Portal domain setup.\n5. Install the Traefik (ingress-based) load balancer The WebLogic Kubernetes Operator supports three load balancers: Traefik, NGINX and Apache. Samples are provided in the documentation.\nThis Quick Start demonstrates how to install the Traefik ingress controller to provide load balancing for an Oracle WebCenter Portal domain.\n Create a namespace for Traefik:\n$ kubectl create namespace traefik Set up Helm for 3rd party services:\n$ helm repo add traefik https://containous.github.io/traefik-helm-chart Install the Traefik operator in the traefik namespace with the provided sample values:\n$ cd ${WORKDIR} $ helm install traefik traefik/traefik \\ --namespace traefik \\ --values charts/traefik/values.yaml \\ --set \u0026quot;kubernetes.namespaces={traefik}\u0026quot; \\ --set \u0026quot;service.type=NodePort\u0026quot; \\ --wait 6. Create and configure an Oracle WebCenter Portal domain 6.1 Prepare for an Oracle WebCenter Portal domain Create a namespace that can host Oracle WebCenter Portal domain:\n$ kubectl create namespace wcpns Use Helm to configure the operator to manage Oracle WebCenter Portal domain in this namespace:\n$ cd ${WORKDIR} $ helm upgrade weblogic-kubernetes-operator charts/weblogic-operator \\ --reuse-values \\ --namespace operator-ns \\ --set \u0026quot;domainNamespaces={wcpns}\u0026quot; \\ --wait Create Kubernetes secrets.\na. Create a Kubernetes secret for the domain in the same Kubernetes namespace as the domain. In this example, the username is weblogic, the password is welcome1, and the namespace is wcpns:\n$ cd ${WORKDIR}/create-weblogic-domain-credentials $ sh create-weblogic-credentials.sh -u weblogic -p welcome1 -n wcpns -d wcp-domain -s wcp-domain-domain-credentials b. Create a Kubernetes secret for the RCU in the same Kubernetes namespace as the domain:\n Schema user : WCP1 Schema password : Oradoc_db1 DB sys user password : Oradoc_db1 Domain name : wcp-domain Domain Namespace : wcpns Secret name : wcp-domain-rcu-credentials $ cd ${WORKDIR}/create-rcu-credentials $ sh create-rcu-credentials.sh -u WCP1 -p Oradoc_db1 -a sys -q Oradoc_db1 -n wcpns -d wcp-domain -s wcp-domain-rcu-credentials Create the Kubernetes persistence volume and persistence volume claim.\na. Create the Oracle WebCenter Portal domain home directory. Determine if a user already exists on your host system with uid:gid of 1000:\n$ sudo getent passwd 1000 If this command returns a username (which is the first field), you can skip the following useradd command. If not, create the oracle user with useradd:\n$ sudo useradd -u 1000 -g 1000 oracle Create the directory that will be used for the Oracle WebCenter Portal domain home:\n$ sudo mkdir /scratch/k8s_dir $ sudo chown -R 1000:1000 /scratch/k8s_dir b. Update create-pv-pvc-inputs.yaml with the following values:\n baseName: domain domainUID: wcp-domain namespace: wcpns weblogicDomainStoragePath: /scratch/k8s_dir $ cd ${WORKDIR}/create-weblogic-domain-pv-pvc $ cp create-pv-pvc-inputs.yaml create-pv-pvc-inputs.yaml.orig $ sed -i -e \u0026quot;s:baseName\\: weblogic-sample:baseName\\: domain:g\u0026quot; create-pv-pvc-inputs.yaml $ sed -i -e \u0026quot;s:domainUID\\::domainUID\\: wcp-domain:g\u0026quot; create-pv-pvc-inputs.yaml $ sed -i -e \u0026quot;s:namespace\\: default:namespace\\: wcpns:g\u0026quot; create-pv-pvc-inputs.yaml $ sed -i -e \u0026quot;s:#weblogicDomainStoragePath\\: /scratch/k8s_dir:weblogicDomainStoragePath\\: /scratch/k8s_dir:g\u0026quot; create-pv-pvc-inputs.yaml c. Run the create-pv-pvc.sh script to create the PV and PVC configuration files:\n$ ./create-pv-pvc.sh -i create-pv-pvc-inputs.yaml -o output d. Create the PV and PVC using the configuration files created in the previous step:\n $ kubectl create -f output/pv-pvcs/wcp-domain-domain-pv.yaml $ kubectl create -f output/pv-pvcs/wcp-domain-domain-pvc.yaml Install and configure the database for the Oracle WebCenter Portal domain.\nThis step is required only when a standalone database is not already set up and you want to use the database in a container.\nThe Oracle Database Docker images are supported only for non-production use. For more details, see My Oracle Support note: Oracle Support for Database Running on Docker (Doc ID 2216342.1). For production, it is suggested to use a standalone database. This example provides steps to create the database in a container.\n a. Create a database in a container:\n$ cd ${WORKDIR}/create-oracle-db-service $ ./start-db-service.sh -i container-registry.oracle.com/database/enterprise:12.2.0.1-slim -p none Once the database is successfully created, you can use the database connection string oracle-db.default.svc.cluster.local:1521/devpdb.k8s as an rcuDatabaseURL parameter in the create-domain-inputs.yaml file.\nb. Create Oracle WebCenter Portal schemas.\nTo create the Oracle WebCenter Portal schemas, run the following commands:\n $ ./create-rcu-schema.sh \\ -s WCP1 \\ -t wcp \\ -d oracle-db.default.svc.cluster.local:1521/devpdb.k8s \\ -i oracle/wcportal:12.2.1.4\\ -n wcpns \\ -q Oradoc_db1 \\ -r welcome1 Now the environment is ready to start the Oracle WebCenter Portal domain creation.\n6.2 Create an Oracle WebCenter Portal domain The sample scripts for Oracle WebCenter Portal domain deployment are available at create-wcp-domain. You must edit create-domain-inputs.yaml (or a copy of it) to provide the details for your domain.\nUpdate create-domain-inputs.yaml with the following values for domain creation:\n rcuDatabaseURL: oracle-db.default.svc.cluster.local:1521/devpdb.k8s Run the create-domain.sh script to create a domain:\n$ cd ${WORKDIR}/create-wcp-domain/domain-home-on-pv/ $ ./create-domain.sh -i create-domain-inputs.yaml -o output Create a Kubernetes domain object:\nOnce the create-domain.sh is successful, it generates output/weblogic-domains/wcp-domain/domain.yaml, which you can use to create the Kubernetes resource domain to start the domain and servers:\n$ cd ${WORKDIR}/create-wcp-domain/domain-home-on-pv $ kubectl create -f output/weblogic-domains/wcp-domain/domain.yaml Verify that the Kubernetes domain object named wcp-domain is created:\n$ kubectl get domain -n wcpns NAME AGE wcp-domain 3m18s Once you create the domain, the introspect pod is created. This inspects the domain home and then starts the wcp-domain-adminserver pod. Once the wcp-domain-adminserver pod starts successfully, the Managed Server pods are started in parallel. Watch the wcpns namespace for the status of domain creation:\n$ kubectl get pods -n wcpns -w Verify that the Oracle WebCenter Portal domain server pods and services are created and in Ready state:\n$ kubectl get all -n wcpns 6.3 Configure Traefik to access Oracle WebCenter Portal domain services Configure Traefik to manage ingresses created in the Oracle WebCenter Portal domain namespace (wcpns):\n$ helm upgrade traefik traefik/traefik \\ --reuse-values \\ --namespace traefik \\ --set \u0026quot;kubernetes.namespaces={traefik,wcpns}\u0026quot; \\ --wait Create an ingress for the domain in the domain namespace by using the sample Helm chart:\n$ cd ${WORKDIR} helm install wcp-traefik-ingress \\ charts/ingress-per-domain \\ --namespace wcpns \\ --values charts/ingress-per-domain/values.yaml \\ --set \u0026quot;traefik.hostname=$(hostname -f)\u0026quot; Verify the created ingress per domain details:\n$ kubectl describe ingress wcp-domain-traefik -n wcpns 6.4 Verify that you can access the Oracle WebCenter Portal domain URL Get the LOADBALANCER_HOSTNAME for your environment:\nexport LOADBALANCER_HOSTNAME=$(hostname -f) Verify the following URLs are available for Oracle WebCenter Portal domain.\nCredentials:\nusername: weblogic password: welcome1\nhttp://${LOADBALANCER_HOSTNAME}:${LOADBALANCER-Non-SSLPORT}/webcenter http://${LOADBALANCER_HOSTNAME}:${LOADBALANCER-Non-SSLPORT}/console http://${LOADBALANCER_HOSTNAME}:${LOADBALANCER-Non-SSLPORT}/em http://${LOADBALANCER_HOSTNAME}:${LOADBALANCER-Non-SSLPORT}/rsscrawl http://${LOADBALANCER_HOSTNAME}:${LOADBALANCER-Non-SSLPORT}/rest http://${LOADBALANCER_HOSTNAME}:${LOADBALANCER-Non-SSLPORT}/webcenterhelp " +}, +{ + "uri": "/fmw-kubernetes/22.2.3/wcportal-domains/manage-wcportal-domains/monitoring-and-publishing-logs/", + "title": "Monitor a domain and publish logs", + "tags": [], + "description": "Monitor Oracle WebCenter Portal and publishing logs to Elasticsearch.", + "content": " Monitor a WebCenter Portal domain Monitor an WebCenter Portal instance using Prometheus and Grafana.\n Publish WebLogic Server logs into Elasticsearch Publish WebLogic Server logs into Elasticsearch.\n " +}, +{ + "uri": "/fmw-kubernetes/22.2.3/wcportal-domains/manage-wcportal-domains/configure-load-balancer/nginx/", + "title": "NGINX", + "tags": [], + "description": "Configure the ingress-based NGINX load balancer for an Oracle WebCenter Portal domain.", + "content": "To load balance Oracle WebCenter Portal domain clusters, you can install the ingress-based NGINX load balancer and configure NGINX for non-SSL, SSL termination, and end-to-end SSL access of the application URL. Follow these steps to set up NGINX as a load balancer for an Oracle WebCenter Portal domain in a Kubernetes cluster:\nSee the official installation document for prerequisites.\n Non-SSL and SSL termination\n Install the NGINX load balancer Configure NGINX to manage ingresses Verify non-SSL and SSL termination access End-to-end SSL configuration\n Install the NGINX load balancer for End-to-end SSL Deploy tls to access the services Verify end-to-end SSL access Non-SSL and SSL termination To get repository information, enter the following Helm commands:\n$ helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx $ helm repo update Install the NGINX load balancer Deploy the ingress-nginx controller by using Helm on the domain namespace:\n$ helm install nginx-ingress ingress-nginx/ingress-nginx -n wcpns \\ --set controller.service.type=NodePort \\ --set controller.admissionWebhooks.enabled=false Click here to see the sample output. NAME: nginx-ingress LAST DEPLOYED: Tue Jan 12 21:13:54 2021 NAMESPACE: wcpns STATUS: deployed REVISION: 1 TEST SUITE: None NOTES: The ingress-nginx controller has been installed. Get the application URL by running these commands: export HTTP_NODE_PORT=30305 export HTTPS_NODE_PORT=$(kubectl --namespace wcpns get services -o jsonpath=\u0026quot;{.spec.ports[1].nodePort}\u0026quot; nginx-ingress-ingress-nginx-controller) export NODE_IP=$(kubectl --namespace wcpns get nodes -o jsonpath=\u0026quot;{.items[0].status.addresses[1].address}\u0026quot;) echo \u0026quot;Visit http://$NODE_IP:$HTTP_NODE_PORT to access your application via HTTP.\u0026quot; echo \u0026quot;Visit https://$NODE_IP:$HTTPS_NODE_PORT to access your application via HTTPS.\u0026quot; An example Ingress that makes use of the controller: apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: annotations: kubernetes.io/ingress.class: nginx name: example namespace: foo spec: rules: - host: www.example.com http: paths: - backend: serviceName: exampleService servicePort: 80 path: / # This section is only required if TLS is to be enabled for the Ingress tls: - hosts: - www.example.com secretName: example-tls If TLS is enabled for the Ingress, a Secret containing the certificate and key must also be provided: apiVersion: v1 kind: Secret metadata: name: example-tls namespace: foo data: tls.crt: \u0026lt;base64 encoded cert\u0026gt; tls.key: \u0026lt;base64 encoded key\u0026gt; type: kubernetes.io/tls Check the status of the deployed ingress controller:\n$ kubectl --namespace wcpns get services | grep ingress-nginx-controller Sample output:\nnginx-ingress-ingress-nginx-controller NodePort 10.101.123.106 \u0026lt;none\u0026gt; 80:30305/TCP,443:31856/TCP 2m12s Configure NGINX to manage ingresses Create an ingress for the domain in the domain namespace by using the sample Helm chart. Here path-based routing is used for ingress. Sample values for default configuration are shown in the file ${WORKDIR}/charts/ingress-per-domain/values.yaml. By default, type is TRAEFIK, tls is Non-SSL. You can override these values by passing values through the command line or edit them in the sample values.yaml file. NOTE: This is not an exhaustive list of rules. You can enhance it based on the application URLs that need to be accessed externally.\n If needed, you can update the ingress YAML file to define more path rules (in section spec.rules.host.http.paths) based on the domain application URLs that need to be accessed. Update the template YAML file for the NGINX load balancer located at ${WORKDIR}/charts/ingress-per-domain/templates/nginx-ingress.yaml You can add new path rules like shown below .\n- path: /NewPathRule backend: serviceName: \u0026#39;Backend Service Name\u0026#39; servicePort: \u0026#39;Backend Service Port\u0026#39; $ cd ${WORKDIR} $ helm install wcp-domain-nginx charts/ingress-per-domain \\ --namespace wcpns \\ --values charts/ingress-per-domain/values.yaml \\ --set \u0026#34;nginx.hostname=$(hostname -f)\u0026#34; \\ --set type=NGINX ``` Sample output: ```bash NAME: wcp-domain-nginx LAST DEPLOYED: Fri Jul 24 09:34:03 2020 NAMESPACE: wcpns STATUS: deployed REVISION: 1 TEST SUITE: None ``` 1. For secured access (SSL) to the Oracle WebCenter Portal application, create a certificate and generate a Kubernetes secret: ```bash $ openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /tmp/tls1.key -out /tmp/tls1.crt -subj \u0026#34;/CN=*\u0026#34; $ kubectl -n wcpns create secret tls wcp-domain-tls-cert --key /tmp/tls1.key --cert /tmp/tls1.crt Install ingress-per-domain using Helm for SSL configuration:\n$ cd ${WORKDIR} $ helm install wcp-domain-nginx charts/ingress-per-domain \\ --namespace wcpns \\ --values charts/ingress-per-domain/values.yaml \\ --set \u0026#34;nginx.hostname=$(hostname -f)\u0026#34; \\ --set type=NGINX --set sslType=SSL For non-SSL access to the Oracle WebCenter Portal application, get the details of the services by the ingress:\n$ kubectl describe ingress wcp-domain-nginx -n wcpns Click here to see the sample output of the services supported by the above deployed ingress. Name: wcp-domain-nginx Namespace: wcpns Address: 10.101.123.106 Default backend: default-http-backend:80 (\u0026lt;error: endpoints \u0026quot;default-http-backend\u0026quot; not found\u0026gt;) Rules: Host Path Backends ---- ---- -------- * /webcenter wcp-domain-cluster-wcp-cluster:8888 (10.244.0.52:8888,10.244.0.53:8888) /console wcp-domain-adminserver:7001 (10.244.0.51:7001) /rsscrawl wcp-domain-cluster-wcp-cluster:8888 (10.244.0.53:8888) /rest wcp-domain-cluster-wcp-cluster:8888 (10.244.0.53:8888) /webcenterhelp wcp-domain-cluster-wcp-cluster:8888 (10.244.0.53:8888) /wsrp-tools wcp-domain-cluster-wcportlet-cluster:8889 (10.244.0.53:8889) /portalTools wcp-domain-cluster-wcportlet-cluster:8889 (10.244.0.53:8889) /em wcp-domain-adminserver:7001 (10.244.0.51:7001) Annotations: meta.helm.sh/release-name: wcp-domain-nginx meta.helm.sh/release-namespace: wcpns nginx.com/sticky-cookie-services: serviceName=wcp-domain-cluster-wcp-cluster srv_id expires=1h path=/; nginx.ingress.kubernetes.io/proxy-connect-timeout: 1800 nginx.ingress.kubernetes.io/proxy-read-timeout: 1800 nginx.ingress.kubernetes.io/proxy-send-timeout: 1800 Events: Type Reason Age From Message ---- ------ ---- ---- ------- Normal Sync 48m (x2 over 48m) nginx-ingress-controller Scheduled for sync For SSL access to the Oracle WebCenter Portal application, get the details of the services by the above deployed ingress:\n$ kubectl describe ingress wcp-domain-nginx -n wcpns Click here to see the sample output of the services supported by the above deployed ingress. Name: wcp-domain-nginx Namespace: wcpns Address: 10.106.220.140 Default backend: default-http-backend:80 (\u0026lt;error: endpoints \u0026quot;default-http-backend\u0026quot; not found\u0026gt;) TLS: wcp-domain-tls-cert terminates mydomain.com Rules: Host Path Backends ---- ---- -------- * /webcenter wcp-domain-cluster-wcp-cluster:8888 (10.244.0.43:8888,10.244.0.44:8888) /console wcp-domain-adminserver:7001 (10.244.0.42:7001) /rsscrawl wcp-domain-cluster-wcp-cluster:8888 (10.244.0.43:8888,10.244.0.44:8888) /webcenterhelp wcp-domain-cluster-wcp-cluster:8888 (10.244.0.43:8888,10.244.0.44:8888) /rest wcp-domain-cluster-wcp-cluster:8888 (10.244.0.43:8888,10.244.0.44:8888) /em wcp-domain-adminserver:7001 (10.244.0.42:7001) /wsrp-tools wcp-domain-cluster-wcportlet-cluster:8889 (10.244.0.43:8889,10.244.0.44:8889) /portalTools wcp-domain-cluster-wcportlet-cluster:8889 (10.244.0.43:8889,10.244.0.44:8889) Annotations: kubernetes.io/ingress.class: nginx meta.helm.sh/release-name: wcp-domain-nginx meta.helm.sh/release-namespace: wcpns nginx.ingress.kubernetes.io/affinity: cookie nginx.ingress.kubernetes.io/affinity-mode: persistent nginx.ingress.kubernetes.io/configuration-snippet: more_set_input_headers \u0026quot;X-Forwarded-Proto: https\u0026quot;; more_set_input_headers \u0026quot;WL-Proxy-SSL: true\u0026quot;; nginx.ingress.kubernetes.io/ingress.allow-http: false nginx.ingress.kubernetes.io/proxy-connect-timeout: 1800 nginx.ingress.kubernetes.io/proxy-read-timeout: 1800 nginx.ingress.kubernetes.io/proxy-send-timeout: 1800 nginx.ingress.kubernetes.io/session-cookie-expires: 172800 nginx.ingress.kubernetes.io/session-cookie-max-age: 172800 nginx.ingress.kubernetes.io/session-cookie-name: stickyid nginx.ingress.kubernetes.io/ssl-redirect: false Events: \u0026lt;none\u0026gt; Verify non-SSL and SSL termination access Verify that the Oracle WebCenter Portal domain application URLs are accessible through the nginx NodePort LOADBALANCER-NODEPORT 30305:\nhttp://${LOADBALANCER-HOSTNAME}:${LOADBALANCER-NODEPORT}/console http://${LOADBALANCER-HOSTNAME}:${LOADBALANCER-NODEPORT}/em http://${LOADBALANCER-HOSTNAME}:${LOADBALANCER-NODEPORT}/webcenter http://${LOADBALANCER-HOSTNAME}:${LOADBALANCER-NODEPORT}/rsscrawl http://${LOADBALANCER-HOSTNAME}:${LOADBALANCER-NODEPORT}/rest http://${LOADBALANCER-HOSTNAME}:${LOADBALANCER-NODEPORT}/webcenterhelp http://${LOADBALANCER-HOSTNAME}:${LOADBALANCER-NODEPORT}/wsrp-tools http://${LOADBALANCER-HOSTNAME}:${LOADBALANCER-NODEPORT}/portalTools Uninstall the ingress Uninstall and delete the ingress-nginx deployment:\n$ helm delete wcp-domain-nginx -n wcpns $ helm delete nginx-ingress -n wcpns End-to-end SSL configuration Install the NGINX load balancer for End-to-end SSL For secured access (SSL) to the Oracle WebCenter Portal application, create a certificate and generate secrets:\n$ openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /tmp/tls1.key -out /tmp/tls1.crt -subj \u0026#34;/CN=domain1.org\u0026#34; $ kubectl -n wcpns create secret tls wcp-domain-tls-cert --key /tmp/tls1.key --cert /tmp/tls1.crt Note: The value of CN is the host on which this ingress is to be deployed.\n Deploy the ingress-nginx controller by using Helm on the domain namespace:\n$ helm install nginx-ingress -n wcpns \\ --set controller.extraArgs.default-ssl-certificate=wcpns/wcp-domain-tls-cert \\ --set controller.service.type=NodePort \\ --set controller.admissionWebhooks.enabled=false \\ --set controller.extraArgs.enable-ssl-passthrough=true \\ ingress-nginx/ingress-nginx Click here to see the sample output. NAME: nginx-ingress LAST DEPLOYED: Tue Sep 15 08:40:47 2020 NAMESPACE: wcpns STATUS: deployed REVISION: 1 TEST SUITE: None NOTES: The ingress-nginx controller has been installed. Get the application URL by running these commands: export HTTP_NODE_PORT=$(kubectl --namespace wcpns get services -o jsonpath=\u0026#34;{.spec.ports[0].nodePort}\u0026#34; nginx-ingress-ingress-nginx-controller) export HTTPS_NODE_PORT=$(kubectl --namespace wcpns get services -o jsonpath=\u0026#34;{.spec.ports[1].nodePort}\u0026#34; nginx-ingress-ingress-nginx-controller) export NODE_IP=$(kubectl --namespace wcpns get nodes -o jsonpath=\u0026#34;{.items[0].status.addresses[1].address}\u0026#34;) echo \u0026#34;Visit http://$NODE_IP:$HTTP_NODE_PORTto access your application via HTTP.\u0026#34; echo \u0026#34;Visit https://$NODE_IP:$HTTPS_NODE_PORTto access your application via HTTPS.\u0026#34; An example Ingress that makes use of the controller: apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: annotations: kubernetes.io/ingress.class: nginx name: example namespace: foo spec: rules: - host: www.example.com http: paths: - backend: serviceName: exampleService servicePort: 80 path: / # This section is only required if TLS is to be enabled for the Ingress tls: - hosts: - www.example.com secretName: example-tls If TLS is enabled for the Ingress, a Secret containing the certificate and key must also be provided: apiVersion: v1 kind: Secret metadata: name: example-tls namespace: foo data: tls.crt: \u0026lt;base64 encoded cert\u0026gt; tls.key: \u0026lt;base64 encoded key\u0026gt; type: kubernetes.io/tls Check the status of the deployed ingress controller:\n$ kubectl --namespace wcpns get services | grep ingress-nginx-controller Sample output:\nnginx-ingress-ingress-nginx-controller NodePort 10.96.177.215 \u0026lt;none\u0026gt; 80:32748/TCP,443:31940/TCP 23s Deploy tls to access services Deploy tls to securely access the services. Only one application can be configured with ssl-passthrough. A sample tls file for NGINX is shown below for the service wcp-domain-cluster-wcp-cluster and port 8889. All the applications running on port 8889 can be securely accessed through this ingress.\n For each backend service, create different ingresses, as NGINX does not support multiple paths or rules with annotation ssl-passthrough. For example, for wcp-domain-adminserver and wcp-domain-cluster-wcp-cluster, different ingresses must be created.\n As ssl-passthrough in NGINX works on the clusterIP of the backing service instead of individual endpoints, you must expose wcp-domain-cluster-wcp-cluster created by the operator with clusterIP.\nFor example:\na. Get the name of wcp-domain cluster service:\n$ kubectl get svc -n wcpns | grep wcp-domain-cluster-wcp-cluster Sample output:\nwcp-domain-cluster-wcp-cluster ClusterIP 10.102.128.124 \u0026lt;none\u0026gt; 8888/TCP,8889/TCP 62m Deploy the secured ingress:\n$ cd ${WORKDIR}/charts/ingress-per-domain/tls $ kubectl create -f nginx-tls.yaml Note: The default nginx-tls.yaml contains the backend for WebCenter Portal service with domainUID wcp-domain. You need to create similar tls configuration YAML files separately for each backend service.\n Click here to check the content of the file nginx-tls.yaml apiVersion: extensions/v1beta1 kind: Ingress metadata: name: wcpns-ingress namespace: wcpns annotations: kubernetes.io/ingress.class: nginx nginx.ingress.kubernetes.io/ssl-passthrough: \u0026quot;true\u0026quot; spec: tls: - hosts: - domain1.org secretName: wcp-domain-tls-cert rules: - host: domain1.org http: paths: - path: backend: serviceName: wcp-domain-cluster-wcp-cluster servicePort: 8889 Note: Host is the server on which this ingress is deployed.\n Check the services supported by the ingress:\n$ kubectl describe ingress wcpns-ingress -n wcpns Verify end-to-end SSL access Verify that the Oracle WebCenter Portal domain application URLs are accessible through the LOADBALANCER-SSLPORT 30233:\nhttps://${LOADBALANCER-HOSTNAME}:${LOADBALANCER-SSLPORT}/webcenter https://${LOADBALANCER-HOSTNAME}:${LOADBALANCER-SSLPORT}/rsscrawl https://${LOADBALANCER-HOSTNAME}:${LOADBALANCER-SSLPORT}/webcenterhelp https://${LOADBALANCER-HOSTNAME}:${LOADBALANCER-SSLPORT}/rest https://${LOADBALANCER-HOSTNAME}:${LOADBALANCER-SSLPORT}/wsrp-tools https://${LOADBALANCER-HOSTNAME}:${LOADBALANCER-SSLPORT}/portalTools Uninstall ingress-nginx tls $ cd ${WORKDIR}/charts/ingress-per-domain/tls $ kubectl delete -f nginx-tls.yaml $ helm delete nginx-ingress -n wcpns " +}, +{ + "uri": "/fmw-kubernetes/22.2.3/wcportal-domains/manage-wcportal-domains/monitoring-and-publishing-logs/publishing-logs/", + "title": "Publish WebLogic Server logs into Elasticsearch", + "tags": [], + "description": "Publish WebLogic Server logs into Elasticsearch.", + "content": "To publish WebLogic Server logs into Elasticsearch, you can configure your WebCenter Portal domain to use Fluentd, WebLogic Logging Exporter or Logstash. Fluentd Describes how to configure a WebCenter Portal domain to use Fluentd to send log information to Elasticsearch.\n WebLogic logging exporter Use the WebLogic Logging Exporter to publish the WebLogic Server logs to Elasticsearch.\n Logstash Describes how to configure a WebCenter Portal domain to use logstash and publish the WebLogic Server logs to Elasticsearch.\n " +}, +{ + "uri": "/fmw-kubernetes/22.2.3/wcportal-domains/installguide/prepare-your-environment/", + "title": "Prepare your environment", + "tags": [], + "description": "Prepare for creating the Oracle WebCenter Portal domain, This preparation includes but not limited to creating required secrets, persistent volume and volume claim, and database schema.", + "content": "Set up the environment, including setting up a Kubernetes cluster and the Weblogic Kubernetes Operator.\n Install Helm\n Set Up your Kubernetes Cluster\n Obtain the Oracle WebCenter Portal Docker Image\n Pull Other Dependent Images\n Set Up the Code Repository to Deploy Oracle WebCenter Portal Domain\n Grant Roles and Clear Stale Resources\n Install the WebLogic Kubernetes Operator\n Prepare the Environment for the WebCenter Portal Domain\na. Create a namespace for an Oracle WebCenter Portal domain\nb. Create a Kubernetes secret with domain credentials\nc. Create a Kubernetes secret with the RCU credentials\nd. Create a persistent storage for an Oracle WebCenter Portal domain\ne. Configure access to your database\nf. Run the Repository Creation Utility to set up your database schemas\n Install Helm The operator uses Helm to create and deploy the necessary resources and then run the operator in a Kubernetes cluster. For Helm installation and usage information, see here.\nSet Up your Kubernetes Cluster If you need help in setting up a Kubernetes environment, check our cheat sheet.\nAfter creating Kubernetes clusters, you can optionally:\n Create load balancers to direct traffic to backend domain Configure Kibana and Elasticsearch for your operator logs Obtain the Oracle WebCenter Portal Docker Image The Oracle WebCenter Portal image with latest bundle patch and required interim patches can be obtained from My Oracle Support (MOS). This is the only image supported for production deployments. Follow the below steps to download the Oracle WebCenter Portal image from My Oracle Support.\n Download patch 33807917 from My Oracle Support (MOS).\n Unzip the downloaded patch zip file.\n Load the image archive using the docker load command.\nFor example:\n$ docker load \u0026lt; wcportal-12.2.1.4-jdk8-ol7-220203.0823.tar Loaded image: oracle/wcportal:12.2.1.4-jdk8-ol7-220203.0823 If you want to build and use an Oracle WebCenter Portal Docker image with any additional bundle patch or interim patches that are not part of the image obtained from My Oracle Support, then follow these steps to create the image.\n Note: The default Oracle WebCenter Portal image name used for Oracle WebCenter Portal domain deployment is oracle/wcportal:12.2.1.4. The image obtained must be tagged as oracle/wcportal:12.2.1.4 using the docker tag command. If you want to use a different name for the image, make sure to update the new image tag name in the create-domain-inputs.yaml file and also in other instances where the oracle/wcportal:12.2.1.4 image name is used.\n Pull Other Dependent Images Dependent images include WebLogic Kubernetes Operator, database, and Traefik. Pull these images and add them to your local registry:\n Pull these docker images and re-tag them as shown: To pull an image from the Oracle Container Registry, in a web browser, navigate to https://container-registry.oracle.com and log in using the Oracle Single Sign-On authentication service. If you do not already have SSO credentials, at the top of the page, click the Sign In link to create them.\nUse the web interface to accept the Oracle Standard Terms and Restrictions for the Oracle software images that you intend to deploy. Your acceptance of these terms are stored in a database that links the software images to your Oracle Single Sign-On login credentials.\nThen, pull these docker images:\n$ docker login https://container-registry.oracle.com (enter your Oracle email Id and password) #This step is required once at every node to get access to the Oracle Container Registry. WebLogic Kubernetes Operator image:\n$ docker pull ghcr.io/oracle/weblogic-kubernetes-operator:3.3.0 Copy all the built and pulled images to all the nodes in your cluster or add to a Docker registry that your cluster can access. NOTE: If you\u0026rsquo;re not running Kubernetes on your development machine, you\u0026rsquo;ll need to make the Docker image available to a registry visible to your Kubernetes cluster. Upload your image to a machine running Docker and Kubernetes as follows:\n# on your build machine $ docker save Image_Name:Tag \u0026gt; Image_Name-Tag.tar $ scp Image_Name-Tag.tar YOUR_USER@YOUR_SERVER:/some/path/Image_Name-Tag.tar # on the Kubernetes server $ docker load \u0026lt; /some/path/Image_Name-Tag.tar Set Up the Code Repository to Deploy Oracle WebCenter Portal Domain Oracle WebCenter Portal domain deployment on Kubernetes leverages the WebLogic Kubernetes Operator infrastructure. For deploying the Oracle WebCenter Portal domain, you need to set up the deployment scripts as below:\n Create a working directory to set up the source code.\n$ mkdir $HOME/wcp_22.2.3 $ cd $HOME/wcp_22.2.3 Download the Oracle WebCenter Portal Kubernetes deployment scripts from the Github repository. Required artifacts are available at OracleWeCenterPortal/kubernetes.\n$ git clone https://github.com/oracle/fmw-kubernetes.git $ export WORKDIR=$HOME/wcp_22.2.3/fmw-kubernetes/OracleWebCenterPortal/kubernetes/ You can now use the deployment scripts from \u0026lt;$WORKDIR\u0026gt; to set up the WebCenter Portal domain as described later in this document.\nGrant Roles and Clear Stale Resources To confirm if there is already a WebLogic custom resource definition, execute the following command:\n$ kubectl get crd NAME CREATED AT domains.weblogic.oracle 2020-03-14T12:10:21Z Delete the WebLogic custom resource definition, if you find any, by executing the following command:\n$ kubectl delete crd domains.weblogic.oracle customresourcedefinition.apiextensions.k8s.io \u0026#34;domains.weblogic.oracle\u0026#34; deleted Install the WebLogic Kubernetes Operator Create a namespace for the WebLogic Kubernetes Operator:\n$ kubectl create namespace operator-ns namespace/operator-ns created NOTE: In this procedure, the namespace is called “operator-ns”. You can use any name.\nYou can use:\n domainUID/domainname as wcp-domain Domain namespace as wcpns Operator namespace as operator-ns traefik namespace as traefik Create a service account for the WebLogic Kubernetes Operator in the operator\u0026rsquo;s namespace:\n$ kubectl create serviceaccount -n operator-ns operator-sa serviceaccount/operator-sa created To be able to set up the log-stash and Elasticsearch after creating the domain, set the value of the field elkIntegrationEnabled to true in the file kubernetes/charts/weblogic-operator/values.yaml.\n Use helm to install and start the WebLogic Kubernetes Operator from the downloaded repository:\n Helm install weblogic-operator\n $ cd ${WORKDIR} $ helm install weblogic-kubernetes-operator charts/weblogic-operator --namespace operator-ns --set serviceAccount=operator-sa --set \u0026#34;domainNamespaces={}\u0026#34; --wait NAME: weblogic-kubernetes-operator LAST DEPLOYED: Wed Jan 6 01:47:33 2021 NAMESPACE: operator-ns STATUS: deployed REVISION: 1 TEST SUITE: None ``\n To verify that the operator\u0026rsquo;s pod is running, list the pods in the operator\u0026rsquo;s namespace. You should see one for the WebLogic Kubernetes Operator:\n$ kubectl get pods -n operator-ns NAME READY STATUS RESTARTS AGE weblogic-operator-67df5fddc5-tlc4b 2/2 Running 0 3m15s Then, check by viewing the Operator pod\u0026rsquo;s log as shown in the following sample log snippet:\n$ kubectl logs -n operator-ns -c weblogic-operator deployments/weblogic-operator Launching Oracle WebLogic Server Kubernetes Operator... Importing keystore /operator/internal-identity/temp/weblogic-operator.jks to /operator/internal-identity/temp/weblogic-operator.p12... Entry for alias weblogic-operator-alias successfully imported. Import command completed: 1 entries successfully imported, 0 entries failed or cancelled Warning: The -srcstorepass option is specified multiple times. All except the last one will be ignored. MAC verified OK % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 4249 0 2394 100 1855 6884 5334 --:--:-- --:--:-- --:--:-- 6899 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 5558 0 3028 100 2530 22704 18970 --:--:-- --:--:-- --:--:-- 22766 OpenJDK 64-Bit Server VM warning: Option MaxRAMFraction was deprecated in version 10.0 and will likely be removed in a future release. VM settings: Max. Heap Size (Estimated): 14.08G Using VM: OpenJDK 64-Bit Server VM {\u0026#34;timestamp\u0026#34;:\u0026#34;03-14-2020T06:49:53.438+0000\u0026#34;,\u0026#34;thread\u0026#34;:1,\u0026#34;fiber\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;domainUID\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;level\u0026#34;:\u0026#34;INFO\u0026#34;,\u0026#34;class\u0026#34;:\u0026#34;oracle.kubernetes.operator.TuningParametersImpl\u0026#34;,\u0026#34;method\u0026#34;:\u0026#34;update\u0026#34;,\u0026#34;timeInMillis\u0026#34;:1584168593438,\u0026#34;message\u0026#34;:\u0026#34;Reloading tuning parameters from Operator\u0026#39;s config map\u0026#34;,\u0026#34;exception\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;code\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;headers\u0026#34;:{},\u0026#34;body\u0026#34;:\u0026#34;\u0026#34;} {\u0026#34;timestamp\u0026#34;:\u0026#34;03-14-2020T06:49:53.944+0000\u0026#34;,\u0026#34;thread\u0026#34;:1,\u0026#34;fiber\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;domainUID\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;level\u0026#34;:\u0026#34;INFO\u0026#34;,\u0026#34;class\u0026#34;:\u0026#34;oracle.kubernetes.operator.Main\u0026#34;,\u0026#34;method\u0026#34;:\u0026#34;main\u0026#34;,\u0026#34;timeInMillis\u0026#34;:1584168593944,\u0026#34;message\u0026#34;:\u0026#34;Oracle WebLogic Server Kubernetes Operator, version: 3.0.4, implementation: master.4d4fe0a, build time: 2019-11-15T21:19:56-0500\u0026#34;,\u0026#34;exception\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;code\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;headers\u0026#34;:{},\u0026#34;body\u0026#34;:\u0026#34;\u0026#34;} {\u0026#34;timestamp\u0026#34;:\u0026#34;03-14-2020T06:49:53.972+0000\u0026#34;,\u0026#34;thread\u0026#34;:11,\u0026#34;fiber\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;domainUID\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;level\u0026#34;:\u0026#34;INFO\u0026#34;,\u0026#34;class\u0026#34;:\u0026#34;oracle.kubernetes.operator.Main\u0026#34;,\u0026#34;method\u0026#34;:\u0026#34;begin\u0026#34;,\u0026#34;timeInMillis\u0026#34;:1584168593972,\u0026#34;message\u0026#34;:\u0026#34;Operator namespace is: operator-ns\u0026#34;,\u0026#34;exception\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;code\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;headers\u0026#34;:{},\u0026#34;body\u0026#34;:\u0026#34;\u0026#34;} {\u0026#34;timestamp\u0026#34;:\u0026#34;03-14-2020T06:49:54.009+0000\u0026#34;,\u0026#34;thread\u0026#34;:11,\u0026#34;fiber\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;domainUID\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;level\u0026#34;:\u0026#34;INFO\u0026#34;,\u0026#34;class\u0026#34;:\u0026#34;oracle.kubernetes.operator.Main\u0026#34;,\u0026#34;method\u0026#34;:\u0026#34;begin\u0026#34;,\u0026#34;timeInMillis\u0026#34;:1584168594009,\u0026#34;message\u0026#34;:\u0026#34;Operator target namespaces are: operator-ns\u0026#34;,\u0026#34;exception\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;code\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;headers\u0026#34;:{},\u0026#34;body\u0026#34;:\u0026#34;\u0026#34;} {\u0026#34;timestamp\u0026#34;:\u0026#34;03-14-2020T06:49:54.013+0000\u0026#34;,\u0026#34;thread\u0026#34;:11,\u0026#34;fiber\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;domainUID\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;level\u0026#34;:\u0026#34;INFO\u0026#34;,\u0026#34;class\u0026#34;:\u0026#34;oracle.kubernetes.operator.Main\u0026#34;,\u0026#34;method\u0026#34;:\u0026#34;begin\u0026#34;,\u0026#34;timeInMillis\u0026#34;:1584168594013,\u0026#34;message\u0026#34;:\u0026#34;Operator service account is: operator-sa\u0026#34;,\u0026#34;exception\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;code\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;headers\u0026#34;:{},\u0026#34;body\u0026#34;:\u0026#34;\u0026#34;}\t{\u0026#34;timestamp\u0026#34;:\u0026#34;03-14-2020T06:49:54.031+0000\u0026#34;,\u0026#34;thread\u0026#34;:11,\u0026#34;fiber\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;domainUID\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;level\u0026#34;:\u0026#34;INFO\u0026#34;,\u0026#34;class\u0026#34;:\u0026#34;oracle.kubernetes.operator.helpers.HealthCheckHelper\u0026#34;,\u0026#34;method\u0026#34;:\u0026#34;performK8sVersionCheck\u0026#34;,\u0026#34;timeInMillis\u0026#34;:1584168594031,\u0026#34;message\u0026#34;:\u0026#34;Verifying Kubernetes minimum version\u0026#34;,\u0026#34;exception\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;code\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;headers\u0026#34;:{},\u0026#34;body\u0026#34;:\u0026#34;\u0026#34;}\t{\u0026#34;timestamp\u0026#34;:\u0026#34;03-14-2020T06:49:54.286+0000\u0026#34;,\u0026#34;thread\u0026#34;:11,\u0026#34;fiber\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;domainUID\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;level\u0026#34;:\u0026#34;INFO\u0026#34;,\u0026#34;class\u0026#34;:\u0026#34;oracle.kubernetes.operator.helpers.ClientPool\u0026#34;,\u0026#34;method\u0026#34;:\u0026#34;getApiClient\u0026#34;,\u0026#34;timeInMillis\u0026#34;:1584168594286,\u0026#34;message\u0026#34;:\u0026#34;The Kuberenetes Master URL is set to https://10.96.0.1:443\u0026#34;,\u0026#34;exception\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;code\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;headers\u0026#34;:{},\u0026#34;body\u0026#34;:\u0026#34;\u0026#34;}\t{\u0026#34;timestamp\u0026#34;:\u0026#34;03-14-2020T06:49:54.673+0000\u0026#34;,\u0026#34;thread\u0026#34;:11,\u0026#34;fiber\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;domainUID\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;level\u0026#34;:\u0026#34;INFO\u0026#34;,\u0026#34;class\u0026#34;:\u0026#34;oracle.kubernetes.operator.helpers.HealthCheckHelper\u0026#34;,\u0026#34;method\u0026#34;:\u0026#34;createAndValidateKubernetesVersion\u0026#34;,\u0026#34;timeInMillis\u0026#34;:1584168594673,\u0026#34;message\u0026#34;:\u0026#34;Kubernetes version is: v1.13.7\u0026#34;,\u0026#34;exception\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;code\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;headers\u0026#34;:{},\u0026#34;body\u0026#34;:\u0026#34;\u0026#34;}\t{\u0026#34;timestamp\u0026#34;:\u0026#34;03-14-2020T06:49:55.259+0000\u0026#34;,\u0026#34;thread\u0026#34;:12,\u0026#34;fiber\u0026#34;:\u0026#34;engine-operator-thread-2-fiber-1\u0026#34;,\u0026#34;domainUID\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;level\u0026#34;:\u0026#34;INFO\u0026#34;,\u0026#34;class\u0026#34;:\u0026#34;oracle.kubernetes.operator.helpers.CrdHelper$CrdContext$CreateResponseStep\u0026#34;,\u0026#34;method\u0026#34;:\u0026#34;onSuccess\u0026#34;,\u0026#34;timeInMillis\u0026#34;:1584168595259,\u0026#34;message\u0026#34;:\u0026#34;Create Custom Resource Definition: oracle.kubernetes.operator.calls.CallResponse@470b40c\u0026#34;,\u0026#34;exception\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;code\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;headers\u0026#34;:{},\u0026#34;body\u0026#34;:\u0026#34;\u0026#34;}\t{\u0026#34;timestamp\u0026#34;:\u0026#34;03-14-2020T06:49:55.356+0000\u0026#34;,\u0026#34;thread\u0026#34;:16,\u0026#34;fiber\u0026#34;:\u0026#34;fiber-1-child-2\u0026#34;,\u0026#34;domainUID\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;level\u0026#34;:\u0026#34;INFO\u0026#34;,\u0026#34;class\u0026#34;:\u0026#34;oracle.kubernetes.operator.helpers.HealthCheckHelper\u0026#34;,\u0026#34;method\u0026#34;:\u0026#34;performSecurityChecks\u0026#34;,\u0026#34;timeInMillis\u0026#34;:1584168595356,\u0026#34;message\u0026#34;:\u0026#34;Verifying that operator service account can access required operations on required resources in namespace operator-ns\u0026#34;,\u0026#34;exception\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;code\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;headers\u0026#34;:{},\u0026#34;body\u0026#34;:\u0026#34;\u0026#34;}\t{\u0026#34;timestamp\u0026#34;:\u0026#34;03-14-2020T06:49:55.598+0000\u0026#34;,\u0026#34;thread\u0026#34;:18,\u0026#34;fiber\u0026#34;:\u0026#34;fiber-1-child-2\u0026#34;,\u0026#34;domainUID\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;level\u0026#34;:\u0026#34;INFO\u0026#34;,\u0026#34;class\u0026#34;:\u0026#34;oracle.kubernetes.operator.helpers.ConfigMapHelper$ScriptConfigMapContext$CreateResponseStep\u0026#34;,\u0026#34;method\u0026#34;:\u0026#34;onSuccess\u0026#34;,\u0026#34;timeInMillis\u0026#34;:1584168595598,\u0026#34;message\u0026#34;:\u0026#34;Creating domain config map, operator-ns, for namespace: {1}.\u0026#34;,\u0026#34;exception\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;code\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;headers\u0026#34;:{},\u0026#34;body\u0026#34;:\u0026#34;\u0026#34;}\t{\u0026#34;timestamp\u0026#34;:\u0026#34;03-14-2020T06:49:55.937+0000\u0026#34;,\u0026#34;thread\u0026#34;:21,\u0026#34;fiber\u0026#34;:\u0026#34;fiber-1\u0026#34;,\u0026#34;domainUID\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;level\u0026#34;:\u0026#34;WARNING\u0026#34;,\u0026#34;class\u0026#34;:\u0026#34;oracle.kubernetes.operator.utils.Certificates\u0026#34;,\u0026#34;method\u0026#34;:\u0026#34;getCertificate\u0026#34;,\u0026#34;timeInMillis\u0026#34;:1584168595937,\u0026#34;message\u0026#34;:\u0026#34;Can\u0026#39;t read certificate at /operator/external-identity/externalOperatorCert\u0026#34;,\u0026#34;exception\u0026#34;:\u0026#34;\\njava.nio.file.NoSuchFileException: /operator/external-identity/externalOperatorCert\\n\\tat java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)\\n\\tat java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)\\n\\tat java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)\\n\\tat java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:215)\\n\\tat java.base/java.nio.file.Files.newByteChannel(Files.java:370)\\n\\tat java.base/java.nio.file.Files.newByteChannel(Files.java:421)\\n\\tat java.base/java.nio.file.Files.readAllBytes(Files.java:3205)\\n\\tat oracle.kubernetes.operator.utils.Certificates.getCertificate(Certificates.java:48)\\n\\tat oracle.kubernetes.operator.utils.Certificates.getOperatorExternalCertificateData(Certificates.java:39)\\n\\tat oracle.kubernetes.operator.rest.RestConfigImpl.getOperatorExternalCertificateData(RestConfigImpl.java:52)\\n\\tat oracle.kubernetes.operator.rest.RestServer.isExternalSslConfigured(RestServer.java:383)\\n\\tat oracle.kubernetes.operator.rest.RestServer.start(RestServer.java:199)\\n\\tat oracle.kubernetes.operator.Main.startRestServer(Main.java:353)\\n\\tat oracle.kubernetes.operator.Main.completeBegin(Main.java:198)\\n\\tat oracle.kubernetes.operator.Main$NullCompletionCallback.onCompletion(Main.java:701)\\n\\tat oracle.kubernetes.operator.work.Fiber.completionCheck(Fiber.java:475)\\n\\tat oracle.kubernetes.operator.work.Fiber.run(Fiber.java:448)\\n\\tat oracle.kubernetes.operator.work.ThreadLocalContainerResolver.lambda$wrapExecutor$0(ThreadLocalContainerResolver.java:87)\\n\\tat java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)\\n\\tat java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)\\n\\tat java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)\\n\\tat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)\\n\\tat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)\\n\\tat java.base/java.lang.Thread.run(Thread.java:834)\\n\u0026#34;,\u0026#34;code\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;headers\u0026#34;:{},\u0026#34;body\u0026#34;:\u0026#34;\u0026#34;} {\u0026#34;timestamp\u0026#34;:\u0026#34;03-14-2020T06:49:55.967+0000\u0026#34;,\u0026#34;thread\u0026#34;:21,\u0026#34;fiber\u0026#34;:\u0026#34;fiber-1\u0026#34;,\u0026#34;domainUID\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;level\u0026#34;:\u0026#34;INFO\u0026#34;,\u0026#34;class\u0026#34;:\u0026#34;oracle.kubernetes.operator.rest.RestServer\u0026#34;,\u0026#34;method\u0026#34;:\u0026#34;start\u0026#34;,\u0026#34;timeInMillis\u0026#34;:1584168595967,\u0026#34;message\u0026#34;:\u0026#34;Did not start the external ssl REST server because external ssl has not been configured.\u0026#34;,\u0026#34;exception\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;code\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;headers\u0026#34;:{},\u0026#34;body\u0026#34;:\u0026#34;\u0026#34;} {\u0026#34;timestamp\u0026#34;:\u0026#34;03-14-2020T06:49:57.910+0000\u0026#34;,\u0026#34;thread\u0026#34;:21,\u0026#34;fiber\u0026#34;:\u0026#34;fiber-1\u0026#34;,\u0026#34;domainUID\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;level\u0026#34;:\u0026#34;INFO\u0026#34;,\u0026#34;class\u0026#34;:\u0026#34;oracle.kubernetes.operator.rest.RestServer\u0026#34;,\u0026#34;method\u0026#34;:\u0026#34;start\u0026#34;,\u0026#34;timeInMillis\u0026#34;:1584168597910,\u0026#34;message\u0026#34;:\u0026#34;Started the internal ssl REST server on https://0.0.0.0:8082/operator\u0026#34;,\u0026#34;exception\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;code\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;headers\u0026#34;:{},\u0026#34;body\u0026#34;:\u0026#34;\u0026#34;}\t{\u0026#34;timestamp\u0026#34;:\u0026#34;03-14-2020T06:49:57.913+0000\u0026#34;,\u0026#34;thread\u0026#34;:21,\u0026#34;fiber\u0026#34;:\u0026#34;fiber-1\u0026#34;,\u0026#34;domainUID\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;level\u0026#34;:\u0026#34;INFO\u0026#34;,\u0026#34;class\u0026#34;:\u0026#34;oracle.kubernetes.operator.Main\u0026#34;,\u0026#34;method\u0026#34;:\u0026#34;markReadyAndStartLivenessThread\u0026#34;,\u0026#34;timeInMillis\u0026#34;:1584168597913,\u0026#34;message\u0026#34;:\u0026#34;Starting Operator Liveness Thread\u0026#34;,\u0026#34;exception\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;code\u0026#34;:\u0026#34;\u0026#34;,\u0026#34;headers\u0026#34;:{},\u0026#34;body\u0026#34;:\u0026#34;\u0026#34;} Prepare the Environment for the WebCenter Portal Domain Create a namespace for an Oracle WebCenter Portal domain Unless you want to use the default namespace, create a Kubernetes namespace that can host one or more domains:\n$ kubectl create namespace wcpns namespace/wcpns created To manage domain in this namespace, configure the operator using helm:\n Helm upgrade weblogic-operator\n $ helm upgrade --reuse-values --set \u0026#34;domainNamespaces={wcpns}\u0026#34; \\ --wait weblogic-kubernetes-operator charts/weblogic-operator --namespace operator-ns NAME: weblogic-kubernetes-operator LAST DEPLOYED: Wed Jan 6 01:52:58 2021 NAMESPACE: operator-ns STATUS: deployed REVISION: 2 Create a Kubernetes secret with domain credentials Using the create-weblogic-credentials script, create a Kubernetes secret that contains the user name and password for the domain in the same Kubernetes namespace as the domain:\n$ cd ${WORKDIR}/create-weblogic-domain-credentials $ ./create-weblogic-credentials.sh -u weblogic -p welcome1 -n wcpns -d wcp-domain -s wcp-domain-domain-credentials secret/wcp-domain-domain-credentials created secret/wcp-domain-domain-credentials labeled The secret wcp-domain-domain-credentials has been successfully created in the wcpns namespace. Where: * weblogic is the weblogic username * welcome1 is the weblogic password * wcp-domain is the domain name * wcpns is the domain namespace * wcp-domain-domain-credentials is the secret name Note: You can inspect the credentials as follows: $ kubectl get secret wcp-domain-domain-credentials -o yaml -n wcpns Create a Kubernetes secret with the RCU credentials Create a Kubernetes secret for the Repository Configuration Utility (user name and password) using the create-rcu-credentials.sh script in the same Kubernetes namespace as the domain:\n$ cd ${WORKDIR}/create-rcu-credentials $ sh create-rcu-credentials.sh \\ -u WCP1 -p welcome1 -a sys -q Oradoc_db1 -n wcpns \\ -d wcp-domain -s wcp-domain-rcu-credentials secret/wcp-domain-rcu-credentials created secret/wcp-domain-rcu-credentials labeled The secret wcp-domain-rcu-credentials has been successfully created in the wcpns namespace. Where: * WCP1 is the schema user * welcome1 is the schema password * Oradoc_db1 is the database SYS users password * wcp-domain is the domain name * wcpns is the domain namespace * wcp-domain-rcu-credentials is the secret name Note: You can inspect the credentials as follows: $ kubectl get secret wcp-domain-rcu-credentials -o yaml -n wcpns Create a persistent storage for an Oracle WebCenter Portal domain Create a Kubernetes PV and PVC (Persistent Volume and Persistent Volume Claim):\nIn the Kubernetes namespace you created, create the PV and PVC for the domain by running the create-pv-pvc.sh script. Follow the instructions for using the script to create a dedicated PV and PVC for the Oracle WebCenter Portal domain.\n Review the configuration parameters for PV creation here. Based on your requirements, update the values in the create-pv-pvc-inputs.yaml file located at ${WORKDIR}/create-weblogic-domain-pv-pvc/. Sample configuration parameter values for an Oracle WebCenter Portal domain are:\n baseName: domain domainUID: wcp-domain namespace: wcpns weblogicDomainStorageType: HOST_PATH weblogicDomainStoragePath: /scratch/kubevolume Ensure that the path for the weblogicDomainStoragePath property exists (create one if it doesn\u0026rsquo;t exist), that it has full access permissions, and that the folder is empty.\n Run the create-pv-pvc.sh script:\n$ cd ${WORKDIR}/create-weblogic-domain-pv-pvc $ ./create-pv-pvc.sh -i create-pv-pvc-inputs.yaml -o output Input parameters being used export version=\u0026#34;create-weblogic-sample-domain-pv-pvc-inputs-v1\u0026#34; export baseName=\u0026#34;domain\u0026#34; export domainUID=\u0026#34;wcp-domain\u0026#34; export namespace=\u0026#34;wcpns\u0026#34; export weblogicDomainStorageType=\u0026#34;HOST_PATH\u0026#34; export weblogicDomainStoragePath=\u0026#34;/scratch/kubevolume\u0026#34; export weblogicDomainStorageReclaimPolicy=\u0026#34;Retain\u0026#34; export weblogicDomainStorageSize=\u0026#34;10Gi\u0026#34; Generating output/pv-pvcs/wcp-domain-domain-pv.yaml Generating output/pv-pvcs/wcp-domain-domain-pvc.yaml The following files were generated: output/pv-pvcs/wcp-domain-domain-pv.yaml output/pv-pvcs/wcp-domain-domain-pvc.yaml The create-pv-pvc.sh script creates a subdirectory pv-pvcs under the given /path/to/output-directory directory and creates two YAML configuration files for PV and PVC. Apply these two YAML files to create the PV and PVC Kubernetes resources using the kubectl create -f command:\n$ kubectl create -f output/pv-pvcs/wcp-domain-domain-pv.yaml $ kubectl create -f output/pv-pvcs/wcp-domain-domain-pvc.yaml Configure access to your database Oracle WebCenter Portal domain requires a database which is configured with the necessary schemas. The Repository Creation Utility (RCU) allows you to create those schemas. You must set up the database before you create your domain.\nFor production deployments, you must set up and use a standalone (non-container) database running outside of Kubernetes.\nBefore creating a domain, you need to set up the necessary schemas in your database.\nRun the Repository Creation Utility to set up your database schemas To create the database schemas for Oracle WebCenter Portal domain, run the create-rcu-schema.sh script.\n$ cd ${WORKDIR}/create-rcu-schema $ sh create-rcu-schema.sh -h usage: create-rcu-schema.sh -s \u0026lt;schemaPrefix\u0026gt; -t \u0026lt;schemaType\u0026gt; -d \u0026lt;dburl\u0026gt; -i \u0026lt;image\u0026gt; -u \u0026lt;imagePullPolicy\u0026gt; -p \u0026lt;docker-store\u0026gt; -n \u0026lt;namespace\u0026gt; -q \u0026lt;sysPassword\u0026gt; -r \u0026lt;schemaPassword\u0026gt; -o \u0026lt;rcuOutputDir\u0026gt; [-h] -s RCU Schema Prefix (required) -t RCU Schema Type (optional) (supported values: wcp(default), wcpp) -d RCU Oracle Database URL (optional) (default: oracle-db.default.svc.cluster.local:1521/devpdb.k8s) -p FMW Infrastructure ImagePullSecret (optional) (default: none) -i Oracle WebCenter Portal Image (optional) (default: oracle/wcportal:12.2.1.4) -u FMW Infrastructure 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 WCP1 \\ -t wcp \\ -d oracle-db.default.svc.cluster.local:1521/devpdb.k8s \\ -i oracle/wcportal:12.2.1.4\\ -n wcpns \\ -q Oradoc_db1 \\ -r welcome1 Where RCU Schema type wcp generates webcenter portal related schema and wcpp generates webcenter portal plus portlet schemas.\n " +}, +{ + "uri": "/fmw-kubernetes/22.2.3/wcportal-domains/manage-wcportal-domains/monitoring-and-publishing-logs/publishing-logs/weblogiclogging/", + "title": "WebLogic logging exporter", + "tags": [], + "description": "Use the WebLogic Logging Exporter to publish the WebLogic Server logs to Elasticsearch.", + "content": "The WebLogic Logging Exporter adds a log event handler to WebLogic Server which enables WebLogic Server to push the logs to Elasticsearch in Kubernetes by using the Elasticsearch REST API. For more details, see to the WebLogic Logging Exporter project.\nThis sample shows you how to publish WebLogic Server logs to Elasticsearch and view them in Kibana. For publishing operator logs, see this sample.\nPrerequisites This document assumes that you have already set up Elasticsearch and Kibana for logs collection. If you have not, please see this document.\n Download the WebLogic Logging Exporter binaries The pre-built binaries are available on the WebLogic Logging Exporter Releases page.\nDownload:\n weblogic-logging-exporter-1.0.0.jar from the release page snakeyaml-1.25.jar from Maven Central These identifiers are used in the sample commands.\n wcpns: WebCenter Portal domain namespace wcp-domain: domainUID wcp-domain-adminserver: Administration Server pod name Copy the JAR Files to the WebLogic Domain Home Copy the weblogic-logging-exporter-1.0.0.jar and snakeyaml-1.25.jar files to the domain home directory in the Administration Server pod.\n$ kubectl cp \u0026lt;file-to-copy\u0026gt; \u0026lt;namespace\u0026gt;/\u0026lt;Administration-Server-pod\u0026gt;:\u0026lt;domainhome\u0026gt; $ kubectl cp snakeyaml-1.25.jar wcpns/wcp-domain-adminserver:/u01/oracle/user_projects/domains/wcp-domain/ $ kubectl cp weblogic-logging-exporter-1.0.0.jar wcpns/wcp-domain-adminserver:/u01/oracle/user_projects/domains/wcp-domain/ Add a Startup Class to the Domain Configuration In the WebLogic Server Administration Console, in the left navigation pane, expand Environment, and then select Startup and Shutdown Classes.\n Add a new startup class. You may choose any descriptive name, however, the class name must be weblogic.logging.exporter.Startup.\n Target the startup class to each server from which you want to export logs.\n In your config.xml file located at, /u01/oracle/user_projects/domains/wcp-domain/config/config.xml the newly added startup-class must exist as shown below:\n$ kubectl exec -it wcp-domain-adminserver -n wcpns cat /u01/oracle/user_projects/domains/wcp-domain/config/config.xml \u0026lt;startup-class\u0026gt; \u0026lt;name\u0026gt;weblogic-logging-exporter\u0026lt;/name\u0026gt; \u0026lt;target\u0026gt;AdminServer,wcp_cluster\u0026lt;/target\u0026gt; \u0026lt;class-name\u0026gt;weblogic.logging.exporter.Startup\u0026lt;/class-name\u0026gt; \u0026lt;/startup-class\u0026gt; Update the WebLogic Server CLASSPATH Copy the setDomainEnv.sh file from the pod to a local folder: $ kubectl cp wcpns/wcp-domain-adminserver:/u01/oracle/user_projects/domains/wcp-domain/bin/setDomainEnv.sh $PWD/setDomainEnv.sh tar: Removing leading `/\u0026#39; from member names Ignore exception: tar: Removing leading '/' from member names\n Update the server class path in setDomainEnv.sh: CLASSPATH=/u01/oracle/user_projects/domains/wcp-domain/weblogic-logging-exporter-1.0.0.jar:/u01/oracle/user_projects/domains/wcp-domain/snakeyaml-1.25.jar:${CLASSPATH} export CLASSPATH Copy back the modified setDomainEnv.sh file to the pod: $ kubectl cp setDomainEnv.sh wcpns/wcp-domain-adminserver:/u01/oracle/user_projects/domains/wcp-domain/bin/setDomainEnv.sh Create a Configuration File for the WebLogic Logging Exporter Specify the Elasticsearch server host and port number in the file: \u0026lt;$WORKDIR\u0026gt;/logging-services/weblogic-logging-exporter/WebLogicLoggingExporter.yaml\nExample:\nweblogicLoggingIndexName: wls publishHost: elasticsearch.default.svc.cluster.local publishPort: 9300 domainUID: wcp-domain weblogicLoggingExporterEnabled: true weblogicLoggingExporterSeverity: TRACE weblogicLoggingExporterBulkSize: 1 Copy the WebLogicLoggingExporter.yaml file to the domain home directory in the WebLogic Administration Server pod:\n $ kubectl cp \u0026lt;$WORKDIR\u0026gt;/logging-services/weblogic-logging-exporter/WebLogicLoggingExporter.yaml wcpns/wcp-domain-adminserver:/u01/oracle/user_projects/domains/wcp-domain/config/ Restart the Servers in the Domain To restart the servers, stop and then start them using the following commands:\nTo stop the servers:\n$ kubectl patch domain wcp-domain -n wcpns --type=\u0026#39;json\u0026#39; -p=\u0026#39;[{\u0026#34;op\u0026#34;: \u0026#34;replace\u0026#34;, \u0026#34;path\u0026#34;: \u0026#34;/spec/serverStartPolicy\u0026#34;, \u0026#34;value\u0026#34;: \u0026#34;NEVER\u0026#34; }]\u0026#39; To start the servers:\n$ kubectl patch domain wcp-domain -n wcpns --type=\u0026#39;json\u0026#39; -p=\u0026#39;[{\u0026#34;op\u0026#34;: \u0026#34;replace\u0026#34;, \u0026#34;path\u0026#34;: \u0026#34;/spec/serverStartPolicy\u0026#34;, \u0026#34;value\u0026#34;: \u0026#34;IF_NEEDED\u0026#34; }]\u0026#39; After all the servers are restarted, see their server logs to check that the weblogic-logging-exporter class is called, as shown below:\n======================= WebLogic Logging Exporter Startup class called Reading configuration from file name: /u01/oracle/user_projects/domains/wcp-domain/config/WebLogicLoggingExporter.yaml Config{weblogicLoggingIndexName='wls', publishHost='domain.host.com', publishPort=9200, weblogicLoggingExporterSeverity='Notice', weblogicLoggingExporterBulkSize='2', enabled=true, weblogicLoggingExporterFilters=FilterConfig{expression='NOT(MSGID = 'BEA-000449')', servers=[]}], domainUID='wcp-domain'} Create an Index Pattern in Kibana Create an index pattern wls* in Kibana by navigating to the dashboard through the Management option. After the servers are started, the log data is displayed on the Kibana dashboard:\n" +}, +{ + "uri": "/fmw-kubernetes/22.2.3/wcportal-domains/appendix/docker-k8s-hardening/", + "title": "Security hardening", + "tags": [], + "description": "Review resources for the Docker and Kubernetes cluster hardening.", + "content": "Securing a Kubernetes cluster involves hardening on multiple fronts - securing the API servers, etcd, nodes, container images, container run-time, and the cluster network. Apply principles of defense in depth, principle of least privilege, and minimize the attack surface. Use security tools such as Kube-Bench to verify the cluster\u0026rsquo;s security posture. Since Kubernetes is evolving rapidly refer to Kubernetes Security Overview for the latest information on securing a Kubernetes cluster. Also ensure the deployed Docker containers follow the Docker Security guidance.\nThis section provides references on how to securely configure Docker and Kubernetes.\nReferences Docker hardening\n https://docs.docker.com/engine/security/security/ https://blog.aquasec.com/docker-security-best-practices Kubernetes hardening\n https://kubernetes.io/docs/concepts/security/overview/ https://kubernetes.io/docs/concepts/security/pod-security-standards/ https://blogs.oracle.com/developers/5-best-practices-for-kubernetes-security Security best practices for Oracle WebLogic Server Running in Docker and Kubernetes\n https://blogs.oracle.com/weblogicserver/security-best-practices-for-weblogic-server-running-in-docker-and-kubernetes " +}, +{ + "uri": "/fmw-kubernetes/22.2.3/wcportal-domains/installguide/create-wcp-domain/", + "title": "Create WebCenter Portal domain", + "tags": [], + "description": "Create an Oracle WebCenter Portal domain home on an existing PV or PVC, and create the domain resource YAML file for deploying the generated Oracle WebCenter Portal domain.", + "content": "Contents Introduction Prerequisites Prepare the WebCenter Portal Domain Creation Input File Create the WebCenter Portal Domain Initialize the WebCenter Portal Domain Verify the WebCenter Portal Domain Managing WebCenter Portal Introduction You can use the sample scripts to create a WebCenter Portal domain home on an existing Kubernetes persistent volume (PV) and persistent volume claim (PVC).The scripts also generate the domain YAML file, which helps you start the Kubernetes artifacts of the corresponding domain.\nPrerequisites Ensure that you have completed all of the steps under prepare-your-environment. Ensure that the database and the WebLogic Kubernetes operator is up. Prepare the WebCenter Portal Domain Creation Input File If required, you can customize the parameters used for creating a domain in the create-domain-inputs.yaml file.\nPlease note that the sample scripts for the WebCenter Portal domain deployment are available from the previously downloaded repository at ${WORKDIR}/create-wcp-domain/domain-home-on-pv/.\nMake a copy of the create-domain-inputs.yaml file before updating the default values.\nThe default domain created by the script has the following characteristics:\n An Administration Server named AdminServer listening on port 7001. A configured cluster named wcp-cluster of size 5. Managed Server, named wcpserver, listening on port 8888. If configurePortletServer is set to true . It configures a cluster named wcportlet-cluster of size 5 and Managed Server, named wcportletserver, listening on port 8889. Log files that are located in /shared/logs/\u0026lt;domainUID\u0026gt;. Configuration parameters The following parameters can be provided in the inputs file:\n Parameter Definition Default adminPort Port number for the Administration Server inside the Kubernetes cluster. 7001 sslEnabled SSL mode enabling flag false configurePortletServer Configure portlet server cluster false adminServerSSLPort SSL Port number for the Administration Server inside the Kubernetes cluster. 7002 adminServerName Name of the Administration Server. AdminServer clusterName Name of the WebLogic cluster instance to generate for the domain. By default the cluster name is wcp-cluster for the WebCenter Portal domain. wcp-cluster portletClusterName Name of the Portlet cluster instance to generate for the domain. By default the cluster name is wcportlet-cluster for the Portlet. wcportlet-cluster configuredManagedServerCount Number of Managed Server instances for the domain. 5 createDomainFilesDir Directory on the host machine to locate all the files that you need to create a WebLogic domain, including the script that is specified in the createDomainScriptName property. By default, this directory is set to the relative path wlst, and the create script uses the built-in WLST offline scripts in the wlst directory to create the WebLogic domain. An absolute path is also supported to point to an arbitrary directory in the file system. The built-in scripts can be replaced by the user-provided scripts or model files as long as those files are in the specified directory. Files in this directory are put into a Kubernetes config map, which in turn is mounted to createDomainScriptsMountPath, so that the Kubernetes pod can use the scripts and supporting files to create a domain home. wlst createDomainScriptsMountPath Mount path where the create domain scripts are located inside a pod. The create-domain.sh script creates a Kubernetes job to run the script (specified in the createDomainScriptName property) in a Kubernetes pod that creates a domain home. Files in the createDomainFilesDir directory are mounted to this location in the pod, so that the Kubernetes pod can use the scripts and supporting files to create a domain home. /u01/weblogic createDomainScriptName Script that the create domain script uses to create a WebLogic domain. The create-domain.sh script creates a Kubernetes job to run this script that creates a domain home. The script is located in the in-pod directory that is specified in the createDomainScriptsMountPath property. If you need to provide your own scripts to create the domain home, instead of using the built-in scripts, you must use this property to set the name of the script to that which you want the create domain job to run. create-domain-job.sh domainHome Home directory of the WebCenter Portal domain. This field cannot be modified. /u01/oracle/user_projects/domains/wcp-domain domainPVMountPath Mount path of the domain persistent volume. This field cannot be modified. /u01/oracle/user_projects/domains domainUID Unique ID that identifies this particular domain. Used as the name of the generated WebLogic domain as well as the name of the Kubernetes domain resource. This ID must be unique across all domains in a Kubernetes cluster. This ID cannot contain any character that is not valid in a Kubernetes service name. wcp-domain exposeAdminNodePort Boolean indicating if the Administration Server is exposed outside of the Kubernetes cluster. false exposeAdminT3Channel Boolean indicating if the T3 administrative channel is exposed outside the Kubernetes cluster. false image WebCenter Portal Docker image. The WebLogic Kubernetes Operator requires WebCenter Portal release 12.2.1.4. Refer to WebCenter Portal Docker Image for details on how to obtain or create the image. oracle/wcportal:12.2.1.4 imagePullPolicy WebLogic Docker image pull policy. Legal values are IfNotPresent, Always, or Never IfNotPresent imagePullSecretName Name of the Kubernetes secret to access the Docker Store to pull the WebLogic Server Docker image. The presence of the secret is validated when this parameter is specified. includeServerOutInPodLog Boolean indicating whether to include server.out to the pod\u0026rsquo;s stdout. true initialManagedServerReplicas Number of Managed Server to initially start for the domain. 2 javaOptions Java options for starting the Administration Server and Managed Servers. A Java option can include references to one or more of the following pre-defined variables to obtain WebLogic domain information: $(DOMAIN_NAME), $(DOMAIN_HOME), $(ADMIN_NAME), $(ADMIN_PORT), and $(SERVER_NAME). -Dweblogic.StdoutDebugEnabled=false logHome The in-pod location for the domain log, server logs, server out, and Node Manager log files. This field cannot be modified. /u01/oracle/user_projects/logs/wcp-domain managedServerNameBase Base string used to generate Managed Server names. wcpserver portletServerNameBase Base string used to generate Portlet Server names. wcportletserver managedServerPort Port number for each Managed Server. By default the managedServerPort is 8888 for the wcpserver and managedServerPort is 8889 for the wcportletserver. 8888 managedServerSSLPort SSL port number for each Managed Server. By default the managedServerPort is 8788 for the wcpserver and managedServerPort is 8789 for the wcportletserver. 8788 portletServerPort Port number for each Portlet Server. By default the portletServerPort is 8889 for the wcportletserver. 8888 portletServerSSLPort SSL port number for each Portlet Server. By default the portletServerSSLPort is 8789 for the wcportletserver. 8789 namespace Kubernetes namespace in which to create the domain. wcpns persistentVolumeClaimName Name of the persistent volume claim created to host the domain home. If not specified, the value is derived from the domainUID as \u0026lt;domainUID\u0026gt;-weblogic-sample-pvc. wcp-domain-domain-pvc productionModeEnabled Boolean indicating if production mode is enabled for the domain. true serverStartPolicy Determines which WebLogic Server instances are to be started. Legal values are NEVER, IF_NEEDED, ADMIN_ONLY. IF_NEEDED t3ChannelPort Port for the T3 channel of the NetworkAccessPoint. 30012 t3PublicAddress Public address for the T3 channel. This should be set to the public address of the Kubernetes cluster. This would typically be a load balancer address. For development environments only: In a single server (all-in-one) Kubernetes deployment, this may be set to the address of the master, or at the very least, it must be set to the address of one of the worker nodes. If not provided, the script will attempt to set it to the IP address of the Kubernetes cluster. weblogicCredentialsSecretName Name of the Kubernetes secret for the Administration Server\u0026rsquo;s user name and password. If not specified, then the value is derived from the domainUID as \u0026lt;domainUID\u0026gt;-weblogic-credentials. wcp-domain-domain-credentials weblogicImagePullSecretName Name of the Kubernetes secret for the Docker Store, used to pull the WebLogic Server image. serverPodCpuRequest, serverPodMemoryRequest, serverPodCpuCLimit, serverPodMemoryLimit The maximum amount of compute resources allowed and minimum amount of compute resources required for each server pod. Please refer to the Kubernetes documentation on Managing Compute Resources for Containers for details. Resource requests and resource limits are not specified. Refer to WebCenter Portal Cluster Sizing Recommendations for more details. rcuSchemaPrefix The schema prefix to use in the database, for example WCP1. You may wish to make this the same as the domainUID in order to simplify matching domain to their RCU schemas. WCP1 rcuDatabaseURL The database URL. dbhostname:dbport/servicename rcuCredentialsSecret The Kubernetes secret containing the database credentials. wcp-domain-rcu-credentials loadBalancerHostName Host name for the final url accessible outside K8S environment. abc.def.com loadBalancerPortNumber Port for the final url accessible outside K8S environment. 30305 loadBalancerProtocol Protocol for the final url accessible outside K8S environment. http loadBalancerType Loadbalancer name. Example: Traefik or \u0026quot;\u0026rdquo; traefik unicastPort Starting range of unicast port that application will use. 50000 You can form the names of the Kubernetes resources in the generated YAML files with the value of these properties specified in the create-domain-inputs.yaml file: adminServerName, clusterName and managedServerNameBase. Characters that are invalid in a Kubernetes service name are converted to valid values in the generated YAML files. For example, an uppercase letter is converted to a lowercase letter and an underscore (\u0026quot;_\u0026quot;) is converted to a hyphen (\u0026quot;-\u0026quot;) .\nThe sample demonstrates how to create a WebCenter Portal domain home and associated Kubernetes resources for a domain that has one cluster only. In addition, the sample provides users with the capability to supply their own scripts to create the domain home for other use cases. You can modify the generated domain YAML file to include more use cases.\nCreate the WebCenter Portal Domain The syntax of the create-domain.sh script is as follows:\n $ ./create-domain.sh \\ -i create-domain-inputs.yaml \\ -o /\u0026lt;path to output-directory\u0026gt; The script performs the following functions:\n Creates a directory for the generated Kubernetes YAML files for this domain if it does not already exist. The path name is /\u0026lt;path to output-directory\u0026gt;/weblogic-domains/\u0026lt;domainUID\u0026gt;.If the directory already exists, remove its content before using this script. Creates a Kubernetes job to start the WebCenter Portal Container utility and run offline WLST scripts that create the domain on the shared storage. Runs and waits for the job to finish. Creates a Kubernetes domain YAML file, domain.yaml, in the directory that is created above. This YAML file can be used to create the Kubernetes resource using the kubectl create -f or kubectl apply -f command: $ kubectl apply -f ../\u0026lt;path to output-directory\u0026gt;/weblogic-domains/\u0026lt;domainUID\u0026gt;/domain.yaml Creates a convenient utility script, delete-domain-job.yaml, to clean up the domain home created by the create script. Run the create-domain.sh sample script, pointing it at the create-domain-inputs.yaml inputs file and an output directory like below:\n$ cd ${WORKDIR}/create-wcp-domain/ $ sh create-domain.sh -i create-domain-inputs.yaml -o output Input parameters being used export version=\u0026#34;create-weblogic-sample-domain-inputs-v1\u0026#34; export sslEnabled=\u0026#34;false\u0026#34; export adminPort=\u0026#34;7001\u0026#34; export adminServerSSLPort=\u0026#34;7002\u0026#34; export adminServerName=\u0026#34;AdminServer\u0026#34; export domainUID=\u0026#34;wcp-domain\u0026#34; export domainHome=\u0026#34;/u01/oracle/user_projects/domains/$domainUID\u0026#34; export serverStartPolicy=\u0026#34;IF_NEEDED\u0026#34; export clusterName=\u0026#34;wcp-cluster\u0026#34; export configuredManagedServerCount=\u0026#34;5\u0026#34; export initialManagedServerReplicas=\u0026#34;2\u0026#34; export managedServerNameBase=\u0026#34;wcpserver\u0026#34; export managedServerPort=\u0026#34;8888\u0026#34; export managedServerSSLPort=\u0026#34;8788\u0026#34; export portletServerPort=\u0026#34;8889\u0026#34; export portletServerSSLPort=\u0026#34;8789\u0026#34; export image=\u0026#34;oracle/wcportal:12.2.1.4\u0026#34; export imagePullPolicy=\u0026#34;IfNotPresent\u0026#34; export productionModeEnabled=\u0026#34;true\u0026#34; export weblogicCredentialsSecretName=\u0026#34;wcp-domain-domain-credentials\u0026#34; export includeServerOutInPodLog=\u0026#34;true\u0026#34; export logHome=\u0026#34;/u01/oracle/user_projects/domains/logs/$domainUID\u0026#34; export httpAccessLogInLogHome=\u0026#34;true\u0026#34; export t3ChannelPort=\u0026#34;30012\u0026#34; export exposeAdminT3Channel=\u0026#34;false\u0026#34; export adminNodePort=\u0026#34;30701\u0026#34; export exposeAdminNodePort=\u0026#34;false\u0026#34; export namespace=\u0026#34;wcpns\u0026#34; javaOptions=-Dweblogic.StdoutDebugEnabled=false export persistentVolumeClaimName=\u0026#34;wcp-domain-domain-pvc\u0026#34; export domainPVMountPath=\u0026#34;/u01/oracle/user_projects/domains\u0026#34; export createDomainScriptsMountPath=\u0026#34;/u01/weblogic\u0026#34; export createDomainScriptName=\u0026#34;create-domain-job.sh\u0026#34; export createDomainFilesDir=\u0026#34;wlst\u0026#34; export rcuSchemaPrefix=\u0026#34;WCP1\u0026#34; export rcuDatabaseURL=\u0026#34;oracle-db.wcpns.svc.cluster.local:1521/devpdb.k8s\u0026#34; export rcuCredentialsSecret=\u0026#34;wcp-domain-rcu-credentials\u0026#34; export loadBalancerHostName=\u0026#34;abc.def.com\u0026#34; export loadBalancerPortNumber=\u0026#34;30305\u0026#34; export loadBalancerProtocol=\u0026#34;http\u0026#34; export loadBalancerType=\u0026#34;traefik\u0026#34; export unicastPort=\u0026#34;50000\u0026#34; Generating output/weblogic-domains/wcp-domain/create-domain-job.yaml Generating output/weblogic-domains/wcp-domain/delete-domain-job.yaml Generating output/weblogic-domains/wcp-domain/domain.yaml Checking to see if the secret wcp-domain-domain-credentials exists in namespace wcpns configmap/wcp-domain-create-wcp-infra-sample-domain-job-cm created Checking the configmap wcp-domain-create-wcp-infra-sample-domain-job-cm was created configmap/wcp-domain-create-wcp-infra-sample-domain-job-cm labeled Checking if object type job with name wcp-domain-create-wcp-infra-sample-domain-job exists Deleting wcp-domain-create-wcp-infra-sample-domain-job using output/weblogic-domains/wcp-domain/create-domain-job.yaml job.batch \u0026#34;wcp-domain-create-wcp-infra-sample-domain-job\u0026#34; deleted $loadBalancerType is NOT empty Creating the domain by creating the job output/weblogic-domains/wcp-domain/create-domain-job.yaml job.batch/wcp-domain-create-wcp-infra-sample-domain-job created Waiting for the job to complete... status on iteration 1 of 20 pod wcp-domain-create-wcp-infra-sample-domain-job-b5l6c status is Running status on iteration 2 of 20 pod wcp-domain-create-wcp-infra-sample-domain-job-b5l6c status is Running status on iteration 3 of 20 pod wcp-domain-create-wcp-infra-sample-domain-job-b5l6c status is Running status on iteration 4 of 20 pod wcp-domain-create-wcp-infra-sample-domain-job-b5l6c status is Running status on iteration 5 of 20 pod wcp-domain-create-wcp-infra-sample-domain-job-b5l6c status is Running status on iteration 6 of 20 pod wcp-domain-create-wcp-infra-sample-domain-job-b5l6c status is Running status on iteration 7 of 20 pod wcp-domain-create-wcp-infra-sample-domain-job-b5l6c status is Completed Domain wcp-domain was created and will be started by the WebLogic Kubernetes Operator The following files were generated: output/weblogic-domains/wcp-domain/create-domain-inputs.yaml output/weblogic-domains/wcp-domain/create-domain-job.yaml output/weblogic-domains/wcp-domain/domain.yaml Completed To monitor the above domain creation logs:\n$ kubectl get pods -n wcpns |grep wcp-domain-create wcp-domain-create-fmw-infra-sample-domain-job-8jr6k 1/1 Running 0 6s $ kubectl get pods -n wcpns | grep wcp-domain-create | awk \u0026#39;{print $1}\u0026#39; | xargs kubectl -n wcpns logs -f SAMPLE OUTPUT:\nThe domain will be created using the script /u01/weblogic/create-domain-script.sh Initializing WebLogic Scripting Tool (WLST) ... Welcome to WebLogic Server Administration Scripting Shell Type help() for help on available commands ================================================================= WebCenter Portal Weblogic Operator Domain Creation Script 12.2.1.4.0 ================================================================= Creating Base Domain... Creating Admin Server... Creating cluster... managed server name is wcpserver1 managed server name is wcpserver2 managed server name is wcpserver3 managed server name is wcpserver4 managed server name is wcpserver5 ['wcpserver1', 'wcpserver2', 'wcpserver3', 'wcpserver4', 'wcpserver5'] Creating porlet cluster... managed server name is wcportletserver1 managed server name is wcportletserver2 managed server name is wcportletserver3 ['wcportletserver1', 'wcportletserver2', 'wcportletserver3', 'wcportletserver4', 'wcportletserver5'] Managed servers created... Creating Node Manager... Will create Base domain at /u01/oracle/user_projects/domains/wcp-domain Writing base domain... Base domain created at /u01/oracle/user_projects/domains/wcp-domain Extending Domain... Extending domain at /u01/oracle/user_projects/domains/wcp-domain Database oracle-db.wcpns.svc.cluster.local:1521/devpdb.k8s ExposeAdminT3Channel false with 100.111.157.155:30012 Applying JRF templates... Applying WCPortal templates... Extension Templates added... WC_Portal Managed server deleted... Configuring the Service Table DataSource... fmwDatabase jdbc:oracle:thin:@oracle-db.wcpns.svc.cluster.local:1521/devpdb.k8s Getting Database Defaults... Targeting Server Groups... Set CoherenceClusterSystemResource to defaultCoherenceCluster for server:wcpserver1 Set CoherenceClusterSystemResource to defaultCoherenceCluster for server:wcpserver2 Set CoherenceClusterSystemResource to defaultCoherenceCluster for server:wcpserver3 Set CoherenceClusterSystemResource to defaultCoherenceCluster for server:wcpserver4 Set CoherenceClusterSystemResource to defaultCoherenceCluster for server:wcpserver5 Set CoherenceClusterSystemResource to defaultCoherenceCluster for server:wcportletserver1 Set CoherenceClusterSystemResource to defaultCoherenceCluster for server:wcportletserver2 Set CoherenceClusterSystemResource to defaultCoherenceCluster for server:wcportletserver3 Targeting Cluster ... Set CoherenceClusterSystemResource to defaultCoherenceCluster for cluster:wcp-cluster Set WLS clusters as target of defaultCoherenceCluster:wcp-cluster Set CoherenceClusterSystemResource to defaultCoherenceCluster for cluster:wcportlet-cluster Set WLS clusters as target of defaultCoherenceCluster:wcportlet-cluster Preparing to update domain... Jan 12, 2021 10:30:09 AM oracle.security.jps.az.internal.runtime.policy.AbstractPolicyImpl initializeReadStore INFO: Property for read store in parallel: oracle.security.jps.az.runtime.readstore.threads = null Domain updated successfully Domain Creation is done... Successfully Completed Initialize the WebCenter Portal Domain To start the domain, apply the above domain.yaml:\n$ kubectl apply -f output/weblogic-domains/wcp-domain/domain.yaml domain.weblogic.oracle/wcp-domain created Verify the WebCenter Portal Domain Verify that the domain and servers pods and services are created and in the READY state:\nSample run below:\n-bash-4.2$ kubectl get pods -n wcpns -w NAME READY STATUS RESTARTS\tAGE wcp-domain-create-fmw-infra-sample-domain-job-8jr6k 0/1 Completed 0 15m wcp-domain-adminserver 1/1 Running 0 8m9s wcp-domain-create-fmw-infra-sample-domain-job-8jr6k 0/1 Completed 0 3h6m wcp-domain-wcp-server1 0/1 Running 0 6m5s wcp-domain-wcp-server2 0/1 Running 0 6m4s wcp-domain-wcp-server2 1/1 Running 0 6m18s wcp-domain-wcp-server1 1/1 Running 0 6m54s -bash-4.2$ kubectl get all -n wcpns NAME READY STATUS RESTARTS AGE pod/wcp-domain-adminserver 1/1 Running 0 13m pod/wcp-domain-create-fmw-infra-sample-domain-job-8jr6k 0/1 Completed 0 3h12m pod/wcp-domain-wcp-server1 1/1 Running 0 11m pod/wcp-domain-wcp-server2 1/1 Running 0 11m pod/wcp-domain-wcportletserver1 1/1 Running 1 21h NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE service/wcp-domain-adminserver ClusterIP None \u0026lt;none\u0026gt; 7001/TCP 13m service/wcp-domain-cluster-wcp-cluster ClusterIP 10.98.145.173 \u0026lt;none\u0026gt; 8888/TCP 11m service/wcp-domain-wcp-server1 ClusterIP None \u0026lt;none\u0026gt; 8888/TCP 11m service/wcp-domain-wcp-server2 ClusterIP None \u0026lt;none\u0026gt; 8888/TCP 11m service/wcp-domain-cluster-wcportlet-cluster ClusterIP 10.98.145.173 \u0026lt;none\u0026gt; 8889/TCP 11m service/wcp-domain-wcportletserver1 ClusterIP None \u0026lt;none\u0026gt; 8889/TCP 11m NAME COMPLETIONS DURATION AGE job.batch/wcp-domain-create-fmw-infra-sample-domain-job 1/1 16m 3h12m To see the Admin and Managed Servers logs, you can check the pod logs:\n$ kubectl logs -f wcp-domain-adminserver -n wcpns $ kubectl logs -f wcp-domain-wcp-server1 -n wcpns Verify the Pods Use the following command to see the pods running the servers:\n$ kubectl get pods -n NAMESPACE Here is an example of the output of this command:\n-bash-4.2$ kubectl get pods -n wcpns NAME READY STATUS RESTARTS AGE rcu 1/1 Running 1 14d wcp-domain-adminserver 1/1 Running 0 16m wcp-domain-create-fmw-infra-sample-domain-job-8jr6k 0/1 Completed 0 3h14m wcp-domain-wcp-server1 1/1 Running 0 14m wcp-domain-wcp-server2 1/1 Running 0 14m wcp-domain-wcportletserver1 1/1 Running 1 14m Verify the Services Use the following command to see the services for the domain:\n$ kubectl get services -n NAMESPACE Here is an example of the output of this command:\n-bash-4.2$ kubectl get services -n wcpns NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE wcp-domain-adminserver ClusterIP None \u0026lt;none\u0026gt; 7001/TCP 17m wcp-domain-cluster-wcp-cluster ClusterIP 10.98.145.173 \u0026lt;none\u0026gt; 8888/TCP 14m wcp-domain-wcp-server1 ClusterIP None \u0026lt;none\u0026gt; 8888/TCP 14m wcp-domain-wcp-server2 ClusterIP None \u0026lt;none\u0026gt; 8888/TCP 14m wcp-domain-cluster-wcportlet-cluster ClusterIP 10.98.145.173 \u0026lt;none\u0026gt; 8889/TCP 14m wcp-domain-wcportletserver1 ClusterIP None \u0026lt;none\u0026gt; 8889/TCP 14m Managing WebCenter Portal To stop Managed Servers:\n$ kubectl patch domain wcp-domain -n wcpns --type=\u0026#39;json\u0026#39; -p=\u0026#39;[{\u0026#34;op\u0026#34;: \u0026#34;replace\u0026#34;, \u0026#34;path\u0026#34;: \u0026#34;/spec/clusters/0/replicas\u0026#34;, \u0026#34;value\u0026#34;: 0 }]\u0026#39; To start all configured Managed Servers:\n$ kubectl patch domain wcp-domain -n wcpns --type=\u0026#39;json\u0026#39; -p=\u0026#39;[{\u0026#34;op\u0026#34;: \u0026#34;replace\u0026#34;, \u0026#34;path\u0026#34;: \u0026#34;/spec/clusters/0/replicas\u0026#34;, \u0026#34;value\u0026#34;: 3 }]\u0026#39; -bash-4.2$ kubectl get pods -n wcpns -w NAME READY STATUS RESTARTS\tAGE wcp-domain-create-fmw-infra-sample-domain-job-8jr6k 0/1 Completed 0 15m wcp-domain-adminserver 1/1 Running 0 8m9s wcp-domain-create-fmw-infra-sample-domain-job-8jr6k 0/1 Completed 0 3h6m wcp-domain-wcp-server1 0/1 Running 0 6m5s wcp-domain-wcp-server2 0/1 Running 0 6m4s wcp-domain-wcp-server2 1/1 Running 0 6m18s wcp-domain-wcp-server1 1/1 Running 0 6m54s " +}, +{ + "uri": "/fmw-kubernetes/22.2.3/wcportal-domains/manage-wcportal-domains/monitoring-and-publishing-logs/publishing-logs/logstash/", + "title": "Logstash", + "tags": [], + "description": "Describes how to configure a WebCenter Portal domain to use logstash and publish the WebLogic Server logs to Elasticsearch.", + "content": "Install Elasticsearch and Kibana To install Elasticsearch and Kibana, run the following command:\n$ cd ${WORKDIR}/elasticsearch-and-kibana $ kubectl create -f elasticsearch_and_kibana.yaml Publish to Elasticsearch The diagnostics or other logs can be pushed to Elasticsearch server using logstash pod. The logstash pod should have access to the shared domain home or the log location. In case of the Oracle WebCenter Portal domain, the persistent volume of the domain home can be used in the logstash pod. The steps to create the logstash pod are,\n Get domain home persistence volume claim details of the Oracle WebCenter Portal domain. The following command will list the persistent volume claim details in the namespace - wcpns. In the example below the persistent volume claim is wcp-domain-domain-pvc.\n$ kubectl get pv -n wcpns NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE wcp-domain-domain-pv 10Gi RWX Retain Bound wcpns/wcp-domain-domain-pvc wcp-domain-domain-storage-class 175d Create logstash configuration file logstash.conf. Below is a sample Logstash configuration file is located at ${WORKDIR}/logging-services/logstash. Below configuration pushes diagnostic and all domains logs.\ninput { file { path =\u0026gt; \u0026#34;/u01/oracle/user_projects/domains/wcp-domain/servers/**/logs/*-diagnostic.log\u0026#34; start_position =\u0026gt; beginning } file { path =\u0026gt; \u0026#34;/u01/oracle/user_projects/domains/logs/wcp-domain/*.log\u0026#34; start_position =\u0026gt; beginning } } filter { grok { match =\u0026gt; [ \u0026#34;message\u0026#34;, \u0026#34;\u0026lt;%{DATA:log_timestamp}\u0026gt; \u0026lt;%{WORD:log_level}\u0026gt; \u0026lt;%{WORD:thread}\u0026gt; \u0026lt;%{HOSTNAME:hostname}\u0026gt; \u0026lt;%{HOSTNAME:servername}\u0026gt; \u0026lt;%{DATA:timer}\u0026gt; \u0026lt;\u0026lt;%{DATA:kernel}\u0026gt;\u0026gt; \u0026lt;\u0026gt; \u0026lt;%{DATA:uuid}\u0026gt; \u0026lt;%{NUMBER:timestamp}\u0026gt; \u0026lt;%{DATA:misc}\u0026gt; \u0026lt;%{DATA:log_number}\u0026gt; \u0026lt;%{DATA:log_message}\u0026gt;\u0026#34; ] } } output { elasticsearch { hosts =\u0026gt; [\u0026#34;elasticsearch.default.svc.cluster.local:9200\u0026#34;] } } Copy the logstash.conf into say /u01/oracle/user_projects/domains so that it can be used for logstash deployment, using Administration Server pod ( For example wcp-domain-adminserver pod in namespace wcpns):\n$ kubectl cp ${WORKDIR}/logging-services/logstash/logstash.conf wcpns/wcp-domain-adminserver:/u01/oracle/user_projects/domains -n wcpns Create deployment YAML logstash.yaml for logstash pod using the domain home persistence volume claim. Make sure to point the logstash configuration file to correct location ( For example: we copied logstash.conf to /u01/oracle/user_projects/domains/logstash.conf) and also correct domain home persistence volume claim. Sample Logstash deployment is located at kubernetes/samples/scripts/create-wcp-domain/utils/logstash/logstash.yaml:\napiVersion: apps/v1\rkind: Deployment\rmetadata:\rname: logstash\rnamespace: wcpns\rspec:\rselector:\rmatchLabels:\rapp: logstash\rtemplate: metadata:\rlabels:\rapp: logstash\rspec:\rvolumes:\r- name: domain-storage-volume\rpersistentVolumeClaim:\rclaimName: wcp-domain-domain-pvc\r- name: shared-logs\remptyDir: {}\rcontainers:\r- name: logstash\rimage: logstash:6.6.0\rcommand: [\u0026quot;/bin/sh\u0026quot;]\rargs: [\u0026quot;/usr/share/logstash/bin/logstash\u0026quot;, \u0026quot;-f\u0026quot;, \u0026quot;/u01/oracle/user_projects/domains/logstash.conf\u0026quot;]\rimagePullPolicy: IfNotPresent\rvolumeMounts:\r- mountPath: /u01/oracle/user_projects/domains\rname: domain-storage-volume\r- name: shared-logs\rmountPath: /shared-logs\rports:\r- containerPort: 5044\rname: logstash\r Deploy logstash to start publish logs to Elasticsearch\n$ kubectl create -f ${WORKDIR}/logging-services/logstash/logstash.yaml Create an Index Pattern in Kibana Create an index pattern logstash* in Kibana \u0026gt; Management. After the servers are started, you will see the log data in the Kibana dashboard:\n" +}, +{ + "uri": "/fmw-kubernetes/22.2.3/wcportal-domains/manage-wcportal-domains/", + "title": "Administration Guide", + "tags": [], + "description": "Describes how to use some common utility tools and configurations to administer WebCenter Portal domain.", + "content": "Administer Oracle WebCenter Portal domain in Kubernetes.\n Set up a load balancer Configure different load balancers for the Oracle WebCenter Portal domain.\n Monitor a domain and publish logs Monitor Oracle WebCenter Portal and publishing logs to Elasticsearch.\n " +}, +{ + "uri": "/fmw-kubernetes/22.2.3/wcportal-domains/create-or-update-image/", + "title": "Create or update an image", + "tags": [], + "description": "Create or update an Oracle WebCenter Portal Docker image used for deploying Oracle WebCenter Portal domains. An Oracle WebCenter Portal Docker image can be created using the WebLogic Image Tool or using the Dockerfile approach.", + "content": "You can build an Oracle WebCenter Portal image for production deployments with patches (bundle or interim) using the WebLogic Image Tool, you must have access to the My Oracle Support (MOS) to download (bundle or interim) patches.\n Create or update an Oracle WebCenter Portal Docker image using the WebLogic Image Tool Set up the WebLogic Image Tool Create an image Update an image Create an Oracle WebCenter Portal Docker image using Dockerfile Create or update an Oracle WebCenter Portal Docker image using the WebLogic Image Tool Using the WebLogic Image Tool, you can create a new Oracle WebCenter Portal Docker image (can include patches as well) or update an existing image with one or more patches (bundle patch and interim patches).\n Recommendations:\n Use create for creating a new Oracle WebCenter Portal Docker image: without any patches or, containing the Oracle WebCenter Portal binaries, bundle , and interim patches. This is the recommended approach if you have access to the Oracle WebCenter Portal patches because it optimizes the size of the image. Use update for patching an existing Oracle WebCenter Portal Docker image with a single interim patch. Note that the patched image size may increase considerably due to additional image layers introduced by the patch application tool. Prerequisites Set up the WebLogic Image Tool Validate the setup WebLogic Image Tool build directory WebLogic Image Tool cache Set up additional build scripts Prerequisites Verify that your environment meets the following prerequisites:\n Docker client and daemon on the build machine, with minimum Docker version 18.03.1.ce. Bash version 4.0 or later, to enable the command complete feature. JAVA_HOME environment variable set to the appropriate JDK location. Set up the WebLogic Image Tool To set up the WebLogic Image Tool:\n Create a working directory and change to it. In these steps, this directory is imagetool-setup.\n$ mkdir imagetool-setup $ cd imagetool-setup Download the latest version of the WebLogic Image Tool from the releases page.\n Unzip the release ZIP file to the imagetool-setup directory.\n Execute the following commands to set up the WebLogic Image Tool on a Linux environment:\n$ cd imagetool-setup/imagetool/bin $ source setup.sh Validate the setup To validate the setup of the WebLogic Image Tool:\n Enter the following command to retrieve the version of the WebLogic Image Tool:\n$ imagetool --version Enter imagetool then press the Tab key to display the available imagetool commands:\n$ imagetool \u0026lt;TAB\u0026gt; cache create help rebase update WebLogic Image Tool build directory The WebLogic Image Tool creates a temporary Docker context directory, prefixed by wlsimgbuilder_temp, every time the tool runs. Under normal circumstances, this context directory is deleted. However, if the process is aborted or the tool is unable to remove the directory, it is safe for you to delete it manually. By default, the WebLogic Image Tool creates the Docker context directory under the user\u0026rsquo;s home directory. If you prefer to use a different directory for the temporary context, set the environment variable WLSIMG_BLDDIR:\n$ export WLSIMG_BLDDIR=\u0026#34;/path/to/buid/dir\u0026#34; WebLogic Image Tool cache The WebLogic Image Tool maintains a local file cache store. This store is used to look up where the Java, WebLogic Server installers, and WebLogic Server patches reside in the local file system. By default, the cache store is located in the user\u0026rsquo;s $HOME/cache directory. Under this directory, the lookup information is stored in the .metadata file. All automatically downloaded patches also reside in this directory. You can change the default cache store location by setting the environment variable WLSIMG_CACHEDIR:\n$ export WLSIMG_CACHEDIR=\u0026#34;/path/to/cachedir\u0026#34; Set up additional build scripts To create an Oracle WebCenter Portal Docker image using the WebLogic Image Tool, additional container scripts for Oracle WebCenter Portal domains are required.\n Clone the docker-images repository to set up those scripts. In these steps, this directory is DOCKER_REPO:\n$ cd imagetool-setup $ git clone https://github.com/oracle/docker-images.git Copy the additional WebLogic Image Tool build files from the operator source repository to the imagetool-setup location:\n$ mkdir -p imagetool-setup/docker-images/OracleWebCenterPortal/imagetool/12.2.1.4.0 $ cd imagetool-setup/docker-images/OracleWebCenterPortal/imagetool/12.2.1.4.0 $ cp -rf ${WORKDIR}/imagetool-scripts/* . Note: To create the image, continue with the following steps. To update the image, see update an image.\n Create an image After setting up the WebLogic Image Tool and configuring the required build scripts, create a new Oracle WebCenter Portal Docker image using the WebLogic Image Tool as described ahead.\nDownload the Oracle WebCenter Portal installation binaries and patches You must download the required Oracle WebCenter Portal installation binaries and patches listed below from the Oracle Software Delivery Cloud and save them in a directory of your choice. In these steps, the directory is download location.\nThe installation binaries and patches required for release 21.2.3 are:\n JDK:\n jdk-8u281-linux-x64.tar.gz Fusion Middleware Infrastructure installer:\n fmw_12.2.1.4.0_infrastructure.jar WCP installers:\n fmw_12.2.1.4.0_wcportal.jar Fusion Middleware Infrastructure patches:\n p28186730_139425_Generic.zip (OPatch) p32253037_122140_Generic.zip(WLS) p31544353_122140_Linux-x86-64.zip(WLS ADR Patch) p32124456_122140_Generic.zip(Bundle patch for Oracle Coherence Version 12.2.1.4.7) p31666198_122140_Generic.zip(OPSS Bundle Patch 12.2.1.4.200724) p32357288_122140_Generic.zip(ADF BUNDLE PATCH 12.2.1.4.210107) WCP patches:\n p32224021_122140_Generic.zip(WCP BUNDLE PATCH 12.2.1.4.201126) p31852495_122140_Generic.zip(WEBCENTER CORE BUNDLE PATCH 12.2.1.4.200905)) Update required build files The following files in the code repository location \u0026lt;imagetool-setup-location\u0026gt;/docker-images/OracleWebCenterPortal/imagetool/12.2.1.4.0 are used for creating the image:\n additionalBuildCmds.txt buildArgs In the buildArgs file, update all occurrences of %DOCKER_REPO% with the docker-images repository location, which is the complete path of \u0026lt;imagetool-setup-location\u0026gt;/docker-images.\nFor example, update:\n%DOCKER_REPO%/OracleWebCenterPortal/imagetool/12.2.1.4.0/\nto:\n\u0026lt;imagetool-setup-location\u0026gt;/docker-images/OracleWebCenterPortal/imagetool/12.2.1.4.0/\n Similarly, update the placeholders %JDK_VERSION% and %BUILDTAG% with appropriate values.\n Update the response file \u0026lt;imagetool-setup-location\u0026gt;/docker-images/OracleFMWInfrastructure/dockerfiles/12.2.1.4/install.file to add the parameter INSTALL_TYPE=\u0026quot;Fusion Middleware Infrastructure\u0026quot; in the [GENERIC] section.\n Create the image Add a JDK package to the WebLogic Image Tool cache:\n$ imagetool cache addInstaller --type jdk --version 8u281 --path \u0026lt;download location\u0026gt;/jdk-8u281-linux-x64.tar.gz Add the downloaded installation binaries to the WebLogic Image Tool cache:\n$ imagetool cache addInstaller --type fmw --version 12.2.1.4.0 --path \u0026lt;download location\u0026gt;/fmw_12.2.1.4.0_infrastructure.jar $ imagetool cache addInstaller --type wcp --version 12.2.1.4.0 --path \u0026lt;download location\u0026gt;/fmw_12.2.1.4.0_wcportal.jar Add the downloaded OPatch patch to the WebLogic Image Tool cache:\n$ imagetool cache addEntry --key 28186730_13.9.4.2.5 --value \u0026lt;download location\u0026gt;/p28186730_139425_Generic.zip Append the --opatchBugNumber flag and the OPatch patch key to the create command in the buildArgs file:\n--opatchBugNumber 28186730_13.9.4.2.5 Add the downloaded product patches to the WebLogic Image Tool cache:\n$ imagetool cache addEntry --key 32253037_12.2.1.4.0 --value \u0026lt;download location\u0026gt;/p32253037_122140_Generic.zip $ imagetool cache addEntry --key 32124456_12.2.1.4.0 --value \u0026lt;download location\u0026gt;/p32124456_122140_Generic.zip $ imagetool cache addEntry --key 32357288_12.2.1.4.0 --value \u0026lt;download location\u0026gt;/p32357288_122140_Generic.zip $ imagetool cache addEntry --key 32224021_12.2.1.4.0 --value \u0026lt;download location\u0026gt;/p32224021_122140_Generic.zip $ imagetool cache addEntry --key 31666198_12.2.1.4.0 --value \u0026lt;download location\u0026gt;/p31666198_122140_Generic.zip $ imagetool cache addEntry --key 31544353_12.2.1.4.0 --value \u0026lt;download location\u0026gt;/p31544353_122140_Linux-x86-64.zip $ imagetool cache addEntry --key 31852495_12.2.1.4.0 --value \u0026lt;download location\u0026gt;/p31852495_122140_Generic.zip Append the --patches flag and the product patch keys to the create command in the buildArgs file. The --patches list must be a comma-separated collection of patch --key values used in the imagetool cache addEntry commands above.\nSample --patches list for the product patches added in to the cache:\n--patches 32253037_12.2.1.4.0,32124456_12.2.1.4.0,32357288_12.2.1.4.0,32224021_12.2.1.4.0 Example buildArgs file after appending the OPatch patch and product patches:\ncreate --jdkVersion=8u281 --type wcp --version=12.2.1.4.0 --tag=oracle/wcportal:12.2.1.4 --pull --fromImage ghcr.io/oracle/oraclelinux:7-slim --additionalBuildCommands \u0026lt;imagetool-setup-location\u0026gt;/docker-images/OracleWebCenterPortal/imagetool/12.2.1.4.0/additionalBuildCmds.txt --additionalBuildFiles \u0026lt;imagetool-setup-location\u0026gt;/docker-images/OracleWebCenterPortal/dockerfiles/12.2.1.4/container-scripts --opatchBugNumber 28186730_13.9.4.2.5 --patches 32253037_12.2.1.4.0,32124456_12.2.1.4.0,32357288_12.2.1.4.0,32224021_12.2.1.4.0,31666198_12.2.1.4.0,31544353_12.2.1.4.0,31852495_12.2.1.4.0 Note: In the buildArgs file:\n --jdkVersion value must match the --version value used in the imagetool cache addInstaller command for --type jdk. --version value must match the --version value used in the imagetool cache addInstaller command for --type wcp. --pull always pulls the latest base Linux image oraclelinux:7-slim from the Docker registry. This flag can be removed if you want to use the Linux image oraclelinux:7-slim, which is already available on the host where the WCP image is created. Refer to this page for the complete list of options available with the WebLogic Image Tool create command.\n Create the Oracle WebCenter Portal image:\n$ imagetool @\u0026lt;absolute path to buildargs file\u0026gt; Note: Make sure that the absolute path to the buildargs file is prepended with a @ character, as shown in the example above.\n For example:\n$ imagetool @\u0026lt;imagetool-setup-location\u0026gt;/docker-images/OracleWebCenterPortal/imagetool/12.2.1.4.0/buildArgs Click here to see the sample Dockerfile generated with the imagetool command. ########## BEGIN DOCKERFILE ########## # # 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. # # FROM ghcr.io/oracle/oraclelinux:7-slim as os_update LABEL com.oracle.weblogic.imagetool.buildid=\u0026quot;dabe3ff7-ec35-4b8d-b62a-c3c02fed5571\u0026quot; USER root RUN yum -y --downloaddir=/tmp/imagetool install gzip tar unzip libaio jq hostname procps sudo zip \\ \u0026amp;\u0026amp; yum -y --downloaddir=/tmp/imagetool clean all \\ \u0026amp;\u0026amp; rm -rf /var/cache/yum/* \\ \u0026amp;\u0026amp; rm -rf /tmp/imagetool ## Create user and group RUN if [ -z \u0026quot;$(getent group oracle)\u0026quot; ]; then hash groupadd \u0026amp;\u0026gt; /dev/null \u0026amp;\u0026amp; groupadd oracle || exit -1 ; fi \\ \u0026amp;\u0026amp; if [ -z \u0026quot;$(getent passwd oracle)\u0026quot; ]; then hash useradd \u0026amp;\u0026gt; /dev/null \u0026amp;\u0026amp; useradd -g oracle oracle || exit -1; fi \\ \u0026amp;\u0026amp; mkdir -p /u01 \\ \u0026amp;\u0026amp; chown oracle:oracle /u01 \\ \u0026amp;\u0026amp; chmod 775 /u01 # Install Java FROM os_update as jdk_build LABEL com.oracle.weblogic.imagetool.buildid=\u0026quot;dabe3ff7-ec35-4b8d-b62a-c3c02fed5571\u0026quot; ENV JAVA_HOME=/u01/jdk COPY --chown=oracle:oracle jdk-8u251-linux-x64.tar.gz /tmp/imagetool/ USER oracle RUN tar xzf /tmp/imagetool/jdk-8u251-linux-x64.tar.gz -C /u01 \\ \u0026amp;\u0026amp; $(test -d /u01/jdk* \u0026amp;\u0026amp; mv /u01/jdk* /u01/jdk || mv /u01/graal* /u01/jdk) \\ \u0026amp;\u0026amp; rm -rf /tmp/imagetool \\ \u0026amp;\u0026amp; rm -f /u01/jdk/javafx-src.zip /u01/jdk/src.zip # Install Middleware FROM os_update as wls_build LABEL com.oracle.weblogic.imagetool.buildid=\u0026quot;dabe3ff7-ec35-4b8d-b62a-c3c02fed5571\u0026quot; ENV JAVA_HOME=/u01/jdk \\ ORACLE_HOME=/u01/oracle \\ OPATCH_NO_FUSER=true RUN mkdir -p /u01/oracle \\ \u0026amp;\u0026amp; mkdir -p /u01/oracle/oraInventory \\ \u0026amp;\u0026amp; chown oracle:oracle /u01/oracle/oraInventory \\ \u0026amp;\u0026amp; chown oracle:oracle /u01/oracle COPY --from=jdk_build --chown=oracle:oracle /u01/jdk /u01/jdk/ COPY --chown=oracle:oracle fmw_12.2.1.4.0_infrastructure.jar fmw.rsp /tmp/imagetool/ COPY --chown=oracle:oracle fmw_12.2.1.4.0_wcportal.jar wcp.rsp /tmp/imagetool/ COPY --chown=oracle:oracle oraInst.loc /u01/oracle/ COPY --chown=oracle:oracle p28186730_139425_Generic.zip /tmp/imagetool/opatch/ COPY --chown=oracle:oracle patches/* /tmp/imagetool/patches/ USER oracle RUN echo \u0026quot;INSTALLING MIDDLEWARE\u0026quot; \\ \u0026amp;\u0026amp; echo \u0026quot;INSTALLING fmw\u0026quot; \\ \u0026amp;\u0026amp; \\ /u01/jdk/bin/java -Xmx1024m -jar /tmp/imagetool/fmw_12.2.1.4.0_infrastructure.jar -silent ORACLE_HOME=/u01/oracle \\ -responseFile /tmp/imagetool/fmw.rsp -invPtrLoc /u01/oracle/oraInst.loc -ignoreSysPrereqs -force -novalidation \\ \u0026amp;\u0026amp; echo \u0026quot;INSTALLING wcp\u0026quot; \\ \u0026amp;\u0026amp; \\ /u01/jdk/bin/java -Xmx1024m -jar /tmp/imagetool/fmw_12.2.1.4.0_wcportal.jar -silent ORACLE_HOME=/u01/oracle \\ -responseFile /tmp/imagetool/wcp.rsp -invPtrLoc /u01/oracle/oraInst.loc -ignoreSysPrereqs -force -novalidation \\ \u0026amp;\u0026amp; chmod -R g+r /u01/oracle RUN cd /tmp/imagetool/opatch \\ \u0026amp;\u0026amp; /u01/jdk/bin/jar -xf /tmp/imagetool/opatch/p28186730_139425_Generic.zip \\ \u0026amp;\u0026amp; /u01/jdk/bin/java -jar /tmp/imagetool/opatch/6880880/opatch_generic.jar -silent -ignoreSysPrereqs -force -novalidation oracle_home=/u01/oracle # Apply all patches provided at the same time RUN /u01/oracle/OPatch/opatch napply -silent -oh /u01/oracle -phBaseDir /tmp/imagetool/patches \\ \u0026amp;\u0026amp; test $? -eq 0 \\ \u0026amp;\u0026amp; /u01/oracle/OPatch/opatch util cleanup -silent -oh /u01/oracle \\ || (cat /u01/oracle/cfgtoollogs/opatch/opatch*.log \u0026amp;\u0026amp; exit 1) FROM os_update as final_build ARG ADMIN_NAME ARG ADMIN_HOST ARG ADMIN_PORT ARG MANAGED_SERVER_PORT ENV ORACLE_HOME=/u01/oracle \\ JAVA_HOME=/u01/jdk \\ PATH=${PATH}:/u01/jdk/bin:/u01/oracle/oracle_common/common/bin:/u01/oracle/wlserver/common/bin:/u01/oracle LABEL com.oracle.weblogic.imagetool.buildid=\u0026quot;dabe3ff7-ec35-4b8d-b62a-c3c02fed5571\u0026quot; COPY --from=jdk_build --chown=oracle:oracle /u01/jdk /u01/jdk/ COPY --from=wls_build --chown=oracle:oracle /u01/oracle /u01/oracle/ USER oracle WORKDIR /u01/oracle #ENTRYPOINT /bin/bash ENV ORACLE_HOME=/u01/oracle \\ SCRIPT_FILE=/u01/oracle/container-scripts/* \\ USER_MEM_ARGS=\u0026quot;-Djava.security.egd=file:/dev/./urandom\u0026quot; \\ PATH=$PATH:/usr/java/default/bin:/u01/oracle/oracle_common/common/bin:/u01/oracle/wlserver/common/bin:/u01/oracle/container-scripts USER root RUN env \u0026amp;\u0026amp; \\ mkdir -p /u01/oracle/container-scripts \u0026amp;\u0026amp; \\ mkdir -p /u01/oracle/logs \u0026amp;\u0026amp; \\ mkdir -p /u01/esHome/esNode \u0026amp;\u0026amp; \\ chown oracle:oracle -R /u01 $VOLUME_DIR \u0026amp;\u0026amp; \\ chmod a+xr /u01 COPY --chown=oracle:oracle files/container-scripts/ /u01/oracle/container-scripts/ RUN chmod +xr $SCRIPT_FILE \u0026amp;\u0026amp; \\ rm /u01/oracle/oracle_common/lib/ons.jar /u01/oracle/oracle_common/modules/oracle.jdbc/simplefan.jar USER oracle EXPOSE $WCPORTAL_PORT $ADMIN_PORT WORKDIR ${ORACLE_HOME} CMD [\u0026quot;/u01/oracle/container-scripts/configureOrStartAdminServer.sh\u0026quot;] ########## END DOCKERFILE ########## Check the created image using the docker images command:\n$ docker images | grep wcportal Update an image After setting up the WebLogic Image Tool and configuring the build scripts, use the WebLogic Image Tool to update an existing Oracle WebCenter Portal Docker image:\n Enter the following command to add the OPatch patch to the WebLogic Image Tool cache:\n$ imagetool cache addEntry --key 28186730_13.9.4.2.5 --value \u0026lt;downloaded-patches-location\u0026gt;/p28186730_139425_Generic.zip Execute the imagetool cache addEntry command for each patch to add the required patch(es) to the WebLogic Image Tool cache. For example, to add patch p30761841_122140_Generic.zip:\n$ imagetool cache addEntry --key=32224021_12.2.1.4.0 --value \u0026lt;downloaded-patches-location\u0026gt;/p32224021_122140_Generic.zip Provide the following arguments to the WebLogic Image Tool update command:\n –-fromImage - Identify the image that needs to be updated. In the example below, the image to be updated is oracle/wcportal:12.2.1.4. –-patches - Multiple patches can be specified as a comma-separated list. --tag - Specify the new tag to be applied for the image being built. Refer here for the complete list of options available with the WebLogic Image Tool update command.\n Note: The WebLogic Image Tool cache should have the latest OPatch zip. The WebLogic Image Tool updates the OPatch if it is not already updated in the image.\n Examples Click here to see the example of update command: $ imagetool update --fromImage oracle/wcportal:12.2.1.4 --tag=wcportal:12.2.1.4-32224021 --patches=32224021_12.2.1.4.0 [INFO ] Image Tool build ID: 50f9b9aa-596c-4bae-bdff-c47c16b4c928 [INFO ] Temporary directory used for docker build context: /scratch/imagetoolcache/builddir/wlsimgbuilder_temp5130105621506307568 [INFO ] Using patch 28186730_13.9.4.2.5 from cache: /home/imagetool-setup/jars/p28186730_139425_Generic.zip [INFO ] Updating OPatch in final image from version 13.9.4.2.1 to version 13.9.4.2.5 [WARNING] Skipping patch conflict check, no support credentials provided [WARNING] No credentials provided, skipping validation of patches [INFO ] Using patch 32224021_12.2.1.4 from cache: /home/imagetool-setup/jars/p32224021_122140_Generic.zip [INFO ] docker cmd = docker build --no-cache --force-rm --tag wcportal:12.2.1.4-32224021 --build-arg http_proxy=http://\u0026lt;YOUR-COMPANY-PROXY\u0026gt; --build-arg https_proxy=http://\u0026lt;YOUR-COMPANY-PROXY\u0026gt; --build-arg no_proxy=\u0026lt;IP addresses and Domain address for no_proxy\u0026gt;,/var/run/docker.sock \u0026lt;work-directory\u0026gt;/wlstmp/wlsimgbuilder_temp5130105621506307568 Sending build context to Docker daemon 192.4MB Step 1/9 : FROM oracle/wcportal:12.2.1.4 as final_build ---\u0026gt; 5592ff7e5a02 Step 2/9 : USER root ---\u0026gt; Running in 0b3ff2600f11 Removing intermediate container 0b3ff2600f11 ---\u0026gt; faad3a32f39c Step 3/9 : ENV OPATCH_NO_FUSER=true ---\u0026gt; Running in 2beab0bfe88b Removing intermediate container 2beab0bfe88b ---\u0026gt; 6fd9e1664818 Step 4/9 : LABEL com.oracle.weblogic.imagetool.buildid=\u0026quot;50f9b9aa-596c-4bae-bdff-c47c16b4c928\u0026quot; ---\u0026gt; Running in 9a5f8fc172c9 Removing intermediate container 9a5f8fc172c9 ---\u0026gt; 499620a1f857 Step 5/9 : USER oracle ---\u0026gt; Running in fe28af056858 Removing intermediate container fe28af056858 ---\u0026gt; 3507971c35d5 Step 6/9 : COPY --chown=oracle:oracle p28186730_139425_Generic.zip /tmp/imagetool/opatch/ ---\u0026gt; c44c3c7b17f7 Step 7/9 : RUN cd /tmp/imagetool/opatch \u0026amp;\u0026amp; /u01/jdk/bin/jar -xf /tmp/imagetool/opatch/p28186730_139425_Generic.zip \u0026amp;\u0026amp; /u01/jdk/bin/java -jar /tmp/imagetool/opatch/6880880/opatch_generic.jar -silent -ignoreSysPrereqs -force -novalidation oracle_home=/u01/oracle \u0026amp;\u0026amp; rm -rf /tmp/imagetool ---\u0026gt; Running in 8380260fe62d Launcher log file is /tmp/OraInstall2021-04-08_05-18-14AM/launcher2021-04-08_05-18-14AM.log. Extracting the installer . . . . Done Checking if CPU speed is above 300 MHz. Actual 2195.098 MHz Passed Checking swap space: must be greater than 512 MB. Actual 14999 MB Passed Checking if this platform requires a 64-bit JVM. Actual 64 Passed (64-bit not required) Checking temp space: must be greater than 300 MB. Actual 152772 MB Passed Preparing to launch the Oracle Universal Installer from /tmp/OraInstall2021-04-08_05-18-14AM Installation Summary Disk Space : Required 34 MB, Available 152,736 MB Feature Sets to Install: Next Generation Install Core 13.9.4.0.1 OPatch 13.9.4.2.5 OPatch Auto OPlan 13.9.4.2.5 Session log file is /tmp/OraInstall2021-04-08_05-18-14AM/install2021-04-08_05-18-14AM.log Loading products list. Please wait. 1% 40% Loading products. Please wait. 98% 99% Updating Libraries Starting Installations 1% 94% 95% 96% Install pending Installation in progress Component : oracle.glcm.logging 1.6.4.0.0 Copying files for oracle.glcm.logging 1.6.4.0.0 Component : oracle.glcm.comdev 7.8.4.0.0 Copying files for oracle.glcm.comdev 7.8.4.0.0 Component : oracle.glcm.dependency 1.8.4.0.0 Copying files for oracle.glcm.dependency 1.8.4.0.0 Component : oracle.glcm.xmldh 3.4.4.0.0 Copying files for oracle.glcm.xmldh 3.4.4.0.0 Component : oracle.glcm.wizard 7.8.4.0.0 Copying files for oracle.glcm.wizard 7.8.4.0.0 Component : oracle.glcm.opatch.common.api 13.9.4.0.0 Copying files for oracle.glcm.opatch.common.api 13.9.4.0.0 Component : oracle.nginst.common 13.9.4.0.0 Copying files for oracle.nginst.common 13.9.4.0.0 Component : oracle.nginst.core 13.9.4.0.0 Copying files for oracle.nginst.core 13.9.4.0.0 Component : oracle.glcm.encryption 2.7.4.0.0 Copying files for oracle.glcm.encryption 2.7.4.0.0 Component : oracle.swd.opatch 13.9.4.2.5 Copying files for oracle.swd.opatch 13.9.4.2.5 Component : oracle.glcm.osys.core 13.9.1.0.0 Copying files for oracle.glcm.osys.core 13.9.1.0.0 Component : oracle.glcm.oplan.core 13.9.4.2.0 Copying files for oracle.glcm.oplan.core 13.9.4.2.0 Install successful Post feature install pending Post Feature installing Feature Set : glcm_common_lib Feature Set : glcm_common_logging_lib Post Feature installing glcm_common_lib Post Feature installing glcm_common_logging_lib Feature Set : commons-cli_1.3.1.0.0 Post Feature installing commons-cli_1.3.1.0.0 Feature Set : oracle.glcm.opatch.common.api.classpath Post Feature installing oracle.glcm.opatch.common.api.classpath Feature Set : glcm_encryption_lib Post Feature installing glcm_encryption_lib Feature Set : oracle.glcm.osys.core.classpath Post Feature installing oracle.glcm.osys.core.classpath Feature Set : oracle.glcm.oplan.core.classpath Post Feature installing oracle.glcm.oplan.core.classpath Feature Set : oracle.glcm.opatchauto.core.classpath Post Feature installing oracle.glcm.opatchauto.core.classpath Feature Set : oracle.glcm.opatchauto.core.binary.classpath Post Feature installing oracle.glcm.opatchauto.core.binary.classpath Feature Set : oracle.glcm.opatchauto.core.actions.classpath Post Feature installing oracle.glcm.opatchauto.core.actions.classpath Feature Set : oracle.glcm.opatchauto.core.wallet.classpath Post Feature installing oracle.glcm.opatchauto.core.wallet.classpath Post feature install complete String substitutions pending String substituting Component : oracle.glcm.logging 1.6.4.0.0 String substituting oracle.glcm.logging 1.6.4.0.0 Component : oracle.glcm.comdev 7.8.4.0.0 String substituting oracle.glcm.comdev 7.8.4.0.0 Component : oracle.glcm.dependency 1.8.4.0.0 String substituting oracle.glcm.dependency 1.8.4.0.0 Component : oracle.glcm.xmldh 3.4.4.0.0 String substituting oracle.glcm.xmldh 3.4.4.0.0 Component : oracle.glcm.wizard 7.8.4.0.0 String substituting oracle.glcm.wizard 7.8.4.0.0 Component : oracle.glcm.opatch.common.api 13.9.4.0.0 String substituting oracle.glcm.opatch.common.api 13.9.4.0.0 Component : oracle.nginst.common 13.9.4.0.0 String substituting oracle.nginst.common 13.9.4.0.0 Component : oracle.nginst.core 13.9.4.0.0 String substituting oracle.nginst.core 13.9.4.0.0 Component : oracle.glcm.encryption 2.7.4.0.0 String substituting oracle.glcm.encryption 2.7.4.0.0 Component : oracle.swd.opatch 13.9.4.2.5 String substituting oracle.swd.opatch 13.9.4.2.5 Component : oracle.glcm.osys.core 13.9.1.0.0 String substituting oracle.glcm.osys.core 13.9.1.0.0 Component : oracle.glcm.oplan.core 13.9.4.2.0 String substituting oracle.glcm.oplan.core 13.9.4.2.0 String substitutions complete Link pending Linking in progress Component : oracle.glcm.logging 1.6.4.0.0 Linking oracle.glcm.logging 1.6.4.0.0 Component : oracle.glcm.comdev 7.8.4.0.0 Linking oracle.glcm.comdev 7.8.4.0.0 Component : oracle.glcm.dependency 1.8.4.0.0 Linking oracle.glcm.dependency 1.8.4.0.0 Component : oracle.glcm.xmldh 3.4.4.0.0 Linking oracle.glcm.xmldh 3.4.4.0.0 Component : oracle.glcm.wizard 7.8.4.0.0 Linking oracle.glcm.wizard 7.8.4.0.0 Component : oracle.glcm.opatch.common.api 13.9.4.0.0 Linking oracle.glcm.opatch.common.api 13.9.4.0.0 Component : oracle.nginst.common 13.9.4.0.0 Linking oracle.nginst.common 13.9.4.0.0 Component : oracle.nginst.core 13.9.4.0.0 Linking oracle.nginst.core 13.9.4.0.0 Component : oracle.glcm.encryption 2.7.4.0.0 Linking oracle.glcm.encryption 2.7.4.0.0 Component : oracle.swd.opatch 13.9.4.2.5 Linking oracle.swd.opatch 13.9.4.2.5 Component : oracle.glcm.osys.core 13.9.1.0.0 Linking oracle.glcm.osys.core 13.9.1.0.0 Component : oracle.glcm.oplan.core 13.9.4.2.0 Linking oracle.glcm.oplan.core 13.9.4.2.0 Linking in progress Link successful Setup pending Setup in progress Component : oracle.glcm.logging 1.6.4.0.0 Setting up oracle.glcm.logging 1.6.4.0.0 Component : oracle.glcm.comdev 7.8.4.0.0 Setting up oracle.glcm.comdev 7.8.4.0.0 Component : oracle.glcm.dependency 1.8.4.0.0 Setting up oracle.glcm.dependency 1.8.4.0.0 Component : oracle.glcm.xmldh 3.4.4.0.0 Setting up oracle.glcm.xmldh 3.4.4.0.0 Component : oracle.glcm.wizard 7.8.4.0.0 Setting up oracle.glcm.wizard 7.8.4.0.0 Component : oracle.glcm.opatch.common.api 13.9.4.0.0 Setting up oracle.glcm.opatch.common.api 13.9.4.0.0 Component : oracle.nginst.common 13.9.4.0.0 Setting up oracle.nginst.common 13.9.4.0.0 Component : oracle.nginst.core 13.9.4.0.0 Setting up oracle.nginst.core 13.9.4.0.0 Component : oracle.glcm.encryption 2.7.4.0.0 Setting up oracle.glcm.encryption 2.7.4.0.0 Component : oracle.swd.opatch 13.9.4.2.5 Setting up oracle.swd.opatch 13.9.4.2.5 Component : oracle.glcm.osys.core 13.9.1.0.0 Setting up oracle.glcm.osys.core 13.9.1.0.0 Component : oracle.glcm.oplan.core 13.9.4.2.0 Setting up oracle.glcm.oplan.core 13.9.4.2.0 Setup successful Save inventory pending Saving inventory 97% Saving inventory complete 98% Configuration complete Component : glcm_common_logging_lib Saving the inventory glcm_common_logging_lib Component : glcm_encryption_lib Component : oracle.glcm.opatch.common.api.classpath Saving the inventory oracle.glcm.opatch.common.api.classpath Saving the inventory glcm_encryption_lib Component : cieCfg_common_rcu_lib Component : glcm_common_lib Saving the inventory cieCfg_common_rcu_lib Saving the inventory glcm_common_lib Component : oracle.glcm.logging Saving the inventory oracle.glcm.logging Component : cieCfg_common_lib Saving the inventory cieCfg_common_lib Component : svctbl_lib Saving the inventory svctbl_lib Component : com.bea.core.binxml_dependencies Saving the inventory com.bea.core.binxml_dependencies Component : svctbl_jmx_client Saving the inventory svctbl_jmx_client Component : cieCfg_wls_shared_lib Saving the inventory cieCfg_wls_shared_lib Component : rcuapi_lib Saving the inventory rcuapi_lib Component : rcu_core_lib Saving the inventory rcu_core_lib Component : cieCfg_wls_lib Saving the inventory cieCfg_wls_lib Component : cieCfg_wls_external_lib Saving the inventory cieCfg_wls_external_lib Component : cieCfg_wls_impl_lib Saving the inventory cieCfg_wls_impl_lib Component : rcu_dependencies_lib Saving the inventory rcu_dependencies_lib Component : oracle.fmwplatform.fmwprov_lib Saving the inventory oracle.fmwplatform.fmwprov_lib Component : fmwplatform-wlst-dependencies Saving the inventory fmwplatform-wlst-dependencies Component : oracle.fmwplatform.ocp_lib Saving the inventory oracle.fmwplatform.ocp_lib Component : oracle.fmwplatform.ocp_plugin_lib Saving the inventory oracle.fmwplatform.ocp_plugin_lib Component : wlst.wls.classpath Saving the inventory wlst.wls.classpath Component : maven.wls.classpath Saving the inventory maven.wls.classpath Component : com.oracle.webservices.fmw.ws-assembler Saving the inventory com.oracle.webservices.fmw.ws-assembler Component : sdpmessaging_dependencies Saving the inventory sdpmessaging_dependencies Component : sdpclient_dependencies Saving the inventory sdpclient_dependencies Component : com.oracle.jersey.fmw.client Saving the inventory com.oracle.jersey.fmw.client Component : com.oracle.webservices.fmw.client Saving the inventory com.oracle.webservices.fmw.client Component : oracle.jrf.wls.classpath Saving the inventory oracle.jrf.wls.classpath Component : oracle.jrf.wlst Saving the inventory oracle.jrf.wlst Component : fmwshare-wlst-dependencies Saving the inventory fmwshare-wlst-dependencies Component : oracle.fmwshare.pyjar Saving the inventory oracle.fmwshare.pyjar Component : com.oracle.webservices.wls.jaxws-owsm-client Saving the inventory com.oracle.webservices.wls.jaxws-owsm-client Component : glcm_common_logging_lib Component : glcm_common_lib Saving the inventory glcm_common_lib Component : glcm_encryption_lib Saving the inventory glcm_encryption_lib Component : oracle.glcm.opatch.common.api.classpath Saving the inventory oracle.glcm.opatch.common.api.classpath Component : cieCfg_common_rcu_lib Saving the inventory cieCfg_common_rcu_lib Saving the inventory glcm_common_logging_lib Component : oracle.glcm.logging Saving the inventory oracle.glcm.logging Component : cieCfg_common_lib Saving the inventory cieCfg_common_lib Component : svctbl_lib Saving the inventory svctbl_lib Component : com.bea.core.binxml_dependencies Saving the inventory com.bea.core.binxml_dependencies Component : svctbl_jmx_client Saving the inventory svctbl_jmx_client Component : cieCfg_wls_shared_lib Saving the inventory cieCfg_wls_shared_lib Component : rcuapi_lib Saving the inventory rcuapi_lib Component : rcu_core_lib Saving the inventory rcu_core_lib Component : cieCfg_wls_lib Saving the inventory cieCfg_wls_lib Component : cieCfg_wls_external_lib Saving the inventory cieCfg_wls_external_lib Component : cieCfg_wls_impl_lib Saving the inventory cieCfg_wls_impl_lib Component : soa_com.bea.core.binxml_dependencies Saving the inventory soa_com.bea.core.binxml_dependencies Component : glcm_common_logging_lib Saving the inventory glcm_common_logging_lib Component : glcm_common_lib Saving the inventory glcm_common_lib Component : glcm_encryption_lib Saving the inventory glcm_encryption_lib Component : oracle.glcm.opatch.common.api.classpath Component : oracle.glcm.oplan.core.classpath Saving the inventory oracle.glcm.oplan.core.classpath Saving the inventory oracle.glcm.opatch.common.api.classpath The install operation completed successfully. Logs successfully copied to /u01/oracle/.inventory/logs. Removing intermediate container 8380260fe62d ---\u0026gt; d57be7ffa162 Step 8/9 : COPY --chown=oracle:oracle patches/* /tmp/imagetool/patches/ ---\u0026gt; dd421aae5aaf Step 9/9 : RUN /u01/oracle/OPatch/opatch napply -silent -oh /u01/oracle -phBaseDir /tmp/imagetool/patches \u0026amp;\u0026amp; test $? -eq 0 \u0026amp;\u0026amp; /u01/oracle/OPatch/opatch util cleanup -silent -oh /u01/oracle || (cat /u01/oracle/cfgtoollogs/opatch/opatch*.log \u0026amp;\u0026amp; exit 1) ---\u0026gt; Running in 323e7ae70339 Oracle Interim Patch Installer version 13.9.4.2.5 Copyright (c) 2021, Oracle Corporation. All rights reserved. Oracle Home : /u01/oracle Central Inventory : /u01/oracle/.inventory from : /u01/oracle/oraInst.loc OPatch version : 13.9.4.2.5 OUI version : 13.9.4.0.0 Log file location : /u01/oracle/cfgtoollogs/opatch/opatch2021-04-08_05-20-25AM_1.log OPatch detects the Middleware Home as \u0026quot;/u01/oracle\u0026quot; Verifying environment and performing prerequisite checks... OPatch continues with these patches: 32224021 Do you want to proceed? [y|n] Y (auto-answered by -silent) User Responded with: Y All checks passed. Please shutdown Oracle instances running out of this ORACLE_HOME on the local system. (Oracle Home = '/u01/oracle') Is the local system ready for patching? [y|n] Y (auto-answered by -silent) User Responded with: Y Backing up files... Applying interim patch '32224021' to OH '/u01/oracle' ApplySession: Optional component(s) [ oracle.webcenter.sca, 12.2.1.4.0 ] , [ oracle.webcenter.sca, 12.2.1.4.0 ] , [ oracle.webcenter.ucm, 12.2.1.4.0 ] , [ oracle.webcenter.ucm, 12.2.1.4.0 ] not present in the Oracle Home or a higher version is found. Patching component oracle.webcenter.portal, 12.2.1.4... Patching component oracle.webcenter.portal, 12.2.1.4... Patching component oracle.rcu.webcenter.portal, 12.2.1.0... Patching component oracle.rcu.webcenter.portal, 12.2.1.0... Patch 32224021 successfully applied. Log file location: /u01/oracle/cfgtoollogs/opatch/opatch2021-04-08_05-20-25AM_1.log OPatch succeeded. Oracle Interim Patch Installer version 13.9.4.2.5 Copyright (c) 2021, Oracle Corporation. All rights reserved. Oracle Home : /u01/oracle Central Inventory : /u01/oracle/.inventory from : /u01/oracle/oraInst.loc OPatch version : 13.9.4.2.5 OUI version : 13.9.4.0.0 Log file location : /u01/oracle/cfgtoollogs/opatch/opatch2021-04-08_05-27-11AM_1.log OPatch detects the Middleware Home as \u0026quot;/u01/oracle\u0026quot; Invoking utility \u0026quot;cleanup\u0026quot; OPatch will clean up 'restore.sh,make.txt' files and 'scratch,backup' directories. You will be still able to rollback patches after this cleanup. Do you want to proceed? [y|n] Y (auto-answered by -silent) User Responded with: Y Backup area for restore has been cleaned up. For a complete list of files/directories deleted, Please refer log file. OPatch succeeded. Removing intermediate container 323e7ae70339 ---\u0026gt; 0e7c514dcf7b Successfully built 0e7c514dcf7b Successfully tagged wcportal:12.2.1.4-32224021 [INFO ] Build successful. Build time=645s. Image tag=wcportal:12.2.1.4-32224021 Click here to see the example Dockerfile generated by the WebLogic Image Tool with the --dryRun option: $ imagetool update --fromImage oracle/wcportal:12.2.1.4 --tag=wcportal:12.2.1.4-30761841 --patches=30761841_12.2.1.4.0 --dryRun [INFO ] Image Tool build ID: a473ba32-84b6-4374-9425-9e92ac90ee87 [INFO ] Temporary directory used for docker build context: /scratch/imagetoolcache/builddir/wlsimgbuilder_temp874401188519547557 [INFO ] Using patch 28186730_13.9.4.2.5 from cache: /home/imagetool-setup/jars/p28186730_139425_Generic.zip [INFO ] Updating OPatch in final image from version 13.9.4.2.1 to version 13.9.4.2.5 [WARNING] Skipping patch conflict check, no support credentials provided [WARNING] No credentials provided, skipping validation of patches [INFO ] Using patch 32224021_12.2.1.4 from cache: /home/imagetool-setup/jars/p32224021_122140_Generic.zip [INFO ] docker cmd = docker build --no-cache --force-rm --tag wcportal:12.2.1.4-32224021 --build-arg http_proxy=http://\u0026lt;YOUR-COMPANY-PROXY\u0026gt; --build-arg https_proxy=http://\u0026lt;YOUR-COMPANY-PROXY\u0026gt; --build-arg no_proxy=\u0026lt;IP addresses and Domain address for no_proxy\u0026gt;,/var/run/docker.sock \u0026lt;work-directory\u0026gt;/wlstmp/wlsimgbuilder_temp874401188519547557 ########## BEGIN DOCKERFILE ########## # # 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. # # FROM oracle/wcportal:12.2.1.4 as final_build USER root ENV OPATCH_NO_FUSER=true LABEL com.oracle.weblogic.imagetool.buildid=\u0026quot;a473ba32-84b6-4374-9425-9e92ac90ee87\u0026quot; USER oracle COPY --chown=oracle:oracle p28186730_139425_Generic.zip /tmp/imagetool/opatch/ RUN cd /tmp/imagetool/opatch \\ \u0026amp;\u0026amp; /u01/jdk/bin/jar -xf /tmp/imagetool/opatch/p28186730_139425_Generic.zip \\ \u0026amp;\u0026amp; /u01/jdk/bin/java -jar /tmp/imagetool/opatch/6880880/opatch_generic.jar -silent -ignoreSysPrereqs -force -novalidation oracle_home=/u01/oracle \\ \u0026amp;\u0026amp; rm -rf /tmp/imagetool COPY --chown=oracle:oracle patches/* /tmp/imagetool/patches/ # Apply all patches provided at the same time RUN /u01/oracle/OPatch/opatch napply -silent -oh /u01/oracle -phBaseDir /tmp/imagetool/patches \\ \u0026amp;\u0026amp; test $? -eq 0 \\ \u0026amp;\u0026amp; /u01/oracle/OPatch/opatch util cleanup -silent -oh /u01/oracle \\ || (cat /u01/oracle/cfgtoollogs/opatch/opatch*.log \u0026amp;\u0026amp; exit 1) ########## END DOCKERFILE ########## Check the built image using the docker images command:\n$ docker images | grep wcportal wcportal 12.2.1.4-30761841 2ef2a67a685b About a minute ago 3.58GB $ Create an Oracle WebCenter Portal Docker image using Dockerfile For test and development purposes, you can create an Oracle WebCenter Portal image using the Dockerfile. Consult the README file for important prerequisite steps, such as building or pulling the Server JRE Docker image, Oracle Fusion Middleware Infrastructure Docker image and downloading the Oracle WebCenter Portal installer and bundle patch binaries.\nA prebuilt Oracle Fusion Middleware Infrastructure image, container-registry.oracle.com/middleware/fmw-infrastructure:12.2.1.4, is available at container-registry.oracle.com. We recommend that you pull and rename this image to build the Oracle WebCenter Portal image.\n$ docker pull container-registry.oracle.com/middleware/fmw-infrastructure:12.2.1.4 $ docker tag container-registry.oracle.com/middleware/fmw-infrastructure:12.2.1.4 oracle/fmw-infrastructure:12.2.1.4 To build an Oracle Fusion Middleware Infrastructure image and on top of that the Oracle WebCenter Portal image as a layer, follow these steps:\n Make a local clone of the sample repository:\n$ git clone https://github.com/oracle/docker-images Download the Oracle WebCenter Portal installer from the Oracle Technology Network or e-delivery.\n Note: Copy the installer binaries to the same location as the Dockerfile.\n Create the Oracle WebCenter Portal image by running the provided script:\n$ cd docker-images/OracleWebCenterPortal/dockerfiles $ ./buildDockerImage.sh -v 12.2.1.4 -s The image produced is named oracle/wcportal:12.2.1.4. The samples and instructions assume the Oracle WebCenter Portal image is named oracle/wcportal:12.2.1.4. You must rename your image to match this name, or update the samples to refer to the image you created.\n " +}, +{ + "uri": "/fmw-kubernetes/22.2.3/wcportal-domains/manage-wcportal-domains/configure-load-balancer/apachewebtier/", + "title": "Apache webtier", + "tags": [], + "description": "Configure the Apache webtier load balancer for an Oracle WebCenter Portal domain.", + "content": "To load balance Oracle WebCenter Portal domain clusters, you can install Apache webtier and configure it for non-SSL and SSL termination access of the application URL. Follow these steps to set up Apache webtier as a load balancer for an Oracle WebCenter Portal domain in a Kubernetes cluster:\n Build the Apache webtier image Create the Apache plugin configuration file Prepare the certificate and private key Install the Apache webtier Helm chart Verify domain application URL access Uninstall Apache webtier Build the Apache webtier image To build the Apache webtier Docker image, refer to the sample.\nCreate the Apache plugin configuration file The configuration file named custom_mod_wl_apache.conf should have all the URL routing rules for the Oracle WebCenter Portal applications deployed in the domain that needs to be accessible externally. Update this file with values based on your environment. The file content is similar to below. Click here to see the sample content of the configuration file custom_mod_wl_apache.conf for wcp-domain domain $ cat ${WORKDIR}/charts/apache-samples/custom-sample/custom_mod_wl_apache.conf #Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved. # # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. # \u0026lt;IfModule mod_weblogic.c\u0026gt; WebLogicHost \u0026lt;WEBLOGIC_HOST\u0026gt; WebLogicPort 7001 \u0026lt;/IfModule\u0026gt; # Directive for weblogic admin Console deployed on Weblogic Admin Server \u0026lt;Location /console\u0026gt; SetHandler weblogic-handler WebLogicHost wcp-domain-adminserver WebLogicPort 7001 \u0026lt;/Location\u0026gt; \u0026lt;Location /em\u0026gt; SetHandler weblogic-handler WebLogicHost wcp-domain-adminserver WebLogicPort 7001 \u0026lt;/Location\u0026gt; \u0026lt;Location /webcenter\u0026gt; WLSRequest On WebLogicCluster wcp-domain-cluster-wcp-cluster:8888 PathTrim /weblogic1 \u0026lt;/Location\u0026gt; \u0026lt;Location /rsscrawl\u0026gt; WLSRequest On WebLogicCluster wcp-domain-cluster-wcp-cluster:8888 PathTrim /weblogic1 \u0026lt;/Location\u0026gt; \u0026lt;Location /rest\u0026gt; WLSRequest On WebLogicCluster wcp-domain-cluster-wcp-cluster:8888 PathTrim /weblogic1 \u0026lt;/Location\u0026gt; \u0026lt;Location /webcenterhelp\u0026gt; WLSRequest On WebLogicCluster wcp-domain-cluster-wcp-cluster:8888 PathTrim /weblogic1 \u0026lt;/Location\u0026gt; \u0026lt;Location /wsrp-tools\u0026gt; WLSRequest On WebLogicCluster wcp-domain-cluster-wcportlet-cluster:8889 PathTrim /weblogic1 \u0026lt;/Location\u0026gt; \u0026lt;Location /portalTools\u0026gt; WLSRequest On WebLogicCluster wcp-domain-cluster-wcportlet-cluster:8889 PathTrim /weblogic1 \u0026lt;/Location\u0026gt; Update persistentVolumeClaimName in ${WORKDIR}/charts/apache-samples/custom-sample/input.yamlwith Persistence Volume which contains your own custom_mod_wl_apache.conf file. Use the PV/PVC created at the time of preparing environment, Copy the custom_mod_wl_apache.conf file to existing PersistantVolume. Prepare the certificate and private key (For the SSL termination configuration only) Run the following commands to generate your own certificate and private key using openssl.\n$ cd ${WORKDIR}/charts/apache-samples/custom-sample $ export VIRTUAL_HOST_NAME=WEBLOGIC_HOST $ export SSL_CERT_FILE=WEBLOGIC_HOST.crt $ export SSL_CERT_KEY_FILE=WEBLOGIC_HOST.key $ sh certgen.sh NOTE: Replace WEBLOGIC_HOST with the name of the host on which Apache webtier is to be installed.\n Click here to see the output of the certifcate generation $ls certgen.sh custom_mod_wl_apache.conf custom_mod_wl_apache.conf_orig input.yaml README.md $ sh certgen.sh Generating certs for WEBLOGIC_HOST Generating a 2048 bit RSA private key ........................+++ .......................................................................+++ unable to write \u0026#39;random state\u0026#39; writing new private key to \u0026#39;apache-sample.key\u0026#39; ----- $ ls certgen.sh custom_mod_wl_apache.conf_orig WEBLOGIC_HOST.info config.txt input.yaml WEBLOGIC_HOST.key custom_mod_wl_apache.conf WEBLOGIC_HOST.crt README.md Prepare input values for the Apache webtier Helm chart.\nRun the following commands to prepare the input value file for the Apache webtier Helm chart.\n$ base64 -i ${SSL_CERT_FILE} | tr -d \u0026#39;\\n\u0026#39; $ base64 -i ${SSL_CERT_KEY_FILE} | tr -d \u0026#39;\\n\u0026#39; $ touch input.yaml Update virtualHostName with the value of the WEBLOGIC_HOST in file ${WORKDIR}/charts/apache-samples/custom-sample/input.yaml\n Click here to see the snapshot of the sample input.yaml file $ cat apache-samples/custom-sample/input.yaml # 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: wcp-domain-domain-pvc # The VirtualHostName of the Apache HTTP server. It is used to enable custom SSL configuration. virtualHostName: \u0026lt;WEBLOGIC_HOST\u0026gt; Install the Apache webtier Helm chart Install the Apache webtier Helm chart to the domain wcpns namespace with the specified input parameters:\n$ cd ${WORKDIR}/charts $ kubectl create namespace apache-webtier $ helm install apache-webtier --values apache-samples/custom-sample/input.yaml --namespace wcpns apache-webtier --set image=oracle/apache:12.2.1.3 Check the status of the Apache webtier:\n$ kubectl get all -n wcpns | grep apache Sample output of the status of the apache webtier:\npod/apache-webtier-apache-webtier-65f69dc6bc-zg5pj 1/1 Running 0 22h service/apache-webtier-apache-webtier NodePort 10.108.29.98 \u0026lt;none\u0026gt; 80:30305/TCP,4433:30443/TCP 22h deployment.apps/apache-webtier-apache-webtier 1/1 1 1 22h replicaset.apps/apache-webtier-apache-webtier-65f69dc6bc 1 1 1 22h Verify domain application URL access Once the Apache webtier load balancer is up, verify that the domain applications are accessible through the load balancer port 30305/30443. The application URLs for domain of type wcp are:\n Note: Port 30305 is the LOADBALANCER-Non-SSLPORT and Port 30443 is LOADBALANCER-SSLPORT.\n Non-SSL configuration http://${LOADBALANCER-HOSTNAME}:${LOADBALANCER-Non-SSLPORT}/console http://${LOADBALANCER-HOSTNAME}:${LOADBALANCER-Non-SSLPORT}/em http://${LOADBALANCER-HOSTNAME}:${LOADBALANCER-Non-SSLPORT}/webcenter http://${LOADBALANCER-HOSTNAME}:${LOADBALANCER-Non-SSLPORT}/webcenterhelp http://${LOADBALANCER-HOSTNAME}:${LOADBALANCER-Non-SSLPORT}/rest http://${LOADBALANCER-HOSTNAME}:${LOADBALANCER-Non-SSLPORT}/rsscrawl SSL configuration https://${LOADBALANCER-HOSTNAME}:${LOADBALANCER-SSLPORT}/webcenter https://${LOADBALANCER-HOSTNAME}:${LOADBALANCER-SSLPORT}/console https://${LOADBALANCER-HOSTNAME}:${LOADBALANCER-SSLPORT}/em https://${LOADBALANCER-HOSTNAME}:${LOADBALANCER-SSLPORT}/rsscrawl https://${LOADBALANCER-HOSTNAME}:${LOADBALANCER-SSLPORT}/webcenterhelp https://${LOADBALANCER-HOSTNAME}:${LOADBALANCER-SSLPORT}/rest Uninstall Apache webtier $ helm delete apache-webtier -n wcpns " +}, +{ + "uri": "/fmw-kubernetes/22.2.3/wcportal-domains/appendix/additional-configuration/", + "title": "Additional Configuration", + "tags": [], + "description": "Describes how to create connections to Oracle WebCenter Content Server to enable content integration within Oracle WebCenter Portal.", + "content": "Creating a Connection to Oracle WebCenter Content Server To enable content integration within Oracle WebCenter Portal create a connection to Oracle WebCenter Content Server using JAX-WS. Follow the steps in the documentation link to create the connection.\n Note: If the Oracle WebCenter Content Server is configured with SSL, before creating the connection, the SSL certificate should be imported into any location under mount path of domain persistent volume to avoid loss of certificate due pod restart.\n Import SSL Certificate Import the certificate using below sample command, update the keystore location to a directory under mount path of the domain persistent volume :\n$ kubectl exec -it wcp-domain-adminserver -n wcpns /bin/bash $ cd $JAVA_HOME/bin $ ./keytool -importcert -alias collab_cert -file /filepath/sslcertificate/contentcert.crt -keystore /u01/oracle/user_projects/domains/wcp-domain/DemoTrust.jks Update the TrustStore To update the truststore location edit domain.yaml file, append -Djavax.net.ssl.trustStore to the spec.serverPod.env.JAVA_OPTIONS environment variable value. The truststore location used in -Djavax.net.ssl.trustStore option should be same as keystore location where the SSL certificate has been imported.\nserverPod: # an (optional) list of environment variable to be set on the servers env: - name: JAVA_OPTIONS value: \u0026#34;-Dweblogic.StdoutDebugEnabled=true -Dweblogic.ssl.Enabled=true -Dweblogic.security.SSL.ignoreHostnameVerification=true -Djavax.net.ssl.trustStore=/u01/oracle/user_projects/domains/wcp-domain/DemoTrust.jks\u0026#34; - name: USER_MEM_ARGS value: \u0026#34;-Djava.security.egd=file:/dev/./urandom -Xms256m -Xmx1024m \u0026#34; volumes: - name: weblogic-domain-storage-volume persistentVolumeClaim: claimName: wcp-domain-domains-pvc volumeMounts: - mountPath: /u01/oracle/user_projects/domains name: weblogic-domain-storage-volume Apply the domain.yaml file to restart the Oracle WebCenter Portal domain.\n$ kubectl apply -f domain.yaml " +}, +{ + "uri": "/fmw-kubernetes/22.2.3/wcportal-domains/installguide/configure-wcp-search/", + "title": "Configure WebCenter Portal For Search", + "tags": [], + "description": "Set up search functionality in Oracle WebCenter Portal using Elasticsearch.", + "content": " Introduction Set Up Persistent Volume and Persistent Volume Claim Create a Secret Headless Service LoadBalancer LoadBalancer Validation Elasticsearch Cluster Deployment Validation Introduction Elasticsearch is a highly scalable search engine. It allows you to store, search, and analyze big volumes of data quickly and provides a distributed, multitenant-capable full-text search engine with an HTTP web interface and schema-free JSON document.\nSet Up Persistent Volume and Persistent Volume Claim Create a Kubernetes PV and PVC (Persistent Volume and Persistent Volume Claim) to store Elasticsearch data. To create PV and PVC, use the deployment YAML configuration file located at ${WORKDIR}/create-wcp-es-cluster/es-pvpvc.yaml.\napiVersion: v1 kind: PersistentVolume metadata: name: es-data-pv namespace: wcpns spec: storageClassName: es-data-pv-storage-class capacity: storage: 10Gi accessModes: - ReadWriteMany persistentVolumeReclaimPolicy: Retain hostPath: path: \u0026#34;/scratch/esdata\u0026#34; --- apiVersion: v1 kind: PersistentVolumeClaim metadata: name: es-data-pvc namespace: wcpns spec: storageClassName: es-data-pv-storage-class accessModes: - ReadWriteMany resources: requests: storage: 10Gi To create PV \u0026amp; PVC run the below command:\n$ kubectl apply -f es-pvpvc.yaml Create a Secret To grant access to Oracle WebCenter Portal, create a Kubernetes secret using the deployment YAML configuration file located at ${WORKDIR}/create-wcp-es-cluster/es-secret.yaml\napiVersion: v1 kind: Secret metadata: name: es-secret namespace: wcpns data: # base64 encoded strings wls-admin: d2VibG9naWM= wls-admin-pwd: d2VsY29tZTE= search-admin: d2NjcmF3bGFkbWlu search-admin-pwd: d2VsY29tZTE= Where: wls-admin :Oracle WebCenter Admin UserName wls-admin-pwd :Oracle WebCenter Admin Password search-admin :ElasticSearch Username search-admin-pwd : ElasticSearch Password To create Kubernetes Secret run the below command:\n$ kubectl apply -f es-secret.yaml Headless Service Each node in Elasticsearch cluster can communicate using a headless service. Create a headless service using the deployment YAML configuration file located at ${WORKDIR}/create-wcp-es-cluster/es-service.yaml to establish cluster communication.\napiVersion: v1 kind: Service metadata: name: es-svc namespace: wcpns labels: service: elasticsearch spec: # headless service clusterIP: None ports: - port: 9200 name: http - port: 9300 name: transport selector: service: elasticsearch To create Headless Service run below command:\n$ kubectl apply -f es-service.yaml LoadBalancer To access the Elasticsearch service outside of the Kubernetes cluster, create an external loadbalancer. Then access the Elasticsearch service by using the external IP of loadbalancer, create a loadbalancer using the deployment YAML configuration file located at ${WORKDIR}/create-wcp-es-cluster/es-loadbalancer.yaml.\napiVersion: v1 kind: Service metadata: name: es-loadbalancer namespace: wcpns labels: type: external spec: type: LoadBalancer selector: service: elasticsearch ports: - name: http port: 9200 targetPort: 9200 To create a loadbalancer run below command:\n$ kubectl apply -f es-loadbalancer.yaml LoadBalancer Validation Once the loadbalancer is successfully deployed, validate it by running the following command:\n$ kubectl get svc -n wcpns -l type=external Make a note of the external IP from the above command and use this below sample URL to access Elasticsearch cluster health : http://externalIP:9200/_cluster/health\nElasticsearch Cluster Using the Kubernetes StatefulSet controller create an Elasticsearch Cluster comprising of three node using the deployment YAML configuration file located at ${WORKDIR}/create-wcp-es-cluster/es-statefulset.yaml\napiVersion: apps/v1 kind: StatefulSet metadata: name: es-statefulset namespace: wcpns labels: service: elasticsearch spec: serviceName: es-svc replicas: 1 selector: matchLabels: service: elasticsearch template: metadata: labels: service: elasticsearch spec: initContainers: - name: increase-the-vm-max-map-count image: busybox command: - sysctl - -w - vm.max_map_count=262144 securityContext: privileged: true - name: increase-the-ulimit image: busybox command: - sh - -c - ulimit -n 65536 securityContext: privileged: true volumes: - name: es-node persistentVolumeClaim: claimName: es-data-pvc - name: wcp-domain persistentVolumeClaim: claimName: wcp-domain-domain-pvc containers: - name: es-container image: oracle/wcportal:12.2.1.4 imagePullPolicy: IfNotPresent command: [ \u0026#34;/bin/sh\u0026#34;, \u0026#34;-c\u0026#34;, \u0026#34;/u01/oracle/container-scripts/configureOrStartElasticsearch.sh\u0026#34; ] readinessProbe: httpGet: path: / port: 9200 httpHeaders: - name: Authorization value: Basic d2NjcmF3bGFkbWluOndlbGNvbWUx initialDelaySeconds: 150 periodSeconds: 30 timeoutSeconds: 10 successThreshold: 1 failureThreshold: 10 lifecycle: preStop: exec: command: [ \u0026#34;/bin/sh\u0026#34;, \u0026#34;-c\u0026#34;, \u0026#34;/u01/oracle/container-scripts/elasticsearchPreStopHandler.sh\u0026#34; ] ports: - containerPort: 9200 name: http - containerPort: 9300 name: tcp env: - name: NODE_NAME valueFrom: fieldRef: fieldPath: metadata.name - name: UNICAST_HOST_LIST value: \u0026#34;es-svc\u0026#34; - name: ADMIN_USERNAME valueFrom: secretKeyRef: name: es-secret key: wls-admin - name: ADMIN_PASSWORD valueFrom: secretKeyRef: name: es-secret key: wls-admin-pwd - name: SEARCH_APP_USERNAME valueFrom: secretKeyRef: name: es-secret key: search-admin - name: SEARCH_APP_USER_PASSWORD valueFrom: secretKeyRef: name: es-secret key: search-admin-pwd - name: ADMIN_SERVER_CONTAINER_NAME value: wcp-domain-adminserver - name: ADMIN_PORT value: \u0026#34;7001\u0026#34; - name: ES_CLUSTER_NAME value: es-cluster - name: DOMAIN_NAME value: wcp-domain - name: CONFIGURE_ES_CONNECTION value: \u0026#34;true\u0026#34; - name: LOAD_BALANCER_IP value: \u0026#34;es-loadbalancer.wcpns.svc.cluster.local\u0026#34; volumeMounts: - name: es-node mountPath: /u01/esHome/esNode - name: wcp-domain mountPath: /u01/oracle/user_projects/domains Note: The values used for ADMIN_PORT and Image name should be same as values passed to create-domain.sh job while creating domain.\n To create a es-statefulset run below command:\n$ kubectl apply -f es-statefulset.yaml Note: After setting up Elasticsearch cluster restart all the instance of Oracle WebCenter Portal server.\n Deployment Validation Validate the deployment by running the following command:\n$ kubectl get pods -n wcpns -l service=elasticsearch " +}, +{ + "uri": "/fmw-kubernetes/22.2.3/wcportal-domains/cleanup-domain-setup/", + "title": "Uninstall an Oracle WebCenter Portal domain", + "tags": [], + "description": "Clean up the Oracle WebCenter Portal domain setup.", + "content": "To clean up the Oracle WebCenter Portal domain setup, follow the steps below.\nDelete the Generated Domain Home To remove a domain home that you generated by running the create-domain.sh script in your production or testing environment, use the delete-domain-job.yaml file located at, \u0026lt;$WORKDIR\u0026gt;/create-wcp-domain/domain-home-on-pv/output/weblogic-domains/wcp-domain\u0026gt; directory.\n$ kubectl create -f delete-domain-job.yaml Clean Up the create-domain-job script After Execution Failure To clean up the create-domain-job script:\n Get the create domain job and configmaps:\n$ kubectl get configmaps,jobs -n wcpns |grep \u0026#34;create-domain-job\u0026#34; Delete the job and configmap:\n$ kubectl delete job job.batch/wcp-domain-create-fmw-infra-sample-domain-job -n wcpns $ kubectl delete configmap wcp-domain-create-fmw-infra-sample-domain-job-cm -n wcpns Delete the contents of the PV, if any:\n$ sudo rm -rf /scratch/kubevolume " +}, +{ + "uri": "/fmw-kubernetes/22.2.3/wcportal-domains/appendix/", + "title": "Appendix", + "tags": [], + "description": "", + "content": "This section provides information on miscellaneous tasks related to the Oracle WebCenter Portal deployment on Kubernetes.\n Domain resource sizing Describes the resourse sizing information for the Oracle WebCenter Portal domain setup on Kubernetes cluster.\n Quick start deployment on-premise Describes how to quickly get an Oracle WebCenter Portal domain instance running (using the defaults, nothing special) for development and test purposes.\n Security hardening Review resources for the Docker and Kubernetes cluster hardening.\n Additional Configuration Describes how to create connections to Oracle WebCenter Content Server to enable content integration within Oracle WebCenter Portal.\n " +}, +{ + "uri": "/fmw-kubernetes/22.2.3/wcportal-domains/", + "title": "Oracle WebCenter Portal", + "tags": [], + "description": "The WebLogic Kubernetes operator (the “operator”) supports deployment of Oracle WebCenter Portal. Follow the instructions in this guide to set up Oracle WebCenter Portal domain on Kubernetes.", + "content": "With the WebLogic Kubernetes operator (operator), you can deploy your Oracle WebCenter Portal on Kubernetes.\nIn this release, Oracle WebCenter Portal domain is based on the “domain on a persistent volume” model, where the domain home is located in a persistent volume.\nIn this release the support for Portlet Managed Server has been added.\nThe operator has several key features to assist you with deploying and managing the Oracle WebCenter Portal domain in a Kubernetes environment. You can:\n Create Oracle WebCenter Portal instances in a Kubernetes PV. This PV can reside in an Network File System (NFS) or other Kubernetes volume types. Start servers based on declarative startup parameters and desired states. Expose the Oracle WebCenter Portal services for external access. Scale Oracle WebCenter Portal domain by starting and stopping Managed Servers on demand, or by integrating with a REST API. Publish operator and WebLogic Server logs to Elasticsearch and interact with them in Kibana. Monitor the Oracle WebCenter Portal instance using Prometheus and Grafana. Current release The current release for the Oracle WebCenter Portal domain deployment on Kubernetes is 22.2.3. This release uses the WebLogic Kubernetes Operator version 3.3.0.\n Note that this release is only for evaluation purposes and hence applicable to Development and Test deployments only.\n Recent changes and known issues See the Release Notes for recent changes and known issues with the Oracle WebCenter Portal domain deployment on Kubernetes.\nAbout this documentation This documentation includes sections targeted to different audiences. To help you find what you are looking for more easily, please use this table of contents:\n Quick Start explains how to quickly get an Oracle WebCenter Portal domain instance running, using the defaults, nothing special. Note that this is only for development and test purposes.\n Install Guide and Administration Guide provide detailed information about all aspects of using the Kubernetes operator including:\n Installing and configuring the operator Using the operator to create and manage Oracle WebCenter Portal domain Configuring WebCenter Portal for Search Configuring Kubernetes load balancers Configuring Prometheus and Grafana to monitor WebCenter Portal Configuring Logging using ElasticSearch Documentation for earlier releases To view documentation for an earlier release, see:\n Version 21.2.3 " +}, +{ + "uri": "/fmw-kubernetes/22.2.3/categories/", + "title": "Categories", + "tags": [], + "description": "", + "content": "" +}, +{ + "uri": "/fmw-kubernetes/22.2.3/tags/", + "title": "Tags", + "tags": [], + "description": "", + "content": "" +}] \ No newline at end of file diff --git a/docs/22.2.3/index.xml b/docs/22.2.3/index.xml new file mode 100644 index 000000000..f02c803f3 --- /dev/null +++ b/docs/22.2.3/index.xml @@ -0,0 +1,107 @@ + + + + Oracle Fusion Middleware on Kubernetes + /fmw-kubernetes/22.2.3/ + Recent content on Oracle Fusion Middleware on Kubernetes + Hugo -- gohugo.io + en-us + Thu, 18 Apr 2019 06:46:23 -0500 + + + + + + Domain resource sizing + /fmw-kubernetes/22.2.3/wcportal-domains/appendix/wcp-cluster-sizing-info/ + Fri, 22 Feb 2019 15:44:42 -0500 + + /fmw-kubernetes/22.2.3/wcportal-domains/appendix/wcp-cluster-sizing-info/ + Oracle WebCenter Portal cluster sizing recommendations WebCenter Portal Normal Usage Moderate Usage High Usage Admin Server No of CPU(s) : 1, Memory : 4GB No of CPU(s) : 1, Memory : 4GB No of CPU(s) : 1, Memory : 4GB Number of Managed Server No of Servers : 2 No of Servers : 2 No of Servers : 3 Configurations per Managed Server No of CPU(s) : 2, Memory : 16GB No of CPU(s) : 4, Memory : 16GB No of CPU(s) : 6, Memory : 16-32GB PV Storage Minimum 250GB Minimum 250GB Minimum 500GB + + + + Traefik + /fmw-kubernetes/22.2.3/wcportal-domains/manage-wcportal-domains/configure-load-balancer/traefik/ + Fri, 22 Feb 2019 15:44:42 -0500 + + /fmw-kubernetes/22.2.3/wcportal-domains/manage-wcportal-domains/configure-load-balancer/traefik/ + To load balance Oracle WebCenter Portal domain clusters, you can install the ingress-based Traefik load balancer (version 2.2.1 or later for production deployments) and configure it for non-SSL, SSL termination, and end-to-end SSL access of the application URL. Follow these steps to set up Traefik as a load balancer for an Oracle WebCenter Portal domain in a Kubernetes cluster: + Non-SSL and SSL termination + Install the Traefik (ingress-based) load balancer Configure Traefik to manage ingresses Create an Ingress for the domain Verify domain application URL access Uninstall the Traefik ingress End-to-end SSL configuration + + + + Release Notes + /fmw-kubernetes/22.2.3/wcportal-domains/release-notes/ + Mon, 01 Jan 0001 00:00:00 +0000 + + /fmw-kubernetes/22.2.3/wcportal-domains/release-notes/ + Recent changes Date Version Change June 10, 2022 22.2.3 Only Oracle WebCenter Portal 12.2.1.4 is supported and certified with the WebLogic Kubernetes operator version 3.3.0. June 30, 2021 21.2.3 Only Oracle WebCenter Portal 12.2.1.4 is supported and certified with the WebLogic Kubernetes operator version 3.1.1. + + + + Quick start deployment on-premise + /fmw-kubernetes/22.2.3/wcportal-domains/appendix/quickstart-deployment-on-prem/ + Thu, 18 Jun 2020 15:27:38 -0500 + + /fmw-kubernetes/22.2.3/wcportal-domains/appendix/quickstart-deployment-on-prem/ + Use this Quick Start to create an Oracle WebCenter Portal domain deployment in a Kubernetes cluster (on-premise environments) with the WebLogic Kubernetes Operator. Note that this walkthrough is for demonstration purposes only, not for use in production. These instructions assume that you are already familiar with Kubernetes. If you need more detailed instructions, refer to the Install Guide. +Hardware requirements The Linux kernel supported for deploying and running Oracle WebCenter Portal domains with the operator is Oracle Linux 7 (UL6+) and Red Hat Enterprise Linux 7 (UL3+ only with standalone Kubernetes). + + + + NGINX + /fmw-kubernetes/22.2.3/wcportal-domains/manage-wcportal-domains/configure-load-balancer/nginx/ + Fri, 22 Feb 2019 15:44:42 -0500 + + /fmw-kubernetes/22.2.3/wcportal-domains/manage-wcportal-domains/configure-load-balancer/nginx/ + To load balance Oracle WebCenter Portal domain clusters, you can install the ingress-based NGINX load balancer and configure NGINX for non-SSL, SSL termination, and end-to-end SSL access of the application URL. Follow these steps to set up NGINX as a load balancer for an Oracle WebCenter Portal domain in a Kubernetes cluster: +See the official installation document for prerequisites. + Non-SSL and SSL termination + Install the NGINX load balancer Configure NGINX to manage ingresses Verify non-SSL and SSL termination access End-to-end SSL configuration + + + + Security hardening + /fmw-kubernetes/22.2.3/wcportal-domains/appendix/docker-k8s-hardening/ + Fri, 22 Feb 2019 15:44:42 -0500 + + /fmw-kubernetes/22.2.3/wcportal-domains/appendix/docker-k8s-hardening/ + Securing a Kubernetes cluster involves hardening on multiple fronts - securing the API servers, etcd, nodes, container images, container run-time, and the cluster network. Apply principles of defense in depth, principle of least privilege, and minimize the attack surface. Use security tools such as Kube-Bench to verify the cluster&rsquo;s security posture. Since Kubernetes is evolving rapidly refer to Kubernetes Security Overview for the latest information on securing a Kubernetes cluster. Also ensure the deployed Docker containers follow the Docker Security guidance. + + + + Apache webtier + /fmw-kubernetes/22.2.3/wcportal-domains/manage-wcportal-domains/configure-load-balancer/apachewebtier/ + Fri, 22 Feb 2019 15:44:42 -0500 + + /fmw-kubernetes/22.2.3/wcportal-domains/manage-wcportal-domains/configure-load-balancer/apachewebtier/ + To load balance Oracle WebCenter Portal domain clusters, you can install Apache webtier and configure it for non-SSL and SSL termination access of the application URL. Follow these steps to set up Apache webtier as a load balancer for an Oracle WebCenter Portal domain in a Kubernetes cluster: + Build the Apache webtier image Create the Apache plugin configuration file Prepare the certificate and private key Install the Apache webtier Helm chart Verify domain application URL access Uninstall Apache webtier Build the Apache webtier image To build the Apache webtier Docker image, refer to the sample. + + + + Additional Configuration + /fmw-kubernetes/22.2.3/wcportal-domains/appendix/additional-configuration/ + Mon, 01 Jan 0001 00:00:00 +0000 + + /fmw-kubernetes/22.2.3/wcportal-domains/appendix/additional-configuration/ + Creating a Connection to Oracle WebCenter Content Server To enable content integration within Oracle WebCenter Portal create a connection to Oracle WebCenter Content Server using JAX-WS. Follow the steps in the documentation link to create the connection. + Note: If the Oracle WebCenter Content Server is configured with SSL, before creating the connection, the SSL certificate should be imported into any location under mount path of domain persistent volume to avoid loss of certificate due pod restart. + + + + Uninstall an Oracle WebCenter Portal domain + /fmw-kubernetes/22.2.3/wcportal-domains/cleanup-domain-setup/ + Fri, 22 Feb 2019 15:44:42 -0500 + + /fmw-kubernetes/22.2.3/wcportal-domains/cleanup-domain-setup/ + To clean up the Oracle WebCenter Portal domain setup, follow the steps below. +Delete the Generated Domain Home To remove a domain home that you generated by running the create-domain.sh script in your production or testing environment, use the delete-domain-job.yaml file located at, &lt;$WORKDIR&gt;/create-wcp-domain/domain-home-on-pv/output/weblogic-domains/wcp-domain&gt; directory. +$ kubectl create -f delete-domain-job.yaml Clean Up the create-domain-job script After Execution Failure To clean up the create-domain-job script: + Get the create domain job and configmaps: + + + + \ No newline at end of file diff --git a/docs/22.2.3/js/auto-complete.js b/docs/22.2.3/js/auto-complete.js new file mode 100644 index 000000000..7fbde995e --- /dev/null +++ b/docs/22.2.3/js/auto-complete.js @@ -0,0 +1,223 @@ +/* + JavaScript autoComplete v1.0.4 + Copyright (c) 2014 Simon Steinberger / Pixabay + GitHub: https://github.com/Pixabay/JavaScript-autoComplete + License: http://www.opensource.org/licenses/mit-license.php +*/ + +var autoComplete = (function(){ + // "use strict"; + function autoComplete(options){ + if (!document.querySelector) return; + + // helpers + function hasClass(el, className){ return el.classList ? el.classList.contains(className) : new RegExp('\\b'+ className+'\\b').test(el.className); } + + function addEvent(el, type, handler){ + if (el.attachEvent) el.attachEvent('on'+type, handler); else el.addEventListener(type, handler); + } + function removeEvent(el, type, handler){ + // if (el.removeEventListener) not working in IE11 + if (el.detachEvent) el.detachEvent('on'+type, handler); else el.removeEventListener(type, handler); + } + function live(elClass, event, cb, context){ + addEvent(context || document, event, function(e){ + var found, el = e.target || e.srcElement; + while (el && !(found = hasClass(el, elClass))) el = el.parentElement; + if (found) cb.call(el, e); + }); + } + + var o = { + selector: 0, + source: 0, + minChars: 3, + delay: 150, + offsetLeft: 0, + offsetTop: 1, + cache: 1, + menuClass: '', + renderItem: function (item, search){ + // escape special characters + search = search.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); + var re = new RegExp("(" + search.split(' ').join('|') + ")", "gi"); + return '
' + item.replace(re, "$1") + '
'; + }, + onSelect: function(e, term, item){} + }; + for (var k in options) { if (options.hasOwnProperty(k)) o[k] = options[k]; } + + // init + var elems = typeof o.selector == 'object' ? [o.selector] : document.querySelectorAll(o.selector); + for (var i=0; i 0) + that.sc.scrollTop = selTop + that.sc.suggestionHeight + scrTop - that.sc.maxHeight; + else if (selTop < 0) + that.sc.scrollTop = selTop + scrTop; + } + } + } + addEvent(window, 'resize', that.updateSC); + document.body.appendChild(that.sc); + + live('autocomplete-suggestion', 'mouseleave', function(e){ + var sel = that.sc.querySelector('.autocomplete-suggestion.selected'); + if (sel) setTimeout(function(){ sel.className = sel.className.replace('selected', ''); }, 20); + }, that.sc); + + live('autocomplete-suggestion', 'mouseover', function(e){ + var sel = that.sc.querySelector('.autocomplete-suggestion.selected'); + if (sel) sel.className = sel.className.replace('selected', ''); + this.className += ' selected'; + }, that.sc); + + live('autocomplete-suggestion', 'mousedown', function(e){ + if (hasClass(this, 'autocomplete-suggestion')) { // else outside click + var v = this.getAttribute('data-val'); + that.value = v; + o.onSelect(e, v, this); + that.sc.style.display = 'none'; + } + }, that.sc); + + that.blurHandler = function(){ + try { var over_sb = document.querySelector('.autocomplete-suggestions:hover'); } catch(e){ var over_sb = 0; } + if (!over_sb) { + that.last_val = that.value; + that.sc.style.display = 'none'; + setTimeout(function(){ that.sc.style.display = 'none'; }, 350); // hide suggestions on fast input + } else if (that !== document.activeElement) setTimeout(function(){ that.focus(); }, 20); + }; + addEvent(that, 'blur', that.blurHandler); + + var suggest = function(data){ + var val = that.value; + that.cache[val] = data; + if (data.length && val.length >= o.minChars) { + var s = ''; + for (var i=0;i 40) && key != 13 && key != 27) { + var val = that.value; + if (val.length >= o.minChars) { + if (val != that.last_val) { + that.last_val = val; + clearTimeout(that.timer); + if (o.cache) { + if (val in that.cache) { suggest(that.cache[val]); return; } + // no requests if previous suggestions were empty + for (var i=1; i https://github.com/noelboss/featherlight/issues/317 +!function(u){"use strict";if(void 0!==u)if(u.fn.jquery.match(/-ajax/))"console"in window&&window.console.info("Featherlight needs regular jQuery, not the slim version.");else{var r=[],i=function(t){return r=u.grep(r,function(e){return e!==t&&0','
','",'
'+n.loading+"
","
",""].join("")),o="."+n.namespace+"-close"+(n.otherClose?","+n.otherClose:"");return n.$instance=i.clone().addClass(n.variant),n.$instance.on(n.closeTrigger+"."+n.namespace,function(e){if(!e.isDefaultPrevented()){var t=u(e.target);("background"===n.closeOnClick&&t.is("."+n.namespace)||"anywhere"===n.closeOnClick||t.closest(o).length)&&(n.close(e),e.preventDefault())}}),this},getContent:function(){if(!1!==this.persist&&this.$content)return this.$content;var t=this,e=this.constructor.contentFilters,n=function(e){return t.$currentTarget&&t.$currentTarget.attr(e)},r=n(t.targetAttr),i=t.target||r||"",o=e[t.type];if(!o&&i in e&&(o=e[i],i=t.target&&r),i=i||n("href")||"",!o)for(var a in e)t[a]&&(o=e[a],i=t[a]);if(!o){var s=i;if(i=null,u.each(t.contentFilters,function(){return(o=e[this]).test&&(i=o.test(s)),!i&&o.regex&&s.match&&s.match(o.regex)&&(i=s),!i}),!i)return"console"in window&&window.console.error("Featherlight: no content filter found "+(s?' for "'+s+'"':" (no target specified)")),!1}return o.process.call(t,i)},setContent:function(e){return this.$instance.removeClass(this.namespace+"-loading"),this.$instance.toggleClass(this.namespace+"-iframe",e.is("iframe")),this.$instance.find("."+this.namespace+"-inner").not(e).slice(1).remove().end().replaceWith(u.contains(this.$instance[0],e[0])?"":e),this.$content=e.addClass(this.namespace+"-inner"),this},open:function(t){var n=this;if(n.$instance.hide().appendTo(n.root),!(t&&t.isDefaultPrevented()||!1===n.beforeOpen(t))){t&&t.preventDefault();var e=n.getContent();if(e)return r.push(n),s(!0),n.$instance.fadeIn(n.openSpeed),n.beforeContent(t),u.when(e).always(function(e){n.setContent(e),n.afterContent(t)}).then(n.$instance.promise()).done(function(){n.afterOpen(t)})}return n.$instance.detach(),u.Deferred().reject().promise()},close:function(e){var t=this,n=u.Deferred();return!1===t.beforeClose(e)?n.reject():(0===i(t).length&&s(!1),t.$instance.fadeOut(t.closeSpeed,function(){t.$instance.detach(),t.afterClose(e),n.resolve()})),n.promise()},resize:function(e,t){if(e&&t&&(this.$content.css("width","").css("height",""),this.$content.parent().width()');return n.onload=function(){r.naturalWidth=n.width,r.naturalHeight=n.height,t.resolve(r)},n.onerror=function(){t.reject(r)},n.src=e,t.promise()}},html:{regex:/^\s*<[\w!][^<]*>/,process:function(e){return u(e)}},ajax:{regex:/./,process:function(e){var n=u.Deferred(),r=u("
").load(e,function(e,t){"error"!==t&&n.resolve(r.contents()),n.fail()});return n.promise()}},iframe:{process:function(e){var t=new u.Deferred,n=u("