@@ -22,57 +22,88 @@ import (
2222 runtime "k8s.io/apimachinery/pkg/runtime"
2323)
2424
25- // AppWrapperSpec defines the desired state of the appwrapper
25+ // AppWrapperSpec defines the desired state of the AppWrapper
2626type AppWrapperSpec struct {
27- // Components lists the components in the job
27+ // Components lists the components contained in the AppWrapper
2828 Components []AppWrapperComponent `json:"components"`
2929
30- // Suspend suspends the job when set to true
30+ // Suspend suspends the AppWrapper when set to true
31+ //+optional
3132 Suspend bool `json:"suspend,omitempty"`
3233}
3334
34- // AppWrapperComponent describes a wrapped resource
35+ // AppWrapperComponent describes a single wrapped Kubernetes resource
3536type AppWrapperComponent struct {
36- // PodSets contained in the component
37+ // Annotations is an unstructured key value map that may be used to store and retrieve
38+ // arbitrary metadata about the Component to customize its treatment by the AppWrapper controller.
39+ //+optional
40+ Annotations map [string ]string `json:"annotations,omitempty"`
41+
42+ // PodSets contained in the Component
43+ //+optional
3744 PodSets []AppWrapperPodSet `json:"podSets,omitempty"`
3845
39- // PodSetInfos assigned to the Component by Kueue
46+ // PodSetInfos assigned to the Component's PodSets by Kueue
47+ //+optional
4048 PodSetInfos []AppWrapperPodSetInfo `json:"podSetInfos,omitempty"`
4149
4250 // +kubebuilder:pruning:PreserveUnknownFields
4351 // +kubebuilder:validation:EmbeddedResource
44- // Template for the component
52+ // Template defines the Kubernetes resource for the Component
4553 Template runtime.RawExtension `json:"template"`
4654}
4755
4856// AppWrapperPodSet describes an homogeneous set of pods
4957type AppWrapperPodSet struct {
50- // Replicas is the number of pods in the set
58+ // Replicas is the number of pods in this PodSet
59+ //+optional
5160 Replicas * int32 `json:"replicas,omitempty"`
5261
53- // ReplicaPath is the path to the replica count for the set
62+ // ReplicaPath is the path within Component.Template to the replica count for this PodSet
63+ //+optional
5464 ReplicaPath string `json:"replicaPath,omitempty"`
5565
56- // PodPath is the path to the PodTemplateSpec
66+ // PodPath is the path Component.Template to the PodTemplateSpec for this PodSet
5767 PodPath string `json:"podPath"`
5868}
5969
70+ // AppWrapperPodSetInfo contains the data that Kueue wants to inject into an admitted PodSpecTemplate
6071type AppWrapperPodSetInfo struct {
61- Annotations map [string ]string `json:"annotations,omitempty"`
62- Labels map [string ]string `json:"labels,omitempty"`
63- NodeSelector map [string ]string `json:"nodeSelector,omitempty"`
64- Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
72+ // Annotations to be added to the PodSpecTemplate
73+ //+optional
74+ Annotations map [string ]string `json:"annotations,omitempty"`
75+ // Labels to be added to the PodSepcTemplate
76+ //+optional
77+ Labels map [string ]string `json:"labels,omitempty"`
78+ // NodeSelectors to be added to the PodSpecTemplate
79+ //+optional
80+ NodeSelector map [string ]string `json:"nodeSelector,omitempty"`
81+ // Tolerations to be added to the PodSpecTemplate
82+ //+optional
83+ Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
6584}
6685
6786// AppWrapperStatus defines the observed state of the appwrapper
6887type AppWrapperStatus struct {
6988 // Phase of the AppWrapper object
89+ //+optional
7090 Phase AppWrapperPhase `json:"phase,omitempty"`
7191
7292 // Retries counts the number of times the AppWrapper has entered the Resetting Phase
93+ //+optional
7394 Retries int32 `json:"resettingCount,omitempty"`
7495
75- // Conditions
96+ // Conditions hold the latest available observations of the AppWrapper current state.
97+ //
98+ // The type of the condition could be:
99+ //
100+ // - QuotaReserved: The AppWrapper was admitted by Kueue and has quota allocated to it
101+ // - ResourcesDeployed: The contained resources are deployed (or being deployed) on the cluster
102+ // - PodsReady: All pods of the contained resources are in the Ready or Succeeded state
103+ // - Unhealthy: One or more of the contained resources is unhealthy
104+ // - DeletingResources: The contained resources are in the process of being deleted from the cluster
105+ //
106+ //+optional
76107 Conditions []metav1.Condition `json:"conditions,omitempty"`
77108}
78109
0 commit comments