Skip to content

Commit

Permalink
Merge pull request #60 from oracle/master
Browse files Browse the repository at this point in the history
Master
  • Loading branch information
Kuassim authored Jul 6, 2023
2 parents dfe38d1 + 7312e4a commit 76f15f1
Show file tree
Hide file tree
Showing 118 changed files with 6,177 additions and 1,098 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ testbin/*
onpremtest/*
ords/*zip
.gitattributes
.vscode
.vscode
.gitlab-ci.yml
31 changes: 31 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
build-operator:
stage: build
variables:
IMAGE: "$DOCKER_REPO:$CI_COMMIT_BRANCH"
OP_YAML: oracle-database-operator.yaml
script:
- go version
- echo $CI_COMMIT_SHORT_SHA
- make docker-build IMG="$IMAGE"
- docker push "$IMAGE"
- newimage=$DOCKER_REPO@$(skopeo inspect docker://$IMAGE | jq -r .Digest)
- echo $newimage
- docker rmi "$IMAGE" && docker system prune -f
- make operator-yaml IMG=$newimage
- if [ "$CI_COMMIT_BRANCH" != "master" ]; then sed -i "s/\(replicas.\) 3/\1 1/g" ./$OP_YAML; fi
- curl -s --netrc-file $HOME/.netrc_gitlab $ARTIFACTORY_REPO/$CI_COMMIT_BRANCH/$OP_YAML -T ./$OP_YAML
only:
variables:
- $CI_COMMIT_MESSAGE =~ /\#run-pipeline/
- $CI_COMMIT_BRANCH =~ /master/
- $CI_MERGE_REQUEST_ID != ""
except:
variables:
- $CI_COMMIT_MESSAGE =~ /\#skip-pipeline/
- $CI_COMMIT_TAG != null

cleanup:
stage: .post
script:
- echo "Clean up downloaded binaries"
- rm -rf bin/
6 changes: 5 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#

# Build the manager binary
FROM golang:1.17 as builder
FROM golang:1.19 as builder

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

# Use oraclelinux:8-slim as base image to package the manager binary
FROM oraclelinux:8-slim
ARG CI_COMMIT_SHA
ARG CI_COMMIT_BRANCH
ENV COMMIT_SHA=${CI_COMMIT_SHA} \
COMMIT_BRANCH=${CI_COMMIT_BRANCH}
WORKDIR /
COPY --from=builder /workspace/manager .
RUN useradd -u 1002 nonroot
Expand Down
6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,8 @@ run: manifests generate fmt vet ## Run a controller from your host.
go run ./main.go

docker-build: manifests generate fmt vet #test ## Build docker image with the manager. Disable the test but keep the validations to fail fast
docker build --no-cache=true --build-arg http_proxy=${HTTP_PROXY} --build-arg https_proxy=${HTTPS_PROXY} . -t ${IMG}

#docker-build-proxy: test
# docker build --build-arg http_proxy=${http_proxy} --build-arg https_proxy=${https_proxy} build . -t ${IMG}
docker build --no-cache=true --build-arg http_proxy=${HTTP_PROXY} --build-arg https_proxy=${HTTPS_PROXY} \
--build-arg CI_COMMIT_SHA=${CI_COMMIT_SHA} --build-arg CI_COMMIT_BRANCH=${CI_COMMIT_BRANCH} . -t ${IMG}

docker-push: ## Push docker image with the manager.
docker push ${IMG}
Expand Down
13 changes: 13 additions & 0 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,17 @@ resources:
kind: DbcsSystem
path: github.com/oracle/oracle-database-operator/apis/database/v1alpha1
version: v1alpha1
- api:
crdVersion: v1beta1
namespaced: true
controller: true
domain: oracle.com
group: database
kind: DataguardBroker
path: github.com/oracle/oracle-database-operator/apis/database/v1alpha1
version: v1alpha1
webhooks:
defaulting: true
validation: true
webhookVersion: v1beta1
version: "3"
64 changes: 30 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
# Oracle Database Operator for Kubernetes

## Make Oracle Database Kubernetes Native - Take 2
## Make Oracle Database Kubernetes Native

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

In this v0.2.1 release, `OraOperator` supports the following database configurations and infrastructure:
In this v1.0.0 production release, `OraOperator` supports the following database configurations and infrastructure:

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

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

## Features Summary

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

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

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

## Release Status

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

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

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

* ### Install cert-manager

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

Install the certificate manager with the following command:

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

---

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.

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

* [Oracle Autonomous Database](./docs/adb/README.md)
* [Oracle Autonomous Container Database](./docs/acd/README.md)
* [Containerized Oracle Single Instance Database](./docs/sidb/README.md)
* [Oracle Autonomous Container Database](./docs/adb/ACD.md)
* [Containerized Oracle Single Instance Database and Data Guard](./docs/sidb/README.md)
* [Containerized Oracle Sharded Database](./docs/sharding/README.md)
* [Oracle Multitenant Database](./docs/multitenant/README.md)
* [Oracle Database Cloud Service](./docs/dbcs/README.md)
* [Oracle Base Database Cloud Service (BDBCS)](./docs/dbcs/README.md)

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

## Uninstall the Operator

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

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

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

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.


## Docs of the supported Oracle Database configurations

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

## Support

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

## Security

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

### Managing Sensitive Data

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.

The following is an example of a YAML file fragment for specifying Oracle Cloud Infrastructure Vault as the repository for the admin password.
```

```yaml
adminPassword:
ociSecretOCID: ocid1.vaultsecret.oc1...
```

Examples in this repository where passwords are entered on the command line are for demonstration purposes only.

### Reporting a Security Issue

See [Reporting security vulnerabilities](./SECURITY.md)



## License

Copyright (c) 2022 Oracle and/or its affiliates.
Copyright (c) 2022, 2023 Oracle and/or its affiliates.
Released under the Universal Permissive License v1.0 as shown at [https://oss.oracle.com/licenses/upl/](https://oss.oracle.com/licenses/upl/)
Loading

0 comments on commit 76f15f1

Please sign in to comment.