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

serviceaccounts "my-release-spark-operator" already exists #1359

Closed
Oneal65 opened this issue Sep 28, 2021 · 9 comments
Closed

serviceaccounts "my-release-spark-operator" already exists #1359

Oneal65 opened this issue Sep 28, 2021 · 9 comments

Comments

@Oneal65
Copy link

Oneal65 commented Sep 28, 2021

I reinstall operator, the error happen. Before that happened , I use helm uninstall spark-operator/spark-operator.
the command is :
helm install my-release spark-operator/spark-operator --namespace spark-operator --set enableBatchScheduler=true --set enableWebhook=true
the error message is:
image
Error: failed pre-install: warning: Hook pre-install spark-operator/templates/serviceaccount.yaml failed: serviceaccounts "my-release-spark-operator" already exists

@TiansuYu
Copy link
Contributor

TiansuYu commented Nov 3, 2021

Second this issue. Major road blocker for short-lived deployments.

I also tried k delete serviceaccount my-release-spark-operator and k delete namespace my-namespace but it seems this error could not go away. The reason could be that for now helm does not mutate certain k8s objects properly (see helm/helm#5473 and related issues).

Would love to know any workaround. Cuz currently even if I manually delete everything under my namespace, including the service account, helm still complains about the issue shown above when I try to helm install xxx again. This applies to the spark-pi example in the quick-start tutorial.

An unmutable / non-upgradable deployment is by all means should be avoided. I think this issue should be addressed somehow.

@swartz-k
Copy link

swartz-k commented Nov 5, 2021

Looks like those command need to exec.

kubectl -n RELEASE-NAMESPACE delete sa  my-release-spark-operator 
kubectl -n RELEASE-NAMESPACE delete clusterrole  my-release-spark-operator
kubectl -n RELEASE-NAMESPACE delete clusterrolebinding  my-release-spark-operator

@swartz-k
Copy link

swartz-k commented Nov 5, 2021

I think templates/rbac.yaml need add before-hook-creation in annotation helm.sh/hook-delete-policy.

@TiansuYu
Copy link
Contributor

TiansuYu commented Nov 5, 2021

Thx, I have found out the same yesterday.

@swartz-k
Copy link

swartz-k commented Nov 5, 2021

Thx, I have found out the same yesterday.

Maybe you can make a PR to fix it.

@TiansuYu
Copy link
Contributor

Thx, I have opened the PR here #1384.

@echang0929
Copy link

echang0929 commented Nov 18, 2021

@swartz-k @TiansuYu @liyinan926, I found this as well, but there is no issue in the tags/v1beta2-1.2.2-3.0.0, i.e.

  • remove operator's sa, clusterrole and clusterrolebinding when uninstalling this helm chart
  • keep two crds, sparkapp and scheduledsparkapp, so that all of their resources in job namespace are kept.

Why? I mean, could we remove them when uninstallation rather than creation, just like previous tag versions?

Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Copy link

This issue has been automatically closed because it has not had recent activity. Please comment "/reopen" to reopen it.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants