Skip to content

Commit 203ebf6

Browse files
committed
Add Annotations to PodSet; editing pass on CRD comments
1 parent a0ae14f commit 203ebf6

File tree

4 files changed

+130
-53
lines changed

4 files changed

+130
-53
lines changed

api/v1beta2/appwrapper_types.go

Lines changed: 46 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -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
2626
type 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
3536
type AppWrapperComponent struct {
36-
// PodSets contained in the component
37+
// PodSets contained in the Component
38+
//+optional
3739
PodSets []AppWrapperPodSet `json:"podSets,omitempty"`
3840

39-
// PodSetInfos assigned to the Component by Kueue
41+
// PodSetInfos assigned to the Component's PodSets by Kueue
42+
//+optional
4043
PodSetInfos []AppWrapperPodSetInfo `json:"podSetInfos,omitempty"`
4144

4245
// +kubebuilder:pruning:PreserveUnknownFields
4346
// +kubebuilder:validation:EmbeddedResource
44-
// Template for the component
47+
// Template defines the Kubernetes resource for the Component
4548
Template runtime.RawExtension `json:"template"`
4649
}
4750

4851
// AppWrapperPodSet describes an homogeneous set of pods
4952
type AppWrapperPodSet struct {
50-
// Replicas is the number of pods in the set
53+
// Replicas is the number of pods in this PodSet
54+
//+optional
5155
Replicas *int32 `json:"replicas,omitempty"`
5256

53-
// ReplicaPath is the path to the replica count for the set
57+
// ReplicaPath is the path within Component.Template to the replica count for this PodSet
58+
//+optional
5459
ReplicaPath string `json:"replicaPath,omitempty"`
5560

56-
// PodPath is the path to the PodTemplateSpec
61+
// PodPath is the path Component.Template to the PodTemplateSpec for this PodSet
5762
PodPath string `json:"podPath"`
63+
64+
// Annotations is an unstructured key value map that may be used to store and retrieve
65+
// arbitrary metadata about the PodSet to customize its treatment by the AppWrapper controller.
66+
//+optional
67+
Annotations map[string]string `json:"annotations,omitempty"`
5868
}
5969

70+
// AppWrapperPodSetInfo contains the data that Kueue wants to inject into an admitted PodSpecTemplate
6071
type 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
6887
type 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

api/v1beta2/zz_generated.deepcopy.go

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/workload.codeflare.dev_appwrappers.yaml

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,30 +50,38 @@ spec:
5050
metadata:
5151
type: object
5252
spec:
53-
description: AppWrapperSpec defines the desired state of the appwrapper
53+
description: AppWrapperSpec defines the desired state of the AppWrapper
5454
properties:
5555
components:
56-
description: Components lists the components in the job
56+
description: Components lists the components contained in the AppWrapper
5757
items:
58-
description: AppWrapperComponent describes a wrapped resource
58+
description: AppWrapperComponent describes a single wrapped Kubernetes
59+
resource
5960
properties:
6061
podSetInfos:
61-
description: PodSetInfos assigned to the Component by Kueue
62+
description: PodSetInfos assigned to the Component's PodSets
63+
by Kueue
6264
items:
65+
description: AppWrapperPodSetInfo contains the data that Kueue
66+
wants to inject into an admitted PodSpecTemplate
6367
properties:
6468
annotations:
6569
additionalProperties:
6670
type: string
71+
description: Annotations to be added to the PodSpecTemplate
6772
type: object
6873
labels:
6974
additionalProperties:
7075
type: string
76+
description: Labels to be added to the PodSepcTemplate
7177
type: object
7278
nodeSelector:
7379
additionalProperties:
7480
type: string
81+
description: NodeSelectors to be added to the PodSpecTemplate
7582
type: object
7683
tolerations:
84+
description: Tolerations to be added to the PodSpecTemplate
7785
items:
7886
description: |-
7987
The pod this Toleration is attached to tolerates any taint that matches
@@ -114,28 +122,37 @@ spec:
114122
type: object
115123
type: array
116124
podSets:
117-
description: PodSets contained in the component
125+
description: PodSets contained in the Component
118126
items:
119127
description: AppWrapperPodSet describes an homogeneous set
120128
of pods
121129
properties:
130+
annotations:
131+
additionalProperties:
132+
type: string
133+
description: |-
134+
Annotations is an unstructured key value map that may be used to store and retrieve
135+
arbitrary metadata about the PodSet to customize its treatment by the AppWrapper controller.
136+
type: object
122137
podPath:
123-
description: PodPath is the path to the PodTemplateSpec
138+
description: PodPath is the path Component.Template to
139+
the PodTemplateSpec for this PodSet
124140
type: string
125141
replicaPath:
126-
description: ReplicaPath is the path to the replica count
127-
for the set
142+
description: ReplicaPath is the path within Component.Template
143+
to the replica count for this PodSet
128144
type: string
129145
replicas:
130-
description: Replicas is the number of pods in the set
146+
description: Replicas is the number of pods in this PodSet
131147
format: int32
132148
type: integer
133149
required:
134150
- podPath
135151
type: object
136152
type: array
137153
template:
138-
description: Template for the component
154+
description: Template defines the Kubernetes resource for the
155+
Component
139156
type: object
140157
x-kubernetes-embedded-resource: true
141158
x-kubernetes-preserve-unknown-fields: true
@@ -144,7 +161,7 @@ spec:
144161
type: object
145162
type: array
146163
suspend:
147-
description: Suspend suspends the job when set to true
164+
description: Suspend suspends the AppWrapper when set to true
148165
type: boolean
149166
required:
150167
- components

0 commit comments

Comments
 (0)