liveBook · Manning

Deployment hook

As explained in Platform Engineering on Kubernetes

A deployment hook is a lifecycle-triggered action executed before or after a software deployment.

A deployment hook is a lifecycle-triggered action executed before or after a software deployment. It can validate the environment, notify teams, audit a release, run post-deployment tests, or notify customers. section 9.3

Keptn Lifecycle Toolkit implements hooks through reusable task definitions:

  • Define behavior with a KeptnTaskDefinition using Deno, Python 3, or a container image. section 9.3
  • Bind a task to a workload with a deployment annotation such as keptn.sh/post-deployment-tasks. section 9.3
  • Let Keptn create a Kubernetes Job, then inspect task executions through Job records. section 9.3

Post-deployment task

A Deno task reads deployment context and prints the workload name, application version, and task type after the notifications service changes. The resulting execution reports taskType as post.

How Platform Engineering on Kubernetes covers it

How deep it goes
Explains task definitions, annotations, Kubernetes Job execution, and expected context output, but not task implementation beyond a small Deno example.
Examples
Demonstrates a Deno post-deployment task bound by annotation to the notifications service.
What it assumes
Assumes Kubernetes deployments and annotations, while introducing KeptnTaskDefinitions and lifecycle-task binding.
What you can do after
Operate/configure reusable Keptn tasks and inspect their Kubernetes Job executions around deployments.
How it connects
Connects deployment hooks with Kubernetes Jobs, annotations, observability, mutation webhooks, and policy engines.

This explainer was generated by Manning's knowledge graph from the text of Platform Engineering on Kubernetes. The section links point to the parts of the book it draws on.