convoy docs
Search

Lifecycle hooks

How convoy runs Jobs and Pods on the target cluster before and after a sync, on a sync failure, and on deletion.

A lifecycle hook is a Job or a Pod that convoy creates on the target cluster at a fixed point of a sync or of a deletion. Use hooks for work that is not part of the rendered manifests. Examples are database migrations, smoke tests and notifications. You write the hooks in the top-level lifecycle field of the Release, or through the /lifecycle subresource. For the fields and admission rules, see Release lifecycle hooks.

Hook timeline Pick a scenario and step through it. Each event is followed by one reconcile. During a deletion, the Release status does not change.
StepWhat occursEffect of a hook with onFailure: Fail
1Cluster wave check, dry run, render storednone
2preSync hookssync stops, nothing applied
3Sync waves applied, orphans prunednone
4postSync hooks, after Applied or Healthylater weight groups do not run
on failure of step 1 or 3syncFailed hooksnone
delete 1preDelete hooksdeletion stops
delete 2Applied objects deleted, if keepWorkloads: falsenone
delete 3postDelete hooksnone

The order of one sync and of one deletion.

Example#

releases/release-gitrepository-helm-in-cluster-with-lifecycle.yaml
apiVersion: core.convoy.kumodo.io/v1alpha1
kind: Release
metadata:
  name: podinfo-in-cluster-helm-with-lifecycle
  namespace: default
lifecycle:
  preSync:
    - name: pre-sleep
      type: Job
      timeout: 30s
      onFailure: Continue
      cleanup: Never
      deleteBeforeCreation: true
      jobTemplate:
        metadata:
          labels:
            test-label: "true"
          annotations:
            test-annotation: "true"
        spec:
          template:
            spec:
              restartPolicy: Never
              containers:
                - name: job-worker
                  image: "busybox:1.38.0"
                  command: ["sh", "-c", "sleep 10"]
  postSync:
    - name: post-sleep
      type: Job
      runAfter: Healthy
      timeout: 30s
      onFailure: Continue
      cleanup: OnSuccess
      jobTemplate:
        metadata:
          labels:
            test-label: "true"
          annotations:
            test-annotation: "true"
        spec:
          template:
            spec:
              restartPolicy: Never
              containers:
                - name: job-worker
                  image: "busybox:1.38.0"
                  command: ["sh", "-c", "sleep 10"]
mutations:
  - type: syncWave
    waveStrategy:
      strategy: waitForHealthy
      wave: 1
    target:
      group: ""
      version: v1
      kind: Service
spec:
  clusterRef:
    name: dev-local
  source:
    type: gitRepository
    gitRepository:
      name: podinfo
      namespace: default
      ref:
        branch: master
  content:
    type: helm
    helm:
      path: charts/podinfo
      releaseName: podinfo-helm
      values:
        - type: inline
          inline:
            probes:
              readiness:
                initialDelaySeconds: 15
              liveness:
                initialDelaySeconds: 15
  syncPolicy:
    automatic: true
    prune:
      orphaned: false
      includeCRDs: false
      includeNamespaces: false
    interval: 1m
  healthAssessment:
    globalRuleSetSelector:
      matchLabels:
        convoy.kumodo.io/default: "true"
    deadline: 1m

Phases#

PhaseWhen it runs
preSyncAfter the dry run and before the first sync wave. A running hook holds the sync.
postSyncAfter all waves are applied and orphans are pruned.
syncFailedAfter the sync fails in the apply stage.
preDeleteWhen you delete the Release, before convoy deletes the applied objects.
postDeleteAfter convoy deletes the applied objects.

convoy runs preSync, postSync and syncFailed hooks one time for each render. A new render runs them again. A reconcile of the same render does not run them again.

preSync#

While a preSync hook runs, convoy applies nothing. Applied is False with reason WaitingForHook. If the Release holds at a cluster wave, the preSync hooks do not start.

postSync and runAfter#

runAfter sets when a postSync hook starts. It is allowed only on postSync hooks.

  • Applied (default): the hook starts immediately after the apply.
  • Healthy: the hook starts when all resources of the Release are Healthy for the current render. This includes the resources of all waves.

Without spec.healthAssessment, Healthy has the same effect as Applied. runAfter only controls the start of the hook. convoy does not check it again after the hook starts.

A postSync hook does not change the result of the sync. The apply occurred before the hook.

syncFailed#

syncFailed hooks run when the render succeeded, but a step of the apply stage failed. Examples are a failed dry run, a failed apply, a failed prune, and a failed wave gate. They do not run when these fail:

  • the fetch of the source, or the render
  • the target cluster
  • a preSync hook
  • a cluster wave timeout (ClusterWaveFailed)

convoy starts syncFailed hooks and does not wait for them. Their result does not change the sync. onFailure has no effect.

preDelete and postDelete#

convoy runs the delete hooks also when spec.deletionPolicy.keepWorkloads is true. convoy skips the hooks in two cases:

  • The Cluster object does not exist.
  • The target cluster is not reachable, and blockOnClusterUnreachable is false.

With blockOnClusterUnreachable: true, an unreachable cluster blocks the deletion until it is reachable. See Deletion.

The workload#

Each hook has type: Job with a jobTemplate, or type: Pod with a podTemplate. A template has a partial metadata and a Kubernetes spec:

  • metadata can set only namespace, labels and annotations. Without a namespace, convoy uses the target namespace of spec.content (releaseNamespace or targetNamespace). If that is also empty, convoy uses default.
  • convoy sets the name of the workload. The name is {phase}-{name}-{hash}, for example presync-migrate-1f2e3d4c. The phase is in lowercase. convoy shortens the hook name to 32 characters. The hash comes from the Release name, the hook name and the render.
  • convoy adds these labels. They replace your labels with the same key.
LabelValue
convoy.kumodo.io/managed-byconvoy
convoy.kumodo.io/release-nameThe name of the Release
convoy.kumodo.io/release-namespaceThe namespace of the Release
convoy.kumodo.io/release-uidThe UID of the Release
convoy.kumodo.io/hook-phaseThe phase, for example PreSync
convoy.kumodo.io/hook-nameThe name of the hook

The workload is on a different cluster, so it has no owner reference. convoy finds the workloads of a hook with the release-uid, hook-phase and hook-name labels.

Templates and the if condition#

convoy renders the template as a Go template before it creates the workload. The if field is a CEL expression. Both use the same values:

ValueContents
clusterThe keys of spec.metadata of the Cluster, and cluster.name
releasename, namespace, labels and annotations of the Release
yaml
lifecycle:
  postSync:
    - name: smoke-test
      type: Job
      if: 'cluster.tier == "production"'
      jobTemplate:
        spec:
          template:
            spec:
              restartPolicy: Never
              containers:
                - name: test
                  image: curlimages/curl:8.10.1
                  args: ["https://{{ .release.name }}.{{ .cluster.domain }}/healthz"]
  • A key that does not exist renders as an empty value. It does not cause an error.
  • An empty if is true.
  • If if is false, or it cannot be evaluated, convoy skips the hook. It creates no workload and records no entry. A skipped hook is not in status.lifecycle.
  • Admission does not compile the if expression or the template.

Mutations do not change hook templates. The mutation pipeline changes only the rendered objects.

Order in a phase#

weight puts the hooks of a phase in groups. convoy runs the groups in ascending order of weight:

  1. convoy starts all hooks of the lowest group. Hooks with the same weight run in parallel.
  2. convoy waits until all hooks of the group finish.
  3. convoy cleans up the finished hooks and starts the next group.
  4. When the last group finishes, the phase is complete.

Timeout#

timeout is the maximum time from the creation of the workload. When the timeout passes and the workload did not finish, the hook is TimedOut. Without timeout, convoy waits without a time limit.

convoy does not stop the workload at the timeout. The cleanup policy can delete it.

Failure#

A hook fails when the Job has the Failed condition, or the Pod has the Failed phase. A TimedOut hook is also a failure. onFailure sets what convoy does next:

onFailurepreSyncpostSyncpreDeletepostDelete
empty or ContinueThe phase continues.The phase continues.The phase continues.The phase continues.
FailThe sync stops. Applied=False, reason HookFailed.Later groups do not run. The apply stays.The deletion stops. The finalizer stays.convoy logs the failure and completes the deletion.

convoy does not run a failed hook again for the same render. A new render runs it again.

Cleanup#

cleanup sets what convoy does with the workload when the hook finishes:

cleanupWorkload deleted when
empty or NeverNever
OnSuccessThe hook succeeded
OnCompletionThe hook finished, also after a failure

A hook that fails with onFailure: Fail stops the phase before the cleanup step. Thus, convoy does not delete its workload, also with cleanup: OnCompletion.

deleteBeforeCreation: true deletes all earlier workloads of the hook before convoy creates the new one. The name changes with each render. Thus, with cleanup: Never and deleteBeforeCreation: false, one workload for each render stays on the cluster.

There is no garbage collection of hook workloads. convoy does not delete the workloads that stay after the deletion of the Release. A retention policy is planned. Not built

Status#

convoy records each hook in status.lifecycle, in a list for each phase:

yaml
status:
  lifecycle:
    preSync:
      - name: migrate
        source: lifecycle
        kind: Job
        apiVersion: batch/v1
        resourceNamespace: default
        resourceName: presync-migrate-1f2e3d4c
        state: Failed
        renderRef: sha256:…
        followUpAction: Fail
        message: …
  • state is Running, Succeeded, Failed or TimedOut.
  • followUpAction is the onFailure value. convoy sets it only for a Failed or TimedOut hook. Without onFailure, the value is empty, and the hook acts as Continue.
  • Each entry shows the last run of the hook. renderRef is the render of that run. An entry from an earlier render stays until the hook runs again.

The LifecycleSucceeded condition sums up all entries:

EntriesStatusReason
No entryThe condition is not set.
At least one Failed or TimedOutFalseHookFailed
At least one RunningUnknownRunning
All SucceededTrueAllSucceeded

The condition reports a failure also when onFailure is Continue.

The Lifecycle printer column of kubectl get releases uses only the entries of the current render. Its value is N/A, Running:<phase>, Failed:<phase> or Completed:<phase>.

FieldTypeDescription
lifecycleReleaseLifecycleReleaseLifecycle defines the desired state of the ReleaseLifecycle.
lifecycle.postDelete[]LifecycleHookSpeclist type: atomicPostDelete are the post-delete hooks.
lifecycle.postDelete[].cleanup requiredstringCleanup is the action to take when the hook completes.
  • Never is the condition to never perform a cleanup action when a lifecycle hook completes.
  • OnCompletion is the condition to perform a cleanup action when a lifecycle hook completes with any result.
  • OnSuccess is the condition to perform a cleanup action when a lifecycle hook succeeds.
lifecycle.postDelete[].deleteBeforeCreationbooleanDeleteBeforeCreation is true if the hook should delete the resources before they are created.
lifecycle.postDelete[].ifstringIf is the hook execution condition written in CEL expression format.
lifecycle.postDelete[].jobTemplateLifecycleHookJobTemplateJobTemplate is the job template for the hook. Mutual exclusive with PodTemplate.
lifecycle.postDelete[].jobTemplate.metadataPartialMetadataMetadata contains partial object metadata.
lifecycle.postDelete[].jobTemplate.metadata.annotationsmap[string]stringAnnotations is the annotations that will be set on the lifecycle hook workload.
lifecycle.postDelete[].jobTemplate.metadata.labelsmap[string]stringLabels is the labels that will be set on the lifecycle hook workload.
lifecycle.postDelete[].jobTemplate.metadata.namespacestringNamespace is the namespace where the lifecycle hook workload should run. Defaults to release target namespace if not set.
lifecycle.postDelete[].jobTemplate.spec requiredJobSpecSpec contains the Job spec.
lifecycle.postDelete[].name requiredstringName is the name of the hook.
lifecycle.postDelete[].onFailure requiredstringOnFailure is the action to take when the hook fails.
  • Continue is the action to take when a lifecycle hook fails and the Release processing should continue.
  • Fail is the action to take when a lifecycle hook fails and the Release processing should fail.
lifecycle.postDelete[].podTemplateLifecycleHookPodTemplatePodTemplate is the pod template for the hook. Mutual exclusive with JobTemplate.
lifecycle.postDelete[].podTemplate.metadataPartialMetadataMetadata contains partial object metadata.
lifecycle.postDelete[].podTemplate.metadata.annotationsmap[string]stringAnnotations is the annotations that will be set on the lifecycle hook workload.
lifecycle.postDelete[].podTemplate.metadata.labelsmap[string]stringLabels is the labels that will be set on the lifecycle hook workload.
lifecycle.postDelete[].podTemplate.metadata.namespacestringNamespace is the namespace where the lifecycle hook workload should run. Defaults to release target namespace if not set.
lifecycle.postDelete[].podTemplate.spec requiredPodSpecSpec contains the Pod spec.
lifecycle.postDelete[].runAfterstringRunAfter defines the Release condition that should be achieved before running the PostSync lifecycle hook(s).
  • Applied defines the Release state equals to "Applied" to run the PostSync lifecycle hooks.
  • Healthy defines the Release state equals to "Healthy" to run the PostSync lifecycle hooks.
lifecycle.postDelete[].timeoutDurationTimeout is the timeout for the hook. If not set, controller will wait indefinitely.
lifecycle.postDelete[].type requiredstringType is the type of the hook.
  • Job is the type of a lifecycle hook that runs as a job.
  • Pod is the type of a lifecycle hook that runs as a pod.
lifecycle.postDelete[].weight requiredintegerWeight is the weight of the hook.
lifecycle.postSync[]LifecycleHookSpeclist type: atomicPostSync are the post-sync hooks.
lifecycle.postSync[].cleanup requiredstringCleanup is the action to take when the hook completes.
  • Never is the condition to never perform a cleanup action when a lifecycle hook completes.
  • OnCompletion is the condition to perform a cleanup action when a lifecycle hook completes with any result.
  • OnSuccess is the condition to perform a cleanup action when a lifecycle hook succeeds.
lifecycle.postSync[].deleteBeforeCreationbooleanDeleteBeforeCreation is true if the hook should delete the resources before they are created.
lifecycle.postSync[].ifstringIf is the hook execution condition written in CEL expression format.
lifecycle.postSync[].jobTemplateLifecycleHookJobTemplateJobTemplate is the job template for the hook. Mutual exclusive with PodTemplate.
lifecycle.postSync[].jobTemplate.metadataPartialMetadataMetadata contains partial object metadata.
lifecycle.postSync[].jobTemplate.metadata.annotationsmap[string]stringAnnotations is the annotations that will be set on the lifecycle hook workload.
lifecycle.postSync[].jobTemplate.metadata.labelsmap[string]stringLabels is the labels that will be set on the lifecycle hook workload.
lifecycle.postSync[].jobTemplate.metadata.namespacestringNamespace is the namespace where the lifecycle hook workload should run. Defaults to release target namespace if not set.
lifecycle.postSync[].jobTemplate.spec requiredJobSpecSpec contains the Job spec.
lifecycle.postSync[].name requiredstringName is the name of the hook.
lifecycle.postSync[].onFailure requiredstringOnFailure is the action to take when the hook fails.
  • Continue is the action to take when a lifecycle hook fails and the Release processing should continue.
  • Fail is the action to take when a lifecycle hook fails and the Release processing should fail.
lifecycle.postSync[].podTemplateLifecycleHookPodTemplatePodTemplate is the pod template for the hook. Mutual exclusive with JobTemplate.
lifecycle.postSync[].podTemplate.metadataPartialMetadataMetadata contains partial object metadata.
lifecycle.postSync[].podTemplate.metadata.annotationsmap[string]stringAnnotations is the annotations that will be set on the lifecycle hook workload.
lifecycle.postSync[].podTemplate.metadata.labelsmap[string]stringLabels is the labels that will be set on the lifecycle hook workload.
lifecycle.postSync[].podTemplate.metadata.namespacestringNamespace is the namespace where the lifecycle hook workload should run. Defaults to release target namespace if not set.
lifecycle.postSync[].podTemplate.spec requiredPodSpecSpec contains the Pod spec.
lifecycle.postSync[].runAfterstringRunAfter defines the Release condition that should be achieved before running the PostSync lifecycle hook(s).
  • Applied defines the Release state equals to "Applied" to run the PostSync lifecycle hooks.
  • Healthy defines the Release state equals to "Healthy" to run the PostSync lifecycle hooks.
lifecycle.postSync[].timeoutDurationTimeout is the timeout for the hook. If not set, controller will wait indefinitely.
lifecycle.postSync[].type requiredstringType is the type of the hook.
  • Job is the type of a lifecycle hook that runs as a job.
  • Pod is the type of a lifecycle hook that runs as a pod.
lifecycle.postSync[].weight requiredintegerWeight is the weight of the hook.
lifecycle.preDelete[]LifecycleHookSpeclist type: atomicPreDelete are the pre-delete hooks.
lifecycle.preDelete[].cleanup requiredstringCleanup is the action to take when the hook completes.
  • Never is the condition to never perform a cleanup action when a lifecycle hook completes.
  • OnCompletion is the condition to perform a cleanup action when a lifecycle hook completes with any result.
  • OnSuccess is the condition to perform a cleanup action when a lifecycle hook succeeds.
lifecycle.preDelete[].deleteBeforeCreationbooleanDeleteBeforeCreation is true if the hook should delete the resources before they are created.
lifecycle.preDelete[].ifstringIf is the hook execution condition written in CEL expression format.
lifecycle.preDelete[].jobTemplateLifecycleHookJobTemplateJobTemplate is the job template for the hook. Mutual exclusive with PodTemplate.
lifecycle.preDelete[].jobTemplate.metadataPartialMetadataMetadata contains partial object metadata.
lifecycle.preDelete[].jobTemplate.metadata.annotationsmap[string]stringAnnotations is the annotations that will be set on the lifecycle hook workload.
lifecycle.preDelete[].jobTemplate.metadata.labelsmap[string]stringLabels is the labels that will be set on the lifecycle hook workload.
lifecycle.preDelete[].jobTemplate.metadata.namespacestringNamespace is the namespace where the lifecycle hook workload should run. Defaults to release target namespace if not set.
lifecycle.preDelete[].jobTemplate.spec requiredJobSpecSpec contains the Job spec.
lifecycle.preDelete[].name requiredstringName is the name of the hook.
lifecycle.preDelete[].onFailure requiredstringOnFailure is the action to take when the hook fails.
  • Continue is the action to take when a lifecycle hook fails and the Release processing should continue.
  • Fail is the action to take when a lifecycle hook fails and the Release processing should fail.
lifecycle.preDelete[].podTemplateLifecycleHookPodTemplatePodTemplate is the pod template for the hook. Mutual exclusive with JobTemplate.
lifecycle.preDelete[].podTemplate.metadataPartialMetadataMetadata contains partial object metadata.
lifecycle.preDelete[].podTemplate.metadata.annotationsmap[string]stringAnnotations is the annotations that will be set on the lifecycle hook workload.
lifecycle.preDelete[].podTemplate.metadata.labelsmap[string]stringLabels is the labels that will be set on the lifecycle hook workload.
lifecycle.preDelete[].podTemplate.metadata.namespacestringNamespace is the namespace where the lifecycle hook workload should run. Defaults to release target namespace if not set.
lifecycle.preDelete[].podTemplate.spec requiredPodSpecSpec contains the Pod spec.
lifecycle.preDelete[].runAfterstringRunAfter defines the Release condition that should be achieved before running the PostSync lifecycle hook(s).
  • Applied defines the Release state equals to "Applied" to run the PostSync lifecycle hooks.
  • Healthy defines the Release state equals to "Healthy" to run the PostSync lifecycle hooks.
lifecycle.preDelete[].timeoutDurationTimeout is the timeout for the hook. If not set, controller will wait indefinitely.
lifecycle.preDelete[].type requiredstringType is the type of the hook.
  • Job is the type of a lifecycle hook that runs as a job.
  • Pod is the type of a lifecycle hook that runs as a pod.
lifecycle.preDelete[].weight requiredintegerWeight is the weight of the hook.
lifecycle.preSync[]LifecycleHookSpeclist type: atomicPreSync are the pre-sync hooks.
lifecycle.preSync[].cleanup requiredstringCleanup is the action to take when the hook completes.
  • Never is the condition to never perform a cleanup action when a lifecycle hook completes.
  • OnCompletion is the condition to perform a cleanup action when a lifecycle hook completes with any result.
  • OnSuccess is the condition to perform a cleanup action when a lifecycle hook succeeds.
lifecycle.preSync[].deleteBeforeCreationbooleanDeleteBeforeCreation is true if the hook should delete the resources before they are created.
lifecycle.preSync[].ifstringIf is the hook execution condition written in CEL expression format.
lifecycle.preSync[].jobTemplateLifecycleHookJobTemplateJobTemplate is the job template for the hook. Mutual exclusive with PodTemplate.
lifecycle.preSync[].jobTemplate.metadataPartialMetadataMetadata contains partial object metadata.
lifecycle.preSync[].jobTemplate.metadata.annotationsmap[string]stringAnnotations is the annotations that will be set on the lifecycle hook workload.
lifecycle.preSync[].jobTemplate.metadata.labelsmap[string]stringLabels is the labels that will be set on the lifecycle hook workload.
lifecycle.preSync[].jobTemplate.metadata.namespacestringNamespace is the namespace where the lifecycle hook workload should run. Defaults to release target namespace if not set.
lifecycle.preSync[].jobTemplate.spec requiredJobSpecSpec contains the Job spec.
lifecycle.preSync[].name requiredstringName is the name of the hook.
lifecycle.preSync[].onFailure requiredstringOnFailure is the action to take when the hook fails.
  • Continue is the action to take when a lifecycle hook fails and the Release processing should continue.
  • Fail is the action to take when a lifecycle hook fails and the Release processing should fail.
lifecycle.preSync[].podTemplateLifecycleHookPodTemplatePodTemplate is the pod template for the hook. Mutual exclusive with JobTemplate.
lifecycle.preSync[].podTemplate.metadataPartialMetadataMetadata contains partial object metadata.
lifecycle.preSync[].podTemplate.metadata.annotationsmap[string]stringAnnotations is the annotations that will be set on the lifecycle hook workload.
lifecycle.preSync[].podTemplate.metadata.labelsmap[string]stringLabels is the labels that will be set on the lifecycle hook workload.
lifecycle.preSync[].podTemplate.metadata.namespacestringNamespace is the namespace where the lifecycle hook workload should run. Defaults to release target namespace if not set.
lifecycle.preSync[].podTemplate.spec requiredPodSpecSpec contains the Pod spec.
lifecycle.preSync[].runAfterstringRunAfter defines the Release condition that should be achieved before running the PostSync lifecycle hook(s).
  • Applied defines the Release state equals to "Applied" to run the PostSync lifecycle hooks.
  • Healthy defines the Release state equals to "Healthy" to run the PostSync lifecycle hooks.
lifecycle.preSync[].timeoutDurationTimeout is the timeout for the hook. If not set, controller will wait indefinitely.
lifecycle.preSync[].type requiredstringType is the type of the hook.
  • Job is the type of a lifecycle hook that runs as a job.
  • Pod is the type of a lifecycle hook that runs as a pod.
lifecycle.preSync[].weight requiredintegerWeight is the weight of the hook.
lifecycle.syncFailed[]LifecycleHookSpeclist type: atomicSyncFailed are the sync-failed hooks.
lifecycle.syncFailed[].cleanup requiredstringCleanup is the action to take when the hook completes.
  • Never is the condition to never perform a cleanup action when a lifecycle hook completes.
  • OnCompletion is the condition to perform a cleanup action when a lifecycle hook completes with any result.
  • OnSuccess is the condition to perform a cleanup action when a lifecycle hook succeeds.
lifecycle.syncFailed[].deleteBeforeCreationbooleanDeleteBeforeCreation is true if the hook should delete the resources before they are created.
lifecycle.syncFailed[].ifstringIf is the hook execution condition written in CEL expression format.
lifecycle.syncFailed[].jobTemplateLifecycleHookJobTemplateJobTemplate is the job template for the hook. Mutual exclusive with PodTemplate.
lifecycle.syncFailed[].jobTemplate.metadataPartialMetadataMetadata contains partial object metadata.
lifecycle.syncFailed[].jobTemplate.metadata.annotationsmap[string]stringAnnotations is the annotations that will be set on the lifecycle hook workload.
lifecycle.syncFailed[].jobTemplate.metadata.labelsmap[string]stringLabels is the labels that will be set on the lifecycle hook workload.
lifecycle.syncFailed[].jobTemplate.metadata.namespacestringNamespace is the namespace where the lifecycle hook workload should run. Defaults to release target namespace if not set.
lifecycle.syncFailed[].jobTemplate.spec requiredJobSpecSpec contains the Job spec.
lifecycle.syncFailed[].name requiredstringName is the name of the hook.
lifecycle.syncFailed[].onFailure requiredstringOnFailure is the action to take when the hook fails.
  • Continue is the action to take when a lifecycle hook fails and the Release processing should continue.
  • Fail is the action to take when a lifecycle hook fails and the Release processing should fail.
lifecycle.syncFailed[].podTemplateLifecycleHookPodTemplatePodTemplate is the pod template for the hook. Mutual exclusive with JobTemplate.
lifecycle.syncFailed[].podTemplate.metadataPartialMetadataMetadata contains partial object metadata.
lifecycle.syncFailed[].podTemplate.metadata.annotationsmap[string]stringAnnotations is the annotations that will be set on the lifecycle hook workload.
lifecycle.syncFailed[].podTemplate.metadata.labelsmap[string]stringLabels is the labels that will be set on the lifecycle hook workload.
lifecycle.syncFailed[].podTemplate.metadata.namespacestringNamespace is the namespace where the lifecycle hook workload should run. Defaults to release target namespace if not set.
lifecycle.syncFailed[].podTemplate.spec requiredPodSpecSpec contains the Pod spec.
lifecycle.syncFailed[].runAfterstringRunAfter defines the Release condition that should be achieved before running the PostSync lifecycle hook(s).
  • Applied defines the Release state equals to "Applied" to run the PostSync lifecycle hooks.
  • Healthy defines the Release state equals to "Healthy" to run the PostSync lifecycle hooks.
lifecycle.syncFailed[].timeoutDurationTimeout is the timeout for the hook. If not set, controller will wait indefinitely.
lifecycle.syncFailed[].type requiredstringType is the type of the hook.
  • Job is the type of a lifecycle hook that runs as a job.
  • Pod is the type of a lifecycle hook that runs as a pod.
lifecycle.syncFailed[].weight requiredintegerWeight is the weight of the hook.

Helm chart hooks#

convoy does not translate Helm hooks into lifecycle hooks. It drops Helm test hooks. It applies other objects with a helm.sh/hook annotation as normal resources. A translation of Helm hooks into lifecycle hooks is planned. Not built

In the code

convoy v0.9.0