-
Notifications
You must be signed in to change notification settings - Fork 47
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
PDB delete/lifecycle #84
Comments
What is the sequence of event leading to the ORA-65197? can you please specify list of kubectl commands used? did you attempt to delete resource using "kubectl delete pdbs pdbs1 -n ..... " ? |
I forgot |
Issue reproduced in house working on it kubectl apply -f pdb_issue84.yaml cat pdb_issue84.yaml kubectl get pdbs -n pdbnamespace |
Sweet! Would be nice to be able to just But I also want to clarify that what I really need is the ability to delete the Let's say I spin up a review environment with a PDB and Deployment for each branch in my git repo, and use Renovate for dependency updates. Whenever a PR is merged, the branch and namespace is deleted. If the PDB inside the DB is not also deleted, a lot of them will build up. I cannot manually go into all review environments and delete the PDB before merging the PRs. |
If you forget to specify the r.Spec.DropAction when you delete database
As per oracle documentation keep option must be used after unpluging
So we have to choices here
Fix will be available in the next release |
Any update on if deleting the PDB resource in Kubernetes can result in the PDB being deleted in the database server? (not having to update the Kubernetes PDB resource's action field to Delete for the PDB to be deleted in the database server) |
This will not be implemented . If you need to delete a pluggable database then you need to apply a yaml file including action : "delete" + the other options associated to the delete command |
I'm sorry to say that doesn't work for us. It's not the common declerative way of managing infrastructure (and does not support cleaning up resouces by deleting the Kubernets objects). I would strongly suggest that you internally re-evaulate the approach, and read up on Kubernetes patterns. Particularly https://kubernetes.io/docs/concepts/overview/working-with-objects/finalizers regarding the deletion of objects and making sure the PDB is removed from the database server before it's fully removed from Kubernetes. |
and that's exactly what we have in the code ... we make sure it's removed from server before removing from k8s
` |
Thats nice, meaning it's not a technical issue! The thing we disagree about is then only declerative vs imperative management of the PDB resource. We would like it to behave like all other infrastructure managed in Kubernetes, that the existence and deletion of a PDB in the dbserver is declerative in Kubernetes. I.e. when the PDB resource exists in Kubernetes, it exists in the dbserver, and when it is deleted from Kubernetes, it is removed from the dbserver. We do not want to imperatively perform an action telling the operator to delete the PDB in the dbserver thorough an See e.g. to Crossplane and their |
We adopted the declarative approach long ago. Even if mixed object management it's not recommended https://kubernetes.io/docs/concepts/overview/working-with-objects/object-management/ I'm starting internal discussion . But just to set the expectation it will not be available in a short run. |
I too have the requirement to delete a PDB when it's kubernetes resource is deleted. My problem is that after creating and using multiple environments that include PDBs, I somehow need to drop them again. The propagation is done through helm charts. After using those installations, they get deleted/uninstalled by helm. |
Hi Ilfur I'm testing the following option for cdb (the rest server) DeletePDBCascade (boolean) if it's true all the pdb associated to the cdb will be dropped when you delete the cdb (kubectl delete cdb mycdb....) . |
Hello Matteo,
yes absolutely, the declarative approach of deleting the database/pdb on the CDB as soon as the kubernetes resource is deleted is what I desire :-)
Exactly as You wrote:
kubectl delete pdb mypdb ---> drop database(pdb) on the db container(cdb)
I am patient about the timeline, I will manually work around the problem in my next projects: first place a "action: Delete" (not to forget INCLUDING datafiles) in the yaml and apply, then delete the application/helm chart.
And forbid others to delete the helm chart by themselves.
Best regards,
Marcel
Gesendet: Dienstag, 13. August 2024 um 16:48 Uhr
Von: "matteo malvezzi" ***@***.***>
An: "oracle/oracle-database-operator" ***@***.***>
Cc: "ilfur" ***@***.***>, "Comment" ***@***.***>
Betreff: Re: [oracle/oracle-database-operator] PDB delete/lifecycle (Issue #84)
Hi Ilfur I'm testing the following option for cdb (the rest server) DeletePDBCascade (boolean) if it's true all the pdb associated to the cdb will be dropped when you delete the cdb (kubectl delete cdb mycdb....) .
It will be possible to implement your request as well .... If I have understood correctly you want us to adopt the declarative approach (kubectl delete pdb mypdb ---> drop database on the db container) .
PS no idea about the timeline
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
Just a quick recap: in the next release there will be two parameters .
|
Wonderful! Cant wait for it :) Thank You!
Gesendet: Dienstag, 15. Oktober 2024 um 09:53 Uhr
Von: "matteo malvezzi" ***@***.***>
An: "oracle/oracle-database-operator" ***@***.***>
Cc: "ilfur" ***@***.***>, "Comment" ***@***.***>
Betreff: Re: [oracle/oracle-database-operator] PDB delete/lifecycle (Issue #84)
Just a quick recap: in the next release there will be two parameters .
For PDB assertivePDBdeletion if it's true then the command kubectl delete pdb ... automatically drop crd & pdb
For CDB deletePdbCascade if it's true then the command kubectl delete cdb automatically delete all pdbs (CRD/PDB/datafiles) associated to the CDB
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
When deleting a PDB Kubernetes resource like the one below, I would expect the PDB to be deleted in the database. Would say that is the expected behaviour when working with Kubernetes. It also enables cleanup of ephemeral environments by deleting a namespace, without having to manually clean up all PDBs provisioned within it.
Here is the operator log from deleting pdb above:
and the state of the db after deleting the Kubernetes resource:
Current behaviour
action: Delete
Deleting a pdb by specifying
action: Delete
does not work, and results in the following:EDIT: It does work when also having
dropAction: "INCLUDING"
.action: Unplug
It results in
Error "Required value: Please specify XML metadata filename" for field "spec.xmlFileName".
AddingxmlFileName: foo.xml
seems to avoid the issue, resulting in the following status:When it succeeds unplugging, the operator also deletes the PDB resource, and the PDB is gone from the database.
The text was updated successfully, but these errors were encountered: