Skip to content

Commit 5a1d9d8

Browse files
example SIDB
1 parent 559238b commit 5a1d9d8

File tree

1 file changed

+24
-26
lines changed

1 file changed

+24
-26
lines changed

docs/ordsservices/examples/sidb_container.md

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,57 +2,50 @@
22

33
This example walks through using the **ORDSSRVS Controller** with a Containerised Oracle Database created by the **SIDB Controller** in the same Kubernetes Cluster.
44

5-
### Cert-Manager and Oracle Database Operator installation
6-
7-
Install the [Cert Manager](https://github.com/cert-manager/cert-manager/releases/download/v1.14.4/cert-manager.yaml) and the [Oracle Database Operator](https://github.com/oracle/oracle-database-operator) using the instractions in the Operator [README](https://github.com/oracle/oracle-database-operator/blob/main/README.md) file.
8-
5+
Before testing this example, please verify the prerequisites : [ORDSSRVS prerequisites](../README.md#prerequisites)
96

107
### Deploy a Containerised Oracle Database
118

9+
Refer to Single Instance Database (SIDB) [README](https://github.com/oracle/oracle-database-operator/blob/main/docs/sidb/README.md) for details.
10+
1211
1. Create a Secret for the Database password:
1312

1413
```bash
15-
DB_PWD=$(echo "ORDSpoc_$(date +%H%S%M)")
16-
17-
kubectl create secret generic sidb-db-auth \
18-
--from-literal=password=${DB_PWD}
14+
DB_PWD=<specify password here>
15+
kubectl create secret generic sidb-db-auth --from-literal=password=${DB_PWD} --namespace ordsnamespace
1916
```
2017
1. Create a manifest for the containerised Oracle Database.
2118

2219
The POC uses an Oracle Free Image, but other versions may be subsituted; review the OraOperator Documentation for details on the manifests.
2320

24-
```bash
25-
echo "
26-
apiVersion: database.oracle.com/v1alpha1
21+
```yaml
22+
apiVersion: database.oracle.com/v4
2723
kind: SingleInstanceDatabase
2824
metadata:
2925
name: oraoper-sidb
26+
namespace: ordsnamespace
3027
spec:
31-
replicas: 1
32-
image:
33-
pullFrom: container-registry.oracle.com/database/free:23.4.0.0
34-
prebuiltDB: true
35-
sid: FREE
3628
edition: free
3729
adminPassword:
3830
secretName: sidb-db-auth
39-
secretKey: password
40-
pdbName: FREEPDB1" | kubectl apply -f -
31+
image:
32+
pullFrom: container-registry.oracle.com/database/free:23.7.0.0
33+
prebuiltDB: true
34+
replicas: 1
4135
```
42-
<sup>latest container-registry.oracle.com/database/free version, **23.4.0.0**, valid as of **2-May-2024**</sup>
36+
<sup>latest container-registry.oracle.com/database/free version, **23.7.0.0-lite**, valid as of **2-May-2025**</sup>
37+
4338

4439
1. Watch the `singleinstancedatabases` resource until the database status is **Healthy**:
4540

4641
```bash
47-
kubectl get singleinstancedatabases/oraoper-sidb -w
42+
kubectl get singleinstancedatabases/oraoper-sidb -w -n ordsnamespace
4843
```
49-
5044
**NOTE**: If this is the first time pulling the free database image, it may take up to 15 minutes for the database to become available.
5145

5246
### Create encryped secret
5347

5448
```bash
55-
5649
openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -pkeyopt rsa_keygen_pubexp:65537 > ca.key
5750
openssl rsa -in ca.key -outform PEM -pubout -out public.pem
5851
kubectl create secret generic prvkey --from-file=privateKey=ca.key -n ordsnamespace
@@ -61,8 +54,6 @@ echo "${DB_PWD}" > sidb-db-auth
6154
openssl rsautl -encrypt -pubin -inkey public.pem -in sidb-db-auth |base64 > e_sidb-db-auth
6255
kubectl create secret generic sidb-db-auth-enc --from-file=password=e_sidb-db-auth -n ordsnamespace
6356
rm sidb-db-auth e_sidb-db-auth
64-
65-
6657
```
6758

6859

@@ -72,6 +63,7 @@ rm sidb-db-auth e_sidb-db-auth
7263

7364
```bash
7465
CONN_STRING=$(kubectl get singleinstancedatabase oraoper-sidb \
66+
-n ordsnamespace \
7567
-o jsonpath='{.status.pdbConnectString}')
7668
7769
echo $CONN_STRING
@@ -89,14 +81,17 @@ rm sidb-db-auth e_sidb-db-auth
8981

9082
```bash
9183
echo "
92-
apiVersion: database.oracle.com/v1
84+
apiVersion: database.oracle.com/v4
9385
kind: OrdsSrvs
9486
metadata:
9587
name: ords-sidb
9688
namespace: ordsnamespace
9789
spec:
9890
image: container-registry.oracle.com/database/ords:24.1.1
9991
forceRestart: true
92+
encPrivKey:
93+
secretName: prvkey
94+
passwordKey: privateKey
10095
globalSettings:
10196
database.api.enabled: true
10297
poolSettings:
@@ -112,7 +107,10 @@ rm sidb-db-auth e_sidb-db-auth
112107
secretName: sidb-db-auth-enc
113108
db.adminUser: SYS
114109
db.adminUser.secret:
115-
secretName: sidb-db-auth-enc" | kubectl apply -f -
110+
secretName: sidb-db-auth-enc
111+
" > ords-sidb.yaml
112+
113+
kubectl apply -f ords-sidb.yaml
116114
```
117115
<sup>latest container-registry.oracle.com/database/ords version, **24.1.1**, valid as of **30-May-2024**</sup>
118116

0 commit comments

Comments
 (0)