Skip to content
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

Recreate clusters after helm delete operator #1057

Closed
neelasha-09 opened this issue Jul 13, 2020 · 6 comments
Closed

Recreate clusters after helm delete operator #1057

neelasha-09 opened this issue Jul 13, 2020 · 6 comments
Labels

Comments

@neelasha-09
Copy link
Contributor

Hi Team,

While trying to delete the resources using helm delete --purge for postgres-operator and recreating the cluster with the same name we could see the below error.

reason: 'could not create pod disruption budget: poddisruptionbudgets.policy \"postgres-postgres-operator-cluster-pdb\" already exists"  

Could you please have a look ?

@FxKu
Copy link
Member

FxKu commented Jul 13, 2020

Deleting the operator does not delete running Postgres clusters. That's actually a feature 😃

@neelasha-09
Copy link
Contributor Author

neelasha-09 commented Jul 14, 2020 via email

@FxKu
Copy link
Member

FxKu commented Jul 14, 2020

If you run helm delete postgres-operator you delete the controller for Postgres CRDs but not the postgres clusters. If you check with kubectl get postgresqls you should still be able to see your postgres-postgres-operator-cluster listed in Running state. Therefore, trying to create that cluster again will fail with the message you've posted. It can happen that a DELETE event does not clean up all resources, see #498. I don't know if this happens in your case.

To properly remove a Postgres cluster run kubectl delete postgresql postgres-postgres-operator-cluster. Then all elements incl. PDB, endpoints etc. should be removed.

@FxKu FxKu changed the title could not create pod disruption budget Recreate clusters after helm delete operator Jul 14, 2020
@FxKu FxKu added the question label Jul 14, 2020
@neelasha-09
Copy link
Contributor Author

neelasha-09 commented Jul 15, 2020 via email

@kahidna
Copy link

kahidna commented Feb 7, 2021

hi @FxKu I also tried do same (meaning reinit cluster with same name) but the error message still say
reason: 'Create' could not create cluster: could not create master endpoint: could not create master endpoint: endpoints \"acid-cluster-name" already exists.

even I reset the kubernetes cluster using kubeadm reset, delete the pv directory path, delete the docker images. the operator logs is same. Am I miss a step?

ps: my env :

  • kubernetes 1.18.6
  • postgres operator v1.5.0
  • spilo 12 1.6-p3

@holgerson97
Copy link

I could fix this by delete both namespaces for operator and the desired cluster. When reapplying it still through that error. After 10min everything went to running. I then didn't ask questions anymore. I also had to go through that entire process a few times.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants