Skip to content

Commit

Permalink
Report pod and storage resource via generic resource (#529)
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <[email protected]>
  • Loading branch information
tamalsaha authored Jan 13, 2025
1 parent c933111 commit ed1c49e
Show file tree
Hide file tree
Showing 4 changed files with 449 additions and 2 deletions.
29 changes: 28 additions & 1 deletion apis/core/v1alpha1/generic_resource_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,34 @@ type GenericResourceSpec struct {
RoleResourceLimits map[api.PodRole]core.ResourceList `json:"roleResourceLimits,omitempty"`
// +optional
RoleResourceRequests map[api.PodRole]core.ResourceList `json:"roleResourceRequests,omitempty"`
Status GenericResourceStatus `json:"status"`

Pods []ComputeResource `json:"pods,omitempty"`
Storage []StorageResource `json:"storage,omitempty"`

Status GenericResourceStatus `json:"status"`
}

type ComputeResource struct {
Name string `json:"name"`
// +optional
CreationTimestamp metav1.Time `json:"creationTimestamp,omitempty"`
Containers []ContainerResource `json:"containers,omitempty"`
InitContainers []ContainerResource `json:"initContainers,omitempty"`
}

type ContainerResource struct {
Name string `json:"name"`
// +optional
Resource core.ResourceRequirements `json:"resource"`
RestartPolicy *core.ContainerRestartPolicy `json:"restartPolicy,omitempty"`
}

type StorageResource struct {
Name string `json:"name"`
// +optional
CreationTimestamp metav1.Time `json:"creationTimestamp,omitempty"`
// +optional
Resources core.VolumeResourceRequirements `json:"resources,omitempty"`
}

type GenericResourceStatus struct {
Expand Down
151 changes: 150 additions & 1 deletion apis/core/v1alpha1/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

85 changes: 85 additions & 0 deletions apis/core/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ed1c49e

Please sign in to comment.