Skip to content

Commit

Permalink
Add resources section to each of the states
Browse files Browse the repository at this point in the history
Add resource section to NicClusterPolicy
This section is to be used to define resource limits and requirements
for each of the states deployed be netOp

Signed-off-by: amaslennikov <[email protected]>
  • Loading branch information
almaslennikov committed Dec 19, 2023
1 parent 7bdd26e commit e7e7f5f
Show file tree
Hide file tree
Showing 4 changed files with 774 additions and 1 deletion.
19 changes: 18 additions & 1 deletion api/v1alpha1/nicclusterpolicy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ type ImageSpec struct {
Version string `json:"version"`
// +optional
// +kubebuilder:default:={}
ImagePullSecrets []string `json:"imagePullSecrets"`
ImagePullSecrets []string `json:"imagePullSecrets"`
ContainerResources []ResourceRequirements `json:"containerResources,omitempty"`
}

// ImageSpecWithConfig Contains ImageSpec and optional configuration
Expand Down Expand Up @@ -184,6 +185,22 @@ type SecondaryNetworkSpec struct {
IpamPlugin *ImageSpec `json:"ipamPlugin,omitempty"`
}

// ResourceRequirements describes the compute resource requirements.
type ResourceRequirements struct {
// Name of the container the requirements are set for
Name string `json:"name"`
// Limits describes the maximum amount of compute resources allowed.
// More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
// +optional
Limits v1.ResourceList `json:"limits,omitempty"`
// Requests describes the minimum amount of compute resources required.
// If Requests is omitted for a container, it defaults to Limits if that is explicitly specified,
// otherwise to an implementation-defined value. Requests cannot exceed Limits.
// More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
// +optional
Requests v1.ResourceList `json:"requests,omitempty"`
}

// IBKubernetesSpec describes configuration options for ib-kubernetes
type IBKubernetesSpec struct {
// Image information for ib-kubernetes
Expand Down
36 changes: 36 additions & 0 deletions api/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 e7e7f5f

Please sign in to comment.