Skip to content

Commit d8a6248

Browse files
committed
Merge branch 'develop' into owls-69919-domain-resource-properties
2 parents 97c160b + acb6e08 commit d8a6248

File tree

91 files changed

+6782
-1245
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+6782
-1245
lines changed

integration-tests/src/test/resources/setupenv.sh

Lines changed: 100 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -3,98 +3,95 @@
33
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
44

55
function clean_jenkins {
6-
echo "Cleaning."
7-
/usr/local/packages/aime/ias/run_as_root "${PROJECT_ROOT}/src/integration-tests/bash/clean_docker_k8s.sh -y"
6+
echo "Cleaning."
7+
/usr/local/packages/aime/ias/run_as_root "${PROJECT_ROOT}/src/integration-tests/bash/clean_docker_k8s.sh -y"
88
}
99

1010
function setup_jenkins {
11-
echo "Setting up."
12-
/usr/local/packages/aime/ias/run_as_root "sh ${PROJECT_ROOT}/src/integration-tests/bash/install_docker_k8s.sh -y -u wls -v ${K8S_VERSION}"
13-
set +x
14-
. ~/.dockerk8senv
15-
set -x
16-
id
17-
18-
docker login -u [email protected] -p $docker_pass wlsldi-v2.docker.oraclecorp.com
19-
docker images
20-
21-
pull_tag_images
22-
23-
export JAR_VERSION="`grep -m1 "<version>" pom.xml | cut -f2 -d">" | cut -f1 -d "<"`"
24-
# create a docker image for the operator code being tested
25-
docker build --build-arg http_proxy=$http_proxy --build-arg https_proxy=$https_proxy --build-arg no_proxy=$no_proxy -t "${IMAGE_NAME_OPERATOR}:${IMAGE_TAG_OPERATOR}" --build-arg VERSION=$JAR_VERSION --no-cache=true .
26-
docker tag "${IMAGE_NAME_OPERATOR}:${IMAGE_TAG_OPERATOR}" wlsldi-v2.docker.oraclecorp.com/weblogic-operator:latest
27-
28-
docker images
11+
echo "Setting up."
12+
/usr/local/packages/aime/ias/run_as_root "sh ${PROJECT_ROOT}/src/integration-tests/bash/install_docker_k8s.sh -y -u wls -v ${K8S_VERSION}"
13+
set +x
14+
. ~/.dockerk8senv
15+
set -x
16+
id
17+
18+
docker login -u [email protected] -p $docker_pass wlsldi-v2.docker.oraclecorp.com
19+
docker images
20+
21+
pull_tag_images
22+
23+
export JAR_VERSION="`grep -m1 "<version>" pom.xml | cut -f2 -d">" | cut -f1 -d "<"`"
24+
# create a docker image for the operator code being tested
25+
docker build --build-arg http_proxy=$http_proxy --build-arg https_proxy=$https_proxy --build-arg no_proxy=$no_proxy -t "${IMAGE_NAME_OPERATOR}:${IMAGE_TAG_OPERATOR}" --build-arg VERSION=$JAR_VERSION --no-cache=true .
26+
docker tag "${IMAGE_NAME_OPERATOR}:${IMAGE_TAG_OPERATOR}" wlsldi-v2.docker.oraclecorp.com/weblogic-operator:latest
27+
28+
docker images
2929

30-
echo "Helm installation starts"
31-
wget -q -O /tmp/helm-v2.8.2-linux-amd64.tar.gz https://kubernetes-helm.storage.googleapis.com/helm-v2.8.2-linux-amd64.tar.gz
32-
mkdir /tmp/helm
33-
tar xzf /tmp/helm-v2.8.2-linux-amd64.tar.gz -C /tmp/helm
34-
chmod +x /tmp/helm/linux-amd64/helm
35-
/usr/local/packages/aime/ias/run_as_root "cp /tmp/helm/linux-amd64/helm /usr/bin/"
36-
rm -rf /tmp/helm
37-
helm init
38-
echo "Helm is configured."
30+
echo "Helm installation starts"
31+
wget -q -O /tmp/helm-v2.8.2-linux-amd64.tar.gz https://kubernetes-helm.storage.googleapis.com/helm-v2.8.2-linux-amd64.tar.gz
32+
mkdir /tmp/helm
33+
tar xzf /tmp/helm-v2.8.2-linux-amd64.tar.gz -C /tmp/helm
34+
chmod +x /tmp/helm/linux-amd64/helm
35+
/usr/local/packages/aime/ias/run_as_root "cp /tmp/helm/linux-amd64/helm /usr/bin/"
36+
rm -rf /tmp/helm
37+
helm init
38+
echo "Helm is configured."
3939
}
4040

4141
function setup_wercker {
42-
echo "Perform setup for running in wercker"
43-
echo "Install tiller"
44-
kubectl create serviceaccount --namespace kube-system tiller
45-
kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
46-
47-
# Note: helm init --wait would wait until tiller is ready, and requires helm 2.8.2 or above
48-
helm init --service-account=tiller --wait
49-
50-
helm version
51-
52-
kubectl get po -n kube-system
53-
54-
echo "Existing helm charts "
55-
helm ls
56-
echo "Deleting installed helm charts"
57-
helm list --short | xargs -L1 helm delete --purge
58-
echo "After helm delete, list of installed helm charts is: "
59-
helm ls
60-
61-
echo "Completed setup_wercker"
42+
echo "Perform setup for running in wercker"
43+
echo "Install tiller"
44+
kubectl create serviceaccount --namespace kube-system tiller
45+
kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
46+
47+
# Note: helm init --wait would wait until tiller is ready, and requires helm 2.8.2 or above
48+
helm init --service-account=tiller --wait
49+
50+
helm version
51+
52+
kubectl get po -n kube-system
53+
54+
echo "Existing helm charts "
55+
helm ls
56+
echo "Deleting installed helm charts"
57+
helm list --short | xargs -L1 helm delete --purge
58+
echo "After helm delete, list of installed helm charts is: "
59+
helm ls
60+
61+
echo "Completed setup_wercker"
6262
}
6363

6464
function pull_tag_images {
65+
echo "Pull and tag the images we need"
6566

66-
echo "Pull and tag the images we need"
67-
docker pull wlsldi-v2.docker.oraclecorp.com/store-weblogic-12.2.1.3:latest
68-
docker tag wlsldi-v2.docker.oraclecorp.com/store-weblogic-12.2.1.3:latest store/oracle/weblogic:12.2.1.3
69-
70-
docker pull wlsldi-v2.docker.oraclecorp.com/weblogic:19.1.0.0
71-
docker tag wlsldi-v2.docker.oraclecorp.com/weblogic:19.1.0.0 store/oracle/weblogic:19.1.0.0
67+
docker pull wlsldi-v2.docker.oraclecorp.com/store-weblogic-12.2.1.3:latest
68+
docker tag wlsldi-v2.docker.oraclecorp.com/store-weblogic-12.2.1.3:latest store/oracle/weblogic:12.2.1.3
7269

73-
docker pull wlsldi-v2.docker.oraclecorp.com/store-serverjre-8:latest
74-
docker tag wlsldi-v2.docker.oraclecorp.com/store-serverjre-8:latest store/oracle/serverjre:8
70+
docker pull wlsldi-v2.docker.oraclecorp.com/weblogic:19.1.0.0
71+
docker tag wlsldi-v2.docker.oraclecorp.com/weblogic:19.1.0.0 store/oracle/weblogic:19.1.0.0
7572

76-
docker pull wlsldi-v2.docker.oraclecorp.com/weblogic-webtier-apache-12.2.1.3.0:latest
77-
docker tag wlsldi-v2.docker.oraclecorp.com/weblogic-webtier-apache-12.2.1.3.0:latest store/oracle/apache:12.2.1.3
73+
docker pull wlsldi-v2.docker.oraclecorp.com/store-serverjre-8:latest
74+
docker tag wlsldi-v2.docker.oraclecorp.com/store-serverjre-8:latest store/oracle/serverjre:8
7875

76+
docker pull wlsldi-v2.docker.oraclecorp.com/weblogic-webtier-apache-12.2.1.3.0:latest
77+
docker tag wlsldi-v2.docker.oraclecorp.com/weblogic-webtier-apache-12.2.1.3.0:latest store/oracle/apache:12.2.1.3
7978
}
8079

8180

8281
function create_image_pull_secret_jenkins {
83-
84-
echo "Creating Secret"
85-
kubectl create secret docker-registry wlsldi-secret \
82+
echo "Creating Secret"
83+
kubectl create secret docker-registry wlsldi-secret \
8684
--docker-server=wlsldi-v2.docker.oraclecorp.com \
8785
8886
--docker-password=$docker_pass \
8987
9088

91-
echo "Checking Secret"
92-
local SECRET="`kubectl get secret wlsldi-secret | grep wlsldi | wc | awk ' { print $1; }'`"
93-
if [ "$SECRET" != "1" ]; then
94-
echo 'secret wlsldi-secret was not created successfully'
95-
exit 1
96-
fi
97-
89+
echo "Checking Secret"
90+
local SECRET="`kubectl get secret wlsldi-secret | grep wlsldi | wc | awk ' { print $1; }'`"
91+
if [ "$SECRET" != "1" ]; then
92+
echo 'secret wlsldi-secret was not created successfully'
93+
exit 1
94+
fi
9895
}
9996

10097
export SCRIPTPATH="$( cd "$(dirname "$0")" > /dev/null 2>&1 ; pwd -P )"
@@ -103,21 +100,23 @@ export RESULT_ROOT=${RESULT_ROOT:-/scratch/$USER/wl_k8s_test_results}
103100
export PV_ROOT=${PV_ROOT:-$RESULT_ROOT}
104101
echo "RESULT_ROOT$RESULT_ROOT PV_ROOT$PV_ROOT"
105102
export BRANCH_NAME="${BRANCH_NAME:-$WERCKER_GIT_BRANCH}"
103+
export IMAGE_NAME_WEBLOGIC="${IMAGE_NAME_WEBLOGIC:-store/oracle/weblogic}"
104+
export IMAGE_TAG_WEBLOGIC="${IMAGE_TAG_WEBLOGIC:-19.1.0.0}"
106105

107106
if [ -z "$BRANCH_NAME" ]; then
108107
export BRANCH_NAME="`git branch | grep \* | cut -d ' ' -f2-`"
109108
if [ ! "$?" = "0" ] ; then
110-
echo "Error: Could not determine branch. Run script from within a git repo".
111-
exit 1
109+
echo "Error: Could not determine branch. Run script from within a git repo".
110+
exit 1
112111
fi
113112
fi
114113
export IMAGE_TAG_OPERATOR=${IMAGE_TAG_OPERATOR:-`echo "test_${BRANCH_NAME}" | sed "s#/#_#g"`}
115114
export IMAGE_NAME_OPERATOR=${IMAGE_NAME_OPERATOR:-wlsldi-v2.docker.oraclecorp.com/weblogic-operator}
116115

117116
cd $PROJECT_ROOT
118117
if [ $? -ne 0 ]; then
119-
echo "Couldn't change to $PROJECT_ROOT dir"
120-
exit 1
118+
echo "Couldn't change to $PROJECT_ROOT dir"
119+
exit 1
121120
fi
122121

123122
export JAR_VERSION="`grep -m1 "<version>" pom.xml | cut -f2 -d">" | cut -f1 -d "<"`"
@@ -126,40 +125,40 @@ echo IMAGE_NAME_OPERATOR $IMAGE_NAME_OPERATOR IMAGE_TAG_OPERATOR $IMAGE_TAG_OPER
126125

127126
if [ "$WERCKER" = "true" ]; then
128127

129-
echo "Test Suite is running locally on Wercker and k8s is running on remote nodes."
128+
echo "Test Suite is running locally on Wercker and k8s is running on remote nodes."
130129

131-
export IMAGE_PULL_SECRET_OPERATOR=$IMAGE_PULL_SECRET_OPERATOR
132-
export IMAGE_PULL_SECRET_WEBLOGIC=$IMAGE_PULL_SECRET_WEBLOGIC
130+
export IMAGE_PULL_SECRET_OPERATOR=$IMAGE_PULL_SECRET_OPERATOR
131+
export IMAGE_PULL_SECRET_WEBLOGIC=$IMAGE_PULL_SECRET_WEBLOGIC
133132

134-
echo "Creating Docker Secret"
135-
kubectl create secret docker-registry $IMAGE_PULL_SECRET_WEBLOGIC \
133+
echo "Creating Docker Secret"
134+
kubectl create secret docker-registry $IMAGE_PULL_SECRET_WEBLOGIC \
136135
--docker-server=index.docker.io/v1/ \
137136
--docker-username=$DOCKER_USERNAME \
138137
--docker-password=$DOCKER_PASSWORD \
139138
--docker-email=$DOCKER_EMAIL
140139

141-
echo "Checking Secret"
142-
SECRET="`kubectl get secret $IMAGE_PULL_SECRET_WEBLOGIC | grep $IMAGE_PULL_SECRET_WEBLOGIC | wc | awk ' { print $1; }'`"
143-
if [ "$SECRET" != "1" ]; then
144-
echo "secret $IMAGE_PULL_SECRET_WEBLOGIC was not created successfully"
145-
exit 1
146-
fi
140+
echo "Checking Secret"
141+
SECRET="`kubectl get secret $IMAGE_PULL_SECRET_WEBLOGIC | grep $IMAGE_PULL_SECRET_WEBLOGIC | wc | awk ' { print $1; }'`"
142+
if [ "$SECRET" != "1" ]; then
143+
echo "secret $IMAGE_PULL_SECRET_WEBLOGIC was not created successfully"
144+
exit 1
145+
fi
147146

148-
echo "Creating Registry Secret"
149-
kubectl create secret docker-registry $IMAGE_PULL_SECRET_OPERATOR \
147+
echo "Creating Registry Secret"
148+
kubectl create secret docker-registry $IMAGE_PULL_SECRET_OPERATOR \
150149
--docker-server=$REPO_REGISTRY \
151150
--docker-username=$REPO_USERNAME \
152151
--docker-password=$REPO_PASSWORD \
153152
--docker-email=$REPO_EMAIL
154153

155-
echo "Checking Secret"
156-
SECRET="`kubectl get secret $IMAGE_PULL_SECRET_OPERATOR | grep $IMAGE_PULL_SECRET_OPERATOR | wc | awk ' { print $1; }'`"
157-
if [ "$SECRET" != "1" ]; then
158-
echo "secret $IMAGE_PULL_SECRET_OPERATOR was not created successfully"
159-
exit 1
160-
fi
161-
162-
setup_wercker
154+
echo "Checking Secret"
155+
SECRET="`kubectl get secret $IMAGE_PULL_SECRET_OPERATOR | grep $IMAGE_PULL_SECRET_OPERATOR | wc | awk ' { print $1; }'`"
156+
if [ "$SECRET" != "1" ]; then
157+
echo "secret $IMAGE_PULL_SECRET_OPERATOR was not created successfully"
158+
exit 1
159+
fi
160+
161+
setup_wercker
163162

164163
elif [ "$JENKINS" = "true" ]; then
165164

@@ -194,18 +193,14 @@ elif [ "$JENKINS" = "true" ]; then
194193
/usr/local/packages/aime/ias/run_as_root "mkdir -p $PV_ROOT/acceptance_test_pv_archive"
195194
/usr/local/packages/aime/ias/run_as_root "chmod 777 $PV_ROOT/acceptance_test_pv_archive"
196195

197-
198-
199196
else
200-
pull_tag_images
201-
202-
#docker rmi -f $(docker images -q -f dangling=true)
203-
docker images --quiet --filter=dangling=true | xargs --no-run-if-empty docker rmi -f
204-
205-
docker images
197+
pull_tag_images
198+
199+
#docker rmi -f $(docker images -q -f dangling=true)
200+
docker images --quiet --filter=dangling=true | xargs --no-run-if-empty docker rmi -f
201+
202+
docker images
206203

207204
export JAR_VERSION="`grep -m1 "<version>" pom.xml | cut -f2 -d">" | cut -f1 -d "<"`"
208-
docker build --build-arg http_proxy=$http_proxy --build-arg https_proxy=$https_proxy --build-arg no_proxy=$no_proxy -t "${IMAGE_NAME_OPERATOR}:${IMAGE_TAG_OPERATOR}" --build-arg VERSION=$JAR_VERSION --no-cache=true .
209-
205+
docker build --build-arg http_proxy=$http_proxy --build-arg https_proxy=$https_proxy --build-arg no_proxy=$no_proxy -t "${IMAGE_NAME_OPERATOR}:${IMAGE_TAG_OPERATOR}" --build-arg VERSION=$JAR_VERSION --no-cache=true .
210206
fi
211-

kubernetes/charts/weblogic-operator/templates/_operator-dep.tpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ spec:
4343
volumeMounts:
4444
- name: "weblogic-operator-cm-volume"
4545
mountPath: "/operator/config"
46+
- name: "weblogic-operator-debug-cm-volume"
47+
mountPath: "/operator/debug-config"
4648
- name: "weblogic-operator-secrets-volume"
4749
mountPath: "/operator/secrets"
4850
readOnly: true
@@ -79,6 +81,10 @@ spec:
7981
- name: "weblogic-operator-cm-volume"
8082
configMap:
8183
name: "weblogic-operator-cm"
84+
- name: "weblogic-operator-debug-cm-volume"
85+
configMap:
86+
name: "weblogic-operator-debug-cm"
87+
optional: true
8288
- name: "weblogic-operator-secrets-volume"
8389
secret:
8490
secretName: "weblogic-operator-secrets"

kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/create-domain-inputs.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,15 @@ productionModeEnabled: true
5959
# The name must be lowercase
6060
weblogicCredentialsSecretName: domain1-weblogic-credentials
6161

62+
# Whether to include server .out to the pod's stdout, default is true
63+
includeServerOutInPodLog: true
64+
65+
# The in-pod name of the directory to store the domain, node manager, server logs, and server .out
66+
# files in.
67+
# If not specified or empty, domain log file, server logs, server out, and node manager log files
68+
# will be stored in the default logHome location of /shared/logs/<domainUID>/.
69+
#logHome: /shared/logs
70+
6271
# Port for the T3Channel of the NetworkAccessPoint
6372
t3ChannelPort: 30012
6473

kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/create-domain.sh

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ function initialize {
225225

226226
# Parse the commonn inputs file
227227
parseCommonInputs
228+
228229
validateInputParamsSpecified \
229230
adminServerName \
230231
domainUID \
@@ -233,6 +234,7 @@ function initialize {
233234
weblogicCredentialsSecretName \
234235
namespace \
235236
t3PublicAddress \
237+
includeServerOutInPodLog \
236238
version
237239

238240
validateIntegerInputParamsSpecified \
@@ -246,7 +248,8 @@ function initialize {
246248
validateBooleanInputParamsSpecified \
247249
productionModeEnabled \
248250
exposeAdminT3Channel \
249-
exposeAdminNodePort
251+
exposeAdminNodePort \
252+
includeServerOutInPodLog
250253

251254
export requiredInputsVersion="create-weblogic-sample-domain-inputs-v1"
252255
validateVersion
@@ -285,12 +288,6 @@ function createYamlFiles {
285288
enabledPrefix="" # uncomment the feature
286289
disabledPrefix="# " # comment out the feature
287290

288-
# For backward compatability, default to "store/oracle/weblogic:12.2.1.3" if not defined in
289-
# create-domain-inputs.yaml
290-
if [ -z "${image}" ]; then
291-
image="store/oracle/weblogic:12.2.1.3"
292-
fi
293-
294291
domainName=${domainUID}
295292

296293
# Use the default value if not defined.
@@ -395,6 +392,8 @@ function createYamlFiles {
395392
sed -i -e "s:%ADMIN_NODE_PORT%:${adminNodePort}:g" ${dcrOutput}
396393
sed -i -e "s:%JAVA_OPTIONS%:${javaOptions}:g" ${dcrOutput}
397394
sed -i -e "s:%SERVER_START_POLICY%:${serverStartPolicy}:g" ${dcrOutput}
395+
sed -i -e "s:%LOG_HOME%:${logHome}:g" ${dcrOutput}
396+
sed -i -e "s:%INCLUDE_SERVER_OUT_IN_POD_LOG%:${includeServerOutInPodLog}:g" ${dcrOutput}
398397
sed -i -e "s:%DOMAIN_PVC_NAME%:${persistentVolumeClaimName}:g" ${dcrOutput}
399398

400399
# Remove any "...yaml-e" files left over from running sed

kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/domain-custom-resource-template.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ spec:
3535
asName: "%ADMIN_SERVER_NAME%"
3636
# The Admin Server's ListenPort
3737
asPort: %ADMIN_PORT%
38+
# Whether to include the server out file into the pod's stdout, default is true
39+
includeServerOutInPodLog: %INCLUDE_SERVER_OUT_IN_POD_LOG%
40+
# The in-pod name of the directory to store the domain, node manager, server logs, and server .out
41+
# files in.
42+
# If not specified or empty, domain log file, server logs, server out, and node manager log files
43+
# will be stored in the default logHome location of /shared/logs/<domainUID>/.
44+
logHome: %LOG_HOME%
3845
# serverStartPolicy legal values are "NEVER", "ALWAYS", "IF_NEEDED", or "ADMIN_ONLY"
3946
# This determines which WebLogic Servers the Operator will start up when it discovers this Domain
4047
# - "ALWAYS" will start up all defined servers

kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/wdt/wdt_model_dynamic.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ topology:
1717
Server:
1818
'@@PROP:adminServerName@@':
1919
ListenAddress: '@@PROP:domainUID@@-@@PROP:adminServerName@@'
20-
Log:
21-
FileName: '/shared/logs/@@PROP:domainUID@@/@@PROP:adminServerName@@.log'
2220
NetworkAccessPoint:
2321
T3Channel:
2422
ListenAddress: '@@PROP:domainUID@@-@@PROP:adminServerName@@'
@@ -30,7 +28,5 @@ topology:
3028
Cluster: '@@PROP:clusterName@@'
3129
ListenAddress: '@@PROP:domainUID@@-@@PROP:managedServerNameBase@@${id}'
3230
ListenPort: '@@PROP:managedServerPort@@'
33-
Log:
34-
FileName: '/shared/logs/@@PROP:domainUID@@/@@PROP:managedServerNameBase@@${id}.log'
3531
JTAMigratableTarget:
3632
Cluster: '@@PROP:clusterName@@'

0 commit comments

Comments
 (0)