-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
book: extend Runtime SDK documentation & update proposal
- Loading branch information
1 parent
7809ffb
commit cf6c01d
Showing
16 changed files
with
942 additions
and
672 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 56 additions & 0 deletions
56
docs/book/src/images/runtime-sdk-topology-mutation.plantuml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
@startuml | ||
title Figure 1. Cluster topology reconciliation | ||
|
||
|
||
' -- GROUPS START --- | ||
|
||
box #LightGreen | ||
participant "API Server" | ||
end box | ||
|
||
box #LightBlue | ||
participant "Cluster Topology Controller" | ||
end box | ||
|
||
box #LightBlue | ||
participant "External Patch Extensions" | ||
end box | ||
|
||
' -- GROUPS END --- | ||
|
||
"API Server" --> "Cluster Topology Controller": Cluster reconcile event | ||
activate "Cluster Topology Controller" | ||
|
||
"Cluster Topology Controller" -> "API Server": Get current Cluster topology | ||
activate "API Server" | ||
"API Server" -> "Cluster Topology Controller": | ||
deactivate "API Server" | ||
|
||
group Compute desired State | ||
"Cluster Topology Controller" -> "Cluster Topology Controller": Compute desired State | ||
loop Ordered list of Patches | ||
alt | ||
"Cluster Topology Controller" -> "Cluster Topology Controller": Generate inline patches | ||
else | ||
"Cluster Topology Controller" -> "External Patch Extensions": Generate external patches | ||
activate "External Patch Extensions" | ||
"External Patch Extensions" -> "Cluster Topology Controller": | ||
deactivate "External Patch Extensions" | ||
end | ||
"Cluster Topology Controller" -> "Cluster Topology Controller": Apply patches to desired State | ||
end loop | ||
|
||
loop External Patches | ||
"Cluster Topology Controller" -> "External Patch Extensions": ValidateTopology | ||
activate "External Patch Extensions" | ||
"External Patch Extensions" -> "Cluster Topology Controller": | ||
deactivate "External Patch Extensions" | ||
end loop | ||
end group | ||
|
||
"Cluster Topology Controller" -> "API Server": Reconcile Cluster topology | ||
|
||
deactivate "Cluster Topology Controller" | ||
|
||
hide footbox | ||
@enduml |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
51 changes: 51 additions & 0 deletions
51
docs/book/src/tasks/experimental-features/runtime-sdk/deploy-runtime-extension.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Deploy Runtime Extensions | ||
|
||
<aside class="note warning"> | ||
|
||
Please note Runtime SDK is an advanced feature. If implemented incorrectly a failing Runtime Extension can severly impact the Cluster API runtime. | ||
|
||
</aside> | ||
|
||
Cluster API requires that each Runtime Extension must be deployed using an endpoint accessible from the Cluster API | ||
controllers; additionally, Runtime Extensions must always be executed out of process (not in the same process as | ||
the Cluster API runtime). | ||
|
||
This proposal assumes that the default solution that implementers are going to adopt is to deploy Runtime Extension | ||
in the management cluster by: | ||
|
||
- Packing the Runtime Extension in a container image; | ||
- Using a Kubernetes Deployment to run the above container inside the Management Cluster; | ||
- Using a Cluster IP service to make the Runtime Extension instances accessible via a stable DNS name; | ||
- Using a cert-manager generated Certificate to protect the endpoint. | ||
|
||
There are a set of important guidelines that must be considered while choosing the deployment method: | ||
|
||
## Availability | ||
|
||
It is recommended that Runtime Extensions should leverage some form of load-balancing, to provide high availability | ||
and performance benefits; you can run multiple Runtime Extension backends behind a service to leverage the | ||
load-balancing that services support. | ||
|
||
## Identity and access management | ||
|
||
The security model for each Runtime Extensions should be carefully defined, similar to any other application deployed | ||
in the Cluster: the deployment must use a dedicated service account with limited RBAC permission. | ||
|
||
On top of that, the container image for the Runtime Extension should be carefully designed in order to avoid | ||
privilege escalation (e.g using [distroless](https://github.com/GoogleContainerTools/distroless) base images) and | ||
the Pod spec in the Deployment manifest should enforce security best practices (e.g. do not use privileged pods etc.). | ||
|
||
## Alternative deployments methods | ||
|
||
Alternative deployment methods can be used given that the requirement about the HTTP endpoint accessibility | ||
is satisfied, like e.g. | ||
|
||
- deploying the HTTP Server as a part of another component, e.g. a controller; | ||
- deploying the HTTP Server outside the Management Cluster. | ||
|
||
In these cases above recommendations about availability and identity and access management apply as well. | ||
|
||
## Example | ||
|
||
For an example, please see our [test extension](https://github.com/kubernetes-sigs/cluster-api/tree/main/test/extension) | ||
which follows the kubebuilder setup we usually use for our controllers as close as possible. |
Oops, something went wrong.