Skip to content

Commit d5f2e13

Browse files
authored
Merge pull request #98 from psaini79/devop
Added support for v1.1.0
2 parents bb344e4 + 1683616 commit d5f2e13

File tree

183 files changed

+12605
-2562
lines changed

Some content is hidden

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

183 files changed

+12605
-2562
lines changed

.gitlab-ci.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

Dockerfile

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,18 @@
33
#
44

55
# Build the manager binary
6-
FROM golang:1.19 as builder
6+
ARG BUILDER_IMG
7+
FROM ${BUILDER_IMG} as builder
8+
9+
# Download golang if BUILD_INTERNAL is set to true
10+
ARG INSTALL_GO
11+
ARG GOLANG_VERSION
12+
RUN if [ "$INSTALL_GO" = "true" ]; then \
13+
curl -LJO https://go.dev/dl/go${GOLANG_VERSION}.linux-amd64.tar.gz &&\
14+
rm -rf /usr/local/go && tar -C /usr/local -xzf go${GOLANG_VERSION}.linux-amd64.tar.gz &&\
15+
rm go${GOLANG_VERSION}.linux-amd64.tar.gz; \
16+
fi
17+
ENV PATH=${GOLANG_VERSION:+"${PATH}:/usr/local/go/bin"}
718

819
WORKDIR /workspace
920
# Copy the Go Modules manifests

Makefile

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,23 @@ build: generate fmt vet ## Build manager binary.
7171
run: manifests generate fmt vet ## Run a controller from your host.
7272
go run ./main.go
7373

74-
docker-build: manifests generate fmt vet #test ## Build docker image with the manager. Disable the test but keep the validations to fail fast
75-
docker build --no-cache=true --build-arg http_proxy=${HTTP_PROXY} --build-arg https_proxy=${HTTPS_PROXY} \
76-
--build-arg CI_COMMIT_SHA=${CI_COMMIT_SHA} --build-arg CI_COMMIT_BRANCH=${CI_COMMIT_BRANCH} . -t ${IMG}
74+
GOLANG_VERSION ?= 1.21.7
75+
## Download golang in the Dockerfile if BUILD_INTERNAL is set to true.
76+
## Otherwise, use golang image from docker hub as the builder.
77+
ifeq ($(BUILD_INTERNAL), true)
78+
BUILDER_IMG = oraclelinux:8
79+
BUILD_ARGS = --build-arg BUILDER_IMG=$(BUILDER_IMG) --build-arg GOLANG_VERSION=$(GOLANG_VERSION) --build-arg INSTALL_GO=true
80+
else
81+
BUILDER_IMG = golang:$(GOLANG_VERSION)
82+
BUILD_ARGS = --build-arg BUILDER_IMG=$(BUILDER_IMG) --build-arg INSTALL_GO=false
83+
endif
84+
docker-build: #manifests generate fmt vet #test ## Build docker image with the manager. Disable the test but keep the validations to fail fast
85+
docker build --no-cache=true --build-arg http_proxy=$(HTTP_PROXY) --build-arg https_proxy=$(HTTPS_PROXY) \
86+
--build-arg CI_COMMIT_SHA=$(CI_COMMIT_SHA) --build-arg CI_COMMIT_BRANCH=$(CI_COMMIT_BRANCH) \
87+
$(BUILD_ARGS) . -t $(IMG)
7788

7889
docker-push: ## Push docker image with the manager.
79-
docker push ${IMG}
90+
docker push $(IMG)
8091

8192
##@ Deployment
8293

@@ -87,17 +98,17 @@ uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified
8798
$(KUSTOMIZE) build config/crd | kubectl delete -f -
8899

89100
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
90-
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
101+
cd config/manager && $(KUSTOMIZE) edit set image controller=$(IMG)
91102
$(KUSTOMIZE) build config/default | kubectl apply -f -
92103

93104
# Bug:34265574
94105
# Used sed to reposition the controller-manager Deployment after the certificate creation in the OPERATOR_YAML
95106
operator-yaml: manifests kustomize
96-
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
97-
$(KUSTOMIZE) build config/default > "${OPERATOR_YAML}"
98-
sed -i.bak -e '/^apiVersion: apps\/v1/,/---/d' "${OPERATOR_YAML}"
99-
(echo --- && sed '/^apiVersion: apps\/v1/,/---/!d' "${OPERATOR_YAML}.bak") >> "${OPERATOR_YAML}"
100-
rm "${OPERATOR_YAML}.bak"
107+
cd config/manager && $(KUSTOMIZE) edit set image controller=$(IMG)
108+
$(KUSTOMIZE) build config/default > "$(OPERATOR_YAML)"
109+
sed -i.bak -e '/^apiVersion: apps\/v1/,/---/d' "$(OPERATOR_YAML)"
110+
(echo --- && sed '/^apiVersion: apps\/v1/,/---/!d' "$(OPERATOR_YAML).bak") >> "$(OPERATOR_YAML)"
111+
rm "$(OPERATOR_YAML).bak"
101112

102113
undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config.
103114
$(KUSTOMIZE) build config/default | kubectl delete -f -

PROJECT

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,4 +136,17 @@ resources:
136136
defaulting: true
137137
validation: true
138138
webhookVersion: v1beta1
139+
- api:
140+
crdVersion: v1beta1
141+
namespaced: true
142+
controller: true
143+
domain: oracle.com
144+
group: observability
145+
kind: DatabaseObserver
146+
path: github.com/oracle/oracle-database-operator/apis/observability/v1alpha1
147+
version: v1alpha1
148+
webhooks:
149+
defaulting: true
150+
validation: true
151+
webhookVersion: v1beta1
139152
version: "3"

README.md

Lines changed: 95 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,48 @@
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 v1.0.0 production release, `OraOperator` supports the following database configurations and infrastructure:
7+
In this v1.1.0 production release, `OraOperator` supports the following database configurations and infrastructure:
88

99
* Oracle Autonomous Database:
1010
* Oracle Autonomous Database shared Oracle Cloud Infrastructure (OCI) (ADB-S)
1111
* Oracle Autonomous Database on dedicated Cloud infrastructure (ADB-D)
12-
* Oracle Autonomous Container Database (ACD) (infrastructure) the infrastructure for provisionning Autonomous Databases.
12+
* Oracle Autonomous Container Database (ACD) (infrastructure) the infrastructure for provisioning Autonomous Databases.
1313
* Containerized Single Instance databases (SIDB) deployed in the Oracle Kubernetes Engine (OKE) and any k8s where OraOperator is deployed
1414
* Containerized Sharded databases (SHARDED) deployed in OKE and any k8s where OraOperator is deployed
1515
* Oracle Multitenant Databases (CDB/PDBs)
1616
* Oracle Base Database Cloud Service (BDBCS)
1717
* Oracle Data Guard (Preview status)
18+
* Oracle Database Observability (Preview status)
1819

1920
Oracle will continue to extend `OraOperator` to support additional Oracle Database configurations.
2021

22+
## New in V1.1.0 Release
23+
* Namespace scope deployment option
24+
* Support for Oracle Database 23ai Free (with SIDB)
25+
* Automatic Storage Expansion for SIDB and Sharded DB
26+
* User-Defined Sharding
27+
* TCPS support customer provided certs
28+
* Execute custom scripts during DB setup/startup
29+
* Patching for SIDB Primary/Standby in Data Guard
30+
* Long-term backup for Autonomous Databases (ADB): Moves to long-term backup and removes the deprecated mandatory backup
31+
* Wallet expiry date for ADB: A user-freindly enhancement to display wallet expiry date in the status of assiciated ADB
32+
* Wait-for-Completion option for ADB: Supports `kubectl wait` command that allows user to wait a specific condition on ADB
33+
* OKE workload Identify: Supports OKE workload indentity authentication method. For more details, refer to [Oracle Autonomous Database (ADB) Prerequisites](docs/adb/ADB_PREREQUISITES.md#authorized-with-oke-workload-identity)
34+
* Database Observability (Preview - Metrics)
35+
2136
## Features Summary
2237

2338
This release of Oracle Database Operator for Kubernetes (the operator) supports the following lifecycle operations:
2439

25-
* ADB-S/ADB-D: Provision, Bind, Start, Stop, terminate (soft/hard), scale (up/down), Manual Backup, Manual Restore
40+
* ADB-S/ADB-D: Provision, bind, start, stop, terminate (soft/hard), scale (up/down), long-term backup, manual restore
2641
* ACD: provision, bind, restart, terminate (soft/hard)
2742
* 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)
2843
* SHARDED: Provision/deploy sharded databases and the shard topology, Add a new shard, Delete an existing shard
2944
* 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
3045
* Oracle Base Database Cloud Service (BDBCS): provision, bind, scale shape Up/Down, Scale Storage Up, Terminate and Update License
3146
* Oracle Data Guard: Provision a Standby for the SIDB resource, Create a Data Guard Configuration, Perform a Switchover, Patch Primary and Standby databases in Data Guard Configuration
47+
* Oracle Database Observability: create, patch, delete databaseObserver resources
48+
* Watch over a set of namespaces or all the namespaces in the cluster using the "WATCH_NAMESPACE" env variable of the operator deployment
3249

3350
The upcoming releases will support new configurations, operations and capabilities.
3451

@@ -55,19 +72,70 @@ Oracle strongly recommends that you ensure your system meets the following [Prer
5572
Install the certificate manager with the following command:
5673

5774
```sh
58-
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.12.0/cert-manager.yaml
75+
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.14.4/cert-manager.yaml
5976
```
6077

61-
## Quick Install of the Operator
78+
* ### Create Role Bindings for Access Management
79+
80+
OraOperator supports the following two modes of deployment:
81+
##### 1. Cluster Scoped Deployment
82+
83+
This is the default mode, in which OraOperator is deployed to operate in a cluster, and to monitor all the namespaces in the cluster.
84+
85+
- Grant the `serviceaccount:oracle-database-operator-system:default` cluster wide access for the resources by applying [cluster-role-binding.yaml](./rbac/cluster-role-binding.yaml)
86+
87+
```sh
88+
kubectl apply -f rbac/cluster-role-binding.yaml
89+
```
90+
91+
- Next, apply the [oracle-database-operator.yaml](./oracle-database-operator.yaml) to deploy the Operator
92+
93+
```sh
94+
kubectl apply -f oracle-database-operator.yaml
95+
```
96+
97+
##### 2. Namespace Scoped Deployment
6298

63-
To install the operator in the cluster quickly, you can use a single [oracle-database-operator.yaml](https://github.com/oracle/oracle-database-operator/blob/main/oracle-database-operator.yaml) file.
99+
In this mode, OraOperator can be deployed to operate in a namespace, and to monitor one or many namespaces.
64100

65-
Run the following command
101+
- Grant `serviceaccount:oracle-database-operator-system:default` service account with resource access in the required namespaces. For example, to monitor only the default namespace, apply the [default-ns-role-binding.yaml](./rbac/default-ns-role-binding.yaml)
102+
103+
```sh
104+
kubectl apply -f rbac/default-ns-role-binding.yaml
105+
```
106+
To watch additional namespaces, create different role binding files for each namespace, using [default-ns-role-binding.yaml](./rbac/default-ns-role-binding.yaml) as a template, and changing the `metadata.name` and `metadata.namespace` fields
107+
108+
- Next, edit the [oracle-database-operator.yaml](./oracle-database-operator.yaml) to add the required namespaces under `WATCH_NAMESPACE`. Use comma-delimited values for multiple namespaces.
109+
110+
```sh
111+
- name: WATCH_NAMESPACE
112+
value: "default"
113+
```
114+
- Finally, apply the edited [oracle-database-operator.yaml](./oracle-database-operator.yaml) to deploy the Operator
115+
116+
```sh
117+
kubectl apply -f oracle-database-operator.yaml
118+
```
119+
120+
121+
* ### ClusterRole and ClusterRoleBinding for NodePort services
122+
123+
To expose services on each node's IP and port (the NodePort) apply the [node-rbac.yaml](./rbac/node-rbac.yaml). Note that this step is not required for LoadBalancer services.
66124
67125
```sh
68-
kubectl apply -f https://raw.githubusercontent.com/oracle/oracle-database-operator/main/oracle-database-operator.yaml
126+
kubectl apply -f rbac/node-rbac.yaml
69127
```
70128
129+
## Install Oracle DB Operator
130+
131+
After you have completed the preceding prerequisite changes, you can install the operator. To install the operator in the cluster quickly, you can apply the modified `oracle-database-operator.yaml` file from the preceding step.
132+
133+
Run the following command
134+
135+
```sh
136+
kubectl apply -f oracle-database-operator.yaml
137+
```
138+
71139
Ensure that the operator pods are up and running. For high availability, Operator pod replicas are set to a default of 3. You can scale this setting up or down.
72140
73141
```sh
@@ -86,9 +154,9 @@ You should see that the operator is up and running, along with the shipped contr
86154
87155
For more details, see [Oracle Database Operator Installation Instructions](./docs/installation/OPERATOR_INSTALLATION_README.md).
88156
89-
## Getting Started
157+
## Getting Started with the Operator (Quickstart)
90158
91-
The quickstarts are designed for specific database configurations:
159+
The following quickstarts are designed for specific database configurations:
92160
93161
* [Oracle Autonomous Database](./docs/adb/README.md)
94162
* [Oracle Autonomous Container Database](./docs/adb/ACD.md)
@@ -97,13 +165,17 @@ The quickstarts are designed for specific database configurations:
97165
* [Oracle Multitenant Database](./docs/multitenant/README.md)
98166
* [Oracle Base Database Cloud Service (BDBCS)](./docs/dbcs/README.md)
99167
168+
169+
The following quickstart is designed for non-database configurations:
170+
* [Oracle Database Observability](./docs/observability/README.md)
171+
100172
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.
101173
102174
## Uninstall the Operator
103175
104176
To uninstall the operator, the final step consists of deciding whether you want to delete the custom resource definitions (CRDs) and Kubernetes APIServices introduced into the cluster by the operator. Choose one of the following options:
105177
106-
* ### Deleting the CRDs and APIServices
178+
* ### Delete the CRDs and APIServices
107179
108180
To delete all the CRD instances deployed to cluster by the operator, run the following commands, where <namespace> is the namespace of the cluster object:
109181
@@ -119,8 +191,17 @@ YAML file templates are available under [`/config/samples`](./config/samples/).
119191
kubectl delete cdb.database.oracle.com --all -n <namespace>
120192
kubectl delete pdb.database.oracle.com --all -n <namespace>
121193
kubectl delete dataguardbrokers.database.oracle.com --all -n <namespace>
194+
kubectl delete databaseobserver.observability.oracle.com --all -n <namespace>
195+
```
196+
197+
* ### Delete the RBACs
198+
199+
```sh
200+
cat rbac/* | kubectl delete -f -
122201
```
123202
203+
* ### Delete the Deployment
204+
124205
After all CRD instances are deleted, it is safe to remove the CRDs, APIServices and operator deployment. To remove these files, use the following command:
125206
126207
```sh
@@ -129,7 +210,7 @@ YAML file templates are available under [`/config/samples`](./config/samples/).
129210
130211
Note: If the CRD instances are not deleted, and the operator is deleted by using the preceding command, then operator deployment and instance objects (pods, services, PVCs, and so on) are deleted. However, if that happens, then the CRD deletion stops responding. This is because the CRD instances have properties that prevent their deletion, and that can only be removed by the operator pod, which is deleted when the APIServices are deleted.
131212
132-
## Docs of the supported Oracle Database configurations
213+
## Documentation for the supported Oracle Database configurations
133214
134215
* [Oracle Autonomous Database](https://docs.oracle.com/en-us/iaas/Content/Database/Concepts/adboverview.htm)
135216
* [Components of Dedicated Autonomous Database](https://docs.oracle.com/en-us/iaas/autonomous-database/doc/components.html)
@@ -143,7 +224,7 @@ See [Contributing to this Repository](./CONTRIBUTING.md)
143224
144225
## Support
145226
146-
You can submit a GitHub issue, and/or you file an [Oracle Support service](https://support.oracle.com/portal/) request, using this product ID: 14430.
227+
You can submit a GitHub issue, oir submit an issue and then file an [Oracle Support service](https://support.oracle.com/portal/) request. To file an issue or a service request, use the following product ID: 14430.
147228
148229
## Security
149230
@@ -168,5 +249,5 @@ See [Reporting security vulnerabilities](./SECURITY.md)
168249
169250
## License
170251
171-
Copyright (c) 2022, 2023 Oracle and/or its affiliates.
252+
Copyright (c) 2022, 2024 Oracle and/or its affiliates.
172253
Released under the Universal Permissive License v1.0 as shown at [https://oss.oracle.com/licenses/upl/](https://oss.oracle.com/licenses/upl/)

SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ security features are welcome on GitHub Issues.
2121

2222
Security updates will be released on a regular cadence. Many of our projects
2323
will typically release security fixes in conjunction with the
24-
Oracle Critical Patch Update program. Additional
24+
[Oracle Critical Patch Update][3] program. Additional
2525
information, including past advisories, is available on our [security alerts][4]
2626
page.
2727

0 commit comments

Comments
 (0)