头盔按一定顺序安装 [英] Helm install in certain order

查看:136
本文介绍了头盔按一定顺序安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用以下资源创建头盔图表:

I am trying to create a Helm Chart with the following resources:

  1. 秘密
  2. ConfigMap
  3. 服务
  4. 工作
  5. 部署

这些也是按照我希望它们部署的顺序进行的.我在部署"中添加了一个挂钩,以便在安装后进行安装,但是Helm并不将其视为资源,因此必须手动进行管理.

These are also in the order that I would like them to be deployed. I have put a hook in the Deployment so that it is post-install, but then Helm does not see it as a resource and I have to manually manage it.

Job需要Secret和ConfigMap中的信息,否则我将使它成为预安装挂钩.但是我无法将所有事情都挂钩,否则在我的发行版中将无法处理任何事情.

The Job needs the information in the Secret and ConfigMap, otherwise I would make that a pre-install hook. But I can't make everything a hook or nothing will be managed in my release.

是否有人有解决方案或想法能够管理Helm版本中的所有资源,并确保作业在部署开始之前完成?

Does anyone have a solution or idea to be able to manage all of the resources within the Helm release AND make sure the Job finishes before the Deployment begins?

我现在唯一的想法就是两个图表两个:一个图表为1-4,第二个图表为5,这取决于第一个图表.

My only thought right now is two make two Charts: One with 1-4 and the second with 5 which would depend on the first.

推荐答案

Helm收集给定Chart中所有资源及其依赖项,并按资源类型对其进行分组,然后按以下顺序安装(请参见此处-头盔2.10):

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. 命名空间
  2. ResourceQuota
  3. LimitRange
  4. PodSecurityPolicy
  5. 秘密
  6. ConfigMap
  7. StorageClass
  8. PersistentVolume
  9. PersistentVolumeClaim
  10. ServiceAccount
  11. CustomResourceDefinition
  12. ClusterRole
  13. ClusterRoleBinding
  14. 角色
  15. 角色绑定
  16. 服务
  17. DaemonSet
  18. Pod
  19. ReplicationController
  20. ReplicaSet
  21. 部署
  22. StatefulSet
  23. 工作
  24. CronJob
  25. 入口
  26. APIService
  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).

按照这种逻辑,在您创建Job资源的情况下,Secret和ConfigMap都将已经应用,但是Helm在应用Deployment之前不会等待Job完成. 如果将图表分为两部分(1-4、5)并按顺序安装它们,您仍然会遇到在作业完成之前可能应用展开的问题. 我建议将图表分为两个部分(1-3、4-5),其中作业具有预安装挂钩,可以确保在应用部署之前完成该工作.

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.

这篇关于头盔按一定顺序安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆