convoy docs
Search

Release lifecycle hooks

The fields, admission rules, status and subresource of Release lifecycle hooks.

lifecycle is a top-level field of a Release, next to spec. It holds one list of hooks per phase. Each hook creates a Job or a Pod on the target cluster. For the behavior, see Lifecycle hooks.

PathRelease.lifecycle
Subresourcereleases/lifecycle (GET, PUT, PATCH)
Statusstatus.lifecycle, condition LifecycleSucceeded
Changes metadata.generationNo

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#

FieldWhen the hooks run
preSyncAfter the dry run, before the first sync wave
postSyncAfter all waves are applied and orphans are pruned
syncFailedAfter the sync fails in the apply stage
preDeleteOn deletion, before convoy deletes the applied objects
postDeleteOn deletion, after convoy deletes the applied objects

Fields of a hook#

FieldDefaultMeaning
namerequiredUnique in its phase.
typerequiredJob or Pod.
jobTemplateRequired for type: Job. Partial metadata (labels, annotations, namespace) and a JobSpec.
podTemplateRequired for type: Pod. Partial metadata and a PodSpec.
ifalways runA CEL expression. false or an error skips the hook.
runAfterAppliedpostSync only. Healthy waits until all resources of the render are healthy.
weight0Lower weights run first. Hooks with the same weight run in parallel.
timeoutno limitAfter this time, the hook state is TimedOut.
onFailureContinueFail stops the sync (preSync) or the deletion (preDelete).
cleanupNeverOnSuccess, OnCompletion or Never.
deleteBeforeCreationfalseDelete the workloads of this hook from earlier renders before convoy creates the new one.

Templates and if read cluster (the spec.metadata keys of the Cluster and cluster.name) and release (the name, namespace, labels and annotations of the Release). Mutations do not change hook templates.

Admission rules#

  • name is required and unique in its phase.
  • type: Job requires jobTemplate, and podTemplate must not be set. type: Pod is the reverse.
  • onFailure, if set, is Continue or Fail.
  • cleanup, if set, is OnSuccess, OnCompletion or Never.
  • runAfter is allowed only on postSync hooks, and is Applied or Healthy.

Admission does not compile the if expression or the templates.

Workloads#

convoy names each workload <phase>-<name>-<hash>. The hash comes from the Release, the hook and the renderRef, so a new render creates a new workload. convoy sets these labels, and they replace user 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

Status#

status.lifecycle has one list per phase. Each entry records the workload, the renderRef, the state (Running, Succeeded, Failed or TimedOut) and the times. A skipped hook has no entry.

LifecycleSucceeded · written by convoy-controller-manager (field manager convoy-release)

ReasonStatusMeaning
AllSucceededTrueAll lifecycle hooks succeeded or were skipped.
RunningUnknownAt least one lifecycle hook is still running.
HookFailedFalseA lifecycle hook failed. This is so for each onFailure value. onFailure only controls if the sync continues.

The Lifecycle printer column shows N/A, Running:<phase>, Failed:<phase> or Completed:<phase>, for the hooks of the current render.

FieldTypeDescription
status.lifecycleLifecycleStatusLifecycle reflects the observed state of the release lifecycle hooks.
status.lifecycle.postDelete[]LifecycleHookStatuslist type: map, keys: namePostDelete are the post-delete hooks.
status.lifecycle.postDelete[].apiVersion requiredstringApiVersion is the API version of the resource created by the hook.
status.lifecycle.postDelete[].cleanedUpAtTimeCleanedUpAt is the time when the hook was cleaned up.
status.lifecycle.postDelete[].completedAtTimeCompletedAt is the time when the hook completed.
status.lifecycle.postDelete[].followUpActionstringFollowUpAction is the action to take after the hook failed.
  • 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.
status.lifecycle.postDelete[].kind requiredstringKind is the kind of the resource created by the hook.
status.lifecycle.postDelete[].messagestringMessage is the human-readable message containing the failure reason, if any.
status.lifecycle.postDelete[].name requiredstringName is the name of the hook.
status.lifecycle.postDelete[].renderRefstringRenderRef is the hash of the release render lifecycle hook was triggered by.
status.lifecycle.postDelete[].resourceName requiredstringResourceName is the name of the resource created by the hook.
status.lifecycle.postDelete[].resourceNamespace requiredstringResourceNamespace is the namespace of the resource created by the hook.
status.lifecycle.postDelete[].source requiredstringSource is the source of the hook.
  • chart is the source of a lifecycle hook that is defined in the Helm chart.
  • lifecycle is the source of a lifecycle hook that is defined in the Release.
status.lifecycle.postDelete[].startedAtTimeStartedAt is the time when the hook started.
status.lifecycle.postDelete[].state requiredstringState is the state of the hook.
  • Failed is the state of a lifecycle hook that has failed.
  • Running is the state of a lifecycle hook that is running.
  • Skipped is the state of a lifecycle hook that has been skipped.
  • Succeeded is the state of a lifecycle hook that has succeeded.
  • TimedOut is the state of a lifecycle hook that has timed out.
status.lifecycle.postDelete[].weight requiredintegerWeight is the weight of the hook.
status.lifecycle.postSync[]LifecycleHookStatuslist type: map, keys: namePostSync are the post-sync hooks.
status.lifecycle.postSync[].apiVersion requiredstringApiVersion is the API version of the resource created by the hook.
status.lifecycle.postSync[].cleanedUpAtTimeCleanedUpAt is the time when the hook was cleaned up.
status.lifecycle.postSync[].completedAtTimeCompletedAt is the time when the hook completed.
status.lifecycle.postSync[].followUpActionstringFollowUpAction is the action to take after the hook failed.
  • 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.
status.lifecycle.postSync[].kind requiredstringKind is the kind of the resource created by the hook.
status.lifecycle.postSync[].messagestringMessage is the human-readable message containing the failure reason, if any.
status.lifecycle.postSync[].name requiredstringName is the name of the hook.
status.lifecycle.postSync[].renderRefstringRenderRef is the hash of the release render lifecycle hook was triggered by.
status.lifecycle.postSync[].resourceName requiredstringResourceName is the name of the resource created by the hook.
status.lifecycle.postSync[].resourceNamespace requiredstringResourceNamespace is the namespace of the resource created by the hook.
status.lifecycle.postSync[].source requiredstringSource is the source of the hook.
  • chart is the source of a lifecycle hook that is defined in the Helm chart.
  • lifecycle is the source of a lifecycle hook that is defined in the Release.
status.lifecycle.postSync[].startedAtTimeStartedAt is the time when the hook started.
status.lifecycle.postSync[].state requiredstringState is the state of the hook.
  • Failed is the state of a lifecycle hook that has failed.
  • Running is the state of a lifecycle hook that is running.
  • Skipped is the state of a lifecycle hook that has been skipped.
  • Succeeded is the state of a lifecycle hook that has succeeded.
  • TimedOut is the state of a lifecycle hook that has timed out.
status.lifecycle.postSync[].weight requiredintegerWeight is the weight of the hook.
status.lifecycle.preDelete[]LifecycleHookStatuslist type: map, keys: namePreDelete are the pre-delete hooks.
status.lifecycle.preDelete[].apiVersion requiredstringApiVersion is the API version of the resource created by the hook.
status.lifecycle.preDelete[].cleanedUpAtTimeCleanedUpAt is the time when the hook was cleaned up.
status.lifecycle.preDelete[].completedAtTimeCompletedAt is the time when the hook completed.
status.lifecycle.preDelete[].followUpActionstringFollowUpAction is the action to take after the hook failed.
  • 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.
status.lifecycle.preDelete[].kind requiredstringKind is the kind of the resource created by the hook.
status.lifecycle.preDelete[].messagestringMessage is the human-readable message containing the failure reason, if any.
status.lifecycle.preDelete[].name requiredstringName is the name of the hook.
status.lifecycle.preDelete[].renderRefstringRenderRef is the hash of the release render lifecycle hook was triggered by.
status.lifecycle.preDelete[].resourceName requiredstringResourceName is the name of the resource created by the hook.
status.lifecycle.preDelete[].resourceNamespace requiredstringResourceNamespace is the namespace of the resource created by the hook.
status.lifecycle.preDelete[].source requiredstringSource is the source of the hook.
  • chart is the source of a lifecycle hook that is defined in the Helm chart.
  • lifecycle is the source of a lifecycle hook that is defined in the Release.
status.lifecycle.preDelete[].startedAtTimeStartedAt is the time when the hook started.
status.lifecycle.preDelete[].state requiredstringState is the state of the hook.
  • Failed is the state of a lifecycle hook that has failed.
  • Running is the state of a lifecycle hook that is running.
  • Skipped is the state of a lifecycle hook that has been skipped.
  • Succeeded is the state of a lifecycle hook that has succeeded.
  • TimedOut is the state of a lifecycle hook that has timed out.
status.lifecycle.preDelete[].weight requiredintegerWeight is the weight of the hook.
status.lifecycle.preSync[]LifecycleHookStatuslist type: map, keys: namePreSync are the pre-sync hooks.
status.lifecycle.preSync[].apiVersion requiredstringApiVersion is the API version of the resource created by the hook.
status.lifecycle.preSync[].cleanedUpAtTimeCleanedUpAt is the time when the hook was cleaned up.
status.lifecycle.preSync[].completedAtTimeCompletedAt is the time when the hook completed.
status.lifecycle.preSync[].followUpActionstringFollowUpAction is the action to take after the hook failed.
  • 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.
status.lifecycle.preSync[].kind requiredstringKind is the kind of the resource created by the hook.
status.lifecycle.preSync[].messagestringMessage is the human-readable message containing the failure reason, if any.
status.lifecycle.preSync[].name requiredstringName is the name of the hook.
status.lifecycle.preSync[].renderRefstringRenderRef is the hash of the release render lifecycle hook was triggered by.
status.lifecycle.preSync[].resourceName requiredstringResourceName is the name of the resource created by the hook.
status.lifecycle.preSync[].resourceNamespace requiredstringResourceNamespace is the namespace of the resource created by the hook.
status.lifecycle.preSync[].source requiredstringSource is the source of the hook.
  • chart is the source of a lifecycle hook that is defined in the Helm chart.
  • lifecycle is the source of a lifecycle hook that is defined in the Release.
status.lifecycle.preSync[].startedAtTimeStartedAt is the time when the hook started.
status.lifecycle.preSync[].state requiredstringState is the state of the hook.
  • Failed is the state of a lifecycle hook that has failed.
  • Running is the state of a lifecycle hook that is running.
  • Skipped is the state of a lifecycle hook that has been skipped.
  • Succeeded is the state of a lifecycle hook that has succeeded.
  • TimedOut is the state of a lifecycle hook that has timed out.
status.lifecycle.preSync[].weight requiredintegerWeight is the weight of the hook.
status.lifecycle.syncFailed[]LifecycleHookStatuslist type: map, keys: nameSyncFailed are the sync-failed hooks.
status.lifecycle.syncFailed[].apiVersion requiredstringApiVersion is the API version of the resource created by the hook.
status.lifecycle.syncFailed[].cleanedUpAtTimeCleanedUpAt is the time when the hook was cleaned up.
status.lifecycle.syncFailed[].completedAtTimeCompletedAt is the time when the hook completed.
status.lifecycle.syncFailed[].followUpActionstringFollowUpAction is the action to take after the hook failed.
  • 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.
status.lifecycle.syncFailed[].kind requiredstringKind is the kind of the resource created by the hook.
status.lifecycle.syncFailed[].messagestringMessage is the human-readable message containing the failure reason, if any.
status.lifecycle.syncFailed[].name requiredstringName is the name of the hook.
status.lifecycle.syncFailed[].renderRefstringRenderRef is the hash of the release render lifecycle hook was triggered by.
status.lifecycle.syncFailed[].resourceName requiredstringResourceName is the name of the resource created by the hook.
status.lifecycle.syncFailed[].resourceNamespace requiredstringResourceNamespace is the namespace of the resource created by the hook.
status.lifecycle.syncFailed[].source requiredstringSource is the source of the hook.
  • chart is the source of a lifecycle hook that is defined in the Helm chart.
  • lifecycle is the source of a lifecycle hook that is defined in the Release.
status.lifecycle.syncFailed[].startedAtTimeStartedAt is the time when the hook started.
status.lifecycle.syncFailed[].state requiredstringState is the state of the hook.
  • Failed is the state of a lifecycle hook that has failed.
  • Running is the state of a lifecycle hook that is running.
  • Skipped is the state of a lifecycle hook that has been skipped.
  • Succeeded is the state of a lifecycle hook that has succeeded.
  • TimedOut is the state of a lifecycle hook that has timed out.
status.lifecycle.syncFailed[].weight requiredintegerWeight is the weight of the hook.

Subresource and CLI#

A write to releases/lifecycle changes only lifecycle, and requests a reconcile. Kubernetes RBAC controls releases/lifecycle separately from the Release.

sh
kubectl convoy release lifecycle get podinfo
kubectl convoy release lifecycle set podinfo -f hooks.yaml

Fields#

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.

In the code

convoy v0.9.0