Skip to content

Commit 8a2fd6e

Browse files
committed
Merge branch 'fix-startdb-script' into 'main'
Fix startdb script and JRF sample See merge request weblogic-cloud/weblogic-kubernetes-operator!5044
2 parents 932f5e2 + 8f40db8 commit 8a2fd6e

File tree

6 files changed

+28
-33
lines changed

6 files changed

+28
-33
lines changed

documentation/site/content/samples/domains/domain-home-on-pv/build-domain-creation-image.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,8 @@ domainInfo:
222222
rcu_prefix: '@@SECRET:@@ENV:DOMAIN_UID@@-rcu-access:rcu_prefix@@'
223223
rcu_schema_password: '@@SECRET:@@ENV:DOMAIN_UID@@-rcu-access:rcu_schema_password@@'
224224
rcu_db_conn_string: '@@SECRET:@@ENV:DOMAIN_UID@@-rcu-access:rcu_db_conn_string@@'
225+
rcu_admin_password: '@@SECRET:@@ENV:DOMAIN_UID@@-rcu-access:dba_password@@'
226+
rcu_admin_user: sys
225227
226228
topology:
227229
AdminServerName: 'admin-server'

documentation/site/content/samples/domains/domain-home-on-pv/prerequisites.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ To do this, follow the same steps as the [Quick Start](https://oracle.github.io/
127127
For more information on ingresses and load balancers, see [Ingress]({{< relref "/managing-domains/accessing-the-domain/ingress/_index.md" >}}).
128128
129129
130-
1. Obtain the WebLogic 12.2.1.4 image that is referenced by the sample's Domain resource YAML.
130+
1. Obtain the WebLogic 14.1.2.0 image that is referenced by the sample's Domain resource YAML.
131131
132132
a. Use a browser to access the [Oracle Container Registry](http://container-registry.oracle.com).
133133
@@ -169,11 +169,11 @@ A JRF domain requires an infrastructure database and requires initializing this
169169
| --------- | ----- |
170170
| database Kubernetes namespace | `default` |
171171
| database Kubernetes pod | `oracle-db` |
172-
| database image | `container-registry.oracle.com/database/enterprise:12.2.0.1-slim` |
172+
| database image | `container-registry.oracle.com/database/enterprise:19.3.0.0` |
173173
| database password | MY_DBA_PASSWORD |
174174
| infrastructure schema prefix | `FMW1` (for domain1) |
175175
| infrastructure schema password | MY_RCU_SCHEMA_PASSWORD |
176-
| database URL | `oracle-db.default.svc.cluster.local:1521/devpdb.k8s` |
176+
| database URL | `oracle-db.default.svc.cluster.local:1521/devpdb` |
177177
178178
179179
1. Ensure that you have access to the database image, and then create a deployment using it:
@@ -201,7 +201,7 @@ A JRF domain requires an infrastructure database and requires initializing this
201201
$ cd /tmp/weblogic-kubernetes-operator/kubernetes/samples/scripts/create-oracle-db-service
202202
```
203203
```shell
204-
$ start-db-service.sh
204+
$ start-db-service.sh -i container-registry.oracle.com/database/enterprise:19.3.0.0
205205
```
206206
207207
This script will deploy a database in the `default` namespace with the connect string `oracle-db.default.svc.cluster.local:1521/devpdb.k8s`, and administration password MY_DBA_PASSWORD.
@@ -231,6 +231,8 @@ For example, in this sample:
231231
rcu_prefix: '@@SECRET:@@ENV:DOMAIN_UID@@-rcu-access:rcu_prefix@@'
232232
rcu_schema_password: '@@SECRET:@@ENV:DOMAIN_UID@@-rcu-access:rcu_schema_password@@'
233233
rcu_db_conn_string: '@@SECRET:@@ENV:DOMAIN_UID@@-rcu-access:rcu_db_conn_string@@'
234+
rcu_admin_password: '@@SECRET:@@ENV:DOMAIN_UID@@-rcu-access:dba_password@@'
235+
rcu_admin_user: sys
234236
```
235237
236238
For important JRF domain information, refer to [JRF domains]({{< relref "/managing-domains/domain-on-pv/jrf-domain.md" >}}).

documentation/site/content/samples/domains/domain-home-on-pv/sample.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ The sample uses a `domain creation image` with the name `wdt-domain-image:WLS-v1
4747
In this section, you will define the PV and PVC configuration and reference the `domain creation image` created earlier in the domain resource YAML file. You will then deploy the domain resource YAML file to the namespace `sample-domain1-ns`, including the following steps:
4848

4949
- Create a Secret containing your WebLogic administrator user name and password.
50-
- If your domain type is `JRF`, create secrets containing your RCU access URL, credentials, and prefix.
50+
- If your domain type is `JRF`, create secrets containing your RCU access URL, credentials, prefix and DBA password.
5151
- Deploy a Domain YAML file that references the PV/PVC configuration and a `domain creation image` under the `spec.configuration.initializeDomainOnPV` section.
5252
- Wait for the PV and PVC to be created if they do not already exist.
5353
- Wait for domain's Pods to start and reach their ready state.
@@ -82,16 +82,18 @@ Run the following `kubectl` commands to deploy the required secrets:
8282

8383
{{%expand "Click here for the commands for deploying additional secrets for JRF." %}}
8484

85-
**NOTE**: Replace `MY_RCU_SCHEMA_PASSWORD` with the RCU schema password
86-
that you chose in the prequisite steps when
85+
**NOTE**: Replace `MY_RCU_SCHEMA_PASSWORD` with the RCU schema password and `MY_DBA_PASSWORD` with the DBA password of the database
86+
that you chose in the prerequisite steps when
8787
[setting up JRF]({{< relref "/samples/domains/domain-home-on-pv/prerequisites#additional-prerequisites-for-jrf-domains" >}}).
8888

8989
```shell
9090
$ kubectl -n sample-domain1-ns create secret generic \
9191
sample-domain1-rcu-access \
9292
--from-literal=rcu_prefix=FMW1 \
9393
--from-literal=rcu_schema_password=MY_RCU_SCHEMA_PASSWORD \
94-
--from-literal=rcu_db_conn_string=oracle-db.default.svc.cluster.local:1521/devpdb.k8s
94+
--from-literal=rcu_db_conn_string=oracle-db.default.svc.cluster.local:1521/devpdb \
95+
--from-literal=dba_user=sys \
96+
--from-literal=dba_password=MY_DBA_PASSWORD
9597
```
9698
```shell
9799
$ kubectl -n sample-domain1-ns label secret \

kubernetes/samples/scripts/create-oracle-db-service/common/oracle.db.19plus.yaml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,11 @@ spec:
4444
containers:
4545
- env:
4646
- name: ORACLE_SID
47-
value: ORCLCDB
47+
value: devcdb
4848
- name: ORACLE_PDB
49-
value: ORCLPDB1
50-
- name: DB_DOMAIN
51-
value: k8s
52-
- name: DB_BUNDLE
53-
value: basic
49+
value: devpdb
50+
- name: ORACLE_EDITION
51+
value: standard
5452
- name: ORACLE_PWD
5553
valueFrom:
5654
secretKeyRef:

kubernetes/samples/scripts/create-oracle-db-service/start-db-service.sh

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ usage() {
2222
echo " If this secret is not deployed, then Kubernetes will try pull anonymously."
2323
echo " -n Configurable Kubernetes NameSpace for Oracle DB Service (optional)"
2424
echo " (default: default) "
25-
echo " -l db pdb id for Oracle DB service (optional, default: devpdb.k8s)"
2625
echo " -h Help"
2726
exit $1
2827
}
@@ -46,8 +45,6 @@ while getopts ":a:p:i:s:n:h:l:" opt; do
4645
;;
4746
n) namespace="${OPTARG}"
4847
;;
49-
l) pdbid="${OPTARG}"
50-
;;
5148
h) usage 0
5249
;;
5350
*) usage 1
@@ -67,20 +64,18 @@ fi
6764

6865
echo "NodePort[$nodeport] ImagePullSecret[$pullsecret] Image[${dbimage}] NameSpace[${namespace}] SysSecret[${syssecret}]"
6966

70-
#create unique db yaml file if does not exists
67+
#unique db yaml file holder
7168
dbYaml=${scriptDir}/common/oracle.db.${namespace}.yaml
7269

73-
if [ ! -f "$dbYaml" ]; then
74-
echo "$dbYaml does not exist."
75-
# Choose template based on dbimage version
76-
if echo "$dbimage" | grep -q "12\."; then
77-
templateYaml="${scriptDir}/common/oracle.db.yaml"
78-
else
79-
templateYaml="${scriptDir}/common/oracle.db.19plus.yaml"
80-
fi
81-
echo "Using template: $templateYaml"
82-
cp "$templateYaml" "$dbYaml"
70+
# Choose template based on dbimage version
71+
if echo "$dbimage" | grep -q "12\."; then
72+
templateYaml="${scriptDir}/common/oracle.db.yaml"
73+
else
74+
templateYaml="${scriptDir}/common/oracle.db.19plus.yaml"
75+
pdbid="devpdb"
8376
fi
77+
echo "Using template: $templateYaml"
78+
cp "$templateYaml" "$dbYaml"
8479

8580

8681
# Modify ImagePullSecret and DatabaseImage based on input
@@ -141,10 +136,6 @@ if [ $counter -gt ${max} ]; then
141136
exit -1
142137
fi
143138

144-
# for db 19c only
145-
echo " set sys password "
146-
${KUBERNETES_CLI:-kubectl} exec -it ${dbpod} -n ${namespace} -- /bin/bash setPassword.sh Oradoc_db1
147-
148139
if [ $? != 0 ]; then
149140
echo "######################";
150141
echo "[ERROR] Could not create Oracle DB Service, check the pod log for pod ${dbpod} in namespace ${namespace}";

kubernetes/samples/scripts/create-weblogic-domain/wdt-artifacts/wdt-model-files/JRF-v1/model.10.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ domainInfo:
1010
rcu_schema_password: '@@SECRET:@@ENV:DOMAIN_UID@@-rcu-access:rcu_schema_password@@'
1111
rcu_db_conn_string: '@@SECRET:@@ENV:DOMAIN_UID@@-rcu-access:rcu_db_conn_string@@'
1212
rcu_admin_user: sys
13-
rcu_admin_password: '@@SECRET:@@ENV:DOMAIN_UID@@-rcu-access:rcu_schema_password@@'
13+
rcu_admin_password: '@@SECRET:@@ENV:DOMAIN_UID@@-rcu-access:dba_password@@'
1414

1515
topology:
1616
AdminServerName: 'admin-server'

0 commit comments

Comments
 (0)