Repository navigation
Closed
Labels
Description
Output of helm version:
Client: &version.Version{SemVer:"v2.14.1", GitCommit:"5270352a09c7e8b6e8c9593002a73535276507c0", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.14.1", GitCommit:"5270352a09c7e8b6e8c9593002a73535276507c0", GitTreeState:"clean"}
Output of kubectl version:
Client Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.6", GitCommit:"abdda3f9fefa29172298a2e42f5102e777a8ec25", GitTreeState:"clean", BuildDate:"2019-05-08T13:53:53Z", GoVersion:"go1.11.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"13+", GitVersion:"v1.13.6-gke.13", GitCommit:"fcbc1d20b6bca1936c0317743055ac75aef608ce", GitTreeState:"clean", BuildDate:"2019-06-19T20:50:07Z", GoVersion:"go1.11.5b4", Compiler:"gc", Platform:"linux/amd64"}
Cloud Provider/Platform (AKS, GKE, Minikube etc.): GKE
I'm installing a chart that consists of a single Kubernetes Job. Since I want it to run on every upgrade, I've given it a name that changes each time:
name: keycloak-migrations-{{ now | date "20060102150405" }}
The problem is that Helm doesn't seem to wait for the Job to finish properly:
% helm upgrade --wait -i keycloak-post-install . Release "keycloak-post-install" has been upgraded.
LAST DEPLOYED: Wed Jun 26 20:08:22 2019
NAMESPACE: default
STATUS: DEPLOYED
RESOURCES:
==> v1/ConfigMap
NAME DATA AGE
keycloak-migrations 1 95s
==> v1/Job
NAME COMPLETIONS DURATION AGE
keycloak-migrations-20190626180822 0/1 7s 7s
==> v1/Pod(related)
NAME READY STATUS RESTARTS AGE
keycloak-migrations-20190626180822-bc7zl 1/1 Running 0 7s
I guess this is a bug, since Helm waited for all of the other Jobs I've run using it.
Additional question: is there a simple way to run a Job on each upgrade?
Reacted by Mathieu Filotto and Emin Umut Gerçek
Activity
mfilotto commentedon Jun 27, 2019
I'm afraid Jobs are not managed by helm
mfilotto commentedon Jun 27, 2019
I tried to set the Job as a hook but then I have the error "failed: no objects visited"
#4670
hickeyma commentedon Jun 27, 2019
@mfilotto Jobs are managed by Helm. The discussion in #4670 mentions the use of hooks which are "un-managed" and if you have a chart which has everything marked as a hook then there is nothing to install (#4670 (comment)).
hickeyma commentedon Jun 27, 2019
@wieslaw-decent Can you show the job so I can get a better understanding of the situation?
wieslaw-decent commentedon Jun 27, 2019
@hickeyma sure! here you go:
No annotations are present, so it shouldn't be treated as a hook.
NandoTheessen commentedon Jul 5, 2019
I believe this does not only apply to hooks but also secrets, jobs and a few others! You can read more about it in the issue #4670 where there is a full list.
hickeyma commentedon Jul 8, 2019
@thomastaylor312 You have been looking into the
--waitcapability lately. You might be best placed to comment on this?thomastaylor312 commentedon Jul 8, 2019
Ok, so the behavior here is correct. Helm only waits for Jobs that are hooks. However, the
--waitflag does not support waiting for jobs, so I think this would correctly be classified as a feature request. Is that fair @wieslaw-decent?wieslaw-decent commentedon Jul 17, 2019
Thanks for looking into it, @thomastaylor312 sounds fair enough to me!
jasondamour commentedon Mar 4, 2020
@thomastaylor312 @wieslaw-decent With helm 3 out now, is there any change to this? Can helm 3 return the exit code of jobs, or is it still a feature request
desaintmartin commentedon Jun 17, 2020
This issue is interesting.
Let's say we have:
1/ A Statefulset with a database to deploy
2/ a Job containing a script that initializes the database, waiting for the database to be started as initContainer
3/ a Deployment containing the application server, waiting for the database to be started as initContainer, and simply raising exceptions if access while the database is not initialized yet
As there is no order, everything is ran in parallel, which is not an issue and works well... Unless the job fails. In this case, the deployment is successful in theory (every resource is Running, so Helm considers this a success), but a failure in practice.
Should we have an "expected state" annotation, like finished, so that we can state that we want this Job to be completed, not simply running? Or are we expected to use another architecture?
zh168654 commentedon Jul 1, 2020
@thomastaylor312 @hickeyma I've submitted a PR to implement this, could you please take a look. Thanks
github-actions commentedon Nov 22, 2020
This issue has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs.
saada commentedon Nov 22, 2020
unstale