Skip to content

Commit 8615d34

Browse files
committed
book: extend Runtime SDK documentation & update proposals
1 parent a20193b commit 8615d34

16 files changed

+1057
-701
lines changed

docs/book/src/SUMMARY.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@
2626
- [Writing a ClusterClass](./tasks/experimental-features/cluster-class/write-clusterclass.md)
2727
- [Changing a ClusterClass](./tasks/experimental-features/cluster-class/change-clusterclass.md)
2828
- [Operating a managed Cluster](./tasks/experimental-features/cluster-class/operate-cluster.md)
29-
- [Runtime SDK](./tasks/experimental-features/runtime-sdk.md)
29+
- [Runtime SDK](tasks/experimental-features/runtime-sdk/index.md)
30+
- [Implementing Runtime Extensions](./tasks/experimental-features/runtime-sdk/implement-extensions.md)
31+
- [Implementing Lifecycle Hook Extensions](./tasks/experimental-features/runtime-sdk/implement-lifecycle-hooks.md)
32+
- [Implementing Topology Mutation Hook Extensions](./tasks/experimental-features/runtime-sdk/implement-topology-mutation-hook.md)
33+
- [Deploying Runtime Extensions](./tasks/experimental-features/runtime-sdk/deploy-runtime-extension.md)
3034
- [Ignition Bootstrap configuration](./tasks/experimental-features/ignition.md)
3135
- [Security Guidelines](./security/index.md)
3236
- [Pod Security Standards](./security/pod-security-standards.md)
Loading
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
@startuml
2+
title Figure 1. Cluster topology reconciliation
3+
4+
5+
' -- GROUPS START ---
6+
7+
box #LightGreen
8+
participant "API Server"
9+
end box
10+
11+
box #LightBlue
12+
participant "Cluster Topology Controller"
13+
end box
14+
15+
box #LightBlue
16+
participant "External Patch Extensions"
17+
end box
18+
19+
' -- GROUPS END ---
20+
21+
"API Server" --> "Cluster Topology Controller": Cluster reconcile event
22+
activate "Cluster Topology Controller"
23+
24+
"Cluster Topology Controller" -> "API Server": Get current Cluster topology
25+
activate "API Server"
26+
"API Server" -> "Cluster Topology Controller":
27+
deactivate "API Server"
28+
29+
group Compute desired State
30+
"Cluster Topology Controller" -> "Cluster Topology Controller": Compute desired State
31+
loop Ordered list of Patches
32+
alt
33+
"Cluster Topology Controller" -> "Cluster Topology Controller": Generate inline patches
34+
else
35+
"Cluster Topology Controller" -> "External Patch Extensions": Generate external patches
36+
activate "External Patch Extensions"
37+
"External Patch Extensions" -> "Cluster Topology Controller":
38+
deactivate "External Patch Extensions"
39+
end
40+
"Cluster Topology Controller" -> "Cluster Topology Controller": Apply patches to desired State
41+
end loop
42+
43+
loop External Patches
44+
"Cluster Topology Controller" -> "External Patch Extensions": ValidateTopology
45+
activate "External Patch Extensions"
46+
"External Patch Extensions" -> "Cluster Topology Controller":
47+
deactivate "External Patch Extensions"
48+
end loop
49+
end group
50+
51+
"Cluster Topology Controller" -> "API Server": Reconcile Cluster topology
52+
53+
deactivate "Cluster Topology Controller"
54+
55+
hide footbox
56+
@enduml
Loading

docs/book/src/tasks/experimental-features/cluster-class/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ In order to use the ClusterClass (alpha) experimental feature the Kubernetes Ver
1616
**Variable name to enable/disable the feature gate**: `CLUSTER_TOPOLOGY`
1717

1818
Additional documentation:
19-
* Background information: [ClusterClass and Managed Topologies CAEP](https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20210526-cluster-class-and-managed-topologies.md)
19+
* Background information: [ClusterClass and Managed Topologies CAEP](https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20210526-cluster-class-and-managed-topologies.md)
2020
* For ClusterClass authors:
2121
* [Writing a ClusterClass](./write-clusterclass.md)
2222
* [Changing a ClusterClass](./change-clusterclass.md)

docs/book/src/tasks/experimental-features/experimental-features.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ kubectl describe -n capi-system deployment.apps/capi-controller-manager
7878
* [ClusterResourceSet](./cluster-resource-set.md)
7979
* [ClusterClass](./cluster-class/index.md)
8080
* [Ignition Bootstrap configuration](./ignition.md)
81-
* [Runtime SDK](./runtime-sdk.md)
81+
* [Runtime SDK](runtime-sdk/index.md)
8282

8383
**Warning**: Experimental features are unreliable, i.e., some may one day be promoted to the main repository, or they may be modified arbitrarily or even disappear altogether.
8484
In short, they are not subject to any compatibility or deprecation promise.

docs/book/src/tasks/experimental-features/runtime-sdk.md

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Deploy 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+
Cluster API requires that each Runtime Extension must be deployed using an endpoint accessible from the Cluster API
12+
controllers. The recommended deployment model is to deploy a Runtime Extension in the management cluster by:
13+
14+
- Packing the Runtime Extension in a container image.
15+
- Using a Kubernetes Deployment to run the above container inside the Management Cluster.
16+
- Using a Cluster IP Service to make the Runtime Extension instances accessible via a stable DNS name.
17+
- Using a cert-manager generated Certificate to protect the endpoint.
18+
19+
For an example, please see our [test extension](https://github.com/kubernetes-sigs/cluster-api/tree/main/test/extension)
20+
which follows, as closely as possible, the kubebuilder setup used for controllers in Cluster API.
21+
22+
There are a set of important guidelines that must be considered while choosing the deployment method:
23+
24+
## Availability
25+
26+
It is recommended that Runtime Extensions should leverage some form of load-balancing, to provide high availability
27+
and performance benefits. You can run multiple Runtime Extension servers behind a Kubernetes Service to leverage the
28+
load-balancing that services support.
29+
30+
## Identity and access management
31+
32+
The security model for each Runtime Extension should be carefully defined, similar to any other application deployed
33+
in the Cluster. If the Runtime Extension requires access to the apiserver the deployment must use a dedicated service
34+
account with limited RBAC permission. Otherwise no service account should be used.
35+
36+
On top of that, the container image for the Runtime Extension should be carefully designed in order to avoid
37+
privilege escalation (e.g using [distroless](https://github.com/GoogleContainerTools/distroless) base images).
38+
The Pod spec in the Deployment manifest should enforce security best practices (e.g. do not use privileged pods).
39+
40+
## Alternative deployments methods
41+
42+
Alternative deployment methods can be used as long as the HTTPs endpoint is accessible, like e.g.:
43+
44+
- deploying the HTTPS Server as a part of another component, e.g. a controller.
45+
- deploying the HTTPS Server outside the Management Cluster.
46+
47+
In those cases recommendations about availability and identity and access management still apply.

0 commit comments

Comments
 (0)