Skip to content

Backup new stuff #137

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
fe06d36
Merge branch 'fix_operator_yaml' into 'master'
yunus-qureshi Jul 13, 2023
b09ccfe
Fix webhook reject scaling after stop and restart adb
ting-lan-wang Aug 15, 2023
464bf7e
Merge branch 'fix-adb-webhook-lifecyclestate' into 'master'
ting-lan-wang Aug 15, 2023
7f8634f
Update the command of installing cert-manager
ting-lan-wang Aug 23, 2023
f63c1a6
Update cert-manager command installation command in README.md
ting-lan-wang Aug 28, 2023
28dc9f9
Merge branch 'ting-lan_wang-master-patch-27095' into 'master'
ting-lan-wang Aug 28, 2023
53d92cf
Enhance CI/CD pipeline to use commit ID
yunus-qureshi Sep 8, 2023
6cc50e1
Merge branch 'enhancement/cicd-pipeline' into 'master'
yunus-qureshi Sep 8, 2023
1cc8737
Bugfix issue 67
IshaanDesai45 Sep 12, 2023
bc35cfc
Merge branch 'bugfix-issue_67' into 'master'
yunus-qureshi Sep 12, 2023
94e1d84
Fix adb controller reconcile error
ting-lan-wang Sep 22, 2023
4da1609
Merge branch 'fix-adb-reconciler-error' into 'master'
ting-lan-wang Sep 22, 2023
121e0ed
Fix adb reconcile
ting-lan-wang Sep 28, 2023
c2c9e16
Merge branch 'fix-adb-reconcile' into 'master'
ting-lan-wang Sep 28, 2023
2d1126d
Tcps user certs
vatsrahul Oct 13, 2023
08077ad
Merge branch 'tcps_user_certs' into 'master'
yunus-qureshi Oct 13, 2023
1d6361e
Enhance status updation of sidb controller
IshaanDesai45 Nov 7, 2023
124410a
Merge branch 'idesai_enhance_status_updation' into 'master'
yunus-qureshi Nov 7, 2023
75e6c7f
Modifying singleinstancedatabase types attributes, for bug 35430671 r…
IshaanDesai45 Nov 10, 2023
00f72c7
Merge branch 'idesai_hotfix_35430671' into 'master'
yunus-qureshi Nov 10, 2023
c05a115
Commit message for the new commit
mmalvezz Sep 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,9 @@ testbin/*
onpremtest/*
ords/*zip
.gitattributes
.vscode
.vscode
.gitlab-ci.yml

# development
.idea
.local
31 changes: 0 additions & 31 deletions .gitlab-ci.yml

This file was deleted.

13 changes: 12 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,18 @@
#

# Build the manager binary
FROM golang:1.19 as builder
ARG BUILDER_IMG
FROM ${BUILDER_IMG} as builder

# Download golang if BUILD_INTERNAL is set to true
ARG INSTALL_GO
ARG GOLANG_VERSION
RUN if [ "$INSTALL_GO" = "true" ]; then \
curl -LJO https://go.dev/dl/go${GOLANG_VERSION}.linux-amd64.tar.gz &&\
rm -rf /usr/local/go && tar -C /usr/local -xzf go${GOLANG_VERSION}.linux-amd64.tar.gz &&\
rm go${GOLANG_VERSION}.linux-amd64.tar.gz; \
fi
ENV PATH=${GOLANG_VERSION:+"${PATH}:/usr/local/go/bin"}

WORKDIR /workspace
# Copy the Go Modules manifests
Expand Down
33 changes: 22 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ test: manifests generate fmt vet envtest ## Run unit tests.

E2ETEST ?= ./test/e2e/
e2e: manifests generate fmt vet envtest ## Run e2e tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" ginkgo -v --timeout=2h30m --fail-fast $(E2ETEST)
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test $(E2ETEST) -test.timeout 0 -test.v --ginkgo.fail-fast

##@ Build

Expand All @@ -71,12 +71,23 @@ build: generate fmt vet ## Build manager binary.
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} \
--build-arg CI_COMMIT_SHA=${CI_COMMIT_SHA} --build-arg CI_COMMIT_BRANCH=${CI_COMMIT_BRANCH} . -t ${IMG}
GOLANG_VERSION ?= 1.21.7
## Download golang in the Dockerfile if BUILD_INTERNAL is set to true.
## Otherwise, use golang image from docker hub as the builder.
ifeq ($(BUILD_INTERNAL), true)
BUILDER_IMG = oraclelinux:8
BUILD_ARGS = --build-arg BUILDER_IMG=$(BUILDER_IMG) --build-arg GOLANG_VERSION=$(GOLANG_VERSION) --build-arg INSTALL_GO=true
else
BUILDER_IMG = golang:$(GOLANG_VERSION)
BUILD_ARGS = --build-arg BUILDER_IMG=$(BUILDER_IMG) --build-arg INSTALL_GO=false
endif
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) \
--build-arg CI_COMMIT_SHA=$(CI_COMMIT_SHA) --build-arg CI_COMMIT_BRANCH=$(CI_COMMIT_BRANCH) \
$(BUILD_ARGS) . -t $(IMG)

docker-push: ## Push docker image with the manager.
docker push ${IMG}
docker push $(IMG)

##@ Deployment

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

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

# Bug:34265574
# Used sed to reposition the controller-manager Deployment after the certificate creation in the OPERATOR_YAML
operator-yaml: manifests kustomize
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
$(KUSTOMIZE) build config/default > "${OPERATOR_YAML}"
sed -i.bak -e '/^apiVersion: apps\/v1/,/---/d' "${OPERATOR_YAML}"
(echo --- && sed '/^apiVersion: apps\/v1/,/---/!d' "${OPERATOR_YAML}.bak") >> "${OPERATOR_YAML}"
rm "${OPERATOR_YAML}.bak"
cd config/manager && $(KUSTOMIZE) edit set image controller=$(IMG)
$(KUSTOMIZE) build config/default > "$(OPERATOR_YAML)"
sed -i.bak -e '/^apiVersion: apps\/v1/,/---/d' "$(OPERATOR_YAML)"
(echo --- && sed '/^apiVersion: apps\/v1/,/---/!d' "$(OPERATOR_YAML).bak") >> "$(OPERATOR_YAML)"
rm "$(OPERATOR_YAML).bak"

undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config.
$(KUSTOMIZE) build config/default | kubectl delete -f -
Expand Down
21 changes: 21 additions & 0 deletions PROJECT
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Code generated by tool. DO NOT EDIT.
# This file is used to track the info used to scaffold your project
# and allow the plugins properly work.
# More info: https://book.kubebuilder.io/reference/project-config.html
domain: oracle.com
layout:
- go.kubebuilder.io/v2
Expand Down Expand Up @@ -67,6 +71,10 @@ resources:
kind: ShardingDatabase
path: github.com/oracle/oracle-database-operator/apis/database/v1alpha1
version: v1alpha1
webhooks:
defaulting: true
validation: true
webhookVersion: v1beta1
- api:
crdVersion: v1
namespaced: true
Expand Down Expand Up @@ -136,4 +144,17 @@ resources:
defaulting: true
validation: true
webhookVersion: v1beta1
- api:
crdVersion: v1beta1
namespaced: true
controller: true
domain: oracle.com
group: observability
kind: DatabaseObserver
path: github.com/oracle/oracle-database-operator/apis/observability/v1alpha1
version: v1alpha1
webhooks:
defaulting: true
validation: true
webhookVersion: v1beta1
version: "3"
110 changes: 96 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,51 @@

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

* 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.
* Oracle Autonomous Container Database (ACD) (infrastructure) is the infrastructure for provisioning 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 Base Database Cloud Service (BDBCS)
* Oracle Data Guard (Preview status)
* Oracle Database Observability (Preview status)

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

## New in V1.1.0 Release
* Namespace scope deployment option
* Enhanced security with namespace scope deployment option
* Support for Oracle Database 23ai Free (with SIDB)
* Automatic Storage Expansion for SIDB and Sharded DB
* User-Defined Sharding
* TCPS support customer provided certs
* Execute custom scripts during DB setup/startup
* Patching for SIDB Primary/Standby in Data Guard
* Long-term backup for Autonomous Databases (ADB): Support for [long-term retention backup](https://docs.oracle.com/en/cloud/paas/autonomous-database/serverless/adbsb/backup-long-term.html) and removed support for the deprecated mandatory backup
* Wallet expiry date for ADB: A user-friendly enhancement to display the wallet expiry date in the status of the associated ADB
* Wait-for-Completion option for ADB: Supports `kubectl wait` command that allows the user to wait for a specific condition on ADB
* OKE workload Identify: Supports OKE workload identity authentication method (i.e., uses OKE credentials). For more details, refer to [Oracle Autonomous Database (ADB) Prerequisites](docs/adb/ADB_PREREQUISITES.md#authorized-with-oke-workload-identity)
* Database Observability (Preview - Metrics)

## Features Summary

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

* ADB-S/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), long-term 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
* 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
* Oracle Database Observability: create, patch, delete databaseObserver resources
* Watch over a set of namespaces or all the namespaces in the cluster using the "WATCH_NAMESPACE" env variable of the operator deployment

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

## Release Status

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

```sh
kubectl apply -f https://github.com/jetstack/cert-manager/releases/latest/download/cert-manager.yaml
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.14.4/cert-manager.yaml
```

## Quick Install of the Operator
* ### Create Role Bindings for Access Management

OraOperator supports the following two modes of deployment:
##### 1. Cluster Scoped Deployment

This is the default mode, in which OraOperator is deployed to operate in a cluster, and to monitor all the namespaces in the cluster.

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

```sh
kubectl apply -f rbac/cluster-role-binding.yaml
```

- Next, apply the [oracle-database-operator.yaml](./oracle-database-operator.yaml) to deploy the Operator

```sh
kubectl apply -f oracle-database-operator.yaml
```

##### 2. Namespace Scoped Deployment

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.
In this mode, OraOperator can be deployed to operate in a namespace, and to monitor one or many namespaces.

Run the following command
- 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)

```sh
kubectl apply -f rbac/default-ns-role-binding.yaml
```
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

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

```sh
- name: WATCH_NAMESPACE
value: "default"
```
- Finally, apply the edited [oracle-database-operator.yaml](./oracle-database-operator.yaml) to deploy the Operator

```sh
kubectl apply -f oracle-database-operator.yaml
```


* ### ClusterRole and ClusterRoleBinding for NodePort services

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.

```sh
kubectl apply -f https://raw.githubusercontent.com/oracle/oracle-database-operator/main/oracle-database-operator.yaml
kubectl apply -f rbac/node-rbac.yaml
```

## Install Oracle DB Operator

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.

Run the following command

```sh
kubectl apply -f oracle-database-operator.yaml
```

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.

```sh
Expand All @@ -88,7 +157,7 @@ For more details, see [Oracle Database Operator Installation Instructions](./doc

## Getting Started with the Operator (Quickstart)

The quickstarts are designed for specific database configurations:
The following quickstarts are designed for specific database configurations:

* [Oracle Autonomous Database](./docs/adb/README.md)
* [Oracle Autonomous Container Database](./docs/adb/ACD.md)
Expand All @@ -97,13 +166,17 @@ The quickstarts are designed for specific database configurations:
* [Oracle Multitenant Database](./docs/multitenant/README.md)
* [Oracle Base Database Cloud Service (BDBCS)](./docs/dbcs/README.md)


The following quickstart is designed for non-database configurations:
* [Oracle Database Observability](./docs/observability/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.

## Uninstall the Operator

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:

* ### Deleting the CRDs and APIServices
* ### Delete the CRDs and APIServices

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:

Expand All @@ -119,8 +192,17 @@ YAML file templates are available under [`/config/samples`](./config/samples/).
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>
kubectl delete databaseobserver.observability.oracle.com --all -n <namespace>
```

* ### Delete the RBACs

```sh
cat rbac/* | kubectl delete -f -
```

* ### Delete the Deployment

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
Expand All @@ -129,7 +211,7 @@ YAML file templates are available under [`/config/samples`](./config/samples/).

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
## Documentation for the supported Oracle Database configurations

* [Oracle Autonomous Database](https://docs.oracle.com/en-us/iaas/Content/Database/Concepts/adboverview.htm)
* [Components of Dedicated Autonomous Database](https://docs.oracle.com/en-us/iaas/autonomous-database/doc/components.html)
Expand All @@ -143,7 +225,7 @@ See [Contributing to this Repository](./CONTRIBUTING.md)

## Support

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

## Security

Expand All @@ -168,5 +250,5 @@ See [Reporting security vulnerabilities](./SECURITY.md)

## License

Copyright (c) 2022, 2023 Oracle and/or its affiliates.
Copyright (c) 2022, 2024 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