Skip to content

Commit 76f15f1

Browse files
authored
Merge pull request #60 from oracle/master
Master
2 parents dfe38d1 + 7312e4a commit 76f15f1

File tree

118 files changed

+6177
-1098
lines changed

Some content is hidden

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

118 files changed

+6177
-1098
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ testbin/*
55
onpremtest/*
66
ords/*zip
77
.gitattributes
8-
.vscode
8+
.vscode
9+
.gitlab-ci.yml

.gitlab-ci.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
build-operator:
2+
stage: build
3+
variables:
4+
IMAGE: "$DOCKER_REPO:$CI_COMMIT_BRANCH"
5+
OP_YAML: oracle-database-operator.yaml
6+
script:
7+
- go version
8+
- echo $CI_COMMIT_SHORT_SHA
9+
- make docker-build IMG="$IMAGE"
10+
- docker push "$IMAGE"
11+
- newimage=$DOCKER_REPO@$(skopeo inspect docker://$IMAGE | jq -r .Digest)
12+
- echo $newimage
13+
- docker rmi "$IMAGE" && docker system prune -f
14+
- make operator-yaml IMG=$newimage
15+
- if [ "$CI_COMMIT_BRANCH" != "master" ]; then sed -i "s/\(replicas.\) 3/\1 1/g" ./$OP_YAML; fi
16+
- curl -s --netrc-file $HOME/.netrc_gitlab $ARTIFACTORY_REPO/$CI_COMMIT_BRANCH/$OP_YAML -T ./$OP_YAML
17+
only:
18+
variables:
19+
- $CI_COMMIT_MESSAGE =~ /\#run-pipeline/
20+
- $CI_COMMIT_BRANCH =~ /master/
21+
- $CI_MERGE_REQUEST_ID != ""
22+
except:
23+
variables:
24+
- $CI_COMMIT_MESSAGE =~ /\#skip-pipeline/
25+
- $CI_COMMIT_TAG != null
26+
27+
cleanup:
28+
stage: .post
29+
script:
30+
- echo "Clean up downloaded binaries"
31+
- rm -rf bin/

Dockerfile

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

55
# Build the manager binary
6-
FROM golang:1.17 as builder
6+
FROM golang:1.19 as builder
77

88
WORKDIR /workspace
99
# Copy the Go Modules manifests
@@ -26,6 +26,10 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o manager
2626

2727
# Use oraclelinux:8-slim as base image to package the manager binary
2828
FROM oraclelinux:8-slim
29+
ARG CI_COMMIT_SHA
30+
ARG CI_COMMIT_BRANCH
31+
ENV COMMIT_SHA=${CI_COMMIT_SHA} \
32+
COMMIT_BRANCH=${CI_COMMIT_BRANCH}
2933
WORKDIR /
3034
COPY --from=builder /workspace/manager .
3135
RUN useradd -u 1002 nonroot

Makefile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,8 @@ run: manifests generate fmt vet ## Run a controller from your host.
7272
go run ./main.go
7373

7474
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} . -t ${IMG}
76-
77-
#docker-build-proxy: test
78-
# docker build --build-arg http_proxy=${http_proxy} --build-arg https_proxy=${https_proxy} build . -t ${IMG}
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}
7977

8078
docker-push: ## Push docker image with the manager.
8179
docker push ${IMG}

PROJECT

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,4 +123,17 @@ resources:
123123
kind: DbcsSystem
124124
path: github.com/oracle/oracle-database-operator/apis/database/v1alpha1
125125
version: v1alpha1
126+
- api:
127+
crdVersion: v1beta1
128+
namespaced: true
129+
controller: true
130+
domain: oracle.com
131+
group: database
132+
kind: DataguardBroker
133+
path: github.com/oracle/oracle-database-operator/apis/database/v1alpha1
134+
version: v1alpha1
135+
webhooks:
136+
defaulting: true
137+
validation: true
138+
webhookVersion: v1beta1
126139
version: "3"

README.md

Lines changed: 30 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,44 @@
11
# Oracle Database Operator for Kubernetes
22

3-
## Make Oracle Database Kubernetes Native - Take 2
3+
## Make Oracle Database Kubernetes Native
44

5-
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.
5+
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.1 release, `OraOperator` supports the following database configurations and infrastructure:
7+
In this v1.0.0 production release, `OraOperator` supports the following database configurations and infrastructure:
88

9-
* Oracle Autonomous Database on shared Oracle Cloud Infrastructure (OCI) (ADB-S)
10-
* Oracle Autonomous Database on dedicated Cloud infrastructure (ADB-D)
9+
* Oracle Autonomous Database:
10+
* Oracle Autonomous Database shared Oracle Cloud Infrastructure (OCI) (ADB-S)
11+
* Oracle Autonomous Database on dedicated Cloud infrastructure (ADB-D)
12+
* Oracle Autonomous Container Database (ACD) (infrastructure) the infrastructure for provisionning Autonomous Databases.
1113
* Containerized Single Instance databases (SIDB) deployed in the Oracle Kubernetes Engine (OKE) and any k8s where OraOperator is deployed
1214
* Containerized Sharded databases (SHARDED) deployed in OKE and any k8s where OraOperator is deployed
1315
* Oracle Multitenant Databases (CDB/PDBs)
14-
* Oracle Database Cloud Service (DBCS) (VMDB)
15-
* Oracle Autonomous Container Database (ACD) (infrastructure) the infrastructure for provisionning Autonomous Databases.
16+
* Oracle Base Database Cloud Service (BDBCS)
17+
* Oracle Data Guard (Preview status)
1618

17-
Oracle will continue to extent OraOperator to support additional Oracle Database configurations.
19+
Oracle will continue to extend `OraOperator` to support additional Oracle Database configurations.
1820

1921
## Features Summary
2022

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

23-
* ADB-S: Provision, Bind, Start, Stop, terminate (soft/hard), scale (up/down), Manual Backup, Manual Restore
24-
* ADB-D: provision, bind, start, stop, terminate (soft/hard), scale (up/down), Manual Backup, Manual Restore
25+
* ADB-S/ADB-D: Provision, Bind, Start, Stop, terminate (soft/hard), scale (up/down), Manual Backup, Manual Restore
2526
* ACD: provision, bind, restart, terminate (soft/hard)
2627
* 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)
2728
* SHARDED: Provision/deploy sharded databases and the shard topology, Add a new shard, Delete an existing shard
2829
* 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
29-
* Database Cloud Service: Provision, Bind, Scale Up/Down, Liveness Probe, Manual Backup
30+
* Oracle Base Database Cloud Service (BDBCS): provision, bind, scale shape Up/Down, Scale Storage Up, Terminate and Update License
31+
* 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
3032

3133
The upcoming releases will support new configurations, operations and capabilities.
3234

3335
## Release Status
3436

35-
**CAUTION:** The current release of `OraOperator` (v0.2.1) is for development and testing only. DO NOT USE IN PRODUCTION.
37+
This production release has been installed and tested on the following Kubernetes platforms:
3638

37-
This release has been installed and tested on the following Kubernetes platforms:
38-
39-
* [Oracle Container Engine for Kubernetes (OKE)](https://www.oracle.com/cloud-native/container-engine-kubernetes/) with Kubernetes 1.17 or later
40-
* [Oracle Linux Cloud Native Environment(OLCNE)](https://docs.oracle.com/en/operating-systems/olcne/) 1.3 or later
41-
* [Minikube](https://minikube.sigs.k8s.io/docs/) with version v1.21.0 or later
39+
* [Oracle Container Engine for Kubernetes (OKE)](https://www.oracle.com/cloud-native/container-engine-kubernetes/) with Kubernetes 1.24
40+
* [Oracle Linux Cloud Native Environment(OLCNE)](https://docs.oracle.com/en/operating-systems/olcne/) 1.6
41+
* [Minikube](https://minikube.sigs.k8s.io/docs/) with version v1.29.0
4242
* [Azure Kubernetes Service](https://azure.microsoft.com/en-us/services/kubernetes-service/)
4343
* [Amazon Elastic Kubernetes Service](https://aws.amazon.com/eks/)
4444
* [Red Hat OKD](https://www.okd.io/)
@@ -50,7 +50,7 @@ Oracle strongly recommends that you ensure your system meets the following [Prer
5050

5151
* ### Install cert-manager
5252

53-
The operator uses webhooks for validating user input before persisting it in Etcd. Webhooks require TLS certificates that are generated and managed by a certificate manager.
53+
The operator uses webhooks for validating user input before persisting it in etcd. Webhooks require TLS certificates that are generated and managed by a certificate manager.
5454

5555
Install the certificate manager with the following command:
5656

@@ -67,11 +67,6 @@ Oracle strongly recommends that you ensure your system meets the following [Prer
6767
```sh
6868
kubectl apply -f https://raw.githubusercontent.com/oracle/oracle-database-operator/main/oracle-database-operator.yaml
6969
```
70-
---
71-
**NOTE:**
72-
The above command will also upgrade the existing v0.2.0 `OraOperator` installation to the latest version i.e. v0.2.1.
73-
74-
---
7570

7671
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.
7772

@@ -96,13 +91,13 @@ For more details, see [Oracle Database Operator Installation Instructions](./doc
9691
The quickstarts are designed for specific database configurations:
9792

9893
* [Oracle Autonomous Database](./docs/adb/README.md)
99-
* [Oracle Autonomous Container Database](./docs/acd/README.md)
100-
* [Containerized Oracle Single Instance Database](./docs/sidb/README.md)
94+
* [Oracle Autonomous Container Database](./docs/adb/ACD.md)
95+
* [Containerized Oracle Single Instance Database and Data Guard](./docs/sidb/README.md)
10196
* [Containerized Oracle Sharded Database](./docs/sharding/README.md)
10297
* [Oracle Multitenant Database](./docs/multitenant/README.md)
103-
* [Oracle Database Cloud Service](./docs/dbcs/README.md)
98+
* [Oracle Base Database Cloud Service (BDBCS)](./docs/dbcs/README.md)
10499

105-
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.
100+
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.
106101

107102
## Uninstall the Operator
108103

@@ -123,17 +118,17 @@ YAML file templates are available under [`/config/samples`](./config/samples/).
123118
kubectl delete autonomouscontainerdatabase.database.oracle.com --all -n <namespace>
124119
kubectl delete cdb.database.oracle.com --all -n <namespace>
125120
kubectl delete pdb.database.oracle.com --all -n <namespace>
121+
kubectl delete dataguardbrokers.database.oracle.com --all -n <namespace>
126122
```
127123

128-
After all CRD instances are deleted, it is safe to remove the CRDs, APISerivces and operator deployment. Use the following command:
124+
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:
129125

130126
```sh
131127
kubectl delete -f oracle-database-operator.yaml --ignore-not-found=true
132128
```
133129

134130
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.
135131

136-
137132
## Docs of the supported Oracle Database configurations
138133

139134
* [Oracle Autonomous Database](https://docs.oracle.com/en-us/iaas/Content/Database/Concepts/adboverview.htm)
@@ -148,29 +143,30 @@ See [Contributing to this Repository](./CONTRIBUTING.md)
148143

149144
## Support
150145

151-
You can submit a GitHub issue, or you can also file an [Oracle Support service](https://support.oracle.com/portal/) request, using the product id: 14430.
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.
152147

153148
## Security
154149

155150
Secure platforms are an important basis for general system security. Ensure that your deployment is in compliance with common security practices.
156151

157152
### Managing Sensitive Data
153+
158154
Kubernetes secrets are the usual means for storing credentials or passwords input for access. The operator reads the Secrets programmatically, which limits exposure of sensitive data. However, to protect your sensitive data, Oracle strongly recommends that you set and get sensitive data from Oracle Cloud Infrastructure Vault, or from third-party Vaults.
159155

160156
The following is an example of a YAML file fragment for specifying Oracle Cloud Infrastructure Vault as the repository for the admin password.
161-
```
157+
158+
```yaml
162159
adminPassword:
163160
ociSecretOCID: ocid1.vaultsecret.oc1...
164161
```
162+
165163
Examples in this repository where passwords are entered on the command line are for demonstration purposes only.
166164
167165
### Reporting a Security Issue
168166
169167
See [Reporting security vulnerabilities](./SECURITY.md)
170168
171-
172-
173169
## License
174170
175-
Copyright (c) 2022 Oracle and/or its affiliates.
171+
Copyright (c) 2022, 2023 Oracle and/or its affiliates.
176172
Released under the Universal Permissive License v1.0 as shown at [https://oss.oracle.com/licenses/upl/](https://oss.oracle.com/licenses/upl/)

0 commit comments

Comments
 (0)