Skip to content

Commit 6fa98e6

Browse files
authored
Merge pull request #177 from oracle/ordssrvs_documentation
Ordssrvs documentation
2 parents 559238b + e69e368 commit 6fa98e6

File tree

9 files changed

+259
-131
lines changed

9 files changed

+259
-131
lines changed

README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,7 @@ The following quickstarts are designed for specific database configurations:
189189
* [Containerized Oracle Globally Distributed Database](./docs/sharding/README.md)
190190
* [Oracle Multitenant Database](./docs/multitenant/README.md)
191191
* [Oracle Base Database Service (OBDS)](./docs/dbcs/README.md)
192-
193-
194-
The following quickstart is designed for non-database configurations:
195-
* [Oracle Database Observability](./docs/observability/README.md)
192+
* [ORDS Services (ORDSSRVS)](./docs/ordsservices/README.md)
196193
197194
198195
The following quickstart is designed for non-database configurations:

docs/ordsservices/README.md

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,53 @@ It supports the majority of ORDS configuration settings as per the [API Document
2525
The ORDS and APEX schemas can be [automatically installed/upgraded](./autoupgrade.md) into the Oracle Database by the ORDS controller.
2626

2727
ORDS Version support:
28-
* v22.1+
28+
* 24.1.1
29+
(Newer versions of ORDS will be supported in the next update of OraOperator)
2930

3031
Oracle Database Version:
3132
* 19c
3233
* 23ai (incl. 23ai Free)
3334

35+
### Prerequisites
3436

35-
### Common Configurations
37+
1. Oracle Database Operator
38+
39+
Install the Oracle Database Operator (OraOperator) using the instructions in the [README](https://github.com/oracle/oracle-database-operator/blob/main/README.md) file.
40+
41+
1. Namespace
42+
43+
For a dedicated namespace deployment of the ORDSSRVS controller, refer to the "Namespace Scoped Deployment" section in the OraOperator [README](https://github.com/oracle/oracle-database-operator/blob/main/README.md#2-namespace-scoped-deployment).
44+
45+
The following examples deploy the controller to the 'ordsnamespace' namespace.
46+
47+
Create the namespace:
48+
```bash
49+
kubectl create namespace ordsnamespace
50+
```
51+
52+
Apply namespace role binding [ordsnamespace-role-binding.yaml](./examples/ordsnamespace-role-binding.yaml):
53+
```bash
54+
kubectl apply -f ordsnamespace-role-binding.yaml
55+
```
56+
57+
Edit OraOperator to add the namespace under WATCH_NAMESPACE:
58+
```yaml
59+
- name: WATCH_NAMESPACE
60+
value: "default,<your namespaces>,ordsnamespace"
61+
```
62+
63+
### Common configuration examples
3664

3765
A few common configuration examples can be used to quickly familiarise yourself with the ORDS Custom Resource Definition.
3866
The "Conclusion" section of each example highlights specific settings to enable functionality that maybe of interest.
3967

40-
* [Containerised Single Instance Database using the Oracontroller](./examples/sidb_container.md)
41-
* [Multipool, Multidatabase using a TNS Names file](./examples/multi_pool.md)
42-
* [Autonomous Database using the Oracontroller](./examples/adb_oraoper.md) - (Customer Managed ORDS) <sup>*See [Limitations](#limitations)</sup>
43-
* [Autonomous Database without the Oracontroller](./examples/adb.md) - (Customer Managed ORDS)
68+
Before
69+
70+
* [Pre-existing Database](./examples/existing_db.md)
71+
* [Containerised Single Instance Database (SIDB)](./examples/sidb_container.md)
72+
* [Multidatabase using a TNS Names file](./examples/multi_pool.md)
73+
* [Autonomous Database using the OraOperator](./examples/adb_oraoper.md) <sup>*See [Limitations](#limitations)</sup>
74+
* [Autonomous Database without the OraOperator](./examples/adb.md)
4475
* [Oracle API for MongoDB Support](./examples/mongo_api.md)
4576

4677
Running through all examples in the same Kubernetes cluster illustrates the ability to run multiple ORDS instances with a variety of different configurations.

docs/ordsservices/examples/adb.md

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@ This example walks through using the **ORDSSRVS controller** with an Oracle Auto
55
This assumes that an ADB has already been provisioned and is configured as "Secure Access from Anywhere".
66
Note that if behind a Proxy, this example will not work as the Wallet will need to be modified to support the proxy configuration.
77

8-
9-
### Cert-Manager and Oracle Database Operator installation
10-
11-
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.
12-
8+
Before testing this example, please verify the prerequisites : [ORDSSRVS prerequisites](../README.md#prerequisites)
139

1410
### ADB Wallet Secret
1511

@@ -25,13 +21,13 @@ kubectl create secret generic adb-wallet \
2521
Create a Secret for the ADB ADMIN password, replacing <ADMIN_PASSWORD> with the real password:
2622

2723
```bash
28-
echo <ADMIN_PASSWORD> adb-db-auth-enc
29-
openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -pkeyopt rsa_keygen_pubexp:65537 > ca.k
24+
echo ${ADMIN_PASSWORD} > adb-db-auth-enc
25+
openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -pkeyopt rsa_keygen_pubexp:65537 > ca.key
3026
openssl rsa -in ca.key -outform PEM -pubout -out public.pem
3127
kubectl create secret generic prvkey --from-file=privateKey=ca.key -n ordsnamespace
32-
openssl rsautl -encrypt -pubin -inkey public.pem -in adb-db-auth-enc |base64 > e_sidb-db-auth-enc
33-
kubectl create secret generic adb-db-auth-enc --from-file=password=e_sidb-db-auth-enc -n ordsnamespace
34-
rm adb-db-auth-enc e_sidb-db-auth-enc
28+
openssl rsautl -encrypt -pubin -inkey public.pem -in adb-db-auth-enc |base64 > e_adb-db-auth-enc
29+
kubectl create secret generic adb-oraoper-db-auth-enc --from-file=password=e_adb-db-auth-enc -n ordsnamespace
30+
rm adb-db-auth-enc e_adb-db-auth-enc
3531
```
3632

3733
### Create RestDataServices Resource
@@ -43,22 +39,24 @@ rm adb-db-auth-enc e_sidb-db-auth-enc
4339

4440
Replace <ADB_NAME> with the ADB Name and ensure that the `db.wallet.zip.service` is valid for your ADB Workload (e.g. _TP or _HIGH, etc.):
4541

46-
```bash
47-
echo "
48-
apiVersion: database.oracle.com/v1
49-
kind: OrdsSrvs
42+
```yaml
43+
apiVersion: database.oracle.com/v4
44+
kind: OrdsSrvs
5045
metadata:
5146
name: ords-adb
5247
namespace: ordsnamespace
5348
spec:
5449
image: container-registry.oracle.com/database/ords:24.1.1
55-
globalSettings:
56-
database.api.enabled: true
50+
forceRestart: true
5751
encPrivKey:
5852
secretName: prvkey
5953
passwordKey: privateKey
54+
globalSettings:
55+
database.api.enabled: true
6056
poolSettings:
6157
- poolName: adb
58+
restEnabledSql.active: true
59+
plsql.gateway.mode: direct
6260
db.wallet.zip.service: <ADB_NAME>_TP
6361
dbWalletSecret:
6462
secretName: adb-wallet
@@ -68,18 +66,16 @@ rm adb-db-auth-enc e_sidb-db-auth-enc
6866
plsql.gateway.mode: proxied
6967
db.username: ORDS_PUBLIC_USER_OPER
7068
db.secret:
71-
secretName: adb-db-auth-enc
72-
passwordKey: password
69+
secretName: adb-oraoper-db-auth-enc
7370
db.adminUser: ADMIN
7471
db.adminUser.secret:
75-
secretName: adb-db-auth-enc
76-
passwordKey: password" | kubectl apply -f -
72+
secretName: adb-oraoper-db-auth-enc
7773
```
7874
<sup>latest container-registry.oracle.com/database/ords version, **24.1.1**, valid as of **30-May-2024**</sup>
7975
8076
1. Watch the restdataservices resource until the status is **Healthy**:
8177
```bash
82-
kubectl get ordssrvs ords-adb -w
78+
kubectl get -n ordsnamespace ordssrvs ords-adb -w
8379
```
8480

8581
**NOTE**: If this is the first time pulling the ORDS image, it may take up to 5 minutes. If APEX
@@ -91,7 +87,7 @@ rm adb-db-auth-enc e_sidb-db-auth-enc
9187
Open a port-forward to the ORDS service, for example:
9288

9389
```bash
94-
kubectl port-forward service/ords-adb 8443:8443
90+
kubectl port-forward service/ords-adb -n ordsnamespace 8443:8443
9591
```
9692

9793
Direct your browser to: `https://localhost:8443/ords/adb`

docs/ordsservices/examples/adb_oraoper.md

Lines changed: 36 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,15 @@ This example walks through using the **ORDS Controller** with a Containerised Or
44

55
When connecting to a mTLS enabled ADB while using the OraOperator to retreive the Wallet as is done in the example, it is currently not supported to have multiple, different databases supported by the single Ordssrvs resource. This is due to a requirement to set the `TNS_ADMIN` parameter at the Pod level ([#97](https://github.com/oracle/oracle-database-operator/issues/97)).
66

7-
### Cert-Manager and Oracle Database Operator installation
8-
9-
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.
7+
Before testing this example, please verify the prerequisites : [ORDSSRVS prerequisites](../README.md#prerequisites)
108

119
### Setup Oracle Cloud Authorisation
1210

13-
In order for the OraOperator to access the ADB, some pre-requisites are required, as detailed [here](https://github.com/oracle/oracle-database-operator/blob/main/docs/adb/ADB_PREREQUISITES.md). Either establish Instance Principles or create the required ConfigMap/Secret. This example uses the later:
11+
In order for the OraOperator to access the ADB, some additional pre-requisites are required, as detailed [here](https://github.com/oracle/oracle-database-operator/blob/main/docs/adb/ADB_PREREQUISITES.md).
12+
Either establish Instance Principles or create the required ConfigMap/Secret. This example uses the later, using the helper script [set_ocicredentials.sh](https://github.com/oracle/oracle-database-operator/blob/main/set_ocicredentials.sh) :
1413

1514
```bash
16-
kubectl create configmap oci-cred \
17-
--from-literal=tenancy=<TENANCY_OCID> \
18-
--from-literal=user=<USER_OCID> \
19-
--from-literal=fingerprint=<FINGERPRINT> \
20-
--from-literal=region=<REGION>
21-
22-
kubectl create secret generic oci-privatekey \
23-
--from-file=privatekey=<full path to private key>
15+
./set_ocicredentials.sh run -n ordsnamespace
2416
```
2517

2618
### ADB ADMIN Password Secret
@@ -31,6 +23,7 @@ Create a Secret for the ADB Admin password:
3123
DB_PWD=$(echo "ORDSpoc_$(date +%H%S%M)")
3224

3325
kubectl create secret generic adb-oraoper-db-auth \
26+
-n ordsnamespace \
3427
--from-literal=adb-oraoper-db-auth=${DB_PWD}
3528
```
3629

@@ -40,87 +33,82 @@ kubectl create secret generic adb-oraoper-db-auth \
4033

4134
1. Obtain the OCID of the ADB and set to an environment variable:
4235

43-
```
44-
export ADB_OCID=<insert OCID here>
45-
```
36+
```bash
37+
export ADB_OCID=<insert OCID here>
38+
```
4639

47-
1. Create a manifest to bind to the ADB.
40+
1. Create and apply a manifest to bind to the ADB.
41+
"adb-oraoper-tns-admin" secret will be created by the controller.
4842

49-
```bash
50-
echo "
51-
apiVersion: database.oracle.com/v1alpha1
43+
```yaml
44+
apiVersion: database.oracle.com/v4
5245
kind: AutonomousDatabase
5346
metadata:
5447
name: adb-oraoper
48+
namespace: ordsnamespace
5549
spec:
56-
hardLink: false
57-
ociConfig:
58-
configMapName: oci-cred
59-
secretName: oci-privatekey
60-
details:
61-
autonomousDatabaseOCID: $ADB_OCID
62-
wallet:
50+
action: Sync
51+
wallet:
6352
name: adb-oraoper-tns-admin
6453
password:
6554
k8sSecret:
66-
name: adb-oraoper-db-auth" | kubectl apply -f -
55+
name: adb-oraoper-db-auth
56+
details:
57+
id: $ADB_OCID
6758
```
6859

6960
1. Update the ADMIN Password:
7061

71-
```bash
72-
kubectl patch adb adb-oraoper --type=merge \
73-
-p '{"spec":{"details":{"adminPassword":{"k8sSecret":{"name":"adb-oraoper-db-auth"}}}}}'
74-
```
62+
```bash
63+
kubectl patch adb adb-oraoper --type=merge \
64+
-n ordsnamespace \
65+
-p '{"spec":{"details":{"adminPassword":{"k8sSecret":{"name":"adb-oraoper-db-auth"}}}}}'
66+
```
7567

7668
1. Watch the `adb` resource until the STATE is **AVAILABLE**:
7769

7870
```bash
79-
kubectl get adb/adb-oraoper -w
71+
kubectl get -n ordsnamespace adb/adb-oraoper -w
8072
```
8173

8274
### Create encrypted password
8375

84-
8576
```bash
86-
echo ${DB_PWD} adb-db-auth-enc
87-
openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -pkeyopt rsa_keygen_pubexp:65537 > ca.k
77+
echo ${DB_PWD} > adb-db-auth-enc
78+
openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -pkeyopt rsa_keygen_pubexp:65537 > ca.key
8879
openssl rsa -in ca.key -outform PEM -pubout -out public.pem
8980
kubectl create secret generic prvkey --from-file=privateKey=ca.key -n ordsnamespace
9081
openssl rsautl -encrypt -pubin -inkey public.pem -in adb-db-auth-enc |base64 > e_adb-db-auth-enc
9182
kubectl create secret generic adb-oraoper-db-auth-enc --from-file=password=e_adb-db-auth-enc -n ordsnamespace
9283
rm adb-db-auth-enc e_adb-db-auth-enc
9384
```
9485

95-
96-
9786
### Create OrdsSrvs Resource
9887

9988
1. Obtain the Service Name from the OraOperator
10089

101-
```bash
102-
SERVICE_NAME=$(kubectl get adb adb-oraoper -o=jsonpath='{.spec.details.dbName}'_TP)
103-
```
90+
```bash
91+
SERVICE_NAME=$(kubectl get -n ordsnamespace adb adb-oraoper -o=jsonpath='{.spec.details.dbName}'_TP)
92+
```
10493

10594
1. Create a manifest for ORDS.
10695

10796
As an ADB already maintains ORDS and APEX, `autoUpgradeORDS` and `autoUpgradeAPEX` will be ignored if set. A new DB User for ORDS will be created to avoid conflict with the pre-provisioned one. This user will be
10897
named, `ORDS_PUBLIC_USER_OPER` if `db.username` is either not specified or set to `ORDS_PUBLIC_USER`.
10998

110-
```bash
111-
echo "
112-
apiVersion: database.oracle.com/v1
99+
```yaml
100+
apiVersion: database.oracle.com/v4
113101
kind: OrdsSrvs
114102
metadata:
115103
name: ords-adb-oraoper
116104
namespace: ordsnamespace
117105
spec:
118106
image: container-registry.oracle.com/database/ords:24.1.1
119107
forceRestart: true
120-
encPrivKey:
121-
secretName: prvkey
122-
passwordKey: privateKey
123-
globalSettings:
108+
encPrivKey:
109+
secretName: prvkey
110+
passwordKey: privateKey
111+
globalSettings:
124112
database.api.enabled: true
125113
poolSettings:
126114
- poolName: adb-oraoper
@@ -134,11 +122,9 @@ rm adb-db-auth-enc e_adb-db-auth-enc
134122
db.username: ORDS_PUBLIC_USER_OPER
135123
db.secret:
136124
secretName: adb-oraoper-db-auth-enc
137-
passwordKey: adb-oraoper-db-auth-enc
138125
db.adminUser: ADMIN
139126
db.adminUser.secret:
140127
secretName: adb-oraoper-db-auth-enc
141-
passwordKey: adb-oraoper-db-auth-enc" | kubectl apply -f -
142128
```
143129
<sup>latest container-registry.oracle.com/database/ords version, **24.1.1**, valid as of **30-May-2024**</sup>
144130

@@ -157,7 +143,7 @@ rm adb-db-auth-enc e_adb-db-auth-enc
157143
Open a port-forward to the ORDS service, for example:
158144

159145
```bash
160-
kubectl port-forward service/ords-adb-oraoper 8443:8443
146+
kubectl port-forward service/ords-adb-oraoper -n ordsnamespace 8443:8443
161147
```
162148

163149
Direct your browser to: `https://localhost:8443/ords/adb-oraoper`

0 commit comments

Comments
 (0)