Skip to content

Commit 187707d

Browse files
authored
Merge pull request #39 from oracle/release/0.2.1
Release/0.2.1
2 parents 86f22f5 + 2847800 commit 187707d

File tree

92 files changed

+3790
-725
lines changed

Some content is hidden

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

92 files changed

+3790
-725
lines changed

README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
As part of Oracle's resolution to make Oracle Database Kubernetes-native (that is, observable and operable by Kubernetes), Oracle released _Oracle Database Operator for Kubernetes_ (`OraOperator` or the operator). OraOperator extends the Kubernetes API with custom resources and controllers for automating Oracle Database lifecycle management.
66

7-
In this v0.2.0 release, `OraOperator` supports the following database configurations and infrastructure:
7+
In this v0.2.1 release, `OraOperator` supports the following database configurations and infrastructure:
88

99
* Oracle Autonomous Database on shared Oracle Cloud Infrastructure (OCI) (ADB-S)
1010
* Oracle Autonomous Database on dedicated Cloud infrastructure (ADB-D)
1111
* Containerized Single Instance databases (SIDB) deployed in the Oracle Kubernetes Engine (OKE) and any k8s where OraOperator is deployed
1212
* Containerized Sharded databases (SHARDED) deployed in OKE and any k8s where OraOperator is deployed
13-
* Oracle On-Premises Databases (CDB/PDBs, Exadata)
13+
* Oracle Multitenant Databases (CDB/PDBs)
1414
* Oracle Database Cloud Service (DBCS) (VMDB)
1515
* Oracle Autonomous Container Database (ACD) (infrastructure) the infrastructure for provisionning Autonomous Databases.
1616

@@ -25,14 +25,14 @@ This release of Oracle Database Operator for Kubernetes (the operator) supports
2525
* ACD: provision, bind, restart, terminate (soft/hard)
2626
* SIDB: Provision, clone, patch (in-place/out-of-place), update database initialization parameters, update database configuration (Flashback, archiving), Oracle Enterprise Manager (EM) Express (a basic observability console), Oracle REST Data Service (ORDS) to support REST based SQL, PDB management, SQL Developer Web, and Application Express (Apex)
2727
* SHARDED: Provision/deploy sharded databases and the shard topology, Add a new shard, Delete an existing shard
28-
* On-Premises Database: Bind to a CDB, Create a  PDB, Plug a  PDB, Unplug a PDB, Delete a PDB, Clone a PDB, Open/Close a PDB
28+
* Oracle Multitenant Database: Bind to a CDB, Create a  PDB, Plug a  PDB, Unplug a PDB, Delete a PDB, Clone a PDB, Open/Close a PDB
2929
* Database Cloud Service: Provision, Bind, Scale Up/Down, Liveness Probe, Manual Backup
3030

3131
The upcoming releases will support new configurations, operations and capabilities.
3232

3333
## Release Status
3434

35-
**CAUTION:** The current release of `OraOperator` (v0.2.0) is for development and testing only. DO NOT USE IN PRODUCTION.
35+
**CAUTION:** The current release of `OraOperator` (v0.2.1) is for development and testing only. DO NOT USE IN PRODUCTION.
3636

3737
This release has been installed and tested on the following Kubernetes platforms:
3838

@@ -69,7 +69,7 @@ Oracle strongly recommends that you ensure your system meets the following [Prer
6969
```
7070
---
7171
**NOTE:**
72-
The above command will also upgrade the existing v0.1.0 `OraOperator` installation to the latest version i.e. v0.2.0.
72+
The above command will also upgrade the existing v0.2.0 `OraOperator` installation to the latest version i.e. v0.2.1.
7373

7474
---
7575

@@ -99,7 +99,7 @@ The quickstarts are designed for specific database configurations:
9999
* [Oracle Autonomous Container Database](./docs/acd/README.md)
100100
* [Containerized Oracle Single Instance Database](./docs/sidb/README.md)
101101
* [Containerized Oracle Sharded Database](./docs/sharding/README.md)
102-
* [Oracle On-Premises Database](./docs/onpremdb/README.md)
102+
* [Oracle Multitenant Database](./docs/multitenant/README.md)
103103
* [Oracle Database Cloud Service](./docs/dbcs/README.md)
104104

105105
YAML file templates are available under [`/config/samples`](./config/samples/). You can copy and edit these template files to configure them for your use cases.

apis/database/v1alpha1/cdb_types.go

+16-3
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,18 @@ type CDBSpec struct {
5151
CDBName string `json:"cdbName,omitempty"`
5252
// Name of the CDB Service
5353
ServiceName string `json:"serviceName,omitempty"`
54+
55+
5456
// Password for the CDB System Administrator
5557
SysAdminPwd CDBSysAdminPassword `json:"sysAdminPwd,omitempty"`
5658
// User in the root container with sysdba priviledges to manage PDB lifecycle
5759
CDBAdminUser CDBAdminUser `json:"cdbAdminUser,omitempty"`
5860
// Password for the CDB Administrator to manage PDB lifecycle
5961
CDBAdminPwd CDBAdminPassword `json:"cdbAdminPwd,omitempty"`
62+
63+
CDBTlsKey CDBTLSKEY `json:"cdbTlsKey,omitempty"`
64+
CDBTlsCrt CDBTLSCRT `json:"cdbTlsCrt,omitempty"`
65+
6066
// Password for user ORDS_PUBLIC_USER
6167
ORDSPwd ORDSPassword `json:"ordsPwd,omitempty"`
6268
// ORDS server port. For now, keep it as 8888. TO BE USED IN FUTURE RELEASE.
@@ -74,14 +80,13 @@ type CDBSpec struct {
7480
WebServerUser WebServerUser `json:"webServerUser,omitempty"`
7581
// Password for the Web Server User
7682
WebServerPwd WebServerPassword `json:"webServerPwd,omitempty"`
77-
// SCAN Name
78-
SCANName string `json:"scanName,omitempty"`
7983
// Name of the DB server
8084
DBServer string `json:"dbServer,omitempty"`
8185
// DB server port
8286
DBPort int `json:"dbPort,omitempty"`
8387
// Node Selector for running the Pod
8488
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
89+
DBTnsurl string `json:"dbTnsurl,omitempty"`
8590
}
8691

8792
// CDBSecret defines the secretName
@@ -120,6 +125,14 @@ type WebServerPassword struct {
120125
Secret CDBSecret `json:"secret"`
121126
}
122127

128+
type CDBTLSKEY struct {
129+
Secret CDBSecret `json:"secret"`
130+
}
131+
132+
type CDBTLSCRT struct {
133+
Secret CDBSecret `json:"secret"`
134+
}
135+
123136
// CDBStatus defines the observed state of CDB
124137
type CDBStatus struct {
125138
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
@@ -138,7 +151,7 @@ type CDBStatus struct {
138151
// +kubebuilder:printcolumn:JSONPath=".spec.cdbName",name="CDB Name",type="string",description="Name of the CDB"
139152
// +kubebuilder:printcolumn:JSONPath=".spec.dbServer",name="DB Server",type="string",description=" Name of the DB Server"
140153
// +kubebuilder:printcolumn:JSONPath=".spec.dbPort",name="DB Port",type="integer",description="DB server port"
141-
// +kubebuilder:printcolumn:JSONPath=".spec.scanName",name="SCAN Name",type="string",description="SCAN Name"
154+
// +kubebuilder:printcolumn:JSONPath=".spec.dbTnsurl",name="TNS STRING",type="string",description=" string of the tnsalias"
142155
// +kubebuilder:printcolumn:JSONPath=".spec.replicas",name="Replicas",type="integer",description="Replicas"
143156
// +kubebuilder:printcolumn:JSONPath=".status.phase",name="Status",type="string",description="Status of the CDB Resource"
144157
// +kubebuilder:printcolumn:JSONPath=".status.msg",name="Message",type="string",description="Error message, if any"

apis/database/v1alpha1/cdb_webhook.go

+25-7
Original file line numberDiff line numberDiff line change
@@ -88,23 +88,41 @@ func (r *CDB) ValidateCreate() error {
8888

8989
var allErrs field.ErrorList
9090

91-
if r.Spec.ServiceName == "" {
91+
if r.Spec.ServiceName == "" && r.Spec.DBServer != "" {
9292
allErrs = append(allErrs,
9393
field.Required(field.NewPath("spec").Child("serviceName"), "Please specify CDB Service name"))
9494
}
95-
if r.Spec.SCANName == "" {
95+
96+
if reflect.ValueOf(r.Spec.CDBTlsKey).IsZero() {
97+
allErrs = append(allErrs,
98+
field.Required(field.NewPath("spec").Child("cdbTlsKey"), "Please specify CDB Tls key(secret)"))
99+
}
100+
101+
if reflect.ValueOf(r.Spec.CDBTlsCrt).IsZero() {
102+
allErrs = append(allErrs,
103+
field.Required(field.NewPath("spec").Child("cdbTlsCrt"), "Please specify CDB Tls Certificate(secret)"))
104+
}
105+
106+
/*if r.Spec.SCANName == "" {
96107
allErrs = append(allErrs,
97108
field.Required(field.NewPath("spec").Child("scanName"), "Please specify SCAN Name for CDB"))
98-
}
99-
if r.Spec.DBServer == "" {
109+
}*/
110+
111+
if ((r.Spec.DBServer == "" && r.Spec.DBTnsurl == "") || (r.Spec.DBServer != "" && r.Spec.DBTnsurl != "")) {
100112
allErrs = append(allErrs,
101-
field.Required(field.NewPath("spec").Child("dbServer"), "Please specify Database Server Name or IP Address"))
113+
field.Required(field.NewPath("spec").Child("dbServer"), "Please specify Database Server Name/IP Address or tnsalias string"))
102114
}
103-
if r.Spec.DBPort == 0 {
115+
116+
if r.Spec.DBTnsurl != "" && ( r.Spec.DBServer != "" || r.Spec.DBPort != 0 || r.Spec.ServiceName != "" ) {
117+
allErrs = append(allErrs,
118+
field.Required(field.NewPath("spec").Child("dbServer"), "DBtnsurl is orthogonal to (DBServer,DBport,Services)"))
119+
}
120+
121+
if r.Spec.DBPort == 0 && r.Spec.DBServer != "" {
104122
allErrs = append(allErrs,
105123
field.Required(field.NewPath("spec").Child("dbPort"), "Please specify DB Server Port"))
106124
}
107-
if r.Spec.DBPort < 0 {
125+
if r.Spec.DBPort < 0 && r.Spec.DBServer != "" {
108126
allErrs = append(allErrs,
109127
field.Required(field.NewPath("spec").Child("dbPort"), "Please specify a valid DB Server Port"))
110128
}

apis/database/v1alpha1/oraclerestdataservice_webhook.go

-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
package v1alpha1
4040

4141
import (
42-
4342
apierrors "k8s.io/apimachinery/pkg/api/errors"
4443
"k8s.io/apimachinery/pkg/runtime"
4544
"k8s.io/apimachinery/pkg/runtime/schema"

apis/database/v1alpha1/pdb_types.go

+17-1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ type PDBSpec struct {
4747
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
4848
// Important: Run "make" to regenerate code after modifying this file
4949

50+
PDBTlsKey PDBTLSKEY `json:"pdbTlsKey,omitempty"`
51+
PDBTlsCrt PDBTLSCRT `json:"pdbTlsCrt,omitempty"`
52+
PDBTlsCat PDBTLSCAT `json:"pdbTlsCat,omitempty"`
53+
5054
// Name of the CDB Custom Resource that runs the ORDS container
5155
CDBResName string `json:"cdbResName,omitempty"`
5256
// Name of the CDB
@@ -132,6 +136,18 @@ type PDBSecret struct {
132136
Key string `json:"key"`
133137
}
134138

139+
type PDBTLSKEY struct {
140+
Secret PDBSecret `json:"secret"`
141+
}
142+
143+
type PDBTLSCRT struct {
144+
Secret PDBSecret `json:"secret"`
145+
}
146+
147+
type PDBTLSCAT struct {
148+
Secret PDBSecret `json:"secret"`
149+
}
150+
135151
// PDBStatus defines the observed state of PDB
136152
type PDBStatus struct {
137153
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
@@ -157,7 +173,7 @@ type PDBStatus struct {
157173

158174
// +kubebuilder:object:root=true
159175
// +kubebuilder:subresource:status
160-
// +kubebuilder:printcolumn:JSONPath=".status.connString",name="Connect String",type="string",description="The connect string to be used"
176+
// +kubebuilder:printcolumn:JSONPath=".status.connString",name="Connect_String",type="string",description="The connect string to be used"
161177
// +kubebuilder:printcolumn:JSONPath=".spec.cdbName",name="CDB Name",type="string",description="Name of the CDB"
162178
// +kubebuilder:printcolumn:JSONPath=".spec.pdbName",name="PDB Name",type="string",description="Name of the PDB"
163179
// +kubebuilder:printcolumn:JSONPath=".status.openMode",name="PDB State",type="string",description="PDB Open Mode"

apis/database/v1alpha1/pdb_webhook.go

+29-2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@
3636
** SOFTWARE.
3737
*/
3838

39+
/* MODIFIED (MM/DD/YY)
40+
** rcitton 07/14/22 - 33822886
41+
*/
42+
3943
package v1alpha1
4044

4145
import (
@@ -143,6 +147,21 @@ func (r *PDB) validateAction(allErrs *field.ErrorList) {
143147

144148
pdblog.Info("Valdiating PDB Resource Action : " + action)
145149

150+
if reflect.ValueOf(r.Spec.PDBTlsKey).IsZero() {
151+
*allErrs = append(*allErrs,
152+
field.Required(field.NewPath("spec").Child("pdbTlsKey"), "Please specify PDB Tls Key(secret)"))
153+
}
154+
155+
if reflect.ValueOf(r.Spec.PDBTlsCrt).IsZero() {
156+
*allErrs = append(*allErrs,
157+
field.Required(field.NewPath("spec").Child("pdbTlsCrt"), "Please specify PDB Tls Certificate(secret)"))
158+
}
159+
160+
if reflect.ValueOf(r.Spec.PDBTlsCat).IsZero() {
161+
*allErrs = append(*allErrs,
162+
field.Required(field.NewPath("spec").Child("pdbTlsCat"), "Please specify PDB Tls Certificate Authority(secret)"))
163+
}
164+
146165
switch action {
147166
case "CREATE":
148167
if reflect.ValueOf(r.Spec.AdminName).IsZero() {
@@ -157,6 +176,14 @@ func (r *PDB) validateAction(allErrs *field.ErrorList) {
157176
*allErrs = append(*allErrs,
158177
field.Required(field.NewPath("spec").Child("fileNameConversions"), "Please specify a value for fileNameConversions. Values can be a filename convert pattern or NONE"))
159178
}
179+
if r.Spec.TotalSize == "" {
180+
*allErrs = append(*allErrs,
181+
field.Required(field.NewPath("spec").Child("totalSize"), "When the storage is not UNLIMITED the Total Size must be specified"))
182+
}
183+
if r.Spec.TempSize == "" {
184+
*allErrs = append(*allErrs,
185+
field.Required(field.NewPath("spec").Child("tempSize"), "When the storage is not UNLIMITED the Temp Size must be specified"))
186+
}
160187
if *(r.Spec.TDEImport) {
161188
r.validateTDEInfo(allErrs)
162189
}
@@ -168,11 +195,11 @@ func (r *PDB) validateAction(allErrs *field.ErrorList) {
168195
}
169196
if r.Spec.TotalSize == "" {
170197
*allErrs = append(*allErrs,
171-
field.Required(field.NewPath("spec").Child("totalSize"), "Please specify size of the tablespace"))
198+
field.Required(field.NewPath("spec").Child("totalSize"), "When the storage is not UNLIMITED the Total Size must be specified"))
172199
}
173200
if r.Spec.TempSize == "" {
174201
*allErrs = append(*allErrs,
175-
field.Required(field.NewPath("spec").Child("tempSize"), "Please specify size of the temporary tablespace"))
202+
field.Required(field.NewPath("spec").Child("tempSize"), "When the storage is not UNLIMITED the Temp Size must be specified"))
176203
}
177204
case "PLUG":
178205
if r.Spec.XMLFileName == "" {

apis/database/v1alpha1/singleinstancedatabase_types.go

+37-24
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,18 @@ type SingleInstanceDatabaseSpec struct {
5757
// +k8s:openapi-gen=true
5858
// +kubebuilder:validation:Pattern=`^[a-zA-Z0-9]+$`
5959
// +kubebuilder:validation:MaxLength:=12
60-
Sid string `json:"sid,omitempty"`
61-
Charset string `json:"charset,omitempty"`
62-
Pdbname string `json:"pdbName,omitempty"`
63-
LoadBalancer bool `json:"loadBalancer,omitempty"`
64-
ServiceAnnotations map[string]string `json:"serviceAnnotations,omitempty"`
65-
FlashBack bool `json:"flashBack,omitempty"`
66-
ArchiveLog bool `json:"archiveLog,omitempty"`
67-
ForceLogging bool `json:"forceLog,omitempty"`
60+
Sid string `json:"sid,omitempty"`
61+
Charset string `json:"charset,omitempty"`
62+
Pdbname string `json:"pdbName,omitempty"`
63+
LoadBalancer bool `json:"loadBalancer,omitempty"`
64+
ListenerPort int `json:"listenerPort,omitempty"`
65+
TcpsListenerPort int `json:"tcpsListenerPort,omitempty"`
66+
ServiceAnnotations map[string]string `json:"serviceAnnotations,omitempty"`
67+
FlashBack bool `json:"flashBack,omitempty"`
68+
ArchiveLog bool `json:"archiveLog,omitempty"`
69+
ForceLogging bool `json:"forceLog,omitempty"`
70+
EnableTCPS bool `json:"enableTCPS,omitempty"`
71+
TcpsCertRenewInterval string `json:"tcpsCertRenewInterval,omitempty"`
6872

6973
CloneFrom string `json:"cloneFrom,omitempty"`
7074
ReadinessCheckPeriod int `json:"readinessCheckPeriod,omitempty"`
@@ -128,24 +132,31 @@ type SingleInstanceDatabaseStatus struct {
128132
DatafilesPatched string `json:"datafilesPatched,omitempty"`
129133
ConnectString string `json:"connectString,omitempty"`
130134
ClusterConnectString string `json:"clusterConnectString,omitempty"`
135+
TcpsConnectString string `json:"tcpsConnectString,omitempty"`
131136
StandbyDatabases map[string]string `json:"standbyDatabases,omitempty"`
132137
// +kubebuilder:default:="false"
133-
DatafilesCreated string `json:"datafilesCreated,omitempty"`
134-
Sid string `json:"sid,omitempty"`
135-
Edition string `json:"edition,omitempty"`
136-
Charset string `json:"charset,omitempty"`
137-
Pdbname string `json:"pdbName,omitempty"`
138-
InitSgaSize int `json:"initSgaSize,omitempty"`
139-
InitPgaSize int `json:"initPgaSize,omitempty"`
140-
CloneFrom string `json:"cloneFrom,omitempty"`
141-
FlashBack string `json:"flashBack,omitempty"`
142-
ArchiveLog string `json:"archiveLog,omitempty"`
143-
ForceLogging string `json:"forceLog,omitempty"`
144-
OemExpressUrl string `json:"oemExpressUrl,omitempty"`
145-
OrdsReference string `json:"ordsReference,omitempty"`
146-
PdbConnectString string `json:"pdbConnectString,omitempty"`
147-
ApexInstalled bool `json:"apexInstalled,omitempty"`
148-
PrebuiltDB bool `json:"prebuiltDB,omitempty"`
138+
DatafilesCreated string `json:"datafilesCreated,omitempty"`
139+
Sid string `json:"sid,omitempty"`
140+
Edition string `json:"edition,omitempty"`
141+
Charset string `json:"charset,omitempty"`
142+
Pdbname string `json:"pdbName,omitempty"`
143+
InitSgaSize int `json:"initSgaSize,omitempty"`
144+
InitPgaSize int `json:"initPgaSize,omitempty"`
145+
CloneFrom string `json:"cloneFrom,omitempty"`
146+
FlashBack string `json:"flashBack,omitempty"`
147+
ArchiveLog string `json:"archiveLog,omitempty"`
148+
ForceLogging string `json:"forceLog,omitempty"`
149+
OemExpressUrl string `json:"oemExpressUrl,omitempty"`
150+
OrdsReference string `json:"ordsReference,omitempty"`
151+
PdbConnectString string `json:"pdbConnectString,omitempty"`
152+
TcpsPdbConnectString string `json:"tcpsPdbConnectString,omitempty"`
153+
ApexInstalled bool `json:"apexInstalled,omitempty"`
154+
PrebuiltDB bool `json:"prebuiltDB,omitempty"`
155+
// +kubebuilder:default:=false
156+
IsTcpsEnabled bool `json:"isTcpsEnabled"`
157+
CertCreationTimestamp string `json:"certCreationTimestamp,omitempty"`
158+
CertRenewInterval string `json:"certRenewInterval,omitempty"`
159+
ClientWalletLoc string `json:"clientWalletLoc,omitempty"`
149160

150161
// +patchMergeKey=type
151162
// +patchStrategy=merge
@@ -165,7 +176,9 @@ type SingleInstanceDatabaseStatus struct {
165176
// +kubebuilder:printcolumn:JSONPath=".status.role",name="Role",type="string",priority=1
166177
// +kubebuilder:printcolumn:JSONPath=".status.releaseUpdate",name="Version",type="string"
167178
// +kubebuilder:printcolumn:JSONPath=".status.connectString",name="Connect Str",type="string"
179+
// +kubebuilder:printcolumn:JSONPath=".status.tcpsConnectString",name="TCPS Connect Str",type="string"
168180
// +kubebuilder:printcolumn:JSONPath=".status.pdbConnectString",name="Pdb Connect Str",type="string",priority=1
181+
// +kubebuilder:printcolumn:JSONPath=".status.tcpsPdbConnectString",name="TCPS Pdb Connect Str",type="string", priority=1
169182
// +kubebuilder:printcolumn:JSONPath=".status.oemExpressUrl",name="Oem Express Url",type="string"
170183

171184
// SingleInstanceDatabase is the Schema for the singleinstancedatabases API

0 commit comments

Comments
 (0)