我在安装后钩子中使用安装脚本。当我使用--wait选项运行helm install时,helm会等待所有pod都准备就绪,但helm不会启动安装后挂钩脚本。然后,pod还没有准备好(pod正在等待安装脚本完成)。
我尝试使用预安装钩子,但安装脚本需要运行其他服务...
PS:如果我不使用"--wait",它工作得很好,但gitlab的CI不会在pod启动时出现错误时失败。
有没有办法在helm安装--等待期间运行安装后的钩子?
发布于 2020-02-18 04:35:47
我认为您无法使用 Helm post-install hook来解决您的问题,但您可以使用普通的 Kubernetesjobs或hooks,,即运行作业/挂钩以及仅依赖于 Kubernetes 的部署。
首先要尝试的一件事是从现有作业中删除helm.sh/hook注释。
annotations:
# This is what defines this resource as a hook. Without this line, the
# job is considered part of the release.
"helm.sh/hook": post-install
"helm.sh/hook-weight": "-5"
"helm.sh/hook-delete-policy": hook-succeeded然后,Helm可以等待它们完成,因为它们将由Kubernetes执行。
https://stackoverflow.com/questions/60262802
复制相似问题