Alan
07/04/2024, 3:36 PMError: INSTALLATION FAILED: Unable to continue with install: ServiceAccount "prefect-worker" in namespace "test-worker" exists and cannot be imported into the current release: invalid ownership metadata; annotation validation error: key "<http://meta.helm.sh/release-name|meta.helm.sh/release-name>" must equal "prefect-worker-1": current value is "worker-mitch-test"
(base)
(edited)Marvin
07/04/2024, 3:36 PMvalues.yaml
to specify different ServiceAccount names for each worker.
Example values.yaml
modifications:
yaml
serviceAccount:
create: true
name: unique-worker-sa
worker:
...
For each worker, you should have a unique `name`: unique-worker-sa1
, unique-worker-sa2
, etc.
3. Install Helm Charts with Unique Names: Use different release names for each installation of the Helm chart.
Commands:
sh
helm install worker1 prefect-helm/prefect --namespace test-worker -f values-worker1.yaml
helm install worker2 prefect-helm/prefect --namespace test-worker -f values-worker2.yaml
Ensure each values-worker*.yaml
has a distinct ServiceAccount name.
4. Helm Chart Templates Fix: Alternatively, to avoid specifying each values.yaml
, modify the Helm templates to auto-generate unique ServiceAccount names.
In the `templates/serviceaccount.yaml`:
yaml
metadata:
name: {{ include "prefect.fullname" . }}-sa-{{ .Release.Name }}
labels:
{{ include "prefect.labels" . | nindent 4 }}
annotations:
"<http://meta.helm.sh/release-name|meta.helm.sh/release-name>": {{ .Release.Name | quote }}
"<http://meta.helm.sh/release-namespace|meta.helm.sh/release-namespace>": {{ .Release.Namespace | quote }}
This will ensure that each ServiceAccount is unique to its Helm release.
Hopefully, this helps resolve the conflict, and you can have multiple workers running in the same Kubernetes namespace.
For more information:
* Helm Docs
* Prefect Kubernetes Deployment Docs