Question

Restore a helm managed workload to a different namespace

  • 28 February 2023
  • 2 comments
  • 108 views

Userlevel 1

When I restore a helm based deployment to a different namespace, all subsequent helm commands fail due to invalid metadata. 

❯ helm upgrade releasename bitnami/chart-name

Error: UPGRADE FAILED: rendered manifests contain a resource that already exists. Unable to continue with update: ServiceAccount "Chart-neme" in namespace "recovery-test" exists and cannot be imported into the current release: invalid ownership metadata; annotation validation error: key "meta.helm.sh/release-namespace" must equal "recovery-test": current value is "default"

I can delete the ServiceAcc and recreate it, but that does not solve the problem with the invalid annotations. I tried to change all occurrences by hand but ended up with unwanted side effects on the default namespace and the live application. 

Is there any documentation how to use the transform function to replace the metadata fields? 
 


2 comments

Userlevel 7
Badge +7

@jaiganeshjk 

Userlevel 4
Badge +2

Hello @Refresh2260,

 

Thank you for contacting pour K10 community!

K10 allows Kubernetes resource artifacts to be transformed on restore. i.e. updates the container image URLs in some resources, or changes storage class settings. 

Bellow the documentation to provide you with more details:
https://docs.kasten.io/latest/usage/migration.html?highlight=transform#transforming-restored-resources

K10 5.5.6 release added "Transform sets", that has the same principle of transforms but you can create transform sets and let them ready to be used in any future restore/import operations.

Please take a look in our documentation about transform sets and let us know if you have any questions:
https://docs.kasten.io/latest/usage/transformsets.html#transform-sets

https://docs.kasten.io/latest/api/transformsets.html#api-transformset

Regards

Fernando R.

Comment