|
| 1 | +# Implementing Lifecycle Hook Runtime Extensions |
| 2 | + |
| 3 | +<aside class="note warning"> |
| 4 | + |
| 5 | +<h1>Caution</h1> |
| 6 | + |
| 7 | +Please note Runtime SDK is an advanced feature. If implemented incorrectly, a failing Runtime Extension can severely impact the Cluster API runtime. |
| 8 | + |
| 9 | +</aside> |
| 10 | + |
| 11 | +## Introduction |
| 12 | + |
| 13 | +The proposal for [n-place updates in Cluster API](https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/20240807-in-place-updates.md) |
| 14 | +introduced extensions allowing users to execute changes on existing machines without deleting the machines and creating a new one. |
| 15 | + |
| 16 | +This document defines those extensions and provides recommendation on how to implement them. |
| 17 | + |
| 18 | +<!-- TOC --> |
| 19 | +* [Implementing Upgrade Plan Runtime Extensions](#implementing-upgrade-plan-runtime-extensions) |
| 20 | + * [Introduction](#introduction) |
| 21 | + * [Guidelines](#guidelines) |
| 22 | + * [Definitions](#definitions) |
| 23 | + * [GenerateUpgradePlan](#generateupgradeplan) |
| 24 | +<!-- TOC --> |
| 25 | + |
| 26 | +## Guidelines |
| 27 | + |
| 28 | +All guidelines defined in [Implementing Runtime Extensions](implement-extensions.md#guidelines) apply to the |
| 29 | +implementation of Runtime Extensions for upgrade plan hooks as well. |
| 30 | + |
| 31 | +In summary, Runtime Extensions are components that should be designed, written and deployed with great caution given |
| 32 | +that they can affect the proper functioning of the Cluster API runtime. A poorly implemented Runtime Extension could |
| 33 | +potentially block upgrade transitions from happening. |
| 34 | + |
| 35 | +Following recommendations are especially relevant: |
| 36 | + |
| 37 | +* [Idempotence](implement-extensions.md#idempotence) |
| 38 | +* [Deterministic result](implement-extensions.md#deterministic-result) |
| 39 | +* [Error messages](implement-extensions.md#error-messages) |
| 40 | +* [Error management](implement-extensions.md#error-management) |
| 41 | +* [Avoid dependencies](implement-extensions.md#avoid-dependencies) |
| 42 | + |
| 43 | +## Definitions |
| 44 | + |
| 45 | +For additional details about the OpenAPI spec of the upgrade plan hooks, please download the [`runtime-sdk-openapi.yaml`]({{#releaselink repo:"https://github.com/kubernetes-sigs/cluster-api" gomodule:"sigs.k8s.io/cluster-api" asset:"runtime-sdk-openapi.yaml" version:"1.11.x"}}) |
| 46 | +file and then open it from the [Swagger UI](https://editor.swagger.io/). |
0 commit comments