@@ -4,55 +4,24 @@ title: "AppWrapper Controllers"
44classes : wide
55---
66
7- Kueue has a well-developed pattern for Kueue-enabling a Custom
8- Resource Definition and its associated operator. Following this pattern
9- allows the resulting operator to smoothly run alongside the core Kueue
10- operator. The pattern consists of three main elements: an Admission
11- Controller, a Workload Controller, and a Framework Controller.
7+ Kueue has a [ well-developed pattern] ( https://kueue.sigs.k8s.io/docs/tasks/dev/integrate_a_custom_job/ )
8+ for Kueue-enabling a Custom Resource Definition and its associated operator.
129
13- #### Admission Controller
10+ AppWrapper version 1.0.6 and earlier was an * external Kueue integration*
11+ and therefore versions of the AppWrapper controller were closely tied to a matching
12+ Kueue version (Kueue 0.7 through Kueue 0.10).
1413
15- Kueue requires the definition of an Admission Controller that ensures
16- that the ` .spec.suspend ` field of newly created AppWrapper instances is
17- set to true. We also leverage the Admission Controller to ensure that
18- the user creating the AppWrapper is entitled to create all wrapped resources
19- and to validate AppWrapper-specific invariants.
14+ Starting with Kueue 0.11 and AppWrapper version 1.1, AppWrapper becamse a first class
15+ * built-in Kueue integration* . This allows a looser coupling between the
16+ two controllers and a significant simplification in their joint deployment and configuration.
2017
21- See [ appwrapper_webhook.go] ({{ site.gh_main_url }}/internal/webhook/appwrapper_webhook.go)
22- for the implementation.
23-
24- #### Workload Controller
25-
26- The Workload Controller is an instantiation of Kueue’s JobReconciller
27- along with an implementation of Kueue’s GenericJob interface for
28- AppWrappers. As is standard practice in Kueue, this controller will
29- watch AppWrapper instances and their owned Workload instances to
30- reconcile the two. This controller makes it possible for Kueue to
31- suspend and resume the AppWrapper and constrain the placement of pods
32- created by the wrapped resources of the AppWrapper. It also translates
33- the status of the AppWrapper to the format expected by Kueue.
34-
35- See [ workload_controller.go] ({{ site.gh_main_url }}/internal/controller/workload/workload_controller.go)
36- for the implementation.
37-
38- To ensure smooth interoperation with all possible configurations of Kueue,
39- it is recommended to register AppWrappers as an
40- [ externalFramework] ( https://kueue.sigs.k8s.io/docs/tasks/dev/integrate_a_custom_job/#building-an-external-integration )
41- with Kueue. Our script [ deploy-kueue.sh] ({{ site.gh_main_url }}/hack/deploy-kueue.sh) automates
42- this. The script accomplishes the following tasks:
43-
44- 1 . Adds the ability to get, list, and watch AppWrappers to the RBACs for Kueue's manager role.
45- 2 . Adds ` "AppWrapper.v1beta2.workload.codeflare.dev" ` to the list of ` externalFrameworks ` in
46- Kueue's manager configuration.
47-
48-
49- #### Framework Controller
18+ #### AppWrapper Controller
5019
51- The Framework Controller is a standard reconciliation loop that watches AppWrapper instances and
20+ The AppWrapper Controller is a standard reconciliation loop that watches AppWrapper instances and
5221is responsible for all AppWrapper-specific operations including
5322creating, monitoring, and deleting the wrapped resources in response
5423to the modifications of the AppWrapper instance’s specification and
55- status made by the Workload Controller described above .
24+ status.
5625
5726``` mermaid!
5827---
@@ -103,7 +72,7 @@ stateDiagram-v2
10372The state diagram above depicts the transitions between the Phases of
10473an AppWrapper. A label on an edge indicates the state change that will
10574trigger that transition. For example, if an AppWrapper is in the
106- Suspended Phase and ` spec.suspend ` becomes False then the Framework Controller
75+ Suspended Phase and Kueue sets ` spec.suspend ` to ` false ` then the AppWrapper Controller
10776will transition the AppWrapper to the Resuming Phase.
10877
10978These states are augmented by two orthogonal Conditions:
@@ -113,16 +82,16 @@ These states are augmented by two orthogonal Conditions:
11382QuotaReserved and ResourcesDeployed are both true in states colored blue below.
11483
11584QuotaReserved and ResourcesDeployed will initially be true in the Failed state (pink),
116- but will become false when the Framework Controller succeeds at deleting all resources created
85+ but will become false when the AppWrapper Controller succeeds at deleting all resources created
11786in the Resuming phase.
11887
11988ResourcesDeployed will be true in the Succeeded state (green), but QuotaReserved will be false.
120- After a configurable delay, the Framework controller will eventually delete the resources of
89+ After a configurable delay, the AppWrapper controller will eventually delete the resources of
12190Succeeded AppWrappers and ResourcesDeployed will become false.
12291
12392Any phase may transition to the Terminating phase (not shown) when the AppWrapper is deleted.
12493During the Terminating phase, QuotaReserved and ResourcesDeployed may initially be true
125- but will become false once the Framework Controller succeeds at deleting all associated resources.
94+ but will become false once the AppWrapper Controller succeeds at deleting all associated resources.
12695
12796See [ appwrapper_controller.go] ({{ site.gh_main_url }}/internal/controller/appwrapper/appwrapper_controller.go)
12897for the implementation.
0 commit comments