ArgoCD : resource already exists and is not managed by SealedSecret

2.5k Views Asked by At

I create sealedsecret from dockercondigjson secret. Created secret displayed in kubectl sealed secrets. But, I have message in ArgoCD, in events of sealedsecret:

failed update: Resource "mysecret" already exists and not managed by SealedSecret

K8s-manifests(such as sealedsecret.yaml) pulled by ArgoCD from gitlab repository. What is my mistake?

2

There are 2 best solutions below

1
On BEST ANSWER

Correct, sealed-secrets controller will not decrypt a sealedsecret into an already existing secret as a precaution. If you want that, annotate the existing secret with:

sealedsecrets.bitnami.com/managed: "true"

before creating the sealedsecret.

See docs: https://github.com/bitnami-labs/sealed-secrets/#managing-existing-secrets

0
On

I solved issue by remove dockerconfigjson secret. After, that secret automatically recreated and error message is gone.