Skip to content

Commit 013f48b

Browse files
authored
Merge pull request #738 from oracle/develop
Catch master up to fix work on develop
2 parents 54d1c9b + 416f623 commit 013f48b

File tree

7 files changed

+85
-51
lines changed

7 files changed

+85
-51
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ The fastest way to experience the operator is to follow the [Quick start guide](
3535
| [#721](https://github.com/oracle/weblogic-kubernetes-operator/issues/721) | Incorrect default `domainHome` when `domainHomeInImage` is true. |
3636
| [#722](https://github.com/oracle/weblogic-kubernetes-operator/issues/722) | Server services not recreated when labels/annotations changed. |
3737
| [#726](https://github.com/oracle/weblogic-kubernetes-operator/issues/726) | Clusters only support default channel. |
38-
| [#727](https://github.com/oracle/weblogic-kubernetes-operator/issues/727) | The `listen-address` and log directories may be incorrect (pods may not start). |
3938

4039
## Operator version 1.1
4140

operator/src/main/resources/scripts/introspectDomain.py

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,14 @@ def addServerTemplates(self):
603603
self.undent()
604604

605605
def addServerTemplate(self, serverTemplate):
606+
# TBD This looks wrong. It should match addClusteredServer.
607+
# It adds default port & listen address. But:
608+
# It's missing adding admin port, SSL, and NAPs.
609+
# It reports the wrong listen address (original rather than overridden).
610+
# Probably tests are passing fine, as it's likely (A)
611+
# the Operator.java is only reading the port, and (B) cluster tests
612+
# are only looking at the cluster default port.
613+
# So: Follow up and fix this, and file test JIRAs for tests.
606614
name=self.name(serverTemplate)
607615
self.writeln("- name: " + name)
608616
if serverTemplate.isListenPortEnabled():
@@ -803,28 +811,34 @@ def customizeServers(self):
803811
for server in self.env.getDomain().getServers():
804812
self.customizeServer(server)
805813

814+
def writeListenAddress(self, originalValue, newValue):
815+
repVerb="\"replace\""
816+
if originalValue is None or len(originalValue)==0:
817+
repVerb="\"add\""
818+
self.writeln("<d:listen-address f:combine-mode=" + repVerb + ">" + newValue + "</d:listen-address>")
819+
806820
def customizeServer(self, server):
807821
name=server.getName()
808822
listen_address=self.env.toDNS1123Legal(self.env.getDomainUID() + "-" + name)
809823
self.writeln("<d:server>")
810824
self.indent()
811825
self.writeln("<d:name>" + name + "</d:name>")
812-
self.writeln("<d:listen-address f:combine-mode=\"replace\">" + listen_address + "</d:listen-address>")
813-
if server.getSSL():
814-
self.writeln("<d:ssl>")
815-
self.indent()
816-
self.writeln("<d:listen-address f:combine-mode=\"replace\">" + listen_address + "</d:listen-address>")
817-
self.undent()
818-
self.writeln("</d:ssl>")
826+
self.customizeLog(name, server, false)
827+
self.writeListenAddress(server.getListenAddress(),listen_address)
819828
for nap in server.getNetworkAccessPoints():
829+
# Don't bother 'add' a nap listen-address, only do a 'replace'.
830+
# If we try 'add' this appears to mess up an attempt to
831+
# 'add' PublicAddress/Port via custom sit-cfg.
832+
# FWIW there's theoretically no need to 'add' or 'replace' when empty
833+
# since the runtime default is the server listen-address.
820834
nap_name=nap.getName()
821-
self.writeln("<d:network-access-point>")
822-
self.indent()
823-
self.writeln("<d:name>" + nap_name + "</d:name>")
824-
self.writeln("<d:listen-address f:combine-mode=\"replace\">" + listen_address + "</d:listen-address>")
825-
self.undent()
826-
self.writeln("</d:network-access-point>")
827-
self.customizeLog(name, server, false)
835+
if not (nap.getListenAddress() is None) and len(nap.getListenAddress()) > 0:
836+
self.writeln("<d:network-access-point>")
837+
self.indent()
838+
self.writeln("<d:name>" + nap_name + "</d:name>")
839+
self.writeListenAddress("force a replace",listen_address)
840+
self.undent()
841+
self.writeln("</d:network-access-point>")
828842
self.undent()
829843
self.writeln("</d:server>")
830844

@@ -839,8 +853,8 @@ def customizeServerTemplate(self, template):
839853
self.writeln("<d:server-template>")
840854
self.indent()
841855
self.writeln("<d:name>" + name + "</d:name>")
842-
self.writeln("<d:listen-address f:combine-mode=\"replace\">" + listen_address + "</d:listen-address>")
843856
self.customizeLog(server_name_prefix + "${id}", template, false)
857+
self.writeListenAddress(template.getListenAddress(),listen_address)
844858
self.undent()
845859
self.writeln("</d:server-template>")
846860

operator/src/main/resources/scripts/startNodeManager.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,12 @@ createFolder ${NODEMGR_HOME}
111111

112112
NODEMGR_LOG_HOME=${NODEMGR_LOG_HOME:-${LOG_HOME:-${NODEMGR_HOME}/${DOMAIN_UID}}}
113113

114+
trace "Info: NODEMGR_HOME='${NODEMGR_HOME}'"
115+
trace "Info: LOG_HOME='${LOG_HOME}'"
116+
trace "Info: SERVER_NAME='${SERVER_NAME}'"
117+
trace "Info: DOMAIN_UID='${DOMAIN_UID}'"
118+
trace "Info: NODEMGR_LOG_HOME='${NODEMGR_LOG_HOME}'"
119+
114120
createFolder ${NODEMGR_LOG_HOME}
115121

116122
nodemgr_log_file=${NODEMGR_LOG_HOME}/${SERVER_NAME}_nodemanager.log

site/quickstart.md

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@ b. Log in to the Docker Store from your docker client:
3232
```
3333
$ docker login
3434
```
35-
c. Pull the operator image:
35+
c. Pull the operator image and tag it to the default image value of the operator:
3636
```
37-
$ docker pull oracle/weblogic-kubernetes-operator:2.0
37+
$ docker pull oracle/weblogic-kubernetes-operator:2.0-rc1
38+
$ docker tag oracle/weblogic-kubernetes-operator:2.0-rc1 weblogic-kubernetes-operator:2.0
3839
```
3940
d. Pull the Traefik load balancer image:
4041
```
@@ -70,17 +71,14 @@ EOF
7071

7172
Use `helm` to install the [Traefik](../kubernetes/samples/charts/traefik/README.md) load balancer. Use the [values.yaml](../kubernetes/samples/charts/traefik/values.yaml) in the sample but set `kubernetes.namespaces` specifically.
7273
```
73-
$ helm install \
74+
$ helm install stable/traefik \
7475
--name traefik-operator \
7576
--namespace traefik \
76-
--values <path>/values.yaml \
77+
--values kubernetes/samples/charts/traefik/values.yaml \
7778
--set "kubernetes.namespaces={traefik}" \
78-
stable/traefik
79-
```
80-
Wait until the Traefik operator pod is running and ready.
81-
```
82-
$ kubectl -n traefik get pod -w
79+
--wait
8380
```
81+
8482
## 3. Install the operator.
8583

8684
a. Create a namespace for the operator:
@@ -137,21 +135,18 @@ c. Configure Traefik to manage Ingresses created in this namespace:
137135
$ helm upgrade \
138136
--reuse-values \
139137
--set "kubernetes.namespaces={traefik,sample-domain1-ns}" \
138+
--wait \
140139
traefik-operator \
141140
stable/traefik
142141
```
143-
d. Wait until the Traefik operator pod finishes restarting.
144-
```
145-
$ kubectl -n traefik get pod -w
146-
```
147142

148143
## 5. Create a domain in the domain namespace.
149144

150145
a. Create a Kubernetes secret containing the `username` and `password` for the domain using the [`create-weblogic-credentials`](../kubernetes/samples/scripts/create-weblogic-domain-credentials/create-weblogic-credentials.sh) script:
151146

152147
```
153-
$ cd kubernetes/samples/scripts/create-weblogic-domain-credentials
154-
$ ./create-weblogic-credentials.sh -u weblogic -p welcome1 -n sample-domain1-ns -d sample-domain1
148+
$ kubernetes/samples/scripts/create-weblogic-domain-credentials/create-weblogic-credentials.sh \
149+
-u weblogic -p welcome1 -n sample-domain1-ns -d sample-domain1
155150
```
156151

157152
The sample will create a secret named `domainUID-weblogic-credentials` where the `domainUID` is replaced
@@ -199,16 +194,19 @@ $ kubectl get services -n sample-domain1-ns
199194
d. Create an Ingress for the domain, in the domain namespace, by using the [sample](../kubernetes/samples/charts/ingress-per-domain/README.md) Helm chart:
200195
* Use `helm install`, specifying the `domainUID` (`sample-domain1`) and domain namespace (`sample-domain1-ns`) in the `values.yaml` file.
201196
```
202-
$ cd kubernetes/samples/charts
203-
$ helm install ingress-per-domain --name domain1-ingress --values ingress-per-domain/values.yaml
197+
$ helm install kubernetes/samples/charts/ingress-per-domain \
198+
--name sample-domain1-ingress \
199+
--set wlsDomain.namespace=sample-domain1-ns \
200+
--set wlsDomain.domainUID=sample-domain1 \
201+
--set traefik.hostname=sample-domain1.org
204202
```
205203

206204
e. To confirm that the load balancer noticed the new Ingress and is successfully routing to the domain's server pods
207205
you can hit the URL for the "WebLogic Ready App" which will return a HTTP 200 status code as
208206
shown in the example below. If you used the host-based routing ingress sample you will need to
209207
provide the hostname in the `-H` option:
210208
```
211-
$ curl -v -H 'host: domain1.org' http://your.server.com:30305/weblogic/

209+
$ curl -v -H 'host: sample-domain1.org' http://your.server.com:30305/weblogic/

212210
*
About to connect() to your.server.com port 30305 (#0)

213211
* Trying 10.196.1.64...

214212
* Connected to your.server.com (10.196.1.64) port 30305 (#0)
@@ -230,10 +228,12 @@ update security lists to allow ingress to this port.
230228

231229
a. Remove the domain's Ingress by using `helm`:
232230
```
233-
$ helm delete --purge domain1-ingress
231+
$ helm delete --purge sample-domain1-ingress
234232
```
235233
b. Remove the domain resources by using the sample [`delete-weblogic-domain-resources`](../kubernetes/samples/scripts/delete-domain/delete-weblogic-domain-resources.sh) script.
236-
234+
```
235+
$ kubernetes/samples/scripts/delete-domain/delete-weblogic-domain-resources.sh -d sample-domain1
236+
```
237237
c. Use `kubectl` to confirm that the server pods and domain resource are gone.
238238
```
239239
$ kubectl get pods -n sample-domain1-ns
@@ -247,6 +247,7 @@ a. Configure the Traefik load balancer to stop managing the Ingresses in the dom
247247
$ helm upgrade \
248248
--reuse-values \
249249
--set "kubernetes.namespaces={traefik}" \
250+
--wait \
250251
traefik-operator \
251252
stable/traefik
252253
```

src/integration-tests/introspector/checkBeans.inputt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
/Log/base_domain,FileName,logs/base_domain.log,/shared/logs/base_domain.log
2+
13
/Servers/${ADMIN_NAME},ListenAddress,,${DOMAIN_UID}-${ADMIN_NAME}
4+
25
/Servers/${ADMIN_NAME}/Log/${ADMIN_NAME},FileName,logs/${ADMIN_NAME}.log,/shared/logs/${ADMIN_NAME}.log
36

47
/Servers/${ADMIN_NAME}/NetworkAccessPoints/T3Channel1,ListenAddress,unresolvable-dns-name,${DOMAIN_UID}-${ADMIN_NAME}
@@ -17,6 +20,9 @@
1720
/Servers/standalone1,MaxMessageSize,7777777,1111111
1821
/Servers/standalone2,MaxMessageSize,10000000,2222222
1922

23+
/ServerTemplates/mycluster-template/Log/mycluster-template,FileName,logs/mycluster-template.log,/shared/logs/managed-server${id}.log
24+
/ServerTemplates/mycluster-template,ListenAddress,None,domain1-managed-server${id}
25+
2026
/JDBCSystemResources/testDS/JDBCResource/testDS/JDBCDriverParams/testDS,Url,jdbc:oracle:thin:@myoriginalhostname:1521:myoriginalsid,jdbc:oracle:thin:@mynewhost:1521:mynewsid
2127
/JDBCSystemResources/testDS/JDBCResource/testDS/JDBCDriverParams/testDS,PasswordEncrypted,*,!
2228
/JDBCSystemResources/testDS/JDBCResource/testDS/JDBCDriverParams/testDS/Properties/testDS/Properties/user,Value,scott,supersecret

src/integration-tests/introspector/introspectTest.sh

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -179,14 +179,20 @@ function cleanupMajor() {
179179
function cleanupMinor() {
180180
trace "Info: RERUN_INTROSPECT_ONLY==true, skipping cleanup.sh and domain home setup, and only deleting wl pods + introspector job."
181181

182-
kubectl -n $NAMESPACE delete pod ${DOMAIN_UID}-${ADMIN_NAME} > /dev/null 2>&1
183-
kubectl -n $NAMESPACE delete pod ${DOMAIN_UID}-${MANAGED_SERVER_NAME_BASE}1 > /dev/null 2>&1
184-
kubectl -n $NAMESPACE delete job ${DOMAIN_UID}-introspect-domain-job > /dev/null 2>&1
182+
kubectl -n $NAMESPACE delete pod ${DOMAIN_UID}-${ADMIN_NAME} --grace-period=2 > /dev/null 2>&1
183+
kubectl -n $NAMESPACE delete pod ${DOMAIN_UID}-${MANAGED_SERVER_NAME_BASE}1 --grace-period=2 > /dev/null 2>&1
184+
kubectl -n $NAMESPACE delete job ${DOMAIN_UID}-introspect-domain-job --grace-period=2 > /dev/null 2>&1
185+
kubectl -n $NAMESPACE delete pod ${DOMAIN_UID}--introspect-domain-pod --grace-period=2 > /dev/null 2>&1
185186
rm -fr ${test_home}/jobfiles
186187
tracen "Info: Waiting for wl pods to completely go away before continuing."
187188
while [ 1 -eq 1 ]; do
188189
echo -n "."
189-
[ "`kubectl -n ${NAMESPACE} get pods | grep '${DOMAIN_UID}.*server'`" = "" ] && break
190+
# echo
191+
# echo "Waiting for: '`kubectl -n ${NAMESPACE} get pods | grep \"${DOMAIN_UID}.*server\"`'"
192+
# echo "Waiting for: '`kubectl -n ${NAMESPACE} get pods | grep \"${DOMAIN_UID}.*introspect\"`'"
193+
[ "`kubectl -n ${NAMESPACE} get pods | grep \"${DOMAIN_UID}.*server\"`" = "" ] \
194+
&& [ "`kubectl -n ${NAMESPACE} get pods | grep \"${DOMAIN_UID}.*introspect\"`" = "" ] \
195+
&& break
190196
sleep 1
191197
done
192198
echo
@@ -339,7 +345,7 @@ function deployTestScriptConfigMap() {
339345
cp ${SCRIPTPATH}/introspectDomainProxy.sh ${test_home}/test-scripts || exit 1
340346

341347
if [ "$CREATE_DOMAIN" = "true" ]; then
342-
rm -f ${test_home}/scripts/createDomain.py
348+
rm -f ${test_home}/test-scripts/createDomain.py
343349
${SCRIPTPATH}/util_subst.sh -g createDomain.pyt ${test_home}/test-scripts/createDomain.py || exit 1
344350
fi
345351

@@ -498,19 +504,15 @@ function deployIntrospectJobPod() {
498504

499505
trace "Info: Run introspection job, parse its output to files, and put files in configmap '$introspect_output_cm_name'."
500506

501-
# delete anything left over from a previous invocation of this function
507+
# delete anything left over from a previous invocation of this function, assume all pods
508+
# have already been cleaned up
509+
510+
rm -f ${target_yaml}
502511

503512
kubectl -n $NAMESPACE delete cm $introspect_output_cm_name \
504513
--ignore-not-found \
505514
2>&1 | tracePipe "Info: kubectl output: "
506515

507-
if [ -f "${target_yaml}" ]; then
508-
kubectl -n $NAMESPACE delete -f ${target_yaml} \
509-
--ignore-not-found \
510-
2>&1 | tracePipe "Info: kubectl output: "
511-
rm -f ${target_yaml}
512-
fi
513-
514516
trace "Info: Deploying job pod '$pod_name' and waiting for it to be ready."
515517

516518
(
@@ -755,11 +757,13 @@ function checkOverrides() {
755757
# matches
756758
#
757759

760+
758761
kubectl -n $NAMESPACE delete secret my-secret > /dev/null 2>&1
759762
kubectl -n $NAMESPACE create secret generic my-secret \
760763
--from-literal=key1=supersecret \
761764
--from-literal=key2=topsecret 2>&1 | tracePipe "Info: kubectl output: "
762765

766+
763767
if [ ! "$RERUN_INTROSPECT_ONLY" = "true" ]; then
764768

765769
cleanupMajor
@@ -785,9 +789,13 @@ else
785789

786790
cleanupMinor
787791

792+
deployDomainConfigMap
793+
deployTestScriptConfigMap
788794
deployCustomOverridesConfigMap
789-
deployIntrospectJob
795+
#deployIntrospectJob
796+
deployIntrospectJobPod
790797
deployPod ${ADMIN_NAME?}
798+
deployPod ${MANAGED_SERVER_NAME_BASE?}1
791799

792800
fi
793801

src/integration-tests/introspector/util_subst.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ sed -i -e 's;${[a-zA-Z0-9_][a-zA-Z0-9_]*:-\([^}]*\)};\1;g' $tfilename
100100
# On a failure, helpfully list the problem lines in the input file
101101
# along with the line numbers.
102102

103-
count="`grep -v 'subst-ignore-missing' $tfilename | grep -v 'env:' | grep -v 'secret:' | grep -c '\${'`"
103+
count="`grep -v 'subst-ignore-missing' $tfilename | grep -v 'env:' | grep -v 'secret:' | grep -v '\${id}' | grep -c '\${'`"
104104
if [ $count -gt 0 ]; then
105105
trace "Debug: Error, found unresolved variables in file '$sfilename':"
106106
grep -n "\${" $tfilename | sed 's/^/@ line /' | grep -v 'subst-ignore-missing'

0 commit comments

Comments
 (0)