diff --git a/operator/api/redpanda/v1alpha2/redpanda_clusterspec_types.go b/operator/api/redpanda/v1alpha2/redpanda_clusterspec_types.go index 0475d3ac0..b5d9bfd77 100644 --- a/operator/api/redpanda/v1alpha2/redpanda_clusterspec_types.go +++ b/operator/api/redpanda/v1alpha2/redpanda_clusterspec_types.go @@ -499,6 +499,9 @@ type UsageStats struct { // Resources configures resource allocation. The default values are for a development environment. Production-level values and other considerations are documented, where those values are different from the default. type Resources struct { + Limits *map[corev1.ResourceName]resource.Quantity `json:"limits,omitempty"` + Requests *map[corev1.ResourceName]resource.Quantity `json:"requests,omitempty"` + // Specifies the number of CPU cores. CPU *CPU `json:"cpu,omitempty"` // Specifies the amount of memory. diff --git a/operator/api/redpanda/v1alpha2/zz_generated.deepcopy.go b/operator/api/redpanda/v1alpha2/zz_generated.deepcopy.go index e49c4f647..f5a775cbf 100644 --- a/operator/api/redpanda/v1alpha2/zz_generated.deepcopy.go +++ b/operator/api/redpanda/v1alpha2/zz_generated.deepcopy.go @@ -18,6 +18,7 @@ import ( monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" "github.com/redpanda-data/redpanda-operator/operator/api/apiutil" "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" ) @@ -2939,6 +2940,28 @@ func (in *ResourceTemplate) DeepCopy() *ResourceTemplate { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Resources) DeepCopyInto(out *Resources) { *out = *in + if in.Limits != nil { + in, out := &in.Limits, &out.Limits + *out = new(map[v1.ResourceName]resource.Quantity) + if **in != nil { + in, out := *in, *out + *out = make(map[v1.ResourceName]resource.Quantity, len(*in)) + for key, val := range *in { + (*out)[key] = val.DeepCopy() + } + } + } + if in.Requests != nil { + in, out := &in.Requests, &out.Requests + *out = new(map[v1.ResourceName]resource.Quantity) + if **in != nil { + in, out := *in, *out + *out = make(map[v1.ResourceName]resource.Quantity, len(*in)) + for key, val := range *in { + (*out)[key] = val.DeepCopy() + } + } + } if in.CPU != nil { in, out := &in.CPU, &out.CPU *out = new(CPU) diff --git a/operator/config/crd/bases/cluster.redpanda.com_redpandas.yaml b/operator/config/crd/bases/cluster.redpanda.com_redpandas.yaml index 5c41c0b88..cb8f33048 100644 --- a/operator/config/crd/bases/cluster.redpanda.com_redpandas.yaml +++ b/operator/config/crd/bases/cluster.redpanda.com_redpandas.yaml @@ -13565,6 +13565,14 @@ spec: than `1`, this setting is set to `true`.' type: boolean type: object + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object memory: description: Specifies the amount of memory. properties: @@ -13620,6 +13628,14 @@ spec: x-kubernetes-int-or-string: true type: object type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object type: object service: description: Defines settings for the headless ClusterIP Service. @@ -33816,6 +33832,14 @@ spec: than `1`, this setting is set to `true`.' type: boolean type: object + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object memory: description: Specifies the amount of memory. properties: @@ -33871,6 +33895,14 @@ spec: x-kubernetes-int-or-string: true type: object type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object type: object service: description: Defines settings for the headless ClusterIP Service.