Skip to content

Introduce hookless installation for kedify agent#462

Merged
jkremser merged 5 commits intomainfrom
hookless
May 5, 2026
Merged

Introduce hookless installation for kedify agent#462
jkremser merged 5 commits intomainfrom
hookless

Conversation

@jkremser
Copy link
Copy Markdown
Member

@jkremser jkremser commented May 4, 2026

There are actually 3 modes now when it comes to hooks and creating cr(d)s:

  • --set hooks=helm is the default one and this is the status quo so it behaves copletely the same as before => using helm hooks for creating cr(d)s and for cleanup
  • --set hooks=jobs is trying to replace the helm hooks w/ ordinary k8s jobs that deletes itself. This is useful for environments that don't render the helm hooks (helm template --no-hooks ... | k apply -f -). Like EKS plugins. Check the (*) caveats section.
  • --set hooks=argo. This guy just renders CRDs and CRs w/o any support jobs that is trying to create them. Custom argo annotations are added on those resources in order to make sure the right order is enforced (sync waves for crds (-5) and -4 for cr, default is 0)

For the last two, also init container is added to agent deployment that waits for kedify config CR to exist.

(*): caveats:

  1. cleanup in install jobs is best-effort (can't remove the rbac stuff completely, because of rbac that would be missing, resources are deleted 1 by 1 in api server)
  2. cleanup for whole helm installation is not doable w/o pre/post-delete hooks so kedifyconfig CR and CRD are left in the cluster because of the finalizer that our agent adds on the CR
  3. it's not supported to mix and match these install methods nor upgrade from 1 method to another one. The only supported path for changing from hookless to hookful or vice-versa is uninstall and there reinstall

"1." is okish, just 2 clusterrolebindings are left in the install ns
"2." can cause some headaches and we should document this. workaround:

k patch -nkeda --type=merge kedify kedify -p '{"metadata":{"finalizers":null}}'
k delete -nkeda kedify/kedify crd/kedifyconfigurations.install.kedify.io

How to test this?

helm upgrade -i agent . -nkeda \
   --set agent.kedifyServer=kedify-proxy.api.dev.kedify.io:443 \
   --set agent.orgId=** \
   --set agent.apiKey=kfy_** \
   --set hooks=jobs

or for argo (orgId & apiKey needs to be filled in the argo app):

# kubectl apply --server-side -f https://raw.githubusercontent.com/argoproj/argo-cd/refs/tags/stable/manifests/install.yaml
# kubectl create clusterrolebinding delete-me --clusterrole cluster-admin --serviceaccount default:argocd-application-controller
# kubectl apply -f argocd-application.yaml

Signed-off-by: Jirka Kremser <jiri.kremser@gmail.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new hookless installation mode to the kedify-agent chart by moving CRD/CR bootstrap resources away from Helm hooks and attempting to self-clean those helper resources after installation. It mainly affects the chart’s install/uninstall lifecycle, bootstrap ordering, and hook-based extensibility behavior.

Changes:

  • Adds a new top-level hookless value to disable Helm hooks for the chart’s CRD/CR bootstrap flow.
  • Converts CRD/KedifyConfiguration install resources to support non-hook execution, including wait logic and self-cleanup commands.
  • Disables hook-based cleanup and extra pre/post install manifest helpers when hookless is enabled.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
kedify-agent/values.yaml Adds the new hookless chart value.
kedify-agent/templates/extensibility/prepost-extra-manifests-rbac.yaml Skips hook-based extra manifest RBAC in hookless mode.
kedify-agent/templates/extensibility/prepost-extra-manifests-job.yaml Skips hook-based extra manifest jobs in hookless mode.
kedify-agent/templates/extensibility/prepost-extra-manifests-configmap.yaml Skips hook-based extra manifest ConfigMaps in hookless mode.
kedify-agent/templates/crd-install/crd-rbac.yaml Removes hook annotations conditionally and adds hookless cleanup permissions.
kedify-agent/templates/crd-install/crd-job.yaml Adds hookless CRD wait/self-delete logic and adjusts retries.
kedify-agent/templates/crd-install/crd-configmap.yaml Makes CRD content ConfigMaps non-hook resources in hookless mode.
kedify-agent/templates/cr-install/cr-rbac.yaml Removes hook annotations conditionally and adds hookless cleanup permissions for default CR install.
kedify-agent/templates/cr-install/cr-job.yaml Adds CRD wait logic, hookless self-cleanup, and retry handling for default KedifyConfiguration creation.
kedify-agent/templates/cr-install/cr-configmap.yaml Makes the default KedifyConfiguration payload ConfigMap non-hook in hookless mode.
kedify-agent/templates/cleanup/cleanup-rbac.yaml Disables uninstall cleanup RBAC when hookless mode is enabled.
kedify-agent/templates/cleanup/cleanup-job.yaml Disables uninstall cleanup job when hookless mode is enabled.
kedify-agent/templates/agent-deployment.yaml Adds an init container to block agent startup until the default KedifyConfiguration exists in hookless mode.
kedify-agent/templates/_helpers.tpl Makes CRD hook annotations conditional and adds a helper to derive CRD names from bundled files.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread kedify-agent/templates/agent-deployment.yaml Outdated
Comment thread kedify-agent/templates/agent-deployment.yaml
Comment thread kedify-agent/templates/cr-install/cr-job.yaml Outdated
Comment thread kedify-agent/templates/crd-install/crd-job.yaml Outdated
Comment thread kedify-agent/templates/crd-install/crd-rbac.yaml Outdated
Comment thread kedify-agent/templates/cleanup/cleanup-job.yaml Outdated
Comment thread kedify-agent/templates/extensibility/prepost-extra-manifests-rbac.yaml Outdated
Comment thread kedify-agent/values.yaml Outdated
Comment thread kedify-agent/templates/crd-install/crd-job.yaml Outdated
Comment thread kedify-agent/templates/cr-install/cr-job.yaml Outdated
jkremser and others added 3 commits May 5, 2026 12:56
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Jirka Kremser <535866+jkremser@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Jirka Kremser <535866+jkremser@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Jirka Kremser <535866+jkremser@users.noreply.github.com>
@jkremser jkremser force-pushed the hookless branch 2 times, most recently from 92f790c to d617cd8 Compare May 5, 2026 15:15
Signed-off-by: Jirka Kremser <jiri.kremser@gmail.com>
@jkremser jkremser merged commit 1912fac into main May 5, 2026
2 checks passed
@jkremser jkremser deleted the hookless branch May 5, 2026 15:36
@github-actions github-actions Bot added this to the kedify-agent/next milestone May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants