Helm install in certain order

Helm collects all of the resources in a given Chart and it's dependencies, groups them by resource type, and then installs them in the following order (see here - Helm 2.10):

  1. Namespace
  2. ResourceQuota
  3. LimitRange
  4. PodSecurityPolicy
  5. Secret
  6. ConfigMap
  7. StorageClass
  8. PersistentVolume
  9. PersistentVolumeClaim
  10. ServiceAccount
  11. CustomResourceDefinition
  12. ClusterRole
  13. ClusterRoleBinding
  14. Role
  15. RoleBinding
  16. Service
  17. DaemonSet
  18. Pod
  19. ReplicationController
  20. ReplicaSet
  21. Deployment
  22. StatefulSet
  23. Job
  24. CronJob
  25. Ingress
  26. APIService

During uninstallation of a release, the order is reversed (see here).

Following this logic, in your case when your Job resource is created, both the Secret and the ConfigMap will already be applied, but Helm won't wait for the Job to complete before applying the Deployment. If you split your Chart to two parts (1-4, 5) and install them sequentially you would still have the problem of the Deployment being possibly applied before the Job is completed. What I would suggest is splitting your Chart to two parts (1-3, 4-5), in which the the Job has a pre-install hook, which would make sure it completes before your Deployment is applied.


Here's the order for Helm 3.7 (latest as of this writing):

  1. Namespace
  2. NetworkPolicy
  3. ResourceQuota
  4. LimitRange
  5. PodSecurityPolicy
  6. PodDisruptionBudget
  7. ServiceAccount
  8. Secret
  9. SecretList
  10. ConfigMap
  11. StorageClass
  12. PersistentVolume
  13. PersistentVolumeClaim
  14. CustomResourceDefinition
  15. ClusterRole
  16. ClusterRoleList
  17. ClusterRoleBinding
  18. ClusterRoleBindingList
  19. Role
  20. RoleList
  21. RoleBinding
  22. RoleBindingList
  23. Service
  24. DaemonSet
  25. Pod
  26. ReplicationController
  27. ReplicaSet
  28. Deployment
  29. HorizontalPodAutoscaler
  30. StatefulSet
  31. Job
  32. CronJob
  33. Ingress
  34. APIService

Source. Only difference from above is more resource types and the ServiceAccount got pushed up slightly in the list.

Also, according to this closed git issue, CustomResources are last to be installed, after everything listed above.

Also note that if you want to change this order and create a certain resource before everything else, you can do so with chart hooks