-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
helm hooks are deleted right after creation, not after all hooks are created #2737
Comments
Thank you for submitting such a detailed bug report. A PR for this won't be immediate for this, in the meantime do you have a work-around that we can share? Alex |
Unfortunately no, I just disabled admissionsWebhooks and tlsProxy in prometheus-operator. One can manually render hooks during installation/upgrade, but this can be tricky. |
|
So we've implemented as per the Helm docs, but not as per their implementation. They don't delete hooks until the end of the hook's phase. So we should mimic that rather than just deleting right at the end. |
Is there any progress on at least a temporary patch to match the expected behavior? |
I'm seeing the same issue with ingress-nginx: chart: ingress-nginx |
I've hit the same issue as @wrdls and @estahn when attempting to deploy As kustomization.yamlpatchesJson6902:
- target:
group: rbac.authorization.k8s.io
version: v1
kind: ClusterRole
name: ingress-nginx-admission
namespace: ingress-nginx
path: no-helm-hooks.json
- target:
group: rbac.authorization.k8s.io
version: v1
kind: ClusterRoleBinding
name: ingress-nginx-admission
namespace: ingress-nginx
path: no-helm-hooks.json
- target:
group: batch
version: v1
kind: Job
name: ingress-nginx-admission-create
namespace: ingress-nginx
path: no-helm-hooks.json
- target:
group: batch
version: v1
kind: Job
name: ingress-nginx-admission-patch
namespace: ingress-nginx
path: no-helm-hooks.json
- target:
group: rbac.authorization.k8s.io
version: v1
kind: Role
name: ingress-nginx-admission
namespace: ingress-nginx
path: no-helm-hooks.json
- target:
group: rbac.authorization.k8s.io
version: v1
kind: RoleBinding
name: ingress-nginx-admission
namespace: ingress-nginx
path: no-helm-hooks.json
- target:
version: v1
kind: ServiceAccount
name: ingress-nginx-admission
namespace: ingress-nginx
path: no-helm-hooks.json no-helm-hooks.json[
{
"op": "remove",
"path": "/metadata/annotations/helm.sh~1hook"
},
{
"op": "remove",
"path": "/metadata/annotations/helm.sh~1hook-delete-policy"
}
] Maybe this helps someone else as a temporary workaround to sync EDIT: Just to clarify, I'm explicitly referring to the automatic mapping of Helm hooks to ArgoCD hooks as described in the manual, which seems to take place even if not using Helm at all. |
Any idea what release this will be included in? |
@jessesuen Is there a timeline for this fix to be released? I am still running into this issue with prometheus-operator. |
🆙 |
Is there a timeline for this fix to be released? I am still running into this issue with ingress Nginx |
It is 1.8 - we are working on testing it now. @mayzhang2000 do you think it is safe to cherry-pick fix into 1.7 as well? |
I think it is safe to cherry-pick to 1.7. I will take care of that if you approve. |
Thank you @mayzhang2000 ! Please, go ahead. |
When I am trying to cherry-pick to 1.7, I realized there are too many merge conflicts. It is quite risky. |
Checklist:
argocd version
.Describe the bug
I am deploying prometheus-operator as helm dependency. It has helm hook resources including serviceaccount and job which uses this serviceaccount. I see that sa gets created and then deleted before job is created. As a result, job fails and sync fails.
To Reproduce
Try to deploy prometheus-operator as helm dependency with admission webhooks enabled in values:
It will try to create serviceaccount hook https://github.com/helm/charts/blob/master/stable/prometheus-operator/templates/prometheus-operator/admission-webhooks/job-patch/serviceaccount.yaml then it will delete it, then it will try to create job https://github.com/helm/charts/blob/master/stable/prometheus-operator/templates/prometheus-operator/admission-webhooks/job-patch/job-createSecret.yaml and it will fail because serviceaccount have been deleted to this moment.
Expected behavior
Helm deletes hooks in one go after all hooks are done, this is not documented, but it's clear from code: https://github.com/helm/helm/blob/9b42702a4bced339ff424a78ad68dd6be6e1a80a/pkg/action/hooks.go#L98 - I expect the same behavior from argocd - to delete hook resources only all of them were processed (or after sync wave maybe). It makes sense because it's often needed to have hooks running in parallel or depending on each other.
Version
The text was updated successfully, but these errors were encountered: