Adopt existing Deployment, StatefulSet or Daemonset resources into Helm install

Most Helm adoption kubectl examples will show adding the annotations and label required for Helm 3 to adopt resources, but with Deployments this may cause issues if the nested Pod spec isn’t patched also. Either way you will need to add a label and and annotations. For most resources you can simply label or annotate the spec using kubectl label and kubectl annotate commands respectively.

However for the Pod spec in Deployments, StatefulSets or DaemonSets you will need to patch the nested Pod spec. Patching the Pod spec can be done with the kubectl patch command, which you can pass the label or annotation updates to with JSON.

Add comment