Kubernetes 的 Oracle 数据库操作程序 (又名 OraOperator) 可帮助开发人员、DBA、DevOps 和 GitOps 团队缩短部署和管理 Oracle 数据库的时间和复杂度。
Kubernetes 的 Oracle 数据库操作程序 (又名 OraOperator) 可帮助开发人员、DBA、DevOps 和 GitOps 团队缩短部署和管理 Oracle 数据库的时间和复杂度。
The Oracle Database Operator extends the Kubernetes API by introducing custom resources and controllers that enable the provisioning, management, and lifecycle automation of Oracle Database workloads and associated services on Kubernetes.
It simplifies database operations by leveraging Kubernetes-native constructs, allowing teams to manage Oracle databases using declarative configurations and standard tooling. This approach improves consistency, scalability, and operational efficiency across environments.
Use this repository to install and validate the operator, ensure it is running correctly, and then navigate to the relevant guides for managing specific controllers or database workloads. It also provides examples, configuration references, and best practices to help you get started quickly and operate reliably in production environments.
Version 2.2 introduces expanded database lifecycle automation, stronger reconciliation, new networking capabilities, and improved operator security and observability.
| Controller / area | Highlights |
|---|---|
| AutonomousDatabase | • OCI lifecycle reconciliation, finalizers, wallet validation and rotation |
| • Backup-resource synchronization and cleanup | |
| AutonomousContainerDatabase | • OCI lifecycle-state validation and finalizer-based cleanup |
| • Kubernetes-to-OCI state synchronization | |
| AutonomousDatabaseBackup / Restore | • Target validation and owner references |
| • Point-in-time restore and OCI work-request integration | |
| Multitenant controllers (LREST / LRPDB) | • Internal comunication protocol improvement and cofiguration simplification - No need to specify https password |
| • Creating application users on pdb using k8s secrets | |
| • Monitor pdb init parameters with reconciliation loop | |
| • Code optimization | |
| • Reset bitmask status simplification | |
| • Load tnsname.ora topology | |
| OracleRestart | • Phased reconciliation for validation, storage, workload, and finalization |
| • ASM disk lifecycle with static/dynamic PV/PVC handling | |
| ORDS Services (OrdsSrvs) | • HTTP-only edge deployments, HTTP access-log forwarding/persistence, and Instance API bootstrap |
| • Configurable resource limits, metadata, and JVM options | |
| RacDatabase | • Expanded RAC and ASM storage lifecycle |
| • Disk/PVC provisioning, and validation | |
| ShardingDatabase | • Oracle GDD topology lifecycle and scaling |
| • Catalog/shard management, and status validation | |
| SingleInstanceDatabase | • Service endpoints, TCPS, TrueCache, Data Guard prerequisites, clone/restore, and external PVCs |
| • Improved pod security, resource handling, recreation checks, and connection status | |
| DataguardBroker | • Topology runtime, authentication wallets, validation/provisioning, FSFO observer management, and operation tracking |
| • Idempotent manual switchover support | |
| DatabaseObserver | • Safer child-resource ownership and Server-Side Apply |
| • Improved deployment readiness and status handling | |
| PrivateAI | • Phased dependency/workload reconciliation and update-lock status |
| • TLS secret lifecycle, support for vLLM and GPU, and rollout tracking | |
| TrafficManager (new) (preview mode) | • Oracle Connection Manager (CMAN) endpoints |
• generated rules, cman.ora file mode, and endpoint status |
|
| Operator platform | • New network.oracle.com/v4 API and TrafficManager CRD |
| • Secure HTTPS metrics, hardened manager security context, expanded RBAC/webhooks, compatibility webhooks, network policy, samples, and test coverage |
This production release has been installed and tested on the following platforms:
| Platform | Version |
|---|---|
| Oracle Container Engine for Kubernetes (OKE) | Kubernetes 1.33 or later |
| Red Hat OpenShift | 4.19 or later |
| Oracle Linux Cloud Native Environment (OLCNE) | 1.9 or later |
| Google Kubernetes Engine | Supported |
| Azure Kubernetes Service | Supported |
| Amazon Elastic Kubernetes Service | Supported |
| Red Hat OKD | Supported |
| Minikube | 1.29.0 or later |
Oracle strongly recommends reviewing PREREQUISITES.md before installation.
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.
OCNE note: Before installing cert-manager on an OCNE cluster, review the cert-manager supported releases and choose a cert-manager version that supports the Kubernetes version provided by your OCNE release. OCNE 1.9 uses Kubernetes 1.29, so replace the cert-manager version in the example below with a Kubernetes 1.29-compatible release.
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.20.2/cert-manager.yamlThe default installation is namespace-scoped. The operator runs in oracle-database-operator-system and watches that namespace by default. It does not watch other namespaces unless they are added to WATCH_NAMESPACE and the service account is granted access there.
The operator also supports an optional cluster-scoped mode. Apply the base RBAC manifest first so the operator namespace, service account, and packaged manager roles exist before the controller starts.
If you are planning to install the operator through an OKE add-on, OperatorHub.io, or Red Hat OpenShift, use the corresponding instructions under Install The Operator: Install as an OKE Add-on, Install from OperatorHub.io, or Install on Red Hat OpenShift. Those installation channels manage the deployment manifests and lifecycle, so do not apply the repository YAML scope procedures in addition to the selected platform installation. If you are deploying with repository YAML files, skip to Default namespace-scoped deployment.
For a namespace-scoped deployment, generate the operator manifests from a comma-separated namespace list. The generated system manifest sets WATCH_NAMESPACE, and the generated RBAC manifest adds one manager RoleBinding for each watched namespace.
Example:
scripts/generate-namespace-install.sh oracle-database-operator-system,shnsThen apply the generated manifests:
kubectl apply -f dist/install/oracle-database-operator-rbac.yaml
kubectl apply -f dist/install/oracle-database-operator-system.yamlThe script keeps the operator service account in oracle-database-operator-system and grants access only in the namespaces listed in WATCH_NAMESPACE. This avoids manually editing oracle-database-operator-system.yaml, oracle-database-operator-rbac.yaml, and namespace role binding files separately.
The generated deployment contains the same namespace list:
- name: WATCH_NAMESPACE
value: "oracle-database-operator-system,shns"Verify authorization one namespace at a time. The -n/--namespace option accepts only one namespace; do not pass the comma-separated WATCH_NAMESPACE value to it:
for namespace in oracle-database-operator-system shns; do
echo "Checking ${namespace}"
kubectl auth can-i list lrpdbs.database.oracle.com \
--as=system:serviceaccount:oracle-database-operator-system:oracle-database-operator-controller-manager \
-n "${namespace}"
doneDo not update only WATCH_NAMESPACE. Each namespace in the watch list must also have a manager RoleBinding for the existing operator ServiceAccount. The ServiceAccount itself does not change.
For the standard installation, use these values:
OPERATOR_NS=oracle-database-operator-system
SERVICE_ACCOUNT=oracle-database-operator-controller-manager
MANAGER_ROLE=oracle-database-operator-manager-roleTo add namespaces, first create or update the RoleBinding in every new namespace:
for namespace in shns db-workloads; do
kubectl create rolebinding oracle-database-operator-manager-rolebinding \
--clusterrole="${MANAGER_ROLE}" \
--serviceaccount="${OPERATOR_NS}:${SERVICE_ACCOUNT}" \
--namespace="${namespace}" \
--dry-run=client -o yaml | kubectl apply -f -
doneVerify access before changing the Deployment. Check each namespace separately; kubectl auth can-i -n does not accept a comma-separated namespace list:
for namespace in shns db-workloads; do
kubectl auth can-i list singleinstancedatabases.database.oracle.com \
--as="system:serviceaccount:${OPERATOR_NS}:${SERVICE_ACCOUNT}" \
--namespace="${namespace}"
doneThen set the complete watch list. This replaces the previous value and triggers a rollout:
kubectl set env deployment/oracle-database-operator-controller-manager \
-n "${OPERATOR_NS}" \
WATCH_NAMESPACE="${OPERATOR_NS},shns,db-workloads"
kubectl rollout status deployment/oracle-database-operator-controller-manager \
-n "${OPERATOR_NS}" --timeout=300sTo remove a namespace, first update WATCH_NAMESPACE without it and wait for the rollout. Then remove its obsolete RoleBinding:
kubectl set env deployment/oracle-database-operator-controller-manager \
-n "${OPERATOR_NS}" \
WATCH_NAMESPACE="${OPERATOR_NS},shns"
kubectl rollout status deployment/oracle-database-operator-controller-manager \
-n "${OPERATOR_NS}" --timeout=300s
kubectl delete rolebinding oracle-database-operator-manager-rolebinding \
-n db-workloads --ignore-not-found=trueFor a fresh installation, continue using scripts/generate-namespace-install.sh; it generates the Deployment value and namespace RoleBindings together. For an existing installation, use the in-place procedure above instead of applying a full generated system manifest from a different operator version.
Before applying or changing the operator configuration, verify that the ServiceAccount can list resources in each watched namespace. For example:
kubectl auth can-i list lrpdbs.database.oracle.com \
--as=system:serviceaccount:oracle-database-operator-system:oracle-database-operator-controller-manager \
-n To switch an existing operator from namespace scope to cluster scope, first complete the Default namespace-scoped deployment section, including its RBAC, Deployment, and permission checks. After the namespace-scoped installation is healthy, follow the steps below to add the cluster binding and unset WATCH_NAMESPACE.
Namespace-scoped deployment is preferred because it follows least-privilege practice and limits the operator's access to selected Kubernetes namespaces. Cluster-scoped deployment grants the operator wider access across the cluster and should be used only when your operational requirements require it. If cluster scope is required for your environment, follow the
暂无开放 Issues,或尚未同步最近议题。